Skip to content

x86/hyperv: Support wakeup mailbox for VTL2 TDX guest

Yunhong Jiang linux-acpi linux-devicetree linux-hyperv lkml oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest9 patches 23 repliesIn review
  2. v17 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- Fix the cover letter's summary phrase.
- Fix the DT binding document to pass validation.
- Change the DT binding document to be ACPI independent.
- Move ACPI-only functions into the #ifdef CONFIG_ACPI.
- Change dtb_parse_mp_wake() to return mailbox physical address.
- Rework the hv_is_private_mmio_tdx().
- Remove unrelated real mode change from the patch that marks mailbox page private.
- Check hv_isolation_type_tdx() instead of wakeup_mailbox_addr in hv_vtl_init_platform() because wakeup_mailbox_addr is not parsed yet.
- Add memory range support to reserve_real_mode.
- Remove realmode_reserve callback and use the memory range.
- Move setting the real_mode_header to hv_vtl_init_platform.
- Update comments and commit messages.
- Minor style changes.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9x86/acpi: Move ACPI MADT wakeup to generic codeMAINTAINERS arch/x86/kernel/Makefile arch/x86/kernel/acpi/Makefile +2 more+3 -10 replies
2/9dt-bindings: x86: Add a binding for x86 wakeup mailboxDocumentation/devicetree/bindings/x86/wakeup.yaml+64 -013 replies
3/9x86/dt: Support the ACPI multiprocessor wakeup for device treeMAINTAINERS arch/x86/Kconfig arch/x86/include/asm/acpi.h +2 more+56 -22 replies
4/9x86/hyperv: Parse the ACPI wakeup mailboxarch/x86/include/asm/mshyperv.h arch/x86/kernel/cpu/mshyperv.c drivers/hv/hv_common.c+13 -04 replies
5/9x86/hyperv: Mark ACPI wakeup mailbox page as privatearch/x86/hyperv/hv_vtl.c+16 -03 replies
6/9x86/realmode: Add memory range support to reserve_real_modearch/x86/include/asm/x86_init.h arch/x86/kernel/x86_init.c arch/x86/realmode/init.c+15 -80 replies
7/9x86/hyperv: Move setting the real_mode_header to hv_vtl_init_platformarch/x86/hyperv/hv_vtl.c+1 -10 replies
8/9x86/hyperv: Set realmode_limit to 4G for VTL2 TDX guestarch/x86/hyperv/hv_vtl.c+8 -41 reply
9/9x86/hyperv: Use wakeup mailbox for VTL2 guests if availablearch/x86/hyperv/hv_vtl.c+2 -10 replies

Reviews trailers per patch

None of the 9 patches has a Reviewed-by or Acked-by.

PatchThomas Gleixner
1/9
2/9
3/9
4/9
5/9
6/9Originally-by
7/9
8/9
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/9] x86/hyperv: Support wakeup mailbox for VTL2 TDX guest

This set of patches add ACPI multiprocessor wakeup support to VTL2 TDX VMs booting with device tree instead of ACPI.

Historically, x86 platforms have booted secondary processors (APs) using INIT followed by the start up IPI (SIPI) messages. However, TDX VMs can't use this protocol because this protocol requires assistance from VMMs while VMMs are not trusted by TDX guest.

ACPI specification version 6.4 introduced a new wakeup mailbox model to address this issue. A "Multiprocessor Wakeup Structure" has been added to an existing ACPI table (MADT). This structure provides the physical of a "Multiprocessor Wakeup Mailbox Structure". Message written to the mailbox structure steers the APs to the boot code.

With this new wakeup model, TDX VMs with ACPI support boot the APs securely. However, TDX VMs with the device tree, like VTL2 TDX hyperv guests, have no ACPI support and still face the challenge.

To fix this challenge, either a new mechanism from scratch is introduced, or the TDX VMs with device tree can utilize the ACPI wakeup model.

By reusing the ACPI wakeup mailbox model, the Multiprocessor Wakeup Mailbox Structure will be kept and the message mechanism will be the same as ACPI. This will reduce maintenance effort in the long term.

The first patch moves the madt wakeup implementation to generic code. The patches 2-3 add the wakeup mailbox support to the device tree. The patches 4-5 add the wakeup mailbox support to the hyperv guest. The patches 6-8 update the real mode memory reservation.
The last patch applies the wakeup mailbox support to the VTL2 TDX guest.

v2:
- Fix the cover letter's summary phrase.
- Fix the DT binding document to pass validation.
- Change the DT binding document to be ACPI independent.
- Move ACPI-only functions into the #ifdef CONFIG_ACPI.
- Change dtb_parse_mp_wake() to return mailbox physical address.
- Rework the hv_is_private_mmio_tdx().
- Remove unrelated real mode change from the patch that marks mailbox page private.
- Check hv_isolation_type_tdx() instead of wakeup_mailbox_addr in hv_vtl_init_platform() because wakeup_mailbox_addr is not parsed yet.
- Add memory range support to reserve_real_mode.
- Remove realmode_reserve callback and use the memory range.
- Move setting the real_mode_header to hv_vtl_init_platform.
- Update comments and commit messages.
- Minor style changes.

Yunhong Jiang (9):
x86/acpi: Move ACPI MADT wakeup to generic code
dt-bindings: x86: Add a binding for x86 wakeup mailbox x86/dt: Support the ACPI multiprocessor wakeup for device tree x86/hyperv: Parse the ACPI wakeup mailbox
x86/hyperv: Mark ACPI wakeup mailbox page as private x86/realmode: Add memory range support to reserve_real_mode x86/hyperv: Move setting the real_mode_header to hv_vtl_init_platform x86/hyperv: Set realmode_limit to 4G for VTL2 TDX guest x86/hyperv: Use wakeup mailbox for VTL2 guests if available

 .../devicetree/bindings/x86/wakeup.yaml       | 64 +++++++++++++++++++
 MAINTAINERS                                   |  3 +
 arch/x86/Kconfig                              |  2 +-
 arch/x86/hyperv/hv_vtl.c                      | 29 +++++++--
 arch/x86/include/asm/acpi.h                   |  1 -
 arch/x86/include/asm/madt_wakeup.h            | 16 +++++
 arch/x86/include/asm/mshyperv.h               |  3 +
 arch/x86/include/asm/x86_init.h               |  6 ++
 arch/x86/kernel/Makefile                      |  1 +
 arch/x86/kernel/acpi/Makefile                 |  1 -
 arch/x86/kernel/cpu/mshyperv.c                |  2 +
 arch/x86/kernel/{acpi => }/madt_playdead.S    |  0
 arch/x86/kernel/{acpi => }/madt_wakeup.c      | 38 +++++++++++
 arch/x86/kernel/x86_init.c                    |  3 +
 arch/x86/realmode/init.c                      | 14 ++--
 drivers/hv/hv_common.c                        |  8 +++
 16 files changed, 176 insertions(+), 15 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/x86/wakeup.yaml
 create mode 100644 arch/x86/include/asm/madt_wakeup.h
 rename arch/x86/kernel/{acpi => }/madt_playdead.S (100%)
 rename arch/x86/kernel/{acpi => }/madt_wakeup.c (90%)

base-commit: fedb9ddeb1445f85d8f691b20f3faaa6dab8dd3f

Signature · 1 line
2.25.1