Skip to content

Fixes for recovery for machine check in TDX/SEAM non-root mode

Adrian Hunter kvm linux-edac lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/22 patches 16 repliesIn review
  2. v2 posting 1/22 patches 0 repliesSuperseded
  3. v12 patches 32 repliesSuperseded

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86/mce: Fix missing address mask in recovery for errors in TDX/SEAM non-root modearch/x86/include/uapi/asm/mce.h arch/x86/kernel/cpu/mce/core.c+4 -116 replies
2/2x86/mce: Remove MCI_ADDR_PHYSADDRarch/x86/include/asm/mce.h arch/x86/kernel/cpu/mce/core.c drivers/cxl/core/mce.c +1 more+5 -80 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH RESEND V2 0/2] Fixes for recovery for machine check in TDX/SEAM non-root mode

Hi

Here is V2 of a small fix related to recovery for machine check in TDX/SEAM non-root mode, and a small tidy-up.

Changes in V2:

x86/mce: Fix missing address mask in recovery for errors in TDX/SEAM non-root mode
Mask address when it is read
Amend struct mce addr description

KVM: TDX: Do not clear poisoned pages
Patch dropped

x86/mce: Remove MCI_ADDR_PHYSADDR
New patch

The issue was noticed as part of work to determine the conditions under which TDX private memory needs to be cleared after being reclaimed. For guests with a large amount of memory, clearing all private pages during VM shutdown can take minutes, so we are looking at when that can be skipped. A future patch will deal with that.

One thing that was investigated was the effect of deliberately corrupting a TDX guest private page by writing to it on the host, and then reading it on the guest, which results in a machine check as expected, but revealed the issue addressed in patch 1.

There are 2 outstanding issues:

1. It is assumed that once the TDX VM is shutdown that the memory is returned to the allocator. That is true at present, but may not be in the future. Consider, for example, patch set "New KVM ioctl to link a gmem inode to a new gmem file" :

      https://lore.kernel.org/r/[email protected]/

2. Currently, KVM TDX does not cater for the TDX VM to enter a FATAL error state, where the only operation permitted is to tear down the VM. KVM just carries on, hitting various errors, but in particular, memory reclaim fails because it is not following the teardown procedure, and all guest private memory is leaked.

Adrian Hunter (2):
x86/mce: Fix missing address mask in recovery for errors in TDX/SEAM non-root mode x86/mce: Remove MCI_ADDR_PHYSADDR

 arch/x86/include/asm/mce.h      | 3 ---
 arch/x86/include/uapi/asm/mce.h | 2 +-
 arch/x86/kernel/cpu/mce/core.c  | 9 ++++++---
 drivers/cxl/core/mce.c          | 2 +-
 drivers/edac/skx_common.c       | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

Regards
Adrian