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/20220426114352.1262-1-varad.gautam@xxxxxxxx v2: https://lore.kernel.org/kvm/20220412173407.13637-1-varad.gautam@xxxxxxxx/ 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 -- 2.36.1.476.g0c4daa206d-goog