[SLOF] [PATCH v2 00/20] Add vTPM support to SLOF

Thomas Huth thuth at redhat.com
Tue Nov 24 02:45:59 AEDT 2015


On 23/11/15 15:42, Stefan Berger wrote:
> On 11/19/2015 11:11 AM, Thomas Huth wrote:
>> spec, so it should be fine to remove tpm-static.fs and keep all
>> functions in the device tree node instead.
>>
>> For example vtpm-measure-hdd-mbr - if you move that function to
>> /ibm,vtpm you could do something like this in disk-label instead:
>>
>>   : load-from-boot-partition ( addr -- size )
>>      debug-disk-label? IF ." Trying DOS boot " .s cr THEN
>>      dup load-from-dos-boot-partition ?dup 0 <> IF
>>         nip
>>         block s" /ibm,vtpm" find-node dup IF
>>            s" vtpm-measure-hdd-mbr" rot $call-static
>>         ELSE
>>            2drop
>>         THEN
>>         EXIT
>>      THEN
>>      ...
>>
>> That way you also do not have to worry about including a wrapper for
>> board-js2x anymore.
> 
> tpm-static.fs is now gone and I replace all accesses to vTPM related
> functions through this 3-line find-node sequence above.
> 
> A detail is now that with the global vtpm-debug? gone I now have
> vtpm-debug? again once in the code for /ibm,vtpm and once in
> /vdevice/vtpm. Do you have any suggestions ?

Should IMHO be fine, too, since /vdevice/vtpm are only wrappers and not
that much of interest, are they?
Alternatively, you could also define a function with the same name in
/vdevice/vtpm that simply calls vtpm-debug? of /ibm,vtpm with
$call-static, then you've got pretty much the same functionality again
apart from the fact that you can not set the variable in /device/vtpm
but only in /ibm,vtpm.

 Thomas



More information about the SLOF mailing list