]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: cleanup CR3 reserved bits checks
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 13 Nov 2020 13:30:38 +0000 (08:30 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 3 Feb 2021 09:30:38 +0000 (04:30 -0500)
commit4de549ae7290a2db3572fbee0f0e22266c4ef1bb
tree02f1ec69c65e009d66cc2fed83a9fb3cbf33c008
parent03ba1cc7952eacbef6879985b5d472573426e47c
KVM: x86: cleanup CR3 reserved bits checks

If not in long mode, the low bits of CR3 are reserved but not enforced to
be zero, so remove those checks.  If in long mode, however, the MBZ bits
extend down to the highest physical address bit of the guest, excluding
the encryption bit.

Make the checks consistent with the above, and match them between
nested_vmcb_checks and KVM_SET_SREGS.

Cc: stable@vger.kernel.org
Fixes: b173fd358779 ("KVM: nSVM: Check that MBZ bits in CR3 and CR4 are not set on vmrun of nested guests")
Fixes: c95855f8a409 ("KVM: X86: Fix reserved bits check for MOV to CR3")
Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/nested.c
arch/x86/kvm/svm/svm.h
arch/x86/kvm/x86.c