[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ccee2a0f-18fa-4037-bf97-f359e0791bf6@intel.com>
Date: Thu, 19 Jun 2025 14:57:18 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: Dave Hansen <dave.hansen@...el.com>, Tony Luck <tony.luck@...el.com>,
<pbonzini@...hat.com>, <seanjc@...gle.com>
CC: <vannapurve@...gle.com>, Borislav Petkov <bp@...en8.de>, Thomas Gleixner
<tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, Dave Hansen
<dave.hansen@...ux.intel.com>, <x86@...nel.org>, H Peter Anvin
<hpa@...or.com>, <linux-edac@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <kvm@...r.kernel.org>,
<rick.p.edgecombe@...el.com>, <kirill.shutemov@...ux.intel.com>,
<kai.huang@...el.com>, <reinette.chatre@...el.com>, <xiaoyao.li@...el.com>,
<tony.lindgren@...ux.intel.com>, <binbin.wu@...ux.intel.com>,
<isaku.yamahata@...el.com>, <yan.y.zhao@...el.com>, <chao.gao@...el.com>
Subject: Re: [PATCH 1/2] x86/mce: Fix missing address mask in recovery for
errors in TDX/SEAM non-root mode
On 18/06/2025 17:55, Dave Hansen wrote:
> On 6/18/25 05:08, Adrian Hunter wrote:
>> --- a/arch/x86/kernel/cpu/mce/core.c
>> +++ b/arch/x86/kernel/cpu/mce/core.c
>> @@ -1665,7 +1665,8 @@ noinstr void do_machine_check(struct pt_regs *regs)
>> * be added to free list when the guest is terminated.
>> */
>> if (mce_usable_address(m)) {
>> - struct page *p = pfn_to_online_page(m->addr >> PAGE_SHIFT);
>> + unsigned long pfn = (m->addr & MCI_ADDR_PHYSADDR) >> PAGE_SHIFT;
>> + struct page *p = pfn_to_online_page(pfn);
>
> If ->addr isn't really an address that software can do much with,
> shouldn't we mask MCI_ADDR_PHYSADDR off up front, like in mce_read_aux()?
Would that mean no one would know if the mce addr had KeyID bits or not?
>
> Maybe we should break it up into address and KeyID _there_.
Could we deal with any tidy-ups in separate patches?
Powered by blists - more mailing lists