I'm confused about this statement:
From http://web.stanford.edu/class/cs140/projects/pintos/pintos_4.html#SEC63:
In Pintos, every user virtual page is aliased to its kernel virtual page.
I thought the kernel would just be able to use the user virtual address to refer to the user page, with the kernel virtual addresses above it. In the image below, for instance, wouldn't the entire VAS just be from 0 to 4GB, and the user virtual address space would be restricted to addresses below PHYS_BASE, while the kernel could also access the addresses above it?
(from http://web.stanford.edu/class/cs140/cgi-bin/section/10sp-proj3.pdf)
This doesn't seem to be how it works though, as the PintOS documentation continues:
You must manage these aliases somehow. For example, your code could check and update the accessed and dirty bits for both addresses. Alternatively, the kernel could avoid the problem by only accessing user data through the user virtual address.
This implies that the kernel could access the user data through a separate kernel virtual address. I'm not sure why the two addresses would be different.
Thanks for any clarification.