From: Kameron Carr <[email protected]> Sent: Tuesday, June 9, 
2026 11:10 AM
> 
> Add struct rsi_host_call to rsi_smc.h, which represents the host call
> data structure used by the Realm Management Monitor (RMM) for the
> RSI_HOST_CALL interface. The structure contains a 16-bit immediate field
> and 31 general-purpose register values, aligned to 256 bytes as required
> by the CCA RMM specification.
> 
> Add rsi_host_call() static inline wrapper in rsi_cmds.h that invokes
> SMC_RSI_HOST_CALL with the physical address of the host call structure.
> This will be used by Hyper-V guest code to route hypercalls through the
> RSI interface when running inside an Arm CCA Realm.
> 
> Signed-off-by: Kameron Carr <[email protected]>
> ---
>  arch/arm64/include/asm/rsi_cmds.h | 9 +++++++++
>  arch/arm64/include/asm/rsi_smc.h  | 6 ++++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/arch/arm64/include/asm/rsi_cmds.h 
> b/arch/arm64/include/asm/rsi_cmds.h
> index 2c8763876dfb7..83b4b1f598454 100644
> --- a/arch/arm64/include/asm/rsi_cmds.h
> +++ b/arch/arm64/include/asm/rsi_cmds.h
> @@ -159,4 +159,13 @@ static inline unsigned long
> rsi_attestation_token_continue(phys_addr_t granule,
>       return res.a0;
>  }
> 
> +static inline long rsi_host_call(phys_addr_t host_call_struct)
> +{
> +     struct arm_smccc_res res;
> +
> +     arm_smccc_smc(SMC_RSI_HOST_CALL, host_call_struct, 0, 0, 0, 0, 0, 0,
> +                   &res);
> +     return res.a0;
> +}

For consistent grouping, it seems like this inline function should
be placed after rsi_set_addr_range_state() since it follows the
same pattern. It's a bit different from the token functions.

> +
>  #endif /* __ASM_RSI_CMDS_H */
> diff --git a/arch/arm64/include/asm/rsi_smc.h 
> b/arch/arm64/include/asm/rsi_smc.h
> index e19253f96c940..ffea93340ed7f 100644
> --- a/arch/arm64/include/asm/rsi_smc.h
> +++ b/arch/arm64/include/asm/rsi_smc.h
> @@ -142,6 +142,12 @@ struct realm_config {
>        */
>  } __aligned(0x1000);
> 
> +struct rsi_host_call {
> +     u16 immediate;

I don't see the "immediate" used anywhere in this patch set.
Is it always zero for the Hyper-V use cases?  Just curious ...

> +     u64 gprs[31];
> +} __aligned(256);
> +static_assert(sizeof(struct rsi_host_call) == 256);

This struct defines an ABI with the RMM layer, so I'd suggest
adding explicit padding of 6 bytes after the immediate so there's
no implicit dependency on the compiler adding the padding.
Sashiko had the same comment ....

Michael

> +
>  #endif /* __ASSEMBLER__ */
> 
>  /*
> --
> 2.45.4
> 


Reply via email to