Re: [RFC PATCH v2 2/6] x86/sev: add SVSM vTPM probe/send_command functions

From: Borislav Petkov
Date: Mon Mar 10 2025 - 10:05:36 EST


On Mon, Mar 10, 2025 at 02:59:44PM +0100, Stefano Garzarella wrote:
> On Mon, Mar 10, 2025 at 02:51:33PM +0100, Borislav Petkov wrote:
> > On Mon, Mar 10, 2025 at 08:27:37AM -0500, Tom Lendacky wrote:
> > > I don't think anything needs to be checked or printed.
> >
> > Yes.
>
> Ack, I removed the check and the print.
>
> @Boris I also removed `ret` to continue the slimming, so the end
> result should be this:
>
> bool snp_svsm_vtpm_probe(void)
> {
> struct svsm_call call = {};
>
> /* The vTPM device is available only if a SVSM is present */
> if (!snp_vmpl)
> return false;
>
> call.caa = svsm_get_caa();
> call.rax = SVSM_VTPM_CALL(SVSM_VTPM_QUERY);
>
> if (svsm_perform_call_protocol(&call))
> return false;
>
> /* Check platform commands contains TPM_SEND_COMMAND - platform command 8 */
> return (call.rcx_out & BIT_ULL(8)) == BIT_ULL(8);
> }
>
> Quite nice, thanks for the review!

Thanks, looks clean to me. :)

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette