Skip to content

x86: SMP Support for x86 UEFI Tests

Sean Christopherson kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest13 patches 4 repliesIn review

Changes in v4 from the cover letter

- Add an explict magic string in dummy.c for probing.
- Reduce #ifdefs via macros
- Consolidate final "AP online" code.
- Misc tweaks, e.g. to adhere to preferred style.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13x86: Use an explicit magic string to detect that dummy.efi passesscripts/runtime.bash x86/dummy.c+9 -10 replies
2/13x86: Share realmode trampoline between i386 and x86_64x86/cstart.S x86/cstart64.S x86/trampolines.S+38 -330 replies
3/13x86: Move ap_init() to smp.clib/alloc_page.h lib/x86/setup.c lib/x86/smp.c +5 more+98 -460 replies
4/13x86: Move load_idt() to desc.clib/x86/desc.c lib/x86/desc.h lib/x86/setup.c +3 more+9 -80 replies
5/13x86: desc: Split IDT entry setup into a generic helperlib/x86/desc.c lib/x86/desc.h+23 -60 replies
6/13x86: Move load_gdt_tss() to desc.clib/x86/desc.c lib/x86/desc.h lib/x86/setup.c +1 more+30 -290 replies
7/13x86: efi: Provide a stack within testcase memoryx86/efi/crt0-efi-x86_64.S x86/efi/efistart64.S+9 -00 replies
8/13x86: efi: Provide percpu storagelib/x86/setup.c lib/x86/smp.c+6 -153 replies
9/13x86: Move 32-bit => 64-bit transition code to trampolines.Sx86/cstart64.S x86/trampolines.S+69 -620 replies
10/13x86: efi, smp: Transition APs from 16-bit to 32-bit modelib/x86/setup.c lib/x86/smp.c lib/x86/smp.h +2 more+153 -60 replies
11/13x86: Provide a common 64-bit AP entrypoint for EFI and non-EFIlib/x86/apic.c lib/x86/asm/setup.h lib/x86/setup.c +5 more+48 -470 replies
12/13x86: Rename ap_init() to bringup_aps()lib/x86/setup.c lib/x86/smp.c lib/x86/smp.h +2 more+5 -50 replies
13/13x86: Add ap_online() to consolidate final "AP is alive!" codelib/x86/setup.c lib/x86/smp.c lib/x86/smp.h +1 more+17 -130 replies

Reviews trailers per patch

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

Read the v4 thread

Cover letter [kvm-unit-tests PATCH v4 00/13] x86: SMP Support for x86 UEFI Tests

This is Varad's series to bring multi-vcpu support to UEFI tests on x86, with some relatively minor massaging by me. The only change I made that I suspect might be controversial is squashing start16.S and start32.S into a single trampolines.S.

Most of the necessary AP bringup code already exists within kvm-unit-tests' cstart64.S, and has now been either rewritten in C or moved to a common location to be shared between EFI and non-EFI test builds.

A call gate is used to transition from 16-bit to 32-bit mode, since EFI may not load the 32-bit entrypoint low enough to be reachable from the SIPI vector.

v4:
- Add an explict magic string in dummy.c for probing.
- Reduce #ifdefs via macros
- Consolidate final "AP online" code.
- Misc tweaks, e.g. to adhere to preferred style.

v3:
- Unbreak i386 build, ingest seanjc's reviews from v2.a
- https://lore.kernel.org/all/[email protected]

v2: https://lore.kernel.org/kvm/[email protected]/

Sean Christopherson (3):
x86: Use an explicit magic string to detect that dummy.efi passes
x86: Rename ap_init() to bringup_aps()
x86: Add ap_online() to consolidate final "AP is alive!" code

Varad Gautam (10):
x86: Share realmode trampoline between i386 and x86_64
x86: Move ap_init() to smp.c
x86: Move load_idt() to desc.c
x86: desc: Split IDT entry setup into a generic helper
x86: Move load_gdt_tss() to desc.c
x86: efi: Provide a stack within testcase memory
x86: efi: Provide percpu storage
x86: Move 32-bit => 64-bit transition code to trampolines.S
x86: efi, smp: Transition APs from 16-bit to 32-bit mode
x86: Provide a common 64-bit AP entrypoint for EFI and non-EFI

 lib/alloc_page.h          |   3 +
 lib/x86/apic.c            |   2 -
 lib/x86/asm/setup.h       |   3 +
 lib/x86/desc.c            |  38 ++++++++--
 lib/x86/desc.h            |   4 +
 lib/x86/setup.c           |  82 +++++++++++++++++----
 lib/x86/smp.c             | 150 +++++++++++++++++++++++++++++++++++++-
 lib/x86/smp.h             |  11 +++
 scripts/runtime.bash      |   2 +-
 x86/cstart.S              |  48 ++----------
 x86/cstart64.S            | 125 +------------------------------
 x86/dummy.c               |   8 ++
 x86/efi/crt0-efi-x86_64.S |   3 +
 x86/efi/efistart64.S      |  79 ++++++++++++--------
 x86/svm_tests.c           |  10 +--
 x86/trampolines.S         | 129 ++++++++++++++++++++++++++++++++
 16 files changed, 470 insertions(+), 227 deletions(-)
 create mode 100644 x86/trampolines.S

base-commit: 610c15284a537484682adfb4b6d6313991ab954f

Signature · 1 line
2.36.1.476.g0c4daa206d-goog