Commit cd5998ebfbc9e6cb44408efa217c15d7eea13675

Authored by Avi Kivity
1 parent 18b13e5457

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

arch/x86/kvm/paging_tmpl.h
... ... @@ -345,7 +345,7 @@
345 345 shadow_addr = __pa(shadow_page->spt);
346 346 shadow_pte = shadow_addr | PT_PRESENT_MASK | PT_ACCESSED_MASK
347 347 | PT_WRITABLE_MASK | PT_USER_MASK;
348   - *shadow_ent = shadow_pte;
  348 + set_shadow_pte(shadow_ent, shadow_pte);
349 349 }
350 350  
351 351 mmu_set_spte(vcpu, shadow_ent, access, walker->pte_access & access,