开发者

Linux kernel: Where do the process page tables reside?

开发者 https://www.devze.com 2023-03-14 08:12 出处:网络
Being used only by the kernel, they should only lie in the addresses above PAGE_OFFSET. But I was reading this page and at the end of it (in the IRC convo) I read the following lines which really conf

Being used only by the kernel, they should only lie in the addresses above PAGE_OFFSET. But I was reading this page and at the end of it (in the IRC convo) I read the following lines which really confused me:

 saxm> riel:  so where do page tables reside? Surely not below PAGE_OFFSET? Somewhere above PAGE_OFFSET+896mb then?

riel> they could reside anywhere

saxm> anywhere from 0->4gb (on x86 with no pae)?

riel> saxm: yeah

I mean, why开发者_如何学C would they lie below PAGE_OFFSET? Wouldn't user space processes be able to access them if that is the case?


I think what riel was trying to say is that they can reside (almost) anywhere in physical memory--there's not a fixed mapping.

Page tables are mapped in the kernel virtual address space (i.e. above PAGE_OFFSET), and are invisible to user space (which, like you point out, makes sense because we wouldn't want users clobbering their own page tables).

Take a look at this related post: Does Linux use self-map for page directory and page tables?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号