On Wed, Aug 08, 2018 at 05:45:24PM -0700, Junaid Shahid wrote: > kvm should not attempt to read guest PDPTEs when CR0.PG = 0 and > CR4.PAE = 1. > > Signed-off-by: Junaid Shahid <junaids@xxxxxxxxxx> > --- > arch/x86/kvm/x86.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 3c83711c0ebe..a726af7d31b6 100644 > --- a/arch/x86/kvm/x86.c > +++ b/arch/x86/kvm/x86.c > @@ -627,7 +627,7 @@ bool pdptrs_changed(struct kvm_vcpu *vcpu) > gfn_t gfn; > int r; > > - if (is_long_mode(vcpu) || !is_pae(vcpu)) > + if (is_long_mode(vcpu) || !is_pae(vcpu) || !is_paging(vcpu)) > return false; > > if (!test_bit(VCPU_EXREG_PDPTR, > @@ -8123,7 +8123,7 @@ static int __set_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs) > kvm_update_cpuid(vcpu); > > idx = srcu_read_lock(&vcpu->kvm->srcu); > - if (!is_long_mode(vcpu) && is_pae(vcpu)) { > + if (!is_long_mode(vcpu) && is_pae(vcpu) && is_paging(vcpu)) { > load_pdptrs(vcpu, vcpu->arch.walk_mmu, kvm_read_cr3(vcpu)); > mmu_reset_needed = 1; > } > -- > 2.18.0.345.g5c9ce644c3-goog >