[PULL REQUEST][kinetic/linux-azure] Kinetic: Enable MSFT Hyper-v TDX guest support

Tim Gardner tim.gardner at canonical.com
Thu Jan 12 14:44:26 UTC 2023


SRU Justification

BugLink: https://bugs.launchpad.net/bugs/2002658

[Impact]

Support for Intel TDX guest driver is just now appearing upstream. This 
patch set is a backport of the patches essential to enabling TDX guest 
support on the Microsoft hypervisor.

Most of these patches are not yet upstream, but are considered benign 
with respect to MSFT hypervisors that do not yet have support for TDX. I 
have boot tested on an existing Hyper-v hypervisor to ensure backwards 
compatibility.

This patch set will eventually be replaced by upstream patches.

[Test Plan]

Boot on a TDX enabled Hyper-v instance.

[Where things could go wrong]

Existing Azure instances could have boot issues.

-----------------------------------------------------------------------

The following changes since commit 1c80ad05e8fbba41a36a1dcccdf7ddf9916b6e1a:

   UBUNTU: Ubuntu-azure-5.19.0-1016.17 (2022-12-15 11:28:09 -0700)

are available in the Git repository at:

   git://git.launchpad.net/~timg-tpi/ubuntu/+source/linux/+git/kinetic 
102f198aac3f164c595a552165900fa63bc1f1e6

for you to fetch changes up to 102f198aac3f164c595a552165900fa63bc1f1e6:

   UBUNTU: SAUCE: tdx: Drivers: hv: vmbus:: Fix the ARM64 build caused 
by recent TDX patches (2023-01-12 07:37:26 -0700)

----------------------------------------------------------------
Anirudh Rayabharam (1):
       clocksource/drivers/hyperv: add data structure for reference TSC MSR

Dexuan Cui (14):
       Revert "UBUNTU: SAUCE: x86/tdx: Add TDX Guest attestation 
interface driver"
       Revert "UBUNTU: SAUCE: selftests: tdx: Test GetReport TDX 
attestation feature"
       Revert "x86/hyper-v: Add hyperv Isolation VM check in the 
cc_platform_has()"
       UBUNTU: SAUCE: tdx: enable DEBUG: 
tools/testing/selftests/tdx/tdx_guest_test.c
       UBUNTU: SAUCE: tdx: swiotlb: check set_memory_decrypted()'s 
return value
       UBUNTU: SAUCE: tdx: x86/sev: mem_encrypt_free_decrypted_mem(): 
encrypt the pages for AMD SME only
       UBUNTU: SAUCE: tdx: x86/hyperv: Do not run 
swiotlb_update_mem_attributes() in hyperv_init()
       UBUNTU: SAUCE: tdx: x86/tdx: Retry TDVMCALL_MAP_GPA() when needed
       UBUNTU: SAUCE: tdx: x86/tdx: Support vmalloc() for 
tdx_enc_status_changed()
       UBUNTU: SAUCE: tdx: x86/hyperv: Add hv_isolation_type_tdx() to 
detect TDX guests
       UBUNTU: SAUCE: tdx: x86/hyperv: Support hypercalls for TDX guests
       UBUNTU: SAUCE: tdx: Drivers: hv: vmbus: Support TDX guests
       UBUNTU: SAUCE: tdx: x86/hyperv: Fix serial console interrupts for 
TDX guests
       UBUNTU: SAUCE: tdx: Drivers: hv: vmbus:: Fix the ARM64 build 
caused by recent TDX patches

Kirill A. Shutemov (1):
       UBUNTU: SAUCE: tdx: x86/tdx: Expand __tdx_hypercall() to handle 
more arguments

Kuppuswamy Sathyanarayanan (3):
       x86/tdx: Add a wrapper to get TDREPORT0 from the TDX Module
       virt: Add TDX guest driver
       selftests/tdx: Test TDX attestation GetReport support

Tim Gardner (1):
       UBUNTU: [Config] azure: Enable TDX guest driver

  Documentation/virt/coco/tdx-guest.rst         |  52 +++++++++++++++++
  Documentation/virt/index.rst                  |   1 +
  Documentation/x86/tdx.rst                     |  43 ++++++++++++++
  arch/x86/coco/core.c                          |   6 --
  arch/x86/coco/tdx/tdcall.S                    |  82 
+++++++++++++++++++--------
  arch/x86/coco/tdx/tdx.c                       | 262 
++++++++++++++++++++++++++++++++++++++++---------------------------------------------
  arch/x86/hyperv/hv_init.c                     |  32 +++++++++--
  arch/x86/hyperv/ivm.c                         |  28 +++++++++
  arch/x86/include/asm/hyperv-tlfs.h            |   3 +-
  arch/x86/include/asm/mshyperv.h               |  20 +++++++
  arch/x86/include/asm/shared/tdx.h             |   6 ++
  arch/x86/include/asm/tdx.h                    |   2 +
  arch/x86/include/uapi/asm/tdx.h               |  51 -----------------
  arch/x86/kernel/asm-offsets.c                 |   6 ++
  arch/x86/kernel/cpu/mshyperv.c                |  44 ++++++++++++++-
  arch/x86/mm/mem_encrypt_amd.c                 |   2 +-
  arch/x86/mm/pat/set_memory.c                  |   2 +-
  debian.azure/config/config.common.ubuntu      |   1 +
  drivers/clocksource/hyperv_timer.c            |  29 +++++-----
  drivers/hv/connection.c                       |   4 +-
  drivers/hv/hv.c                               |  60 +++++++++++++++++++-
  drivers/hv/hv_common.c                        |  12 ++++
  drivers/hv/ring_buffer.c                      |   4 ++
  drivers/virt/Kconfig                          |   2 +
  drivers/virt/Makefile                         |   1 +
  drivers/virt/coco/tdx-guest/Kconfig           |  10 ++++
  drivers/virt/coco/tdx-guest/Makefile          |   2 +
  drivers/virt/coco/tdx-guest/tdx-guest.c       | 102 
+++++++++++++++++++++++++++++++++
  include/asm-generic/hyperv-tlfs.h             |   9 +++
  include/asm-generic/mshyperv.h                |   3 +
  include/uapi/linux/tdx-guest.h                |  42 ++++++++++++++
  kernel/dma/swiotlb.c                          |   5 +-
  tools/arch/x86/include/uapi/asm/tdx.h         |  51 -----------------
  tools/testing/selftests/tdx/Makefile          |   8 +--
  tools/testing/selftests/tdx/config            |   2 +-
  tools/testing/selftests/tdx/tdx_attest_test.c | 156 
---------------------------------------------------
  tools/testing/selftests/tdx/tdx_guest_test.c  | 163 
+++++++++++++++++++++++++++++++++++++++++++++++++++++
  37 files changed, 847 insertions(+), 461 deletions(-)
  create mode 100644 Documentation/virt/coco/tdx-guest.rst
  delete mode 100644 arch/x86/include/uapi/asm/tdx.h
  create mode 100644 drivers/virt/coco/tdx-guest/Kconfig
  create mode 100644 drivers/virt/coco/tdx-guest/Makefile
  create mode 100644 drivers/virt/coco/tdx-guest/tdx-guest.c
  create mode 100644 include/uapi/linux/tdx-guest.h
  delete mode 100644 tools/arch/x86/include/uapi/asm/tdx.h
  delete mode 100644 tools/testing/selftests/tdx/tdx_attest_test.c
  create mode 100644 tools/testing/selftests/tdx/tdx_guest_test.c
-- 
-----------
Tim Gardner
Canonical, Inc



More information about the kernel-team mailing list