RE: [PATCH] EDAC, i10nm: make skx_common.o a separate module

From: Luck, Tony
Date: Wed May 29 2024 - 14:27:34 EST


> One of the problems here is that each compilation unit implicitly
> knows the name of the module it gets linked into, via the
> KBUILD_MODNAME macro. If it gets linked twice, the macro is
> wrong for at least one of the two, and this can lead to
> incorrect printk formats and other macro expansions using
> that as an identifier.

Hardly any edac drivers use KBUILD_MODNAME. These two don't.

> A particularly bad case happens when one of the two is
> built-in while the other one is a loadable module. In
> this case, the module infrastructure assumes it's always
> built-in, which can mess up e.g. __exit annotations and
> THIS_MODULE references.

But that does seem like a real problem.

I took your patch for a spin on a system that uses the i10nm_edac
module. Works ok both when built as a module (the skx_edac_common
module was autoloaded) and as a built-in.

If Boris has no other thoughts about this I will apply your patch.

-Tony