diff options
author | Avi Kivity <avi@redhat.com> | 2010-05-27 07:46:04 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-08-01 03:39:23 -0400 |
commit | ec87fe2afcbcc4f430554980ec3e408bae34229d (patch) | |
tree | 17f5574d13dbd24b75d515d77bd0bf26373e0dab /Documentation/kvm | |
parent | 8184dd38e22fcaec664c2b98c382b85c26780e26 (diff) |
KVM: MMU: Document cr0.wp emulation
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'Documentation/kvm')
-rw-r--r-- | Documentation/kvm/mmu.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Documentation/kvm/mmu.txt b/Documentation/kvm/mmu.txt index 2201dcba92a1..1e7ecdd15bba 100644 --- a/Documentation/kvm/mmu.txt +++ b/Documentation/kvm/mmu.txt | |||
@@ -298,6 +298,25 @@ Host translation updates: | |||
298 | - look up affected sptes through reverse map | 298 | - look up affected sptes through reverse map |
299 | - drop (or update) translations | 299 | - drop (or update) translations |
300 | 300 | ||
301 | Emulating cr0.wp | ||
302 | ================ | ||
303 | |||
304 | If tdp is not enabled, the host must keep cr0.wp=1 so page write protection | ||
305 | works for the guest kernel, not guest guest userspace. When the guest | ||
306 | cr0.wp=1, this does not present a problem. However when the guest cr0.wp=0, | ||
307 | we cannot map the permissions for gpte.u=1, gpte.w=0 to any spte (the | ||
308 | semantics require allowing any guest kernel access plus user read access). | ||
309 | |||
310 | We handle this by mapping the permissions to two possible sptes, depending | ||
311 | on fault type: | ||
312 | |||
313 | - kernel write fault: spte.u=0, spte.w=1 (allows full kernel access, | ||
314 | disallows user access) | ||
315 | - read fault: spte.u=1, spte.w=0 (allows full read access, disallows kernel | ||
316 | write access) | ||
317 | |||
318 | (user write faults generate a #PF) | ||
319 | |||
301 | Further reading | 320 | Further reading |
302 | =============== | 321 | =============== |
303 | 322 | ||