RE: [PATCH v20 00/15] EDAC: Scrub: introduce generic EDAC RAS control feature driver + CXL/ACPI-RAS2 drivers

From: Shiju Jose
Date: Tue Feb 25 2025 - 06:21:47 EST


>-----Original Message-----
>From: Borislav Petkov <bp@xxxxxxxxx>
>Sent: 24 February 2025 19:36
>To: Shiju Jose <shiju.jose@xxxxxxxxxx>
>Cc: linux-edac@xxxxxxxxxxxxxxx; linux-cxl@xxxxxxxxxxxxxxx; linux-
>acpi@xxxxxxxxxxxxxxx; linux-mm@xxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
>linux-doc@xxxxxxxxxxxxxxx; tony.luck@xxxxxxxxx; rafael@xxxxxxxxxx;
>lenb@xxxxxxxxxx; mchehab@xxxxxxxxxx; dan.j.williams@xxxxxxxxx;
>dave@xxxxxxxxxxxx; Jonathan Cameron <jonathan.cameron@xxxxxxxxxx>;
>dave.jiang@xxxxxxxxx; alison.schofield@xxxxxxxxx; vishal.l.verma@xxxxxxxxx;
>ira.weiny@xxxxxxxxx; david@xxxxxxxxxx; Vilas.Sridharan@xxxxxxx;
>leo.duran@xxxxxxx; Yazen.Ghannam@xxxxxxx; rientjes@xxxxxxxxxx;
>jiaqiyan@xxxxxxxxxx; Jon.Grimm@xxxxxxx; dave.hansen@xxxxxxxxxxxxxxx;
>naoya.horiguchi@xxxxxxx; james.morse@xxxxxxx; jthoughton@xxxxxxxxxx;
>somasundaram.a@xxxxxxx; erdemaktas@xxxxxxxxxx; pgonda@xxxxxxxxxx;
>duenwen@xxxxxxxxxx; gthelen@xxxxxxxxxx;
>wschwartz@xxxxxxxxxxxxxxxxxxx; dferguson@xxxxxxxxxxxxxxxxxxx;
>wbs@xxxxxxxxxxxxxxxxxxxxxx; nifan.cxl@xxxxxxxxx; tanxiaofei
><tanxiaofei@xxxxxxxxxx>; Zengtao (B) <prime.zeng@xxxxxxxxxxxxx>; Roberto
>Sassu <roberto.sassu@xxxxxxxxxx>; kangkang.shen@xxxxxxxxxxxxx;
>wanghuiqiang <wanghuiqiang@xxxxxxxxxx>; Linuxarm
><linuxarm@xxxxxxxxxx>
>Subject: Re: [PATCH v20 00/15] EDAC: Scrub: introduce generic EDAC RAS
>control feature driver + CXL/ACPI-RAS2 drivers
>
>On Mon, Feb 24, 2025 at 06:30:48PM +0000, Shiju Jose wrote:
>> Testing rest of the patches for CXL RAS features and ACPI RAS2 scrub
>> feature in this branch are worked fine.
>
>Thanks.
>
>Unfortunately, my randbuild tests trigger issues:

Hi Borislav,

Thanks for spotting this bug.

Do you want me to send the fix in the next version?

Please find the fix below:

diff --git a/drivers/edac/mem_repair.c b/drivers/edac/mem_repair.c index cbe5a722715d..3b1a845457b0 100755
--- a/drivers/edac/mem_repair.c
+++ b/drivers/edac/mem_repair.c
@@ -322,7 +322,7 @@ static int mem_repair_create_desc(struct device *dev,
return -ENOMEM;

for (i = 0; i < MR_MAX_ATTRS; i++) {
- memcpy(&ctx->mem_repair_dev_attr[i].dev_attr,
+ memcpy(&ctx->mem_repair_dev_attr[i],
&dev_attr[i], sizeof(dev_attr[i]));
ctx->mem_repair_attrs[i] =
&ctx->mem_repair_dev_attr[i].dev_attr.attr;

Thanks,
Shiju

>
>In file included from drivers/edac/mem_repair.c:12:
>In file included from ./include/linux/edac.h:16:
>In file included from ./include/linux/device.h:15:
>In file included from ./include/linux/dev_printk.h:16:
>In file included from ./include/linux/ratelimit.h:6:
>In file included from ./include/linux/sched.h:13:
>In file included from ./arch/x86/include/asm/processor.h:19:
>In file included from ./arch/x86/include/asm/cpuid.h:71:
>In file included from ./arch/x86/include/asm/paravirt.h:21:
>In file included from ./include/linux/cpumask.h:12:
>In file included from ./include/linux/bitmap.h:13:
>In file included from ./include/linux/string.h:392:
>./include/linux/fortify-string.h:571:4: error: call to '__write_overflow_field'
>declared with 'warning' attribute: detected write beyond size of field (1st
>parameter); maybe use struct_group()? [-Werror,-Wattribute-warning]
> 571 | __write_overflow_field(p_size_field, size);
> | ^
>1 error generated.
>make[4]: *** [scripts/Makefile.build:207: drivers/edac/mem_repair.o] Error 1
>make[4]: *** Waiting for unfinished jobs....
>make[3]: *** [scripts/Makefile.build:465: drivers/edac] Error 2
>make[3]: *** Waiting for unfinished jobs....
>make[2]: *** [scripts/Makefile.build:465: drivers] Error 2
>make[2]: *** Waiting for unfinished jobs....
>make[1]: *** [/home/amd/kernel/linux/Makefile:1989: .] Error 2
>make: *** [Makefile:251: __sub-make] Error 2
>
>That's a allmodconfig-x86_64-clang build.
>
>gcc triggers it too:
>
>In file included from ./include/linux/string.h:392,
> from ./include/linux/bitmap.h:13,
> from ./include/linux/cpumask.h:12,
> from ./arch/x86/include/asm/paravirt.h:21,
> from ./arch/x86/include/asm/cpuid.h:71,
> from ./arch/x86/include/asm/processor.h:19,
> from ./include/linux/sched.h:13,
> from ./include/linux/ratelimit.h:6,
> from ./include/linux/dev_printk.h:16,
> from ./include/linux/device.h:15,
> from ./include/linux/edac.h:16,
> from drivers/edac/mem_repair.c:12:
>In function ‘fortify_memcpy_chk’,
> inlined from ‘mem_repair_create_desc’ at drivers/edac/mem_repair.c:325:3:
>./include/linux/fortify-string.h:571:25: error: call to ‘__write_overflow_field’
>declared with attribute warning: detected write beyond size of field (1st
>parameter); maybe use struct_group()? [-Werror=attribute-warning]
> 571 | __write_overflow_field(p_size_field, size);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>cc1: all warnings being treated as errors
>make[4]: *** [scripts/Makefile.build:207: drivers/edac/mem_repair.o] Error 1
>make[3]: *** [scripts/Makefile.build:465: drivers/edac] Error 2
>make[3]: *** Waiting for unfinished jobs....
>make[2]: *** [scripts/Makefile.build:465: drivers] Error 2
>make[1]: *** [/home/amd/kernel/linux/Makefile:1989: .] Error 2
>make: *** [Makefile:251: __sub-make] Error 2 11-22-09-allmodconfig-x86_64-
>20849.log (END)
>
>--
>Regards/Gruss,
> Boris.
>
>https://people.kernel.org/tglx/notes-about-netiquette