x86/irq: KVM: Track PIR bitmap as an "unsigned long" array
authorSean Christopherson <seanjc@google.com>
Tue, 1 Apr 2025 16:34:43 +0000 (09:34 -0700)
committerSean Christopherson <seanjc@google.com>
Thu, 24 Apr 2025 18:19:38 +0000 (11:19 -0700)
commitf1459315f4d2ff4bf02896e541e1566a69a8fd00
treea3625c27c3f62192ba591e7ce811adb2a5118556
parent6433fc01f9f19573894cdcf776679c10d1310801
x86/irq: KVM: Track PIR bitmap as an "unsigned long" array

Track the PIR bitmap in posted interrupt descriptor structures as an array
of unsigned longs instead of using unionized arrays for KVM (u32s) versus
IRQ management (u64s).  In practice, because the non-KVM usage is (sanely)
restricted to 64-bit kernels, all existing usage of the u64 variant is
already working with unsigned longs.

Using "unsigned long" for the array will allow reworking KVM's processing
of the bitmap to read/write in 64-bit chunks on 64-bit kernels, i.e. will
allow optimizing KVM by reducing the number of atomic accesses to PIR.

Opportunstically replace the open coded literals in the posted MSIs code
with the appropriate macro.  Deliberately don't use ARRAY_SIZE() in the
for-loops, even though it would be cleaner from a certain perspective, in
anticipation of decoupling the processing from the array declaration.

No functional change intended.

Link: https://lore.kernel.org/r/20250401163447.846608-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/include/asm/posted_intr.h
arch/x86/kernel/irq.c
arch/x86/kvm/lapic.c
arch/x86/kvm/lapic.h
arch/x86/kvm/vmx/posted_intr.h