From: Adrian Hunter <adrian.hunter@intel.com>
To: Dave Hansen <dave.hansen@intel.com>,
"Luck, Tony" <tony.luck@intel.com>,
"Annapurve, Vishal" <vannapurve@google.com>
Cc: Borislav Petkov <bp@alien8.de>,
Thomas Gleixner <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
"x86@kernel.org" <x86@kernel.org>, H Peter Anvin <hpa@zytor.com>,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
"kirill.shutemov@linux.intel.com"
<kirill.shutemov@linux.intel.com>,
"Huang, Kai" <kai.huang@intel.com>,
"Chatre, Reinette" <reinette.chatre@intel.com>,
"Li, Xiaoyao" <xiaoyao.li@intel.com>,
"tony.lindgren@linux.intel.com" <tony.lindgren@linux.intel.com>,
"binbin.wu@linux.intel.com" <binbin.wu@linux.intel.com>,
"Yamahata, Isaku" <isaku.yamahata@intel.com>,
"Zhao, Yan Y" <yan.y.zhao@intel.com>,
"Gao, Chao" <chao.gao@intel.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"seanjc@google.com" <seanjc@google.com>
Subject: Re: [PATCH 1/2] x86/mce: Fix missing address mask in recovery for errors in TDX/SEAM non-root mode
Date: Wed, 30 Jul 2025 13:54:11 +0300 [thread overview]
Message-ID: <807ff02d-7af0-419d-8d14-a4d6c5d5420d@intel.com> (raw)
In-Reply-To: <79eca29a-8ba4-4ad9-b2e0-54d8e668f731@intel.com>
On 27/06/2025 19:33, Dave Hansen wrote:
> On 6/27/25 09:24, Luck, Tony wrote:
>> We've been sending a combined key+address in the "mce->addr" to
>> user space for a while. Has anyone built infrastructure on top of that?
>
> I'm not sure they can do anything useful with an address that has the
> KeyID in the first place. The partitioning scheme is in an MSR, so
> they'd need to be doing silly gymnastics to even decode the address.
>
> Userspace can deal with the KeyID not being in the address. It's been
> the default for ages. So, if we take it back out, I'd expect it fixes
> more things than it breaks.
>
> So, yeah, we should carefully consider it. But it still 100% looks like
> the right thing to me to detangle the KeyID and physical address in the ABI.
Coming back to this after a bit of a break.
It feels unlikely to me that any users are expecting KeyID in mce->addr.
Looking at user space programs like mcelog and rasdaemon, gives the
impression that mce->addr contains only an address.
The UAPI header file describes addr as "Bank's MCi_ADDR MSR", but what
mce_read_aux() does tends to contradict that, especially for AMD
SMCA.
But there are also additional places where it seems like MCI_ADDR_PHYSADDR
is missing:
tdx_dump_mce_info()
paddr_is_tdx_private()
__seamcall_ret(TDH_PHYMEM_PAGE_RDMD, &args)
TDH_PHYMEM_PAGE_RDMD expects KeyID bits to be zero
skx_mce_output_error()
edac_mc_handle_error()
expects page_frame_number, so without KeyID
The KeyID is probably only useful for potentially identifying the TD, but
given that the TD incurs a FATAL error, that may be obvious anyway.
So removing the KeyID from mce->addr looks like the right thing to do.
Note AFAICT there are 3 kernel APIs that deal with the MCE address:
Device /dev/mcelog which outputs struct mce
Tracepoint mce:mce_record which outputs members from struct mce
Tracepoint ras:mc_event where the kernel constructs the address
from page_frame_number implying that KeyID should not be present
I guess it would be sensible to ask what customers think.
Vishal, do you know anyone at Google who deals with handling machine
check information, and who might have an opinion on this?
next prev parent reply other threads:[~2025-07-30 10:55 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 12:08 [PATCH 0/2] Fixes for recovery for machine check " Adrian Hunter
2025-06-18 12:08 ` [PATCH 1/2] x86/mce: Fix missing address mask in recovery for errors " Adrian Hunter
2025-06-18 12:36 ` Xiaoyao Li
2025-06-18 14:55 ` Dave Hansen
2025-06-19 11:57 ` Adrian Hunter
2025-06-27 15:23 ` Adrian Hunter
2025-06-27 15:25 ` Dave Hansen
2025-06-27 16:24 ` Luck, Tony
2025-06-27 16:33 ` Dave Hansen
2025-07-30 10:54 ` Adrian Hunter [this message]
2025-07-30 11:57 ` Huang, Kai
2025-07-30 14:20 ` Vishal Annapurve
2025-06-27 16:28 ` Luck, Tony
2025-06-18 23:20 ` Huang, Kai
2025-06-18 23:39 ` Luck, Tony
2025-06-18 23:46 ` Luck, Tony
2025-06-18 23:57 ` Huang, Kai
2025-06-18 23:53 ` Huang, Kai
2025-06-18 12:08 ` [PATCH 2/2] KVM: TDX: Do not clear poisoned pages Adrian Hunter
2025-06-18 12:39 ` Xiaoyao Li
2025-06-18 14:58 ` Dave Hansen
2025-06-25 14:33 ` Vishal Annapurve
2025-06-25 16:25 ` Adrian Hunter
2025-06-25 16:31 ` Dave Hansen
2025-06-25 16:42 ` Adrian Hunter
2025-06-25 16:57 ` Dave Hansen
2025-06-25 16:42 ` Edgecombe, Rick P
2025-06-25 22:32 ` Huang, Kai
2025-06-25 22:38 ` Dave Hansen
2025-06-26 1:19 ` Huang, Kai
2025-06-26 15:31 ` Luck, Tony
2025-06-26 22:20 ` Huang, Kai
2025-06-26 22:33 ` Dave Hansen
2025-06-27 0:56 ` Huang, Kai
2025-06-18 23:09 ` Huang, Kai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=807ff02d-7af0-419d-8d14-a4d6c5d5420d@intel.com \
--to=adrian.hunter@intel.com \
--cc=binbin.wu@linux.intel.com \
--cc=bp@alien8.de \
--cc=chao.gao@intel.com \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=isaku.yamahata@intel.com \
--cc=kai.huang@intel.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=reinette.chatre@intel.com \
--cc=rick.p.edgecombe@intel.com \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=tony.lindgren@linux.intel.com \
--cc=tony.luck@intel.com \
--cc=vannapurve@google.com \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.com \
--cc=yan.y.zhao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®