KVM: MMU: fix apf prefault if nested guest is enabled

If apf is generated in L2 guest and is completed in L1 guest, it will
prefault this apf in L1 guest's mmu context.

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Xiao Guangrong
2010-11-12 14:49:55 +08:00
committed by Avi Kivity
parent 060c2abe6c
commit c4806acdce
3 changed files with 4 additions and 1 deletions

View File

@@ -6168,7 +6168,8 @@ void kvm_arch_async_page_ready(struct kvm_vcpu *vcpu, struct kvm_async_pf *work)
{
int r;
if (!vcpu->arch.mmu.direct_map || is_error_page(work->page))
if (!vcpu->arch.mmu.direct_map || !work->arch.direct_map ||
is_error_page(work->page))
return;
r = kvm_mmu_reload(vcpu);