diff options
author | Avi Kivity <avi@qumranet.com> | 2008-08-26 11:05:28 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-09-08 04:44:32 -0700 |
commit | b6908a04c2ad87725659a1df481921891e3516bc (patch) | |
tree | ba7d88a2761c46285b39ff5a8d698681e5bbdb1b | |
parent | 06a27e265d6be92db8ef6e4abbef33c45453b2cb (diff) | |
download | linux-stable-b6908a04c2ad87725659a1df481921891e3516bc.tar.gz linux-stable-b6908a04c2ad87725659a1df481921891e3516bc.tar.bz2 linux-stable-b6908a04c2ad87725659a1df481921891e3516bc.zip |
KVM: MMU: Fix torn shadow pte
(cherry picked from commit cd5998ebfbc9e6cb44408efa217c15d7eea13675)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index 934c7b619396..d333a74a1ed3 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h @@ -343,7 +343,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, |