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?

Stephen Kitt
  • 434,908
scottxiao
  • 115

1 Answers1

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?

Stephen Kitt
  • 434,908