tpm: Add SNP SVSM vTPM driver
Add driver for the vTPM defined by the AMD SVSM spec [1]. The specification defines a protocol that a SEV-SNP guest OS can use to discover and talk to a vTPM emulated by the Secure VM Service Module (SVSM) in the guest context, but at a more privileged level (VMPL0). The new tpm-svsm platform driver uses API exposed by the x86/sev core implementation interface to a SVSM to send commands and receive responses. The device cannot be hot-plugged/unplugged as it is emulated by the platform, so module_platform_driver_probe() can be used. The device will be registered by the platform only when it's available, so the probe function just needs to setup the tpm_chip. This device does not support interrupts and sends responses to commands synchronously. In order to have .recv() called just after .send() in tpm_try_transmit(), the .status() callback is not implemented as recently supported by commit 980a5736 ("tpm: Make chip->{status,cancel,req_canceled} opt"). [1] "Secure VM Service Module for SEV-SNP Guests" Publication # 58019 Revision: 1.00 [ bp: Massage commit message. ] Signed-off-by:Stefano Garzarella <sgarzare@redhat.com> Signed-off-by:
Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by:
Jarkko Sakkinen <jarkko@kernel.org> Link: https://lore.kernel.org/r/20250410135118.133240-4-sgarzare@redhat.com
Loading
Please register or sign in to comment