KVM: x86: Remove emulator's broken checks on CR0/CR3/CR4 loads
authorSean Christopherson <seanjc@google.com>
Thu, 22 Apr 2021 02:21:20 +0000 (19:21 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 26 Apr 2021 09:27:11 +0000 (05:27 -0400)
commitd0fe7b6404408835ed60232cb3bf28324b2f95db
tree76a387a04a883e10a4d6b65268cc38e1786d0b5a
parentdbdd096a5a74b94f6b786a47baef2085859b0dce
KVM: x86: Remove emulator's broken checks on CR0/CR3/CR4 loads

Remove the emulator's checks for illegal CR0, CR3, and CR4 values, as
the checks are redundant, outdated, and in the case of SEV's C-bit,
broken.  The emulator manually calculates MAXPHYADDR from CPUID and
neglects to mask off the C-bit.  For all other checks, kvm_set_cr*() are
a superset of the emulator checks, e.g. see CR4.LA57.

Fixes: a780a3ea6282 ("KVM: X86: Fix reserved bits check for MOV to CR3")
Cc: Babu Moger <babu.moger@amd.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210422022128.3464144-2-seanjc@google.com>
Cc: stable@vger.kernel.org
[Unify check_cr_read and check_cr_write. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c