Skip to content

KVM: x86: Fix a WARN in kvm_apic_send_ipi()

Tao Su kvm llvm oe-kbuild-all oe-lkp 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86/apic: Introduce X2APIC_ICR_UNUSED_12 for x2APIC modearch/x86/include/asm/apicdef.h+1 -02 replies
2/2KVM: x86: Clear X2APIC_ICR_UNUSED_12 after APIC-write VM-exitarch/x86/kvm/lapic.c+20 -77 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchYi Lai
1/2
2/2T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: x86: Fix a WARN in kvm_apic_send_ipi()

When IPI virtualization is enabled, a WARN is triggered if bit12 of ICR MSR is set after APIC-write VM-exit. The reason is kvm_apic_send_ipi() thinks the APIC_ICR_BUSY bit should be cleared because KVM has no delay, but kvm_apic_write_nodecode() doesn't clear the APIC_ICR_BUSY bit.

The APIC_ICR_BUSY bit is removed in x2APIC mode, and bit12 of ICR is changed to UNUSED bit, but kvm_x2apic_icr_write() still uses APIC_ICR_BUSY, which may cause ambiguity, so introducing X2APIC_ICR_UNUSED_12 instead.

When X2APIC_ICR_UNUSED_12 is set, how the hardware handles it determines how the WARN is fixed. However SDM has no detail about it, we tested on Intel CPU (SRF/GNR) with IPI virtualization and found X2APIC_ICR_UNUSED_12 was also cleared by hardware without #GP. Therefore, the clearing of bit12 should be still kept being consistent with the hardware behavior.

Tao Su (2):
x86/apic: Introduce X2APIC_ICR_UNUSED_12 for x2APIC mode
KVM: x86: Clear X2APIC_ICR_UNUSED_12 after APIC-write VM-exit

 arch/x86/include/asm/apicdef.h |  1 +
 arch/x86/kvm/lapic.c           | 27 ++++++++++++++++++++-------
 2 files changed, 21 insertions(+), 7 deletions(-)

base-commit: 708283abf896dd4853e673cc8cba70acaf9bf4ea

Signature · 1 line
2.34.1