Re: [PATCH v4 22/24] powerpc/pseries: Implement secvars for dynamic secure boot

From: Andrew Donnellan
Date: Mon Jan 30 2023 - 23:26:14 EST


On Tue, 2023-01-31 at 13:54 +1100, Andrew Donnellan wrote:
> > > +{
> > > +       // The max object size reported by the hypervisor is
> > > accurate for the
> > > +       // object itself, but we use the first 8 bytes of data on
> > > write as the
> > > +       // signed update flags, so the max size a user can write
> > > is
> > > larger.
> > > +       *max_size = (u64)plpks_get_maxobjectsize() + 8;
> >
> > You have this 8 open coded twice (once as sizeof(u64)). You could
> > make
> > it a #define at the top with a brief overview of the hcall format
> > so
> > you
> > don't need so much commentage for it. Although a note here that the
> > objsize does not include the flags bytes is good to keep.
>
> Will do.

Thinking about this further, I'm going to change the 8 to sizeof(u64)
to make it clearer that it's linked with the type of the flags
variable, but I am going to keep the other cases as is (they're
sizeof(flags), not sizeof(u64), so it's already obvious how they work,
and I don't want to define a macro for one user).


--
Andrew Donnellan OzLabs, ADL Canberra
ajd@xxxxxxxxxxxxx IBM Australia Limited