Skip to content

Commit

Permalink
KVM: MMU: Fix torn shadow pte
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Avi Kivity committed Aug 25, 2008
1 parent 18b13e5 commit cd5998e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kvm/paging_tmpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cd5998e

Please sign in to comment.