From: Adrian Hunter <adrian.hunter@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
Tony Luck <tony.luck@intel.com>, <pbonzini@redhat.com>,
<seanjc@google.com>, <vannapurve@google.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, <x86@kernel.org>,
H Peter Anvin <hpa@zytor.com>, <linux-edac@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
<rick.p.edgecombe@intel.com>, <kai.huang@intel.com>,
<reinette.chatre@intel.com>, <xiaoyao.li@intel.com>,
<tony.lindgren@linux.intel.com>, <binbin.wu@linux.intel.com>,
<ira.weiny@intel.com>, <isaku.yamahata@intel.com>,
Fan Du <fan.du@intel.com>, Yazen Ghannam <yazen.ghannam@amd.com>,
<yan.y.zhao@intel.com>, <chao.gao@intel.com>
Subject: Re: [PATCH RESEND V2 1/2] x86/mce: Fix missing address mask in recovery for errors in TDX/SEAM non-root mode
Date: Fri, 22 Aug 2025 10:57:36 +0300 [thread overview]
Message-ID: <441aaf76-977f-487e-9db8-80edcda6078f@intel.com> (raw)
In-Reply-To: <20250821132521.GDaKceQXfEWHVwrlxV@fat_crate.local>
On 21/08/2025 16:25, Borislav Petkov wrote:
> On Thu, Aug 21, 2025 at 10:24:22AM +0300, Adrian Hunter wrote:
>> Something like below would work, but doesn't answer Dave's question
>> of why not do it in mce_read_aux()
Thanks for looking at this.
> So, let me see what I understand from all this bla: you want to zap the KeyID
> from mci_addr because it is completely useless there. So zap it.
Not exactly. I just want to fix the bug whereby the mce handler fails
to mark the affected page as poisoned because it does not remove the KeyID
from the address before looking-up the page.
> You can't make any other changes to mci_addr because that goes to luserspace.
>
> So far so good.
>
> Now, all that other bla leads me to believe that there might be some need to
> dump the raw mci_addr value after all.
>
> If so, your patch is not needed.
>
> Which makes me think, all yall folks need to make up your mind here.
>
> And you need to get rid of all that extraneous information in your commit
> message:
>
> "Investigation of user space expectations has concluded it..."
>
> No investigation needed - this is exported to userspace so you can't touch it.
It is a bit of a grey area. No one expects to find non-address bits in
struct mce addr, and the kernel already strips low-order bits, and in the
case of SMCA, high-order bits too, refer smca_extract_err_addr().
> The one and only question you need to answer is, do you really need KeyID in
> it or not. And whatever you do, once you do it, we're stuck with it because it
> goes out to userspace.
No, the KeyID is almost useless. It is just a dynamically allocated
number. It might indicate which TDX VM encountered the error, except the
MCE is fatal to the VM, so a fatal error is reported to the VMM anyway.
However, it is allowed to extend struct mce, so adding KeyID or
raw MCI ADDR later is quite possible.
> Especially if you want this backported to stable.
The bug exists in stable. Ideally it would get fixed there too somehow.
next prev parent reply other threads:[~2025-08-22 7:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-19 16:24 [PATCH RESEND V2 0/2] Fixes for recovery for machine check in TDX/SEAM non-root mode Adrian Hunter
2025-08-19 16:24 ` [PATCH RESEND V2 1/2] x86/mce: Fix missing address mask in recovery for errors " Adrian Hunter
2025-08-19 17:28 ` Yazen Ghannam
2025-08-19 17:51 ` Luck, Tony
2025-08-19 17:58 ` Adrian Hunter
2025-08-19 18:03 ` Luck, Tony
2025-08-20 15:59 ` Adrian Hunter
2025-08-20 16:12 ` Luck, Tony
2025-08-20 17:56 ` Yazen Ghannam
2025-08-21 6:49 ` Adrian Hunter
2025-08-19 21:32 ` Borislav Petkov
2025-08-21 7:24 ` Adrian Hunter
2025-08-21 13:25 ` Borislav Petkov
2025-08-22 7:57 ` Adrian Hunter [this message]
2025-08-22 13:54 ` Borislav Petkov
2025-08-22 14:54 ` Adrian Hunter
2025-08-27 8:22 ` Adrian Hunter
2025-08-27 8:29 ` Borislav Petkov
2025-08-19 16:24 ` [PATCH RESEND V2 2/2] x86/mce: Remove MCI_ADDR_PHYSADDR Adrian Hunter
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=441aaf76-977f-487e-9db8-80edcda6078f@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@linux.intel.com \
--cc=fan.du@intel.com \
--cc=hpa@zytor.com \
--cc=ira.weiny@intel.com \
--cc=isaku.yamahata@intel.com \
--cc=kai.huang@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 \
--cc=yazen.ghannam@amd.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;
as well as URLs for NNTP newsgroup(s).