summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2020-07-08 16:00:23 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-07-09 07:08:37 -0400
commit995decb6c43e1d6e9d6a7d590471f2eea74600f4 (patch)
treed4eae76f4d0582ab885c3d4c24685a0a59f60938 /arch
parent5668821aefcbd8511740301de8bc9153c103a43a (diff)
downloadlinux-stable-995decb6c43e1d6e9d6a7d590471f2eea74600f4.tar.gz
linux-stable-995decb6c43e1d6e9d6a7d590471f2eea74600f4.tar.bz2
linux-stable-995decb6c43e1d6e9d6a7d590471f2eea74600f4.zip
KVM: x86: take as_id into account when checking PGD
OVMF booted guest running on shadow pages crashes on TRIPLE FAULT after enabling paging from SMM. The crash is triggered from mmu_check_root() and is caused by kvm_is_visible_gfn() searching through memslots with as_id = 0 while vCPU may be in a different context (address space). Introduce kvm_vcpu_is_visible_gfn() and use it from mmu_check_root(). Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Message-Id: <20200708140023.1476020-1-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/mmu/mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 0011b2c97f65..231beb6d9cf7 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -3693,7 +3693,7 @@ static int mmu_check_root(struct kvm_vcpu *vcpu, gfn_t root_gfn)
{
int ret = 0;
- if (!kvm_is_visible_gfn(vcpu->kvm, root_gfn)) {
+ if (!kvm_vcpu_is_visible_gfn(vcpu, root_gfn)) {
kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu);
ret = 1;
}