Re: [PATCH v1 01/19] x86/APEI: Extract common CPER memory error reporting helper
From: Pierre Gondois
Date: Thu Nov 19 2026 - 05:46:58 EST
Hello Jonathan,
Thanks for the complete review !
On 11/18/26 19:54, Jonathan Cameron wrote:
On Tue, 17 Nov 2026 12:10:11 +0100
Pierre Gondois<pierre.gondois@xxxxxxx> wrote:
Prepare for reporting CPER Memory Error Section 2 records through MCEOne curious question + trivial comment inline.
by extracting apei_mce_report_mem_error_common().
No functional change.
Signed-off-by: Pierre Gondois<pierre.gondois@xxxxxxx>
Otherwise, this is a simple refactor and seems clean to me.
Reviewed-by: Jonathan Cameron<jonathan.cameron@xxxxxxxxxxxxxxxx>
---Silly question. What stops it being bigger than a page? I appreciate you
arch/x86/kernel/cpu/mce/apei.c | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/apei.c b/arch/x86/kernel/cpu/mce/apei.c
index 0a89947e47bc8..b993ac78a3b36 100644
--- a/arch/x86/kernel/cpu/mce/apei.c
+++ b/arch/x86/kernel/cpu/mce/apei.c
@@ -26,24 +26,15 @@
#include "internal.h"
-void apei_mce_report_mem_error(int severity, struct cper_sec_mem_err *mem_err)
+static void apei_mce_report_mem_error_common(int severity, u64 physical_addr,
+ u64 physical_addr_mask)
{
struct mce_hw_err err;
struct mce *m;
int lsb;
- if (!(mem_err->validation_bits & CPER_MEM_VALID_PA))
- return;
-
- /*
- * Even if the ->validation_bits are set for address mask,
- * to be extra safe, check and reject an error radius '0',
- * and fall back to the default page size.
- */
- if (mem_err->validation_bits & CPER_MEM_VALID_PA_MASK)
- lsb = find_first_bit((void *)&mem_err->physical_addr_mask, PAGE_SHIFT);
- else
- lsb = PAGE_SHIFT;
+ /* Missing or zero masks default to page granularity. */
+ lsb = find_first_bit((void *)&physical_addr_mask, PAGE_SHIFT);
aren't changing what is already here but it made me curious. It's 8 bytes
so limiting it to page size seems odd.
That larger usecase came up last year for how to handle error injection
into a VM that was running smaller pages than the host.
I guess on x86 it simply isn't ever bigger than one page?
I also don't really see why we could not operate on multiple pages
at the same time.