From: "tip-bot2 for Stefano Garzarella" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Stefano Garzarella <sgarzare@redhat.com>,
"Borislav Petkov (AMD)" <bp@alien8.de>,
Tom Lendacky <thomas.lendacky@amd.com>,
Jarkko Sakkinen <jarkko@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/sev] x86/sev: Register tpm-svsm platform device
Date: Fri, 11 Apr 2025 10:15:34 -0000 [thread overview]
Message-ID: <174436653445.31282.8324011808720867533.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20250410135118.133240-5-sgarzare@redhat.com>
The following commit has been merged into the x86/sev branch of tip:
Commit-ID: e396dd85172c6098e3b70b17e91424edc7bb2d8f
Gitweb: https://git.kernel.org/tip/e396dd85172c6098e3b70b17e91424edc7bb2d8f
Author: Stefano Garzarella <sgarzare@redhat.com>
AuthorDate: Thu, 10 Apr 2025 15:51:16 +02:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Thu, 10 Apr 2025 16:25:33 +02:00
x86/sev: Register tpm-svsm platform device
SNP platform can provide a vTPM device emulated by SVSM.
The "tpm-svsm" device can be handled by the platform driver registered by the
x86/sev core code.
Register the platform device only when SVSM is available and it supports vTPM
commands as checked by snp_svsm_vtpm_probe().
[ bp: Massage commit message. ]
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Link: https://lore.kernel.org/r/20250410135118.133240-5-sgarzare@redhat.com
---
arch/x86/coco/sev/core.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index ecd09da..654a4cc 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -2688,6 +2688,11 @@ static struct platform_device sev_guest_device = {
.id = -1,
};
+static struct platform_device tpm_svsm_device = {
+ .name = "tpm-svsm",
+ .id = -1,
+};
+
static int __init snp_init_platform_device(void)
{
if (!cc_platform_has(CC_ATTR_GUEST_SEV_SNP))
@@ -2696,7 +2701,11 @@ static int __init snp_init_platform_device(void)
if (platform_device_register(&sev_guest_device))
return -ENODEV;
- pr_info("SNP guest platform device initialized.\n");
+ if (snp_svsm_vtpm_probe() &&
+ platform_device_register(&tpm_svsm_device))
+ return -ENODEV;
+
+ pr_info("SNP guest platform devices initialized.\n");
return 0;
}
device_initcall(snp_init_platform_device);
prev parent reply other threads:[~2025-04-11 10:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 13:51 [PATCH v7 0/4] Enlightened vTPM support for SVSM on SEV-SNP Stefano Garzarella
2025-04-10 13:51 ` [PATCH v7 1/4] x86/sev: add SVSM vTPM probe/send_command functions Stefano Garzarella
2025-04-10 13:51 ` [PATCH v7 2/4] svsm: add header with SVSM_VTPM_CMD helpers Stefano Garzarella
2025-04-10 13:51 ` [PATCH v7 3/4] tpm: add SNP SVSM vTPM driver Stefano Garzarella
2025-04-11 10:15 ` [tip: x86/sev] tpm: Add " tip-bot2 for Stefano Garzarella
2025-04-10 13:51 ` [PATCH v7 4/4] x86/sev: register tpm-svsm platform device Stefano Garzarella
2025-04-11 10:15 ` tip-bot2 for Stefano Garzarella [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=174436653445.31282.8324011808720867533.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bp@alien8.de \
--cc=jarkko@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=sgarzare@redhat.com \
--cc=thomas.lendacky@amd.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®