summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2008-08-22 19:19:38 +0300
committerAvi Kivity <avi@qumranet.com>2008-08-25 17:24:27 +0300
commitcd5998ebfbc9e6cb44408efa217c15d7eea13675 (patch)
treed0ec4fa1d772c385ea71a1d5a5aa0646710ca3f7 /arch/x86
parent18b13e5457041429af3974afd52f647c3a5465dd (diff)
downloadop-kernel-dev-cd5998ebfbc9e6cb44408efa217c15d7eea13675.zip
op-kernel-dev-cd5998ebfbc9e6cb44408efa217c15d7eea13675.tar.gz
KVM: MMU: Fix torn shadow pte
The shadow code assigns a pte directly in one place, which is nonatomic on i386 can can cause random memory references. Fix by using an atomic setter. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/paging_tmpl.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index f72ac1f..4a814bf 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -345,7 +345,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
shadow_addr = __pa(shadow_page->spt);
shadow_pte = shadow_addr | PT_PRESENT_MASK | PT_ACCESSED_MASK
| PT_WRITABLE_MASK | PT_USER_MASK;
- *shadow_ent = shadow_pte;
+ set_shadow_pte(shadow_ent, shadow_pte);
}
mmu_set_spte(vcpu, shadow_ent, access, walker->pte_access & access,
OpenPOWER on IntegriCloud