Linux memory management (7): detailed explanation of fixmap

Source code based on: Linux 5.4

agreement:

Chip architecture: ARM64

CONFIG_ARM64_VA_BITS:39

CONFIG_ARM64_PAGE_SHIFT:12

0. Preface

The kernel startup will first enter the assembly stage, mmu has been started (that is, the current SOC can only use virtual addresses to access RAM), paging_init has not yet completed the call, when the kernel startup process needs to access some specific kernel modules (such as dtb) , it is necessary to map the virtual address and the physical address. This is why the fixmap mechanism came about.

fixmap is understood as a fixed mapping , and its virtual address space is used for early fdt, console, peripheral dynamic mapping, and paging_init(). It should be noted that fixmaps cannot be completely considered as fixed maps, and the detailed distribution of fixmaps can be found in Section 2.

1. The memory layout of the kernel

According to VA_BITS=39, PAGE_SHIFT=12(4K) look at the memory layout of ARM64 memory: 

VA_BITS=39, PAGE_SHIFT=12 (4K page table)

 fixmap

Guess you like

Origin blog.csdn.net/jingerppp/article/details/130100621