UPSTREAM: KVM: nVMX: add missing consistency checks for CR0 and CR4

The effective values of the guest CR0 and CR4 registers may differ from
those included in the VMCS12.  In particular, disabling EPT forces
CR4.PAE=1 and disabling unrestricted guest mode forces CR0.PG=CR0.PE=1.

Therefore, checks on these bits cannot be delegated to the processor
and must be performed by KVM.

Reported-by: Reima ISHII <ishiir@g.ecc.u-tokyo.ac.jp>
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 112e66017bff7f2837030f34c2bc19501e9212d5)

BUG=b:278162092
TEST=CQ

Change-Id: I1ef6b0df57a554f9489e1ed3388d798b94e4fda0
Disallow-Recycled-Builds: test-failures
Signed-off-by: Guenter Roeck <groeck@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4428971
Reviewed-by: Zubin Mithra <zsm@chromium.org>
Reviewed-by: Sean Paul <sean@poorly.run>
Commit-Queue: Zubin Mithra <zsm@chromium.org>
1 file changed