]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: SVM: Use vcpu_idx, not vcpu_id, for GA log tag/metadata
authorSean Christopherson <seanjc@google.com>
Wed, 11 Jun 2025 22:45:58 +0000 (15:45 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 23 Jun 2025 16:50:48 +0000 (09:50 -0700)
commit11a60455d4c9d50f07a36efefd5e487989b99b8b
treef837788bba3786e57e9116259b6a413b6e2f4413
parentce9d54f41be03555f1b57cf9dc2a50c45f9f712e
KVM: SVM: Use vcpu_idx, not vcpu_id, for GA log tag/metadata

Use a vCPU's index, not its ID, for the GA log tag/metadata that's used to
find and kick vCPUs when a device posted interrupt serves as a wake event.
Lookups on a vCPU index are O(fast) (not sure what xa_load() actually
provides), whereas a vCPU ID lookup is O(n) if a vCPU's ID doesn't match
its index.

Unlike the Physical APIC Table, which is accessed by hardware when
virtualizing IPIs, hardware doesn't consume the GA tag, i.e. KVM _must_
use APIC IDs to fill the Physical APIC Table, but KVM has free rein over
the format/meaning of the GA tag.

Tested-by: Sairaj Kodilkar <sarunkod@amd.com>
Link: https://lore.kernel.org/r/20250611224604.313496-57-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/svm/avic.c