[Skiboot] [PATCH 04/19] hdata/tpmrel.c: register CVC services during HDAT parsing

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Thu Nov 30 23:48:37 AEDT 2017


On 11/30/2017 03:45 AM, Oliver wrote:
> On Wed, Nov 29, 2017 at 10:40 PM, Claudio Carvalho
> <cclaudio at linux.vnet.ibm.com> wrote:
>>
>>
>>>>> diff --git a/hdata/tpmrel.c b/hdata/tpmrel.c
>>>>> index 0aaa70b..11ed3ce 100644
>>>>> --- a/hdata/tpmrel.c
>>>>> +++ b/hdata/tpmrel.c
>>>>> @@ -20,6 +20,8 @@
>>>>>
>>>>>  #include <skiboot.h>
>>>>>  #include <device.h>
>>>>> +#include <inttypes.h>
>>>>> +#include <libstb/cvc.h>
>>>>>
>>>>>  #include "spira.h"
>>>>>  #include "hdata.h"
>>>>> @@ -72,6 +74,93 @@ static void tpmrel_add_firmware_event_log(const
>>>>> struct HDIF_common_hdr *hdif_hdr
>>>>>      }
>>>>>  }
>>>>>
>>>>> +static const struct msvpd_hb_reserved_mem
>>>>> *get_cvc_reserved_memory(void)
>>>>> +{
>>>>> +
>>>>
>>>>
>>>> May be we should add another property inside reserved-memory to identify
>>>> reserved-memory type and use it here. Because today its just secureboot.
>>>> Tomorrow someone else may want to use type field.
>>>
>>>
>>> hmm ... maybe we don't need to add another property. Double checking the
>>> HDAT spec, it defines that the label for the CVC reserved memory is
>>> "ibm,secure-crypt-algo-code" and skiboot uses the label for the
>>> reserved-memory node name and its "ibm,prd-label", see below. If it is OK, I
>>> can iterate on the /ibm,hostboot/reserved-memory children looking for
>>> ibm,prd-label="ibm,secure-crypt-algo-code".
>>>
>>>                 ibm,secure-crypt-algo-code at ffd330000 {
>>>                         ibm,prd-label = "ibm,secure-crypt-algo-code";
>>>                         ibm,prd-instance = <0x0>;
>>>                         phandle = <0x545>;
>>>                         reg = <0xf 0xfd330000 0x0 0x10000>;
>>>                 };
>>>
>>
>> Actually, just realized that ibm,prd-instance is the reserved memory type. I
>> can use it to identify the CVC reserved memory. Thank you.
>>
>> Claudio
>
> Can you check where the prd-label comes from first? IIRC they are
> added late in the boot process based on the region names, but if
> that's a problem then we can probably just add them in the HDAT parser
> rather than as a later step.

So in P8, hostboot just passes reserved memory region. Hence we ended up adding 
prd-label just before loading payload. In P9 we are adding prd-label as part of 
device tree creation itself.

So P9 it should be fine to use prd-label from device tree.

-Vasant



More information about the Skiboot mailing list