From: Will Deacon <will@kernel.org>
To: Jeremy Linton <jeremy.linton@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com,
gshan@redhat.com, steven.price@arm.com, sami.mujawar@arm.com,
catalin.marinas@arm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/1] arm64: rsi: Add automatic arm-cca-guest module loading
Date: Wed, 11 Dec 2024 21:30:19 +0000 [thread overview]
Message-ID: <20241211213018.GA17486@willie-the-truck> (raw)
In-Reply-To: <20241207012128.247522-2-jeremy.linton@arm.com>
On Fri, Dec 06, 2024 at 07:21:28PM -0600, Jeremy Linton wrote:
> The TSM module provides guest identification and attestation when a
> guest runs in CCA mode. By creating a dummy platform device, let's
> ensure the module is automatically loaded. The udev daemon loads the
> TSM module after it receives a device addition event. Once that
> happens, it can be used earlier in the boot process to decrypt the
> rootfs.
>
> Signed-off-by: Jeremy Linton <jeremy.linton@arm.com>
> Reviewed-by: Gavin Shan <gshan@redhat.com>
> ---
> arch/arm64/include/asm/rsi.h | 2 ++
> arch/arm64/kernel/rsi.c | 15 +++++++++++++++
> drivers/virt/coco/arm-cca-guest/arm-cca-guest.c | 8 ++++++++
> 3 files changed, 25 insertions(+)
>
> diff --git a/arch/arm64/include/asm/rsi.h b/arch/arm64/include/asm/rsi.h
> index 188cbb9b23f5..b42aeac05340 100644
> --- a/arch/arm64/include/asm/rsi.h
> +++ b/arch/arm64/include/asm/rsi.h
> @@ -10,6 +10,8 @@
> #include <linux/jump_label.h>
> #include <asm/rsi_cmds.h>
>
> +#define RSI_PDEV_NAME "arm-cca-dev"
> +
> DECLARE_STATIC_KEY_FALSE(rsi_present);
>
> void __init arm64_rsi_init(void);
> diff --git a/arch/arm64/kernel/rsi.c b/arch/arm64/kernel/rsi.c
> index 3031f25c32ef..5434e5496ac2 100644
> --- a/arch/arm64/kernel/rsi.c
> +++ b/arch/arm64/kernel/rsi.c
> @@ -8,6 +8,7 @@
> #include <linux/psci.h>
> #include <linux/swiotlb.h>
> #include <linux/cc_platform.h>
> +#include <linux/platform_device.h>
>
> #include <asm/io.h>
> #include <asm/mem_encrypt.h>
> @@ -140,3 +141,17 @@ void __init arm64_rsi_init(void)
> static_branch_enable(&rsi_present);
> }
>
> +static struct platform_device rsi_dev = {
> + .name = RSI_PDEV_NAME,
> + .id = PLATFORM_DEVID_NONE
> +};
> +
> +static int __init rsi_init(void)
> +{
> + if (is_realm_world() &&
> + platform_device_register(&rsi_dev))
> + pr_err("failed to register rsi platform device\n");
> + return 0;
> +}
> +
> +arch_initcall(rsi_init)
This file already has an arm64_rsi_init()... Ideally, we'd hang this
off the end of that instead of the initcall but I suspect you're going
to tell me that platform_device_register() doesn't like being called
that early?
If so, perhaps arm64_create_dummy_rsi_dev() might be better?
Will
prev parent reply other threads:[~2024-12-11 21:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-07 1:21 [PATCH v3 0/1] arm64: CCA TSM module autoloading Jeremy Linton
2024-12-07 1:21 ` [PATCH v3 1/1] arm64: rsi: Add automatic arm-cca-guest module loading Jeremy Linton
2024-12-08 4:38 ` Itaru Kitayama
2024-12-17 20:16 ` Jeremy Linton
2024-12-11 21:30 ` Will Deacon [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=20241211213018.GA17486@willie-the-truck \
--to=will@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=gshan@redhat.com \
--cc=jeremy.linton@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sami.mujawar@arm.com \
--cc=steven.price@arm.com \
--cc=suzuki.poulose@arm.com \
/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