[PATCH v8 5/7] KVM: arm64: Mask response to FFA_FEATURE call

Will Deacon will at kernel.org
Tue Jul 29 08:46:58 PDT 2025


On Sat, Jul 19, 2025 at 02:11:27AM +0000, Per Larsen via B4 Relay wrote:
> From: Per Larsen <perlarsen at google.com>
> 
> The minimum size and alignment boundary for FFA_RXTX_MAP is returned in
> bit[1:0]. Mask off any other bits in w2 when reading the minimum buffer
> size in hyp_ffa_post_init.
> 
> Signed-off-by: Per Larsen <perlarsen at google.com>
> ---
>  arch/arm64/kvm/hyp/nvhe/ffa.c | 2 +-
>  include/linux/arm_ffa.h       | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c
> index 5a173ea481940236356e2bc4248d094a858a0923..2cbecc9af5d27a9e7c8497001cf9b0987c72bdb4 100644
> --- a/arch/arm64/kvm/hyp/nvhe/ffa.c
> +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c
> @@ -733,7 +733,7 @@ static int hyp_ffa_post_init(void)
>  	if (res.a0 != FFA_SUCCESS)
>  		return -EOPNOTSUPP;
>  
> -	switch (res.a2) {
> +	switch (res.a2 & FFA_FEAT_RXTX_MIN_SZ_MASK) {
>  	case FFA_FEAT_RXTX_MIN_SZ_4K:
>  		min_rxtx_sz = SZ_4K;
>  		break;
> diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h
> index e1634897e159cdc208931938649eb0fb04d5a070..cd7ee4df9045dceca1c4e0dca2d533b770b1b056 100644
> --- a/include/linux/arm_ffa.h
> +++ b/include/linux/arm_ffa.h
> @@ -128,6 +128,7 @@
>  #define FFA_FEAT_RXTX_MIN_SZ_4K		0
>  #define FFA_FEAT_RXTX_MIN_SZ_64K	1
>  #define FFA_FEAT_RXTX_MIN_SZ_16K	2
> +#define FFA_FEAT_RXTX_MIN_SZ_MASK	GENMASK(1, 0)

Acked-by: Will Deacon <will at kernel.org>

Will



More information about the linux-arm-kernel mailing list