x86/tdx: Fix port I/O handling bugs
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest3 patches 7 repliesIn review
- v32 patches 7 repliesSuperseded
- v22 patches 6 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 2 patches | 5 replies | Superseded |
Changes in v4 from the cover letter
- Patch 1/2 carried over unchanged as 1/3.
- Helper extracted from KVM (new patch 2/3) and used from handle_in() (Dave, David Laight).
- Reviewed-by tags from v3 2/2 dropped on patch 3/3 because the implementation changed substantially. v3 1/2 -> v4 1/3 Rb tags preserved (patch unchanged).
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | x86/tdx: Fix off-by-one in port I/O handlingarch/ | +2 | 2 replies | |
| 2/3 | x86/insn-eval: Add insn_assign_reg() helperarch/ arch/ | +29 | 3 replies | |
| 3/3 | x86/tdx: Fix zero-extension for 32-bit port I/Oarch/ | +3 | 2 replies |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Kai Huang | Kuppuswamy Sathyanarayanan | Binbin Wu | Rick Edgecombe |
|---|---|---|---|---|
| 1/3 | R-b | R-b | R-b | R-b |
| 2/3 | R-b | |||
| 3/3 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v4 0/3] x86/tdx: Fix port I/O handling bugs
Two bugs in the TDX guest port I/O #VE emulation, plus a small helper extracted from KVM to avoid open-coding partial-register-write logic in the second fix.
Patch 1 is an off-by-one in the mask used to clip the I/O value:GENMASK(BITS_PER_BYTE * size, 0) is one bit too wide. Unchanged from v3 1/2.
Patch 2 lifts KVM's instruction-emulator helper assign_register() out of arch/x86/kvm/emulate.c into <asm/insn-eval.h>, renamed to insn_assign_reg(). Dave suggested consolidating rather than adding a third copy of the same partial-register switch; the body is rewritten using plain arithmetic (suggested by David Laight) so the helper does not rely on -fno-strict-aliasing or little-endian byte order. KVM behaviour is unchanged.
Patch 3 fixes the architectural zero-extension of 32-bit IN: the old mask-based handle_in() preserves RAX[63:32] after inl, which is wrong. Now done by calling the helper.
Changes since v3:
- Patch 1/2 carried over unchanged as 1/3.
- Helper extracted from KVM (new patch 2/3) and used from handle_in() (Dave, David Laight).
- Reviewed-by tags from v3 2/2 dropped on patch 3/3 because the implementation changed substantially. v3 1/2 -> v4 1/3 Rb tags preserved (patch unchanged).
v3: https://lore.kernel.org/all/[email protected]/
Kiryl Shutsemau (Meta) (3):
x86/tdx: Fix off-by-one in port I/O handling
x86/insn-eval: Add insn_assign_reg() helper
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 | 25 +++++++++++++++++++++++++ arch/x86/kvm/emulate.c | 26 ++++---------------------- 3 files changed, 33 insertions(+), 28 deletions(-)
Signature · 1 line
2.54.0