0

In some configurations, the top 1G space of each process' memory belongs to the kernel. And in the 1G space, the low 896M part is direct mapped to physical address, called fix-mapping area.

But I'm confused that how it is implemented. Because cpu can only access linear address, which is then interpreted into physical address by MMU. What happens when kernel access that fix-mapping area? Does it skip the MMU?

1

The kernel runs on the CPU too, using linear addresses. It doesn’t skip the MMU.

Accesses to permanent mappings happen just like any other access: the corresponding physical pages are mapped using page tables. When a permanent mapping is used, this is set up during boot by permanent_kmaps_init (on 32-bit x86).

See also Is the MMU inside of Unix/Linux kernel? or just in a hardware device with its own memory? and (Why) does the Linux kernel use an identity mapping for its virtual address space?

2
  • but I heard that fix-mapping is used to simplify the procedure of converting linear addr to physical addr. If fix-mapping still uses page table, then what's the benefit of using fix-mapping?
    – scottxiao
    Sep 21 at 8:08
  • See this answer for examples of the benefits. Sep 21 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.