summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2011-08-06 21:29:05 -0700
committerBryan Cantrill <bryan@joyent.com>2011-08-06 21:29:05 -0700
commit50477ee36add08e85b06badc1f8a6f399dec4e92 (patch)
tree59b417d9850173338c469802d57805b1c59771bc
parent72747f868c6d66646ac59da2cfce4d29190d278e (diff)
downloadillumos-kvm-50477ee36add08e85b06badc1f8a6f399dec4e92.tar.gz
HVM-573 KVM: MMU: Remove user access when allowing kernel access to gpte.w=0 page
-rw-r--r--kvm_mmu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kvm_mmu.c b/kvm_mmu.c
index 3895196..58f6fe8 100644
--- a/kvm_mmu.c
+++ b/kvm_mmu.c
@@ -1659,6 +1659,9 @@ set_spte(struct kvm_vcpu *vcpu, uint64_t *sptep, unsigned pte_access,
spte |= PT_WRITABLE_MASK;
+ if (!tdp_enabled && !(pte_access & ACC_WRITE_MASK))
+ spte &= ~PT_USER_MASK;
+
/*
* Optimization: for pte sync, if spte was writable the hash
* lookup is unnecessary (and expensive). Write protection