From 75a96baf8f16a37dab95cd18f3cb4770c4a84015 Mon Sep 17 00:00:00 2001 From: Remzi Arpaci-Dusseau Date: Sun, 11 Mar 2018 21:26:44 -0500 Subject: [PATCH] Hint on cr3 update --- vm-xv6-intro/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vm-xv6-intro/README.md b/vm-xv6-intro/README.md index 6148ec8..079efbd 100644 --- a/vm-xv6-intro/README.md +++ b/vm-xv6-intro/README.md @@ -69,6 +69,13 @@ or `addr` points to a region that is not currently a part of the address space, or `len` is less than or equal to zero, return -1 and do not change anything. Otherwise, return 0 upon success. +Hint: after changing a page-table entry, you need to make sure the hardware +knows of the change. On 32-bit x86, this is readily accomplished by updating +the `CR3` register (what we generically call the *page-table base register* in +class). When the hardware sees that you overwrote `CR3` (even with the same +value), it guarantees that your PTE updates will be used upon subsequent +accesses. The `lcr3()` function will help you in this pursuit. + ## Handling Illegal Accesses In both the cases above, you should be able to demonstrate what happens when