linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.4 STABLE] kvm: mmu: Don't read PDPTEs when paging is not enabled
@ 2019-11-12  0:17 Sean Christopherson
  2019-11-13  1:18 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Sean Christopherson @ 2019-11-12  0:17 UTC (permalink / raw)
  To: stable, Greg Kroah-Hartman; +Cc: Paolo Bonzini, Junaid Shahid, linux-kernel

From: Junaid Shahid <junaids@google.com>

Upstream commit d35b34a9a70edae7ef923f100e51b8b5ae9fe899.

kvm should not attempt to read guest PDPTEs when CR0.PG = 0 and
CR4.PAE = 1.

Signed-off-by: Junaid Shahid <junaids@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
---
 arch/x86/kvm/x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 2b47fd3d4b8c..ad8e19fee71e 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -575,7 +575,7 @@ static 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,
@@ -7168,7 +7168,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
 		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.24.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 4.4 STABLE] kvm: mmu: Don't read PDPTEs when paging is not enabled
  2019-11-12  0:17 [PATCH 4.4 STABLE] kvm: mmu: Don't read PDPTEs when paging is not enabled Sean Christopherson
@ 2019-11-13  1:18 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2019-11-13  1:18 UTC (permalink / raw)
  To: Sean Christopherson
  Cc: stable, Greg Kroah-Hartman, Paolo Bonzini, Junaid Shahid, linux-kernel

On Mon, Nov 11, 2019 at 04:17:05PM -0800, Sean Christopherson wrote:
>From: Junaid Shahid <junaids@google.com>
>
>Upstream commit d35b34a9a70edae7ef923f100e51b8b5ae9fe899.
>
>kvm should not attempt to read guest PDPTEs when CR0.PG = 0 and
>CR4.PAE = 1.
>
>Signed-off-by: Junaid Shahid <junaids@google.com>
>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>

Queued up for 4.4, thank you.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-11-13  1:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-12  0:17 [PATCH 4.4 STABLE] kvm: mmu: Don't read PDPTEs when paging is not enabled Sean Christopherson
2019-11-13  1:18 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).