[PATCH v2 7/8] KVM: VMX: Use arch_xchg() when processing PIR to avoid instrumentation
From: Sean Christopherson
Date: Tue Apr 01 2025 - 12:46:04 EST
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.
Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
---
arch/x86/kvm/lapic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 0463e89376fb..13363327ad87 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -678,7 +678,7 @@ bool __kvm_apic_update_irr(unsigned long *pir, void *regs, int *max_irr)
if (!pir_vals[i])
continue;
- pir_vals[i] = xchg(&pir[i], 0);
+ pir_vals[i] = arch_xchg(&pir[i], 0);
}
for (i = vec = 0; i <= 7; i++, vec += 32) {
--
2.49.0.472.ge94155a9ec-goog