[PATCH 2/2] KVM: nVMX: remove unnecessary CR4_READ_SHADOW write

From: Julian Stecklina
Date: Tue Apr 16 2024 - 08:37:14 EST


From: Thomas Prescher <thomas.prescher@xxxxxxxxxxxxxxxxxxxxx>

This explicit change of CR4_READ_SHADOW is no longer necessary because
it is now handled in vmx_set_cr4.

Signed-off-by: Julian Stecklina <julian.stecklina@xxxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Thomas Prescher <thomas.prescher@xxxxxxxxxxxxxxxxxxxxx>
---
arch/x86/kvm/vmx/nested.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c
index d05ddf751491..e191bf5d4831 100644
--- a/arch/x86/kvm/vmx/nested.c
+++ b/arch/x86/kvm/vmx/nested.c
@@ -2639,7 +2639,6 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12,
vmcs_writel(CR0_READ_SHADOW, nested_read_cr0(vmcs12));

vmx_set_cr4(vcpu, vmcs12->guest_cr4);
- vmcs_writel(CR4_READ_SHADOW, nested_read_cr4(vmcs12));

vcpu->arch.efer = nested_vmx_calc_efer(vmx, vmcs12);
/* Note: may modify VM_ENTRY/EXIT_CONTROLS and GUEST/HOST_IA32_EFER */
--
2.43.2