summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorJunaid Shahid <junaids@google.com>2016-12-21 20:29:30 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2017-01-27 15:46:40 +0100
commitd162f30a7cebe9731fd331419b3a14089d0b41e3 (patch)
tree7edf1bc53948c8cf7e058e7b0c6b5e3a2b716c97 /arch/x86/kvm
parent20d65236d01cdbe14a88f0e2c0f985669f8c41fc (diff)
downloadlinux-stable-d162f30a7cebe9731fd331419b3a14089d0b41e3.tar.gz
linux-stable-d162f30a7cebe9731fd331419b3a14089d0b41e3.tar.bz2
linux-stable-d162f30a7cebe9731fd331419b3a14089d0b41e3.zip
kvm: x86: mmu: Move pgtbl walk inside retry loop in fast_page_fault
Redo the page table walk in fast_page_fault when retrying so that we are working on the latest PTE even if the hierarchy changes. Signed-off-by: Junaid Shahid <junaids@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/mmu.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index e13041ac7cdf..437d16274701 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -3088,14 +3088,16 @@ static bool fast_page_fault(struct kvm_vcpu *vcpu, gva_t gva, int level,
return false;
walk_shadow_page_lockless_begin(vcpu);
- for_each_shadow_entry_lockless(vcpu, gva, iterator, spte)
- if (!is_shadow_present_pte(spte) || iterator.level < level)
- break;
do {
bool remove_write_prot = false;
bool remove_acc_track;
+ for_each_shadow_entry_lockless(vcpu, gva, iterator, spte)
+ if (!is_shadow_present_pte(spte) ||
+ iterator.level < level)
+ break;
+
sp = page_header(__pa(iterator.sptep));
if (!is_last_spte(spte, sp->role.level))
break;
@@ -3176,8 +3178,6 @@ static bool fast_page_fault(struct kvm_vcpu *vcpu, gva_t gva, int level,
break;
}
- spte = mmu_spte_get_lockless(iterator.sptep);
-
} while (true);
trace_fast_page_fault(vcpu, gva, error_code, iterator.sptep,