From: Andrei Cherechesu Date: Thu, 19 Dec 2024 11:23:11 +0000 (+0200) Subject: xen/arm: vsmc: Enable handling SiP-owned SCMI SMC calls X-Git-Tag: 4.20.0-rc1~43 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a767076c03a65eb67d5e59ccd23f418ce314a5bd;p=xen.git xen/arm: vsmc: Enable handling SiP-owned SCMI SMC calls Change the handling of SiP SMC calls to be more generic, instead of directly relying on the `platform_smc()` callback implementation. Try to handle the SiP SMC first through the `platform_smc()` callback (if implemented). Otherwise, try to handle it as SCMI message. Signed-off-by: Andrei Cherechesu Reviewed-by: Stefano Stabellini Acked-by: Julien Grall --- diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c index f679cced7f..62d8117a12 100644 --- a/xen/arch/arm/vsmc.c +++ b/xen/arch/arm/vsmc.c @@ -20,6 +20,7 @@ #include #include #include +#include /* Number of functions currently supported by Hypervisor Service. */ #define XEN_SMCCC_FUNCTION_COUNT 3 @@ -224,6 +225,16 @@ static bool handle_sssc(struct cpu_user_regs *regs) } } +/* Secure Calls defined by the Silicon Provider (SiP) */ +static bool handle_sip(struct cpu_user_regs *regs) +{ + /* Firstly, let each platform define custom handling for these SMCs */ + if ( platform_smc(regs) ) + return true; + + return scmi_handle_smc(regs); +} + /* * vsmccc_handle_call() - handle SMC/HVC call according to ARM SMCCC. * returns true if that was valid SMCCC call (even if function number @@ -288,7 +299,7 @@ static bool vsmccc_handle_call(struct cpu_user_regs *regs) handled = handle_sssc(regs); break; case ARM_SMCCC_OWNER_SIP: - handled = platform_smc(regs); + handled = handle_sip(regs); break; case ARM_SMCCC_OWNER_TRUSTED_APP ... ARM_SMCCC_OWNER_TRUSTED_APP_END: case ARM_SMCCC_OWNER_TRUSTED_OS ... ARM_SMCCC_OWNER_TRUSTED_OS_END: