mbox series

[kvm-unit-tests,0/9] SMP Support for x86 UEFI Tests

Message ID 20220408103127.19219-1-varad.gautam@suse.com (mailing list archive)
Headers show
Series SMP Support for x86 UEFI Tests | expand

Message

Varad Gautam April 8, 2022, 10:31 a.m. UTC
This series brings multi-vcpu support to UEFI tests on x86.

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.

Git branch: https://github.com/varadgautam/kvm-unit-tests/commits/ap-boot-v1

Varad Gautam (9):
  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: efi, smp: Transition APs from 16-bit to 32-bit mode
  x86: Move 32-bit bringup routines to start32.S
  x86: efi, smp: Transition APs from 32-bit to 64-bit mode
  x86: Move load_gdt_tss() to desc.c
  x86: Provide a common 64-bit AP entrypoint for EFI and non-EFI
  x86: setup: Serialize ap_start64 with a spinlock

 lib/x86/asm/setup.h       |   3 ++
 lib/x86/desc.c            |  39 +++++++++++---
 lib/x86/desc.h            |   3 ++
 lib/x86/setup.c           |  65 +++++++++++++++++-----
 lib/x86/smp.c             |  89 +++++++++++++++++++++++++++++-
 lib/x86/smp.h             |   1 +
 x86/cstart64.S            | 111 ++------------------------------------
 x86/efi/crt0-efi-x86_64.S |   3 ++
 x86/efi/efistart64.S      |  73 ++++++++++++++++++++-----
 x86/start32.S             | 102 +++++++++++++++++++++++++++++++++++
 10 files changed, 348 insertions(+), 141 deletions(-)
 create mode 100644 x86/start32.S

Comments

Sean Christopherson April 8, 2022, 2:35 p.m. UTC | #1
On Fri, Apr 08, 2022, Varad Gautam wrote:
> This series brings multi-vcpu support to UEFI tests on x86.
> 
> 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.
> 
> Git branch: https://github.com/varadgautam/kvm-unit-tests/commits/ap-boot-v1
> 
> Varad Gautam (9):
>   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: efi, smp: Transition APs from 16-bit to 32-bit mode
>   x86: Move 32-bit bringup routines to start32.S
>   x86: efi, smp: Transition APs from 32-bit to 64-bit mode
>   x86: Move load_gdt_tss() to desc.c
>   x86: Provide a common 64-bit AP entrypoint for EFI and non-EFI
>   x86: setup: Serialize ap_start64 with a spinlock

This series doesn't apply cleanly on upstream master.  I feel bad for asking, but
in addition to rebasing to master, can you also rebase on top of my series[*] that
fixes SMP bugs that were introduced by the initial UEFI support?  I don't think
there will be semantic conflicts, but the whitespace cleanups (spaces => tabs) do
conflict, and I'd really like to start purging the spaces mess from KUT.

Paolo / Andrew, ping on my series, it still applies cleanly.

[*] https://lore.kernel.org/all/20220121231852.1439917-1-seanjc@google.com
Varad Gautam April 12, 2022, 5:40 p.m. UTC | #2
Hi Sean,

On 4/8/22 4:35 PM, Sean Christopherson wrote:
> On Fri, Apr 08, 2022, Varad Gautam wrote:
>> This series brings multi-vcpu support to UEFI tests on x86.
>>
>> 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.
>>
>> Git branch: https://github.com/varadgautam/kvm-unit-tests/commits/ap-boot-v1
>>
>> Varad Gautam (9):
>>   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: efi, smp: Transition APs from 16-bit to 32-bit mode
>>   x86: Move 32-bit bringup routines to start32.S
>>   x86: efi, smp: Transition APs from 32-bit to 64-bit mode
>>   x86: Move load_gdt_tss() to desc.c
>>   x86: Provide a common 64-bit AP entrypoint for EFI and non-EFI
>>   x86: setup: Serialize ap_start64 with a spinlock
> 
> This series doesn't apply cleanly on upstream master.  I feel bad for asking, but
> in addition to rebasing to master, can you also rebase on top of my series[*] that
> fixes SMP bugs that were introduced by the initial UEFI support?  I don't think
> there will be semantic conflicts, but the whitespace cleanups (spaces => tabs) do
> conflict, and I'd really like to start purging the spaces mess from KUT.
> 

I'd based the v1 on [1], which is no longer required after your apic_ops percpu
conversion series [2].

I've now based my series on yours and posted a v2 here [3].

[1] https://lore.kernel.org/kvm/20220406124002.13741-1-varad.gautam@suse.com/
[2] https://lore.kernel.org/all/20220121231852.1439917-1-seanjc@google.com/
[3] https://lore.kernel.org/kvm/20220412173407.13637-1-varad.gautam@suse.com/

> Paolo / Andrew, ping on my series, it still applies cleanly.
> 
> [*] https://lore.kernel.org/all/20220121231852.1439917-1-seanjc@google.com
>