[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v5 5/7] xen/arm: add and call init_tee_interrupt()


  • To: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 31 May 2024 14:16:37 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j6qopxekm9rB9IanXP9gFZ9QrXGNKkARbXTOYOzxXa8=; b=LkE3ZF8EdvATkLRKzaxRk1e29EFBGfwpAEnOoJMks3hbsOR2DFVbHdAvBlG6uUaKSyHgQYKFdgXJF8dc9DTm63C1G99h80n5QSEiUXoBwV3zZ3t9g9/eLVAiwnKGrVdq9HBLViBs1ZfHzn294ETQYadPLImpk8E2RMbEToWrs63qFAUI92Sd8Swt5/8HMOj9yHYdGlGR/XYuJMLyN7bnPyg+9vYvWi4GsXa1Q/eTTQDILzrHcyF7nCBttA6DqCCFtnUxCqLJLVY/aEDxhZSdOTqt0/gpVNkFoiQ56BdBRAPKAasIaLd4WFO17rm6eZqzuesw6nZUXlzlxfFhKm3NtQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j6qopxekm9rB9IanXP9gFZ9QrXGNKkARbXTOYOzxXa8=; b=mEUOxyzuhZxhFPbrWsh4A+UDBHXXe7KjpOyFyffgSn90Pdf2WwrYQxrXY7kVdJMJipT8cT/80UaHPkai8f9tChEii20AZH020Vqwaji+dPpbhA7FU/LZx0bVQ/T/BPnGPk7lyOg00KTfpHvHQuelwSblgHpzG1phmGzInLJ7OKqgcTYH0jBNH7JES3qv0LDvLNWbqEsCAJvg6Bx1RouqAfCVtYeeBAlI6Qic2mza5DSMmt6hLperWnkjOv5KhvSLhma2YPIUIt0eegAMJTy15R5gNCXW9KCVErcdbTuAah6Ld4STg2KHgRm6fEm+4I8vUP0jtVKGLGo19mCWglwTfw==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=aJ2WSLqrUUc9Ao0RmsVmWk3yFf31t+QvP7lYy/02PxJ1cyF+BEwbs09QfyHmUVI9UABJp6hW4sdc45vLJzEHSrhx72E6yWtvDuRxLQQ8IyfzRxujIpl4OWOmXiI1iLuBpOkUI+xtL61MISrKhduK9aSXZM5fJ5kcU9DOB0/kcJVodz//AZbtBcHrTMLJAUc2/XjD1WFHXaKtaBg8Fp+o7LSySppANH4dyLH3p7kmjrNEGPKikMSbD5CvkfCbTLhvBPjR5LsfFN7vZVxZmAw/+eb5F0NJM58IBERwP2XMDHT4/7XFx4bSBkQJNPBO6EsdP4NepkpYalXBbed3WgIlTw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IUk1RMImh6HyOtKAEiUneZs02SbgF4WgdGlp8kxRlh5SAa1iqbLYgk2i7bSIUOLG08wOUvHHqAok+bUm3wE6xP6T7wLc4ydIc2Z6GRKALi63JyVVR+HvnzTjXx4V/4sqYeBCFBSEmqTzjgN8Ex8qV97YLYkTDMhGBZVAYKDVJMDOPY3vvJeIjU3JTV/EJXMZ8LzKpizkHTKrxg1uVVAbU4iqOWqWFY3kGC9kkdjOrzr/RGv26J62emLm9nKqr2rSd7JeMkYcYGmFKrcH2tpvaRWtW4DxncFz8miCwlCCE1WJacq70CIplVcyabLl6pKAqPKQhjrTRirLhPtPyig+gA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "patches@xxxxxxxxxx" <patches@xxxxxxxxxx>, Volodymyr Babchuk <volodymyr_babchuk@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Fri, 31 May 2024 14:16:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHasZmEe4CnQsBnEUWYbv68lN21P7GxZwyA
  • Thread-topic: [XEN PATCH v5 5/7] xen/arm: add and call init_tee_interrupt()

Hi Jens,

> On 29 May 2024, at 09:25, Jens Wiklander <jens.wiklander@xxxxxxxxxx> wrote:
> 
> Add init_tee_interrupt() to the TEE mediator framework and call it from
> start_secondary() late enough that per-cpu interrupts can be configured
> on CPUs as they are initialized. This is needed in later patches.

Just a NIT:
The function you are adding is in fact just an init on secondary cores and
wether you are using to initialise interrupts or something does not really
matter so I would suggest to rename it to "init_secondary" instead to allow
future use cases that are possible.

With that done, feel free to add my R-b on the next version.

Cheers
Bertrand

> 
> Signed-off-by: Jens Wiklander <jens.wiklander@xxxxxxxxxx>
> ---
> xen/arch/arm/include/asm/tee/tee.h | 8 ++++++++
> xen/arch/arm/smpboot.c             | 2 ++
> xen/arch/arm/tee/tee.c             | 6 ++++++
> 3 files changed, 16 insertions(+)
> 
> diff --git a/xen/arch/arm/include/asm/tee/tee.h 
> b/xen/arch/arm/include/asm/tee/tee.h
> index da324467e130..eda8a8aa38f2 100644
> --- a/xen/arch/arm/include/asm/tee/tee.h
> +++ b/xen/arch/arm/include/asm/tee/tee.h
> @@ -28,6 +28,9 @@ struct tee_mediator_ops {
>      */
>     bool (*probe)(void);
> 
> +    /* Initialize eventual interrupt handlers on the secondary CPUs */
> +    void (*init_interrupt)(void);
> +
>     /*
>      * Called during domain construction if toolstack requests to enable
>      * TEE support so mediator can inform TEE about new
> @@ -66,6 +69,7 @@ int tee_domain_init(struct domain *d, uint16_t tee_type);
> int tee_domain_teardown(struct domain *d);
> int tee_relinquish_resources(struct domain *d);
> uint16_t tee_get_type(void);
> +void init_tee_interrupt(void);
> 
> #define REGISTER_TEE_MEDIATOR(_name, _namestr, _type, _ops)         \
> static const struct tee_mediator_desc __tee_desc_##_name __used     \
> @@ -105,6 +109,10 @@ static inline uint16_t tee_get_type(void)
>     return XEN_DOMCTL_CONFIG_TEE_NONE;
> }
> 
> +static inline void init_tee_interrupt(void)
> +{
> +}
> +
> #endif  /* CONFIG_TEE */
> 
> #endif /* __ARCH_ARM_TEE_TEE_H__ */
> diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
> index 93a10d7721b4..e1c1e20efd98 100644
> --- a/xen/arch/arm/smpboot.c
> +++ b/xen/arch/arm/smpboot.c
> @@ -29,6 +29,7 @@
> #include <asm/procinfo.h>
> #include <asm/psci.h>
> #include <asm/acpi.h>
> +#include <asm/tee/tee.h>
> 
> /* Override macros from asm/page.h to make them work with mfn_t */
> #undef virt_to_mfn
> @@ -401,6 +402,7 @@ void asmlinkage start_secondary(void)
>      */
>     init_maintenance_interrupt();
>     init_timer_interrupt();
> +    init_tee_interrupt();
> 
>     local_abort_enable();
> 
> diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c
> index ddd17506a9ff..8117fd55123e 100644
> --- a/xen/arch/arm/tee/tee.c
> +++ b/xen/arch/arm/tee/tee.c
> @@ -96,6 +96,12 @@ static int __init tee_init(void)
> 
> __initcall(tee_init);
> 
> +void __init init_tee_interrupt(void)
> +{
> +    if ( cur_mediator && cur_mediator->ops->init_interrupt)
> +        cur_mediator->ops->init_interrupt();
> +}
> +
> /*
>  * Local variables:
>  * mode: C
> -- 
> 2.34.1
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.