Skip to content

Commit 3f59529

Browse files
Per LarsenMarc Zyngier
authored andcommitted
KVM: arm64: Mask response to FFA_FEATURE call
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. Acked-by: Will Deacon <will@kernel.org> Signed-off-by: Per Larsen <perlarsen@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent 8d24683 commit 3f59529

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

arch/arm64/kvm/hyp/nvhe/ffa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ static int hyp_ffa_post_init(void)
739739
if (res.a0 != FFA_SUCCESS)
740740
return -EOPNOTSUPP;
741741

742-
switch (res.a2) {
742+
switch (res.a2 & FFA_FEAT_RXTX_MIN_SZ_MASK) {
743743
case FFA_FEAT_RXTX_MIN_SZ_4K:
744744
min_rxtx_sz = SZ_4K;
745745
break;

include/linux/arm_ffa.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
#define FFA_FEAT_RXTX_MIN_SZ_4K 0
129129
#define FFA_FEAT_RXTX_MIN_SZ_64K 1
130130
#define FFA_FEAT_RXTX_MIN_SZ_16K 2
131+
#define FFA_FEAT_RXTX_MIN_SZ_MASK GENMASK(1, 0)
131132

132133
/* FFA Bus/Device/Driver related */
133134
struct ffa_device {

0 commit comments

Comments
 (0)