[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/4] ibmvtpm: Add support for trusted boot using a vTPM 2.
Re: [PATCH v2 4/4] ibmvtpm: Add support for trusted boot using a vTPM 2.0
Fri, 30 Jul 2021 14:44:53 +0200
On Thu, Jul 29, 2021 at 09:30:49AM -0400, Stefan Berger wrote:
> On 7/28/21 9:25 AM, Daniel Kiper wrote:
> > On Tue, Jul 20, 2021 at 05:14:49PM -0400, Stefan Berger wrote:
> > > +#define IEEE1275_CELL_TRUE ((grub_ieee1275_cell_t) -1)
> > This smells like global constant. Does not it? If yes could you define it
> > in a global header and use it? Maybe even replace existing comparisons
> > in the IEEE1275 code with IEEE1275_CELL_TRUE. But probably then
> > s/IEEE1275_CELL_TRUE/GRUB_IEEE1275_CELL_TRUE/...
> I wasn't sure and also had found local #defines in another .c file.
> #define IEEE1275_PHANDLE_INVALID ((grub_ieee1275_cell_t) -1)
> #define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_cell_t) 0)
> #define IEEE1275_CELL_INVALID ((grub_ieee1275_cell_t) -1)
> I haven't seen the usage of -1 as TRUE in other grub files. So I could move
> it to a global header file assuming this is commonly used on this platform.
> I have only seen usage of -1 as TRUE in the SLOF firmware in this file here:
> but then of course also here:
I think we should use IEEE1275_CELL_INVALID in your code. IMO the TRUE
sounds a bit confusing in this context. So, I would move all these
three constants to a global IEEE1275 header and add "GRUB_" prefix.
- [PATCH v2 0/4] Add support for trusted boot on IBM PPC platform, Stefan Berger, 2021/07/20
- [PATCH v2 1/4] ieee1275: drop HEAP_MAX_ADDR, HEAP_MIN_SIZE, Stefan Berger, 2021/07/20
- [PATCH v2 2/4] ieee1275: claim more memory, Stefan Berger, 2021/07/20
- [PATCH v2 3/4] ieee1275: request memory with ibm, client-architecture-support, Stefan Berger, 2021/07/20
- [PATCH v2 4/4] ibmvtpm: Add support for trusted boot using a vTPM 2.0, Stefan Berger, 2021/07/20