[PATCH v3 1/2] lib: generic accessor functions for arch keystore
Greg Joyce
gjoyce at linux.vnet.ibm.com
Fri Aug 5 01:41:00 AEST 2022
On Mon, 2022-08-01 at 22:24 +0200, Michal Suchánek wrote:
> > > > +
> > > > +int __weak arch_read_variable(enum arch_variable_type type,
> > > > char *varname,
> > > > + void *varbuf, u_int *varlen)
> > > > +{
> > > > + return -EOPNOTSUPP;
> > > > +}
> > > > +
> > > > +int __weak arch_write_variable(enum arch_variable_type type,
> > > > char *varname,
> > > > + void *varbuf, u_int varlen)
> > > > +{
> > > > + return -EOPNOTSUPP;
> > > > +}
> > > > --
> > > Doesn't EFI already have some variables?
> > >
> > > And even powernv?
> > >
> > > Shouldn't this generalize the already existing variables?
> > >
> > > Or move to powerpc and at least generalize the powerpc ones?
> >
> > Yes, EFI and PowerNV do have variables, but I am not exactly clear
> > about
> > your reference to them in this context. What do you mean by
> > generalize
> > already existing variables ?
> >
> > This interface is actually generalizing calls to access platform
> > specific
> > keystores. It is explained in cover letter that this patch is
> > defining
> > generic interface and these are default implementations which needs
> > to be
> > overridden by arch specific versions. For PowerVM PLPAR Platform
> > KeyStore,
> > the arch specific version is implemented in Patch 2.
> For powervm, not powernv.
>
> If it's not generic enough to cover even powerpc-specific keystores
> does
> such generalization even need to exist?
I believe that the interface is generic enough to cover most if not all
keystores. However, we're just implementing a PowerVM version since
that is our mandate.
> > Access to EFI variables should be implemented by EFI arch specific
> > interface
> > and PowerNV will have to do the same if it needs to.
>
> If such generic interface is desirable it should cover the existing
> architectures I think. Otherwise how can you tell if it's usable
> there?
Are you suggesting that we implement architecture specific
implementations for every architecture supported by Linux? I'm afraid
that we don't have the time (or skills) to do that. The intent is to
provide the "weak" versions of the interface functions so that they can
be overridden as folks have the time or inclination to provide them for
other architectures.
-Greg
More information about the Linuxppc-dev
mailing list