[svsm-devel] SVSM_VTPM_CMD Call question

Stefano Garzarella sgarzare at redhat.com
Tue Mar 4 17:16:00 CET 2025


Hi Tom, James,
working on the SVSM side of the vTPM emulation, I'm a bit lost on `8.2 
SVSM_VTPM_CMD Call` section.

In the SVSM code [1] we are assuming that the driver is always using a 
PAGE_SIZE buffer for TPM_SEND_COMMAND request/response, but I can't find 
anything in the spec apart from this:

   It is expected that the request/response structure is large
   enough to hold the expected output of the vTPM request. The vTPM
   request/response buffer will be treated as physically contiguous in
   the guest address space.

IIUC from `Table 16: TPM_SEND_COMMAND Request Structure` the 3rd field 
`TPM Command size (in bytes)` is just the amount of bytes filled with 
the request.

How does SVSM know the total buffer size it can use for response?

Claudio mentioned that in an old discussion, we were thinking of adding 
in the specification that the buffer should always be PAGE_SIZE. This 
would explain the assumption we make in SVSM and also the driver that 
always allocates a page.

If there are any changes already planned for the specification, 
apologies in advance for my confusion.

Thanks,
Stefano

[1] https://github.com/coconut-svsm/svsm/blob/376e4571099ee5e9aab8343c137600e97ebe1b4b/kernel/src/protocols/vtpm.rs#L67



More information about the Svsm-devel mailing list