diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2014-05-10 09:24:34 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-05-12 20:04:01 +0200 |
commit | d9f89b88f5102ce235b75a5907838e3c7ed84b97 (patch) | |
tree | 04b6aa4e625eecf1bff59dad2e69fa7426713ddf /arch/x86/kvm/x86.c | |
parent | 87c00572ba05aa8c9db118da75c608f47eb10b9e (diff) | |
download | talos-obmc-linux-d9f89b88f5102ce235b75a5907838e3c7ed84b97.tar.gz talos-obmc-linux-d9f89b88f5102ce235b75a5907838e3c7ed84b97.zip |
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 <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 41f673facf2f..fb313fc896dd 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; |