Re: [PATCH 3/3] s390/uvdevice: autoload module based on CPU facility

Claudio Imbrenda
2022-07-13T09:16:31Z

On Wed, 13 Jul 2022 10:39:47 +0200
Steffen Eiden <seiden@linux.ibm.com> wrote:

> On 7/12/22 18:49, Claudio Imbrenda wrote:
> > On Tue, 12 Jul 2022 12:52:20 +0200
> > Steffen Eiden <seiden@linux.ibm.com> wrote:
> >
> >> Make sure the uvdevice driver will be automatically loaded when
> >> facility 158 is available.
> >>
> >> Signed-off-by: Steffen Eiden <seiden@linux.ibm.com>

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

> >> -module_init(uvio_dev_init);
> >> +module_cpu_feature_match(S390_CPU_FEATURE_UV, uvio_dev_init);
> >
> > does this still prevent manual loading when the feature is not present?
> yes.
>
> Have a look at the macro definition at 'include/linux/cpufeature.h':
>
> Use module_cpu_feature_match(feature, module_init_function) to
>
> declare that
>
> [snip]
> b) the module must not be loaded if CPU feature 'feature' is not present
>
> (not even by manual insmod).

that is what I needed to see :)

>
> The test 'facility(158)' just moved to cpu_have_feature() in
> '/arch/s390/kernel/cpufeature.c'.
> >
> >> module_exit(uvio_dev_exit);
> >>
> >> MODULE_AUTHOR("IBM Corporation");
> >