Skip to content

x86: APIC bug fix and cleanup

Sean Christopherson kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8x86: Always use legacy xAPIC to get APIC ID during TSS setuplib/x86/apic.c lib/x86/apic.h lib/x86/setup.c+9 -21 reply
2/8x86: nVMX: Load actual GS.base for both guest and hostx86/vmx.c+2 -20 replies
3/8x86: smp: Replace spaces with tabslib/x86/smp.c+64 -650 replies
4/8x86: desc: Replace spaces with tabslib/x86/desc.c lib/x86/desc.h+95 -940 replies
5/8x86: Add proper helpers for per-cpu reads/writeslib/x86/desc.c lib/x86/smp.c lib/x86/smp.h+74 -210 replies
6/8x86: apic: Replace spaces with tabslib/x86/apic.c+69 -690 replies
7/8x86: apic: Track APIC ops on a per-cpu basislib/x86/apic.c lib/x86/smp.h+14 -80 replies
8/8x86: apic: Make xAPIC and I/O APIC pointers staticlib/x86/apic-defs.h lib/x86/apic.c lib/x86/apic.h+6 -60 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [kvm-unit-tests PATCH 0/8] x86: APIC bug fix and cleanup

Fix a bug introduced by the UEFI support where setup_tss() can race with enable_x2apic() and crash the test due to attempting to read an x2APIC MSR prior to enabling x2APIC (failure manifests in smptest3).

In an attempt to avoid similar bugs in the future, clean up the per-cpu stuff and convert apic_ops into a per-cpu pointer. 32-bit KUT has a chick-and-egg problem due to using the APIC ID to choose the selector for GS (the per-cpu segment), so the original bug "has" to say on a dedicated helper.

Sean Christopherson (8):
x86: Always use legacy xAPIC to get APIC ID during TSS setup
x86: nVMX: Load actual GS.base for both guest and host
x86: smp: Replace spaces with tabs
x86: desc: Replace spaces with tabs
x86: Add proper helpers for per-cpu reads/writes
x86: apic: Replace spaces with tabs
x86: apic: Track APIC ops on a per-cpu basis
x86: apic: Make xAPIC and I/O APIC pointers static

 lib/x86/apic-defs.h |   3 +-
 lib/x86/apic.c      | 157 ++++++++++++++++++++++++--------------------
 lib/x86/apic.h      |   5 +-
 lib/x86/desc.c      | 120 ++++++++++++++++-----------------
 lib/x86/desc.h      |  68 +++++++++----------
 lib/x86/setup.c     |   4 +-
 lib/x86/smp.c       | 128 +++++++++++++++++-------------------
 lib/x86/smp.h       |  67 +++++++++++++++++++
 x86/vmx.c           |   4 +-
 9 files changed, 311 insertions(+), 245 deletions(-)

base-commit: 3df301615cead4142fe28629d86142de32fc6768

Signature · 1 line
2.35.0.rc0.227.g00780c9af4-goog