git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
KVM: MMU: Remove user access when allowing kernel access to gpte.w=0 page
[safe/jmp/linux-2.6]
/
arch
/
x86
/
kvm
/
mmu.c
diff --git
a/arch/x86/kvm/mmu.c
b/arch/x86/kvm/mmu.c
index
6fbcb48
..
a6f695d
100644
(file)
--- a/
arch/x86/kvm/mmu.c
+++ b/
arch/x86/kvm/mmu.c
@@
-1815,6
+1815,9
@@
static int set_spte(struct kvm_vcpu *vcpu, u64 *sptep,
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