jagomart
digital resources
picture1_Confidential Powerpoint 73040 | Aarch64 Kernel Memory Management


 183x       Filetype PPTX       File size 0.63 MB       Source: community.nxp.com


File: Confidential Powerpoint 73040 | Aarch64 Kernel Memory Management
kernel virtual memory layout modules vaddr va start kimage vaddr text offset vmemmap start phys to virt memblock start of dram 2 confidential and proprietary kernel variable and configure va ...

icon picture PPTX Filetype Power Point PPTX | Posted on 31 Aug 2022 | 3 years ago
Partial capture of text on file.
   Kernel virtual memory layout
     MODULES_VADDR (VA_START)             KIMAGE_VADDR + TEXT_OFFSET
     VMEMMAP_START                      __phys_to_virt(memblock_start_of_DRAM())
   2   CONFIDENTIAL AND PROPRIETARY
   Kernel variable and configure
   • VA_BITS = 48
   • VA_START = 0xffff000000000000
   • PAGE_OFFSET = 0xffff800000000000
   • PHYS_OFFSET = 0x80000000 // i.MX8QM/QXP
   • memblock_start_of_DRAM() = 0x80200000 // passed in by u-boot (get from scfw)
   • KIMAGE_VADDR = MODULE_END = 0xffff000008000000
   • TEXT_OFFSET = 0x80000
   • #define __phys_to_virt(x)       ((unsigned long)((x) - PHYS_OFFSET) | 
     PAGE_OFFSET)
   • #define __phys_to_kimg(x)       ((unsigned long)((x) + kimage_voffset))
    3  CONFIDENTIAL AND PROPRIETARY
    DDR Memory layout
    • Memblock on boot                                                             0x8BFFF_FFF
                                                                     >4G DDR       F
      −configurations is passed by u-boot, who get usable                          0x88000_000
                                                                                   0
       memory from SCFW API sc_rm_get_memreg_info()                                0xFFFF_FFFF
                                                                    BL32 (TEE)
                                                                                   0xFE00_0000
      −On i.MX8Q, there’s 5 memblocks, the hole is used by 
       ATF/M4_0/1/TEE/SHM.. (BLUE)                                                 0xDFFF_FFFF
      −On Android Auto Car2, No M4 used, on boot memory                CMA         0xC600_000
                                                                                   0
       DDR blocks get from uboot:                                    SWIOTLB       0xC5FF_F000
                                                                                   0xBFFF_F000
       memblock_add: [0x0000000080200000-0x00000000fdffffff] 
       memblock_add: [0x0000000880000000-0x00000008bfffffff]                       0x9440_0000
                                                                        DSP        0x9240_0000
    • Kernel after boot (below settings)                               RPMSG       0x9200_0000
                                                                        M4         0x9000_0000
     • CMA = 400MB (RED)                                                           0x8640_0000
                                                                        VPU        0x8400_0000
     • SWIOTLB = 96MB (RED)
                                                                                   0x8020_0000
     • reserved-memory {} in dts (BLACK)                            BL31 (ATF)
                                                                                   0x8000_0000
    4   CONFIDENTIAL AND PROPRIETARY
    Kernel memory allocation
                                                            • kmalloc – for small chunks allocation, 
                                                              go through SLxB. Directly call 
       kmalloc         vmalloc      DMA API                   alloc_pages for large continue size
                                                    ION     • vmalloc – for virtual continuous 
         2
         x
         E                                                    memory allocation, physical is not 
         Z
         I      SLUB
         S                                   Driver           required to be continuous (place in 
         _   (SLAB/SLOB        CMA
         E                                  Specific
         G                                                    virtual vmalloc range)
         A        )
         P
          
         >
                                                            • CMA – described in next page
         e
         z
         i
         S                                                  • Reserved memory (in dts, reserved 
                        Page 
                        Page 
                       allocators                             by memblock_alloc on boot) 
                       allocators
                                                              managed by drivers for specific 
                              DDR                             usage (like GPU)
                        Buddy         Reserved              • ION – Android specific allocator, 
                                                              used for video/camera buffers
    5   CONFIDENTIAL AND PROPRIETARY
     Continuous Memory Allocator (CMA)
     • Target: Allocating big chunks of physically contiguous memory
     • CMA is integrated with the DMA API
                                                                                memblock                        DMA API
                                                                                              Gi
     • How it works                                                                            ve            se
                                                                                                m            u
       −At the boot time, cma= of the memory is reserved.                                  e        ay
                                                                                                  mo     M            e
                                                                                      T             r                s
       −When page allocator initializes, cma range is released with                    ak           y                U
        MIGRATE_CMA type                                                               e m         Page 
         pages can be used for movable pages. (normal usage, e.g. Examples             em       allocator
         anonymous process pages and disk cache)                                         or              I
                                                                                          y      G       n
                                                                                           f     i       t
                                                                                          r     v       e
         Unless the memory is allocated to a device driver. (CMA alloc)                    om    e       g
                                                                                                         r
                                                                                                 b       a
       −Migration                                                                                a       t
                                                                                                 c       e
         allocating a new page                                                                  k       d
         copying contents of the old page to the new page
                                                                                                   CMA
         updating all places where old page was referred, and freeing the old 
         page.
     6    CONFIDENTIAL AND PROPRIETARY
The words contained in this file might help you see if this file matches what you are looking for:

...Kernel virtual memory layout modules vaddr va start kimage text offset vmemmap phys to virt memblock of dram confidential and proprietary variable configure bits xffff page x i mxqm qxp passed in by u boot get from scfw module end define unsigned long kimg voffset ddr on xbfff fff g f configurations is who usable api sc rm memreg info ffff bl tee xfe mxq there s memblocks the hole used atf m shm blue xdfff android auto car no cma xc blocks uboot swiotlb xcff add dsp after below settings rpmsg mb red vpu reserved dts black allocation kmalloc for small chunks go through slxb directly call vmalloc dma alloc pages large continue size ion continuous e physical not z slub driver required be place slab slob specific range a p described next allocators managed drivers usage like gpu buddy allocator video camera buffers target allocating big physically contiguous integrated with gi how it works ve se at time ay mo t r when initializes released ak y migrate type can movable normal examples em an...

no reviews yet
Please Login to review.