]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: add and call init_tee_secondary()
authorJens Wiklander <jens.wiklander@linaro.org>
Mon, 10 Jun 2024 06:53:41 +0000 (08:53 +0200)
committerJulien Grall <jgrall@amazon.com>
Thu, 13 Jun 2024 12:43:49 +0000 (13:43 +0100)
Add init_tee_secondary() 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.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
xen/arch/arm/include/asm/tee/tee.h
xen/arch/arm/smpboot.c
xen/arch/arm/tee/tee.c

index da324467e13096025665add283ed1e59576d0a14..6bc13da885b68f31cc41147672d7c4dd750d39f7 100644 (file)
@@ -28,6 +28,9 @@ struct tee_mediator_ops {
      */
     bool (*probe)(void);
 
+    /* Initialize secondary CPUs */
+    void (*init_secondary)(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_secondary(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_secondary(void)
+{
+}
+
 #endif  /* CONFIG_TEE */
 
 #endif /* __ARCH_ARM_TEE_TEE_H__ */
index 93a10d7721b4b319a06266b81b0c6dd2e8eea52f..04e363088d604716461e26a2c5a65c27570640d8 100644 (file)
@@ -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_secondary();
 
     local_abort_enable();
 
index ddd17506a9ff994d230ae85643df5a0b2238e469..9fd1d7495b2ec5a8d6bf4ac57ef1f9068fd9507c 100644 (file)
@@ -96,6 +96,12 @@ static int __init tee_init(void)
 
 __initcall(tee_init);
 
+void __init init_tee_secondary(void)
+{
+    if ( cur_mediator && cur_mediator->ops->init_secondary )
+        cur_mediator->ops->init_secondary();
+}
+
 /*
  * Local variables:
  * mode: C