Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: VMX: Use arch_xchg() when processing PIR to avoid instrumentation

Use arch_xchg() when moving IRQs from the PIR to the vIRR, purely to avoid
instrumentation so that KVM is compatible with the needs of posted MSI.
This will allow extracting the core PIR logic to common code and sharing
it between KVM and posted MSI handling.

Link: https://lore.kernel.org/r/20250401163447.846608-8-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>

+1 -1
+1 -1
arch/x86/kvm/lapic.c
··· 678 678 if (!pir_vals[i]) 679 679 continue; 680 680 681 - pir_vals[i] = xchg(&pir[i], 0); 681 + pir_vals[i] = arch_xchg(&pir[i], 0); 682 682 } 683 683 684 684 for (i = vec = 0; i <= 7; i++, vec += 32) {