lkml.org 
[lkml]   [2023]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 7/7] powerpc/pseries: Implement secvars for dynamic secure boot
From
Date
On Mon, 2023-01-09 at 14:34 +1100, Russell Currey wrote:
>
> > > +static int plpks_secvar_init(void)
> > > +{
> > > +       if (!plpks_is_available())
> > > +               return -ENODEV;
> > > +
> > > +       set_secvar_ops(&plpks_secvar_ops);
> > > +       set_secvar_config_attrs(config_attrs);
> > > +       return 0;
> > > +}
> > > +device_initcall(plpks_secvar_init);
> >
> > That must be a machine_device_initcall(pseries, ...), otherwise we
> > will
> > blow up doing a hcall on powernv in plpks_is_available().
>
> OK, can do.  I don't understand your case of how powernv could hit
> this, but I think I to have to move plpks_is_available() into
> include/,
> so it's going to be even more possible anyway.

Kernels can be compiled with both pseries and powernv support, in which
case plpks_secvar_init() will be called unconditionally even when
booting on a powernv machine.

I can confirm that as it is, booting this on powernv qemu causes a
panic.

--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited

\
 
 \ /
  Last update: 2023-03-26 23:32    [W:0.095 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site