[PATCH v7 3/6] firmware: smccc: Move RSI definitions to include/linux
Aneesh Kumar K.V
aneesh.kumar at kernel.org
Thu Jun 11 22:41:04 PDT 2026
Suzuki K Poulose <suzuki.poulose at arm.com> writes:
> On 11/06/2026 14:04, Aneesh Kumar K.V (Arm) wrote:
>> The RSI SMCCC function IDs describe a firmware ABI and are not arm64
>> architecture specific definitions. Follow-up changes need to use them from
>> non-arch code, including drivers/firmware/smccc and the Arm CCA guest
>> driver.
>>
>> Move the RSI SMCCC definitions from arch/arm64/include/asm/ to
>> include/linux/ so they can be shared with the driver code. This also
>> keeps the firmware interface outside architecture code, as requested [1].
>
> Please could we also mention about moving the "wrappers" only used by
> drivers accordingly ?
>
Added this
Not all helpers in rsi_cmds.h are used by architecture code. The
attestation token helper wrappers are only used by the Arm CCA guest
driver, so move them to a driver-private header under
drivers/virt/coco/arm-cca-guest/. Keep the remaining RSI command helpers,
which are shared by architecture code and drivers, in the arm64 header.
>
>>
>> [1] https://lore.kernel.org/all/agsNO9cc7H-b0H8L@willie-the-truck
>>
>> Signed-off-by: Aneesh Kumar K.V (Arm) <aneesh.kumar at kernel.org>
>> ---
>> arch/arm64/include/asm/rsi_cmds.h | 74 +---------------
>> .../virt/coco/arm-cca-guest/arm-cca-guest.c | 2 +
>> drivers/virt/coco/arm-cca-guest/rsi.h | 84 +++++++++++++++++++
>> .../linux/arm-smccc-rsi.h | 6 +-
>> 4 files changed, 90 insertions(+), 76 deletions(-)
>> create mode 100644 drivers/virt/coco/arm-cca-guest/rsi.h
>> rename arch/arm64/include/asm/rsi_smc.h => include/linux/arm-smccc-rsi.h (98%)
>>
>> diff --git a/arch/arm64/include/asm/rsi_cmds.h b/arch/arm64/include/asm/rsi_cmds.h
>> index 2c8763876dfb..633123a4e5d5 100644
>> --- a/arch/arm64/include/asm/rsi_cmds.h
>> +++ b/arch/arm64/include/asm/rsi_cmds.h
>> @@ -8,10 +8,9 @@
>>
>> #include <linux/arm-smccc.h>
>> #include <linux/string.h>
>> +#include <linux/arm-smccc-rsi.h>
>
> super minor nit: Please keep them in the alphabetical order.
>
> With that:
>
> Reviewed-by: Suzuki K Poulose <suzuki.poulose at arm.com>
>
Thanks
-aneesh
More information about the linux-arm-kernel
mailing list