mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/6] TDX: Stop metadata auto-generation, improve readability
@ 2025-12-02  5:08 Xu Yilun
  2025-12-02  5:08 ` [PATCH 1/6] x86/virt/tdx: Move bit definitions of TDX_FEATURES0 to public header Xu Yilun
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Xu Yilun @ 2025-12-02  5:08 UTC (permalink / raw)
  To: x86, dave.hansen, kas, linux-kernel
  Cc: chao.gao, rick.p.edgecombe, dan.j.williams, baolu.lu, yilun.xu,
	yilun.xu, zhenzhong.duan, kvm, adrian.hunter

Hi:

This addresses the common need [1][2] to stop auto-generating metadata
reading code, improve readability, allowing us to manually edit and
review metadata code in a comfortable way. TDX Connect needs to add more
metadata fields based on this series, and I believe also for DPAMT and
TDX Module runtime update.

The main changes derive from previous code & discussions before
auto-generation is introduced, including the usage of
struct field_mapping table, the build-time field size check, the concern
about awkward "ret = ret ?: " code pattern. [3]

Another concern from DPAMT [4] leads to the last patch and I realize all
optional features may face with the same problem - Optional metadata
reading should be skipped when a TDX Module doesn't support, don't fail
the whole TDX Module initialization. I use "TDX Module Extensions" as
the example and test case just because I have the TDX Connect ENV on
hand.

This series is based on Dan's tsm#devsec-phase1 [5] (convenient for my
testing), but is clean to apply to v6.18-rc7.

[1] https://lore.kernel.org/kvm/1e7bcbad-eb26-44b7-97ca-88ab53467212@intel.com/
[2] https://lore.kernel.org/all/89a4e42d-b0fd-49b0-8d51-df7bac0d5e5b@intel.com/
[3] https://lore.kernel.org/kvm/9a06e2cf469cbca2777ac2c4ef70579e6bb934d5.camel@intel.com/
[4] https://lore.kernel.org/kvm/850f7ce0571cb54bc984c79861bdfd104e097eb9.camel@intel.com/
[5] https://git.kernel.org/pub/scm/linux/kernel/git/devsec/tsm.git/log/?h=devsec-phase1


Xu Yilun (6):
  x86/virt/tdx: Move bit definitions of TDX_FEATURES0 to public header
  x86/virt/tdx: Move read_sys_metadata_field() to where it is called
  x86/virt/tdx: Refactor metadata reading with a clearer for loop
  x86/virt/tdx: Sanity check the size of each metadata field
  x86/virt/tdx: Add generic support for reading array-typed metadata
  x86/virt/tdx: Skip unsupported metadata by querying tdx_feature0

 arch/x86/include/asm/tdx.h                  |   5 +
 arch/x86/include/asm/tdx_global_metadata.h  |  12 +-
 arch/x86/virt/vmx/tdx/tdx.h                 |   3 -
 arch/x86/virt/vmx/tdx/tdx.c                 |  20 --
 arch/x86/virt/vmx/tdx/tdx_global_metadata.c | 194 ++++++++++++--------
 5 files changed, 134 insertions(+), 100 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2025-12-08 10:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-02  5:08 [PATCH 0/6] TDX: Stop metadata auto-generation, improve readability Xu Yilun
2025-12-02  5:08 ` [PATCH 1/6] x86/virt/tdx: Move bit definitions of TDX_FEATURES0 to public header Xu Yilun
2025-12-02  5:08 ` [PATCH 2/6] x86/virt/tdx: Move read_sys_metadata_field() to where it is called Xu Yilun
2025-12-02  5:08 ` [PATCH 3/6] x86/virt/tdx: Refactor metadata reading with a clearer for loop Xu Yilun
2025-12-02  5:08 ` [PATCH 4/6] x86/virt/tdx: Sanity check the size of each metadata field Xu Yilun
2025-12-02  5:08 ` [PATCH 5/6] x86/virt/tdx: Add generic support for reading array-typed metadata Xu Yilun
2025-12-02  5:08 ` [PATCH 6/6] x86/virt/tdx: Skip unsupported metadata by querying tdx_feature0 Xu Yilun
2025-12-07  7:44 ` [PATCH 0/6] TDX: Stop metadata auto-generation, improve readability dan.j.williams
2025-12-08 10:17   ` Xu Yilun

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®