All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.ibm.com>
To: Daniel Kiper <dkiper@net-space.pl>,
	Stefan Berger <stefanb@linux.vnet.ibm.com>
Cc: grub-devel@gnu.org, Eric Snowberg <eric.snowberg@oracle.com>
Subject: Re: [PATCH v2 4/4] ibmvtpm: Add support for trusted boot using a vTPM 2.0
Date: Thu, 29 Jul 2021 09:30:49 -0400	[thread overview]
Message-ID: <7c83a897-0694-e70c-f210-c70d9c81cbf5@linux.ibm.com> (raw)
In-Reply-To: <20210728132556.xxcu5ua3w6jekcro@tomti.i.net-space.pl>


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)

https://git.savannah.gnu.org/cgit/grub.git/tree/grub-core/kern/ieee1275/ieee1275.c#n24

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:

https://github.com/aik/SLOF/blob/master/lib/libnvram/libnvram.code#L66

but then of course also here: 
https://github.com/aik/SLOF/blob/master/lib/libtpm/tcgbios.c#L965


    Stefan




  reply	other threads:[~2021-07-29 13:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20 21:14 [PATCH v2 0/4] Add support for trusted boot on IBM PPC platform Stefan Berger
2021-07-20 21:14 ` [PATCH v2 1/4] ieee1275: drop HEAP_MAX_ADDR, HEAP_MIN_SIZE Stefan Berger
2021-07-21 14:36   ` Daniel Kiper
2021-07-21 14:46     ` Stefan Berger
2021-07-20 21:14 ` [PATCH v2 2/4] ieee1275: claim more memory Stefan Berger
2021-09-01  6:55   ` Daniel Axtens
2021-07-20 21:14 ` [PATCH v2 3/4] ieee1275: request memory with ibm, client-architecture-support Stefan Berger
2021-07-20 21:14 ` [PATCH v2 4/4] ibmvtpm: Add support for trusted boot using a vTPM 2.0 Stefan Berger
2021-07-28 13:25   ` Daniel Kiper
2021-07-29 13:30     ` Stefan Berger [this message]
2021-07-30 12:44       ` Daniel Kiper
2021-07-30 14:59         ` Stefan Berger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c83a897-0694-e70c-f210-c70d9c81cbf5@linux.ibm.com \
    --to=stefanb@linux.ibm.com \
    --cc=dkiper@net-space.pl \
    --cc=eric.snowberg@oracle.com \
    --cc=grub-devel@gnu.org \
    --cc=stefanb@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.