KVM: VMX: Use kvm_read_cr4() to get cr4 value
authorXiaoyao Li <xiaoyao.li@intel.com>
Mon, 10 Apr 2023 12:50:16 +0000 (08:50 -0400)
committerSean Christopherson <seanjc@google.com>
Fri, 26 May 2023 20:41:43 +0000 (13:41 -0700)
commit334006b78ca84b7619d7dd313d5b6b39007e9528
tree1c7f21d294646f24be8206fbf590c757b1d0bb1d
parentb9846a698c9aff4eb2214a06ac83638ad098f33f
KVM: VMX: Use kvm_read_cr4() to get cr4 value

Directly use vcpu->arch.cr4 is not recommended since it gets stale value
if the cr4 is not available.

Use kvm_read_cr4() instead to ensure correct value.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20230410125017.1305238-2-xiaoyao.li@intel.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx.c