mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: Fix a wrong MSR update in add_atomic_switch_msr()
@ 2026-02-20 22:02 Namhyung Kim
  2026-02-24  3:31 ` Mi, Dapeng
  2026-03-05 17:07 ` Sean Christopherson
  0 siblings, 2 replies; 3+ messages in thread
From: Namhyung Kim @ 2026-02-20 22:02 UTC (permalink / raw)
  To: Paolo Bonzini, Sean Christopherson; +Cc: LKML, kvm, Dapeng Mi

The previous change had a bug to update a guest MSR with a host value.

Fixes: c3d6a7210a4de9096 ("KVM: VMX: Dedup code for adding MSR to VMCS's auto list")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 arch/x86/kvm/vmx/vmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
index 967b58a8ab9d0d47..83d057cfa8164937 100644
--- a/arch/x86/kvm/vmx/vmx.c
+++ b/arch/x86/kvm/vmx/vmx.c
@@ -1149,7 +1149,7 @@ static void add_atomic_switch_msr(struct vcpu_vmx *vmx, unsigned msr,
 	}
 
 	vmx_add_auto_msr(&m->guest, msr, guest_val, VM_ENTRY_MSR_LOAD_COUNT, kvm);
-	vmx_add_auto_msr(&m->guest, msr, host_val, VM_EXIT_MSR_LOAD_COUNT, kvm);
+	vmx_add_auto_msr(&m->host, msr, host_val, VM_EXIT_MSR_LOAD_COUNT, kvm);
 }
 
 static bool update_transition_efer(struct vcpu_vmx *vmx)
-- 
2.53.0.371.g1d285c8824-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-05 17:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-20 22:02 [PATCH] KVM: VMX: Fix a wrong MSR update in add_atomic_switch_msr() Namhyung Kim
2026-02-24  3:31 ` Mi, Dapeng
2026-03-05 17:07 ` Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®