Skip to content

x86: Impplement support for unaccepted memory

Kirill A. Shutemov linux-coco linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 43 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5mm: Add support for unaccepted memorymm/internal.h mm/memblock.c mm/page_alloc.c+27 -121 replies
2/5efi/x86: Implement support for unaccepted memoryDocumentation/x86/zero-page.rst arch/x86/boot/compressed/Makefile arch/x86/boot/compressed/bitmap.c +7 more+153 -157 replies
3/5x86/boot/compressed: Handle unaccepted memoryarch/x86/boot/compressed/bitmap.c arch/x86/boot/compressed/kaslr.c arch/x86/boot/compressed/misc.c +2 more+98 -20 replies
4/5x86/mm: Provide helpers for unaccepted memoryarch/x86/boot/compressed/unaccepted_memory.c arch/x86/include/asm/page.h arch/x86/include/asm/unaccepted_memory.h +2 more+91 -22 replies
5/5x86/tdx: Unaccepted memory supportarch/x86/Kconfig arch/x86/boot/compressed/tdx.c arch/x86/boot/compressed/unaccepted_memory.c +3 more+49 -20 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/5] x86: Impplement support for unaccepted memory

UEFI Specification version 2.9 introduces concept of memory acceptance:
Some Virtual Machine platforms, such as Intel TDX or AMD SEV-SNP, requiring memory to be accepted before it can be used by the guest. Accepting happens via a protocol specific for the Virtrual Machine platform.

Accepting memory is costly and it makes VMM allocate memory for the accepted guest physical address range. We don't want to accept all memory upfront.

The patchset implements on-demand memory acceptance for TDX.

Please, review. Any feedback is welcome.

Kirill A. Shutemov (5):
mm: Add support for unaccepted memory efi/x86: Implement support for unaccepted memory x86/boot/compressed: Handle unaccepted memory x86/mm: Provide helpers for unaccepted memory x86/tdx: Unaccepted memory support

 Documentation/x86/zero-page.rst              |  1 +
 arch/x86/Kconfig                             |  1 +
 arch/x86/boot/compressed/Makefile            |  1 +
 arch/x86/boot/compressed/bitmap.c            | 86 ++++++++++++++++++++
 arch/x86/boot/compressed/kaslr.c             | 14 +++-
 arch/x86/boot/compressed/misc.c              |  9 ++
 arch/x86/boot/compressed/tdx.c               | 29 +++++++
 arch/x86/boot/compressed/unaccepted_memory.c | 51 ++++++++++++
 arch/x86/include/asm/page.h                  |  5 ++
 arch/x86/include/asm/tdx.h                   |  2 +
 arch/x86/include/asm/unaccepted_memory.h     | 17 ++++
 arch/x86/include/uapi/asm/bootparam.h        |  3 +-
 arch/x86/kernel/tdx.c                        |  8 ++
 arch/x86/mm/Makefile                         |  2 +
 arch/x86/mm/unaccepted_memory.c              | 84 +++++++++++++++++++
 drivers/firmware/efi/Kconfig                 | 12 +++
 drivers/firmware/efi/efi.c                   |  1 +
 drivers/firmware/efi/libstub/x86-stub.c      | 75 ++++++++++++++---
 include/linux/efi.h                          |  3 +-
 mm/internal.h                                | 14 ++++
 mm/memblock.c                                |  1 +
 mm/page_alloc.c                              | 13 ++-
 22 files changed, 414 insertions(+), 18 deletions(-)
 create mode 100644 arch/x86/boot/compressed/bitmap.c
 create mode 100644 arch/x86/boot/compressed/unaccepted_memory.c
 create mode 100644 arch/x86/include/asm/unaccepted_memory.h
 create mode 100644 arch/x86/mm/unaccepted_memory.c
Signature · 1 line
2.31.1