]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: arm64: Mask response to FFA_FEATURE call
authorPer Larsen <perlarsen@google.com>
Wed, 20 Aug 2025 01:10:09 +0000 (01:10 +0000)
committerMarc Zyngier <maz@kernel.org>
Mon, 8 Sep 2025 18:30:59 +0000 (19:30 +0100)
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>
arch/arm64/kvm/hyp/nvhe/ffa.c
include/linux/arm_ffa.h

index 96109aa99c48741e45a2b85d8e7bf26440597398..a8ec1a94f3f8a86551895f4606918246c4ac1f39 100644 (file)
@@ -739,7 +739,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;
index e1634897e159cdc208931938649eb0fb04d5a070..cd7ee4df9045dceca1c4e0dca2d533b770b1b056 100644 (file)
 #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)
 
 /* FFA Bus/Device/Driver related */
 struct ffa_device {