KVM: x86: Fix a WARN in kvm_apic_send_ipi()
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | x86/apic: Introduce X2APIC_ICR_UNUSED_12 for x2APIC modearch/ | +1 | 2 replies | |
| 2/2 | KVM: x86: Clear X2APIC_ICR_UNUSED_12 after APIC-write VM-exitarch/ | +20 | 7 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by.
| Patch | Yi Lai |
|---|---|
| 1/2 | |
| 2/2 | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
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