x86/tdx: Allow MMIO instructions from userspace
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v7 Latest6 patches 2 repliesIn review
- v66 patches 17 repliesSuperseded
- v56 patches 4 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v4 | 6 patches | 6 replies | Superseded | |
| v3 | 10 patches | 10 replies | Superseded | |
| v2 | 5 patches | 9 replies | Superseded | |
| v1 | 4 patches | 8 replies | Superseded |
Changes in v7 from the cover letter
- Use fault_in_kernel_space() instead of using your own function as suggested by Dave Hansen.
- Drop the unnecessary ifdef CONFIG_INTEL_TDX_GUEST from thread_struct.
Patches in v7 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | x86/tdx: Fix "in-kernel MMIO" checkarch/ | +6 | 2 replies | |
| 2/6 | x86/tdx: Split MMIO read and write operationsarch/ | +83 | 0 replies | |
| 3/6 | x86/tdx: Add validation of userspace MMIO instructionsarch/ | +118 | 0 replies | |
| 4/6 | x86/tdx: Allow MMIO from userspacearch/ | +34 | 0 replies | |
| 5/6 | x86/tdx: Move MMIO helpers to common libraryarch/ arch/ arch/ | +140 | 0 replies | |
| 6/6 | x86/tdx: Implement MOVS for MMIOarch/ arch/ | +75 | 0 replies |
Reviews trailers per patch
All 6 patches have a Reviewed-by or Acked-by.
| Patch | Kirill A. Shutemov | Thomas Gleixner | Dave Hansen |
|---|---|---|---|
| 1/6 | R-b | A-b | |
| 2/6 | R-b | ||
| 3/6 | R-b | ||
| 4/6 | R-b | R-b | |
| 5/6 | A-b | ||
| 6/6 | 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 3 reviewers.
Cover letter [PATCH v7 0/6] x86/tdx: Allow MMIO instructions from userspace
From: "Alexey Gladkov (Intel)" <[email protected]>
Currently, MMIO inside the TDX guest is allowed from kernel space and access from userspace is denied. This becomes a problem when working with virtual devices in userspace.
In TDX guest MMIO instructions are emulated in #VE. The kernel code uses special helpers to access MMIO memory to limit the number of instructions which are used.
This patchset makes MMIO accessible from userspace. To do this additional checks were added to ensure that the emulated instruction will not be compromised.
v7:
- Use fault_in_kernel_space() instead of using your own function as suggested by Dave Hansen.
- Drop the unnecessary ifdef CONFIG_INTEL_TDX_GUEST from thread_struct.
v6:
- Reorder patches and change commit messages.
v5:
- Improve commit messages and comments in commits as suggested by Kirill A. Shutemov.
- To emulate MOVS, instead of storing the entire address, started using a flag.
v4:
- Move patches to avoid crossing the page boundary to separate patchset. They address separate issue.
- Check the address only in user context and in case of nested exceptions.
- Fix the check that the address does not point to private memory.
v3:
- Add patches to avoid crossing the page boundary when the instruction is read and decoded in the TDX, SEV, UMIP.
- Forbid accessing userspace addresses from kernel space. The exception to this is when emulating MOVS instructions.
- Fix address validation during MOVS emulation.
v2:
- Split into separate patches AMD helpers extraction and MOVS implementation code for intel as suggested by Thomas Gleixner.
- Fix coding style issues.
Alexey Gladkov (Intel) (6):
x86/tdx: Fix "in-kernel MMIO" check
x86/tdx: Split MMIO read and write operations x86/tdx: Add validation of userspace MMIO instructions x86/tdx: Allow MMIO from userspace
x86/tdx: Move MMIO helpers to common library x86/tdx: Implement MOVS for MMIO
arch/x86/coco/sev/core.c | 139 ++----------- arch/x86/coco/tdx/tdx.c | 334 ++++++++++++++++++++++++++----- arch/x86/include/asm/io.h | 3 + arch/x86/include/asm/processor.h | 1 + arch/x86/lib/iomem.c | 115 +++++++++++ 5 files changed, 423 insertions(+), 169 deletions(-)
Signature · 1 line
2.46.0