]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: VMX: Set MSR index auto-load entry if and only if entry is "new"
authorSean Christopherson <seanjc@google.com>
Sat, 6 Dec 2025 00:17:16 +0000 (16:17 -0800)
committerSean Christopherson <seanjc@google.com>
Thu, 8 Jan 2026 19:52:20 +0000 (11:52 -0800)
commit0c4ff0866fc1b0bf8c1d8d5f27fedc6dd9c51183
tree2ee412f41043e5314b5c7d2848875d20ceda6e1b
parent2ed57bb8997610b33cb92c26ccb9a91b2966fff8
KVM: VMX: Set MSR index auto-load entry if and only if entry is "new"

When adding an MSR to the auto-load lists, update the MSR index in the
list entry if and only if a new entry is being inserted, as 'i' can only
be non-negative if vmx_find_loadstore_msr_slot() found an entry with the
MSR's index.  Unnecessarily setting the index is benign, but it makes it
harder to see that updating the value is necessary even when an existing
entry for the MSR was found.

No functional change intended.

Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Tested-by: Manali Shukla <manali.shukla@amd.com>
Link: https://patch.msgid.link/20251206001720.468579-41-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/vmx/vmx.c