mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 0/2] x86/vmware: Share steal-time storage in encrypted guests
@ 2026-09-16  5:05 Zack Rusin
  2026-09-16  5:05 ` [PATCH v1 1/2] percpu: Use X86_MEM_ENCRYPT for decrypted per-CPU data Zack Rusin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Zack Rusin @ 2026-09-16  5:05 UTC (permalink / raw)
  To: Borislav Petkov, Ajay Kaher, Alexey Makhalov, x86, Dennis Zhou,
	Tejun Heo, Arnd Bergmann, Kiryl Shutsemau, Rick Edgecombe
  Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, H . Peter Anvin,
	virtualization, bcm-kernel-feedback-list, linux-kernel,
	Christoph Lameter, Andrew Morton, Tom Lendacky, Bo Gan, linux-mm,
	linux-arch, linux-coco, kvm, Zack Rusin

VMware registers each per-CPU steal-time GPA with the host. An encrypted
guest must first convert that storage to shared memory, but the existing
setup publishes the address without conversion.

Patch 1 makes the decrypted per-CPU section available with
CONFIG_X86_MEM_ENCRYPT, including TDX-only configurations. Patch 2 defers
encrypted-guest setup until allocator-backed page-table splitting is
available, converts every possible CPU's storage before publishing any
GPA, and attempts to roll back all conversions on failure.

TDX's conversion callback uses __pa(), so patch 2 preflights every possible
CPU and leaves steal time disabled if a TDX guest uses vmalloc-backed
per-CPU storage. This covers percpu_alloc=page and automatic allocator
fallback. AMD encrypted guests support those mappings and are not rejected.
Supporting them in TDX would require a separate conversion-API change.

Conversion need not preserve zeroes, and the host initializes only the
8-byte counter. Patch 2 therefore clears each 64-byte object after
conversion and before registration, without disturbing other decrypted
objects that can share its page.

The intended merge path is tip's x86/vmware branch, following
commit ac26963a1175 ("percpu: Introduce DEFINE_PER_CPU_DECRYPTED").
Per-CPU and asm-generic maintainer Acks are requested for patch 1.

This replaces patch 4 of Alexey's v2 posting:
https://lore.kernel.org/all/20260309235250.2611115-1-alexey.makhalov@broadcom.com/

Zack Rusin (2):
  percpu: Use X86_MEM_ENCRYPT for decrypted per-CPU data
  x86/vmware: Decrypt steal-time storage before sharing it

 arch/x86/kernel/cpu/vmware.c      | 96 ++++++++++++++++++++++++++++++-
 include/asm-generic/vmlinux.lds.h |  2 +-
 include/linux/percpu-defs.h       |  2 +-
 3 files changed, 97 insertions(+), 3 deletions(-)


base-commit: fd73f4a6659897191fa0d40695fe370925dd3780
-- 
2.53.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-17 14:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16  5:05 [PATCH v1 0/2] x86/vmware: Share steal-time storage in encrypted guests Zack Rusin
2026-09-16  5:05 ` [PATCH v1 1/2] percpu: Use X86_MEM_ENCRYPT for decrypted per-CPU data Zack Rusin
2026-09-16 11:14   ` Kiryl Shutsemau
2026-09-16  5:05 ` [PATCH v1 2/2] x86/vmware: Decrypt steal-time storage before sharing it Zack Rusin
2026-09-16 12:18 ` [PATCH v1 0/2] x86/vmware: Share steal-time storage in encrypted guests Kiryl Shutsemau
2026-09-16 15:41   ` Zack Rusin
2026-09-17 14:11     ` Kiryl Shutsemau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®