Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH v6 0/3] x86/tdx: Fix port I/O handling bugs
@ 2026-07-13 13:37 Kiryl Shutsemau
  2026-07-13 13:37 ` [PATCH v6 1/3] x86/tdx: Fix off-by-one in port I/O handling Kiryl Shutsemau
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kiryl Shutsemau @ 2026-07-13 13:37 UTC (permalink / raw)
  To: Dave Hansen, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86
  Cc: Sean Christopherson, Paolo Bonzini, Kuppuswamy Sathyanarayanan,
	Kai Huang, Xiaoyao Li, Rick Edgecombe, Binbin Wu, David Laight,
	Andi Kleen, Dan Williams, Borys Tsyrulnikov, kvm, linux-coco,
	linux-kernel, stable, Kiryl Shutsemau (Meta)

From: "Kiryl Shutsemau (Meta)" <kas@kernel.org>

Three fixes for emulated port I/O in the TDX guest #VE handler.

Patch 1 fixes an off-by-one in the GENMASK() used by handle_in() and
handle_out(): the mask was one bit too wide for every I/O size.

Patch 3 fixes 32-bit port IN to zero-extend into RAX, per x86
semantics, instead of preserving the upper 32 bits. To avoid
open-coding the partial-register-write rules, patch 2 first moves KVM's
assign_register() into <asm/insn-eval.h> as insn_assign_reg() so both
KVM and the #VE handler can share it.

Changes since v5:
  - Patch 2: reword the shortlog and comment; no functional change
    (Sean, David Laight). Collect Acked-by from Sean.
  - Patches 1 and 3 unchanged.

v5: https://lore.kernel.org/all/20260701110547.764083-1-kirill@shutemov.name/
v4: https://lore.kernel.org/all/cover.1780584300.git.kas@kernel.org/

Kiryl Shutsemau (Meta) (3):
  x86/tdx: Fix off-by-one in port I/O handling
  x86/insn-eval: Move assign_register() out of KVM as insn_assign_reg()
  x86/tdx: Fix zero-extension for 32-bit port I/O

 arch/x86/coco/tdx/tdx.c          | 10 ++++-----
 arch/x86/include/asm/insn-eval.h | 36 ++++++++++++++++++++++++++++++++
 arch/x86/kvm/emulate.c           | 26 ++++-------------------
 3 files changed, 44 insertions(+), 28 deletions(-)


base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
-- 
2.54.0


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

end of thread, other threads:[~2026-07-13 13:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13 13:37 [PATCH v6 0/3] x86/tdx: Fix port I/O handling bugs Kiryl Shutsemau
2026-07-13 13:37 ` [PATCH v6 1/3] x86/tdx: Fix off-by-one in port I/O handling Kiryl Shutsemau
2026-07-13 13:50   ` sashiko-bot
2026-07-13 13:37 ` [PATCH v6 2/3] x86/insn-eval: Move assign_register() out of KVM as insn_assign_reg() Kiryl Shutsemau
2026-07-13 13:37 ` [PATCH v6 3/3] x86/tdx: Fix zero-extension for 32-bit port I/O Kiryl Shutsemau
2026-07-13 13:51   ` sashiko-bot

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