0

I'm aware that memory allocated by kmalloc is physically continuous and virtual memory it returned has just an offset from its physical memory.

But if CPU tries to access the virtual memory it returned, will MMU and page table be used? I heard all address CPU use are virtual memory and has to be passed to MMU. But now that there is only an offset between its physical and virtual memory, I think there is no need to use page table and mmu anymore.

Chen Li
  • 4,824
  • 3
  • 28
  • 55
  • But the machine still has to know what that offset is. How do you tell it? ... with the page tables. Anyway, I don't know any machine that has a way to say "selectively disable the MMU when accessing this particular range of addresses". It's either on or off. – Nate Eldredge Jan 06 '22 at 05:38
  • *"Will mmu be used when cpu access virtual memory"* - I think you answered yourself in the question title. Virtual = need mmu. – Marco Bonelli Jan 07 '22 at 05:16

0 Answers0