Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] The `rsi_host_call` structure uses native integer types instead of 
explicit little-endian types, which can cause an ABI mismatch on big-endian 
kernels.
--

--- Patch [1]: [PATCH v3 1/6] arm64: rsi: Add RSI host call structure and 
helper function ---
commit 47a2fc3b0f72dc993f44827b221ab5eb02bbcb36
Author: Kameron Carr <[email protected]>

arm64: rsi: Add RSI host call structure and helper function

This commit introduces the rsi_host_call structure and a helper function to
invoke SMC_RSI_HOST_CALL. This allows Hyper-V guest code to route hypercalls
through the RSI interface when running inside an Arm CCA Realm.

[ ... ]

> diff --git a/arch/arm64/include/asm/rsi_smc.h 
> b/arch/arm64/include/asm/rsi_smc.h
> index e19253f96c940..9cc57b5be0c02 100644
> --- a/arch/arm64/include/asm/rsi_smc.h
> +++ b/arch/arm64/include/asm/rsi_smc.h
> @@ -142,6 +142,13 @@ struct realm_config {
>        */
>  } __aligned(0x1000);
>  
> +struct rsi_host_call {
> +     u16 immediate;
> +     u8 _padding[6];
> +     u64 gprs[31];
> +} __aligned(256);

[Severity: Medium]
Should this structure use explicit little-endian types (__le16, __le64)
instead of native integer types?

If a big-endian kernel constructs this structure in memory and issues the
SMC, won't the Realm Management Monitor read byte-swapped values? The CCA
RMM specification dictates that memory structures shared between the Realm
and the RMM must be little-endian, so using native types could cause an ABI
mismatch.

> +static_assert(sizeof(struct rsi_host_call) == 256);
> +
>  #endif /* __ASSEMBLER__ */
>  
>  /*

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to