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

Julian Stecklina
2024-04-16T12:36:45Z

From: Thomas Prescher <thomas.prescher@cyberus-technology.de>

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@cyberus-technology.de>
Signed-off-by: Thomas Prescher <thomas.prescher@cyberus-technology.de>
---
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