2
votes

When memory (suppose some kernel memory buffer) is mapped into userspace, what is it that happens? Is it that the entries in the page tables of the user process's struct mm are modified so that they point to the same pages as those in the kernel's virtual address space?

Does it mean that the process's entries are mapped to corresponding kernel virtual addresses?

How is this memory mapping implemented?

2

2 Answers

1
votes

There is a good explanation of this here

0
votes

Is it that the entries in the page tables of the user process's struct mm are modified so that they point to the same pages as those in the kernel's virtual address space?

Yes they are. In fact, all the physical memory is already mapped into kernel address space. So that implies that whatever physical memory is given to the process as virtual memory, that memory is already mapped by the kernel. I recommend you read the Gorman book on memory management.