diff mbox series

[v4,07/33] tpm: Add sml related nodes to vdevice/vtpm node

Message ID 20191211202728.127996-8-stefanb@linux.vnet.ibm.com
State Superseded
Headers show
Series Add vTPM support to SLOF | expand

Commit Message

Stefan Berger Dec. 11, 2019, 8:27 p.m. UTC
Add stored measurement log (sml) related firmware API calls to the vdevice/vtpm
node and forward calls to them to the ibm,vtpm node.

Once this patch is applied the Linux TPM's securityfs file
/sys/kernel/security/tpm0/ascii_bios_measurements shows the list of measurements,
which is still empty at this point.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
 board-qemu/slof/vio-vtpm-cdriver.fs | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
diff mbox series

Patch

diff --git a/board-qemu/slof/vio-vtpm-cdriver.fs b/board-qemu/slof/vio-vtpm-cdriver.fs
index 53aad4d..04b8ea5 100644
--- a/board-qemu/slof/vio-vtpm-cdriver.fs
+++ b/board-qemu/slof/vio-vtpm-cdriver.fs
@@ -74,6 +74,30 @@  false VALUE vtpm-debug?
     THEN
 ;
 
+\ firmware API call
+: sml-get-allocated-size ( -- buffer-size)
+    " sml-get-allocated-size" vtpm-call-forward IF
+        \ vtpm-call-forward failed
+        0
+    THEN
+;
+
+\ firmware API call
+: sml-get-handover-size ( -- size)
+    " sml-get-handover-size" vtpm-call-forward IF
+        \ vtpm-call-forward failed
+        0
+    THEN
+;
+
+\ firmware API call
+: sml-handover ( dest size -- )
+    " sml-handover" vtpm-call-forward IF
+        \ vtpm-call-forward failed; clean up stack
+        2drop
+    THEN
+;
+
 \ firmware API call
 : hash-all ( data-ptr data-len hash-ptr -- )
     " hash-all" vtpm-call-forward IF