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

From: Claudio Imbrenda
Date: Wed Jul 13 2022 - 05:16:34 EST


On Wed, 13 Jul 2022 10:39:47 +0200
Steffen Eiden <seiden@xxxxxxxxxxxxx> wrote:

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

Reviewed-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>

> >> -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");
> >