From: Jan Kiszka Date: Sat, 10 May 2014 07:24:34 +0000 (+0200) Subject: KVM: x86: Fix CR3 reserved bits check in long mode X-Git-Tag: v3.16-rc4~21^2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9f89b88f5102ce235b75a5907838e3c7ed84b97;p=platform%2Fkernel%2Flinux-exynos.git KVM: x86: Fix CR3 reserved bits check in long mode Regression of 346874c9: PAE is set in long mode, but that does not mean we have valid PDPTRs. Signed-off-by: Jan Kiszka Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 41f673f..fb313fc 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -701,10 +701,11 @@ int kvm_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3) return 0; } - if (is_long_mode(vcpu) && (cr3 & CR3_L_MODE_RESERVED_BITS)) - return 1; - if (is_pae(vcpu) && is_paging(vcpu) && - !load_pdptrs(vcpu, vcpu->arch.walk_mmu, cr3)) + if (is_long_mode(vcpu)) { + if (cr3 & CR3_L_MODE_RESERVED_BITS) + return 1; + } else if (is_pae(vcpu) && is_paging(vcpu) && + !load_pdptrs(vcpu, vcpu->arch.walk_mmu, cr3)) return 1; vcpu->arch.cr3 = cr3;