]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: x86: Rename APIC base setters to better capture their relationship
authorSean Christopherson <seanjc@google.com>
Fri, 1 Nov 2024 18:35:52 +0000 (11:35 -0700)
committerSean Christopherson <seanjc@google.com>
Tue, 5 Nov 2024 04:57:46 +0000 (20:57 -0800)
commit7d1cb7cee94ffd913cb3b70aa1c3538f195c1f23
tree45ca88b358a9f418626344afbcdef73862b2b1e6
parentc9c9acfcd5738fb292e670a582e4333a1187004c
KVM: x86: Rename APIC base setters to better capture their relationship

Rename kvm_set_apic_base() and kvm_lapic_set_base() to kvm_apic_set_base()
and __kvm_apic_set_base() respectively to capture that the underscores
version is a "special" variant (it exists purely to avoid recalculating
the optimized map multiple times when stuffing the RESET value).

Opportunistically add a comment explaining why kvm_lapic_reset() uses the
inner helper.  Note, KVM deliberately invokes kvm_arch_vcpu_create() while
kvm->lock is NOT held so that vCPU setup isn't serialized if userspace is
creating multiple/all vCPUs in parallel.  I.e. triggering an extra
recalculation is not limited to theoretical/rare edge cases, and so is
worth avoiding.

No functional change intended.

Reviewed-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Link: https://lore.kernel.org/r/20241009181742.1128779-7-seanjc@google.com
Link: https://lore.kernel.org/r/20241101183555.1794700-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/lapic.c
arch/x86/kvm/lapic.h
arch/x86/kvm/x86.c