From nobody Sat Sep 26 20:28:45 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 515A32F84F; Sun, 30 Aug 2026 23:08:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788131316; cv=none; b=CPYUrIIptjbg1jqckWaKnioUhi8V3RoBoPXiEjZJ4RyHJgiwLxDO+VoYWY02PU1XfDKbHWcC/5wgpsUZ0OLBSdP2Me0ZYLxyw3Ka1KwiP1QLb8rlp8ZXeiY7XoYZTN0PQkGIdNQQcl/IGVJcOzZYQYWIVPPc851qXdD2cxf4ujw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788131316; c=relaxed/simple; bh=jDp+Nw6b7h22SFzKZLUIEWRF8HaZpA2JP2JZBw82m2s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=B+Y0ct+ig1Svu2079IWMdu8xxFau2Yg5Qkzg44Ag8T6cbXSpq9qzEKT7Xvq+9b3JLcn3uqEFQ2Y16VIzDfZgLPl4+F456feruhgk08MuDBmsrVi3PXsbfmDTKpc/XJ2Z1UFxdpgjqIuj/vTJBsJ/7FswA6uAKsBKjrl1oI4vUmo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Cl3pey6V; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Cl3pey6V" Received: by smtp.kernel.org (Postfix) with ESMTPS id E3ABDC2BCFB; Sun, 30 Aug 2026 23:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1788131316; bh=jDp+Nw6b7h22SFzKZLUIEWRF8HaZpA2JP2JZBw82m2s=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Cl3pey6VkNICIFNuLMkHNbav3N80r945qbrQLuAUxxSgr0HgnmaCyNth4fu9MbqS1 d7TBxmQWJUcCGy8sI/MkNKdttmdJCIVzXDeTSgGip3sn+i1lP9LXDvVdCTGOpUGDEd NMEZ/AVzA7Q3Q77n3NYfG9NemQ7rz7SSDPJS/s3tMhzP44sE5cmapcxZ5HNni9X/kC GTp8w63IuXJBbLpr6f6CvLhAm01F6IJRMApdelrETswFaT5Erm/NiKoF8Xo68OIOun D54NEAIhC3BOy0axKm+ad1FH8TWruOHLmUcX0oKqcqkkSFWeYeehxEAQykVp7vJWxA hVdgl2sQLjU5w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1762C61DD9; Sun, 30 Aug 2026 23:08:35 +0000 (UTC) From: Per Larsen via B4 Relay Date: Sun, 30 Aug 2026 23:08:13 +0000 Subject: [PATCH v7 1/3] KVM: arm64: Block host-initiated FF-A direct responses Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260830-host-direct-messages-v7-1-45f6e6db72c2@google.com> References: <20260830-host-direct-messages-v7-0-45f6e6db72c2@google.com> In-Reply-To: <20260830-host-direct-messages-v7-0-45f6e6db72c2@google.com> To: Marc Zyngier , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Yeoreum Yun , Ben Horgan , Oliver Upton Cc: Sebastien Ene , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Per Larsen , Fuad Tabba X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788131315; l=1110; i=perlarsen@google.com; s=20250508; h=from:subject:message-id; bh=8AHoa5902lBdwgQQj0S5IoBZHdWqjlLxCvW0VZ4P46k=; b=lVUR0IW9heVYxTkTzz63UFlzLz6FnS5mvT3oqFqrWvLIISaAwADTyK2fdfCHeMEb0Dcc0DLSR Bm6c5qGAe/fD27T3Z1wSu6KT8UK27gtIO7zVbMh/0xrLlI66QcOW48n X-Developer-Key: i=perlarsen@google.com; a=ed25519; pk=jjc/Ta4VmrLRmMoahP6d1mBcKzvWU+nsmdtYe2oS2kQ= X-Endpoint-Received: by B4 Relay for perlarsen@google.com/20250508 with auth_id=402 X-Original-From: Per Larsen Reply-To: perlarsen@google.com From: Per Larsen ffa_call_supported() rejects FFA_MSG_SEND_DIRECT_RESP, but allows FFA_FN64_MSG_SEND_DIRECT_RESP to be forwarded to firmware. The host is never the target of an FF-A direct request and therefore cannot initiate a direct response. Reject both calling conventions. Suggested-by: Fuad Tabba Signed-off-by: Per Larsen --- arch/arm64/kvm/hyp/nvhe/ffa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c index a327c2bbb6b6..9e8bb95e8845 100644 --- a/arch/arm64/kvm/hyp/nvhe/ffa.c +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c @@ -686,8 +686,10 @@ static bool ffa_call_supported(u64 func_id) case FFA_MSG_SEND: case FFA_MSG_POLL: case FFA_MSG_WAIT: - /* 32-bit variants of 64-bit calls */ + /* The host is never the target of a direct request */ case FFA_MSG_SEND_DIRECT_RESP: + case FFA_FN64_MSG_SEND_DIRECT_RESP: + /* 32-bit variants of 64-bit calls */ case FFA_RXTX_MAP: case FFA_MEM_DONATE: case FFA_MEM_RETRIEVE_REQ: --=20 2.55.0.897.gb25b4bd76c-goog From nobody Sat Sep 26 20:28:45 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5168A30EF89; Sun, 30 Aug 2026 23:08:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788131316; cv=none; b=rKXkAr5ZS+9e1Df/IWHdVWNqGduSC7wxbYCDapkvHXpNUqwG55bYejgNEpCzyI32tfX7oWAl3+8L6HqNWrdfM9n9s259yNEzJnw7KIE8psol3qRrpGC5slw6tQMYqWQNr/JcZn/JZPEapKWyKxVHc/dSG3oooN5MEo4VzfUNUs4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788131316; c=relaxed/simple; bh=jYdFQnr3uAVSj9mc50d5zTs1vATwWNTAp1myXgkY79g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WBsDJsCHR0aPpXxC2XhsIt8YNDeh41z3kolCSz4Z8fRaBcBqjMoVEAp3Mrud3TWeGrbRwPkJA6LEYomfzLlirSMgcEaM8fVT+MT7Jxcm9ChNFT/cgKK6Cw3zQ+5xOWea9bKwhwPK6tdoSTVuvX9w24kAa8hQPx87eRBKomeFqQk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q1vIXEZm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q1vIXEZm" Received: by smtp.kernel.org (Postfix) with ESMTPS id 00A84C2BCF5; Sun, 30 Aug 2026 23:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1788131316; bh=jYdFQnr3uAVSj9mc50d5zTs1vATwWNTAp1myXgkY79g=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Q1vIXEZmkF3DTjlGRcZVUHu1S1WFcnnQJO0RIJk9ZztwUgVlkw0Qk1kIdsxpHMb99 HWzUlx5cxjV6wPDtW2edfage8187gvcvnAk+weXdkas5Vj9/RT7Q35Iinx43eDLesW igYg+mKGTec7FSA0RGTPGB6ATxf/hFZQG8nessEYS3OpaZUKnmyApG9S4iLQEIXHeE GDDjbDcI3CP0hu6IzHR6ely9Wwb0Cv9iCE2oa7FEQpP0URAwKMt0lDegdMZKusGRBY SxB1tXDqWDwUXT3A9/x2lyUx6trDkKmujykfoGKU/9ael49eZjxwgIDF4AP9eBN/qi gNja4XUj/gNFQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3FABC61DE8; Sun, 30 Aug 2026 23:08:35 +0000 (UTC) From: Per Larsen via B4 Relay Date: Sun, 30 Aug 2026 23:08:14 +0000 Subject: [PATCH v7 2/3] KVM: arm64: Support FFA_MSG_SEND_DIRECT_REQ in host handler Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260830-host-direct-messages-v7-2-45f6e6db72c2@google.com> References: <20260830-host-direct-messages-v7-0-45f6e6db72c2@google.com> In-Reply-To: <20260830-host-direct-messages-v7-0-45f6e6db72c2@google.com> To: Marc Zyngier , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Yeoreum Yun , Ben Horgan , Oliver Upton Cc: Sebastien Ene , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Per Larsen , Fuad Tabba X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788131315; l=2460; i=perlarsen@google.com; s=20250508; h=from:subject:message-id; bh=rJjD1X1aOzt7FsDkT8i5+1EQ5DBJ0OYaQuGPIhMalLI=; b=12JfTKZC/AlyFM8O1hZTlg+a8bQsSTxyTqDgAARC3BvK9OyL0XQ5YQCq0eAlC0nYBtVEM4AA9 HQrKhzr23/PDnFpQ0G4qN4zlZeQILKjGmMf2F6pwL87eDwCOcQUZrVi X-Developer-Key: i=perlarsen@google.com; a=ed25519; pk=jjc/Ta4VmrLRmMoahP6d1mBcKzvWU+nsmdtYe2oS2kQ= X-Endpoint-Received: by B4 Relay for perlarsen@google.com/20250508 with auth_id=402 X-Original-From: Per Larsen Reply-To: perlarsen@google.com From: Sebastian Ene Allow direct messages to be forwarded from the host. The host should not be sending framework messages so they are filtered out. Signed-off-by: Sebastian Ene Reviewed-by: Yeoreum Yun Signed-off-by: Per Larsen --- arch/arm64/kvm/hyp/nvhe/ffa.c | 27 +++++++++++++++++++++++++++ include/linux/arm_ffa.h | 2 ++ 2 files changed, 29 insertions(+) diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c index 9e8bb95e8845..96cf6be969de 100644 --- a/arch/arm64/kvm/hyp/nvhe/ffa.c +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c @@ -880,6 +880,29 @@ static void do_ffa_part_get(struct arm_smccc_1_2_regs = *res, hyp_spin_unlock(&host_buffers.lock); } =20 +static void do_ffa_direct_msg(struct arm_smccc_1_2_regs *res, + struct kvm_cpu_context *ctxt) +{ + DECLARE_REG(u64, endp, ctxt, 1); + DECLARE_REG(u64, flags, ctxt, 2); + + struct arm_smccc_1_2_regs *args =3D (void *)&ctxt->regs.regs[0]; + + if (upper_32_bits(endp) || + FIELD_GET(FFA_SRC_ENDPOINT_MASK, endp) !=3D HOST_FFA_ID) { + ffa_to_smccc_error(res, FFA_RET_INVALID_PARAMETERS); + return; + } + + /* filter out framework messages and validate SBZ/MBZ bits */ + if (flags) { + ffa_to_smccc_error(res, FFA_RET_INVALID_PARAMETERS); + return; + } + + hyp_smccc_1_2_smc(args, res); +} + bool kvm_host_ffa_handler(struct kvm_cpu_context *host_ctxt, u32 func_id) { struct arm_smccc_1_2_regs res =3D {0}; @@ -938,6 +961,10 @@ bool kvm_host_ffa_handler(struct kvm_cpu_context *host= _ctxt, u32 func_id) case FFA_PARTITION_INFO_GET: do_ffa_part_get(&res, host_ctxt); goto out_handled; + case FFA_MSG_SEND_DIRECT_REQ: + case FFA_FN64_MSG_SEND_DIRECT_REQ: + do_ffa_direct_msg(&res, host_ctxt); + goto out_handled; } =20 if (ffa_call_supported(func_id)) diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h index e71d83ee0aef..a3f44e7c08de 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -269,6 +269,8 @@ bool ffa_partition_check_property(struct ffa_device *de= v, u32 property) (ffa_partition_check_property(dev, FFA_PARTITION_DIRECT_REQ2_RECV) && \ !dev->mode_32bit) =20 +#define FFA_SRC_ENDPOINT_MASK GENMASK(31, 16) + /* For use with FFA_MSG_SEND_DIRECT_{REQ,RESP} which pass data via registe= rs */ struct ffa_send_direct_data { unsigned long data0; /* w3/x3 */ --=20 2.55.0.897.gb25b4bd76c-goog From nobody Sat Sep 26 20:28:45 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5161523EA83; Sun, 30 Aug 2026 23:08:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788131316; cv=none; b=H1iy+io2SSjewbYph5mPbyQpOa84ulUZtI7PIug2+RhqZDzDcdauQrjxgoPF5qgtnXzQiKVCISGdIF0DEJGDyhC0KmKVvS6KfKZoEXLE5aKUhjdMFFtyqjnP/B6O/Q8/8dKtHSZAsZIGe4xZAejISL3radxSQ/I5oJxAmxCdvjM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788131316; c=relaxed/simple; bh=TNNJ/C/qEw4KyhnlvAu82dE0ffiDedqwMDh+oVE2Ne0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F3q+yEz/9dQVgWtrssbbPQGzp2tJZAR/3d66ErVGWftI2TiZTQweMhSXrGNjFcTOq7tY9qgGNeRL2s9N6DQ3WnMJMeeQBFcCyFUtUwXvdLU9og9ORuH8kddkr571yIYzLC/xMnwBD6e0P6V8bIYv00EPssdWtgeBfrfv3KSiaKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sPtJbT2d; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sPtJbT2d" Received: by smtp.kernel.org (Postfix) with ESMTPS id 0D6A6C2BCFC; Sun, 30 Aug 2026 23:08:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1788131316; bh=TNNJ/C/qEw4KyhnlvAu82dE0ffiDedqwMDh+oVE2Ne0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=sPtJbT2d85sgiROoP7vavZD1YHEkNPVkdXyobo3uMSSK/cfU/EY206jlRdkpHD0VJ sFyn/ryIiujT5sYM2x5fmsTfVIRfgk2t5eBqAyZuQYQP4jWUCG7SU+eeJ4NCfAjazu Aj3ccBk4v5c9c/YmPEkijZptvBobxHqxczyRHb7jz5IaRxNCoNHNpr6tsQ13vtApGg mJ4cEV61DVHvay9xOdD6XYsTG/Yajs5NqHZUC28EK5mQlLcB2msIojH2tb/nlbMj1f alXoqEWJB0BTIt/zOXZuP3y1kZ65cTKG89555sz+hd2R0ZD/AssRdBNAMc7vCgp329 z8bqWGxwRXDJQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7D3AC61DF1; Sun, 30 Aug 2026 23:08:35 +0000 (UTC) From: Per Larsen via B4 Relay Date: Sun, 30 Aug 2026 23:08:15 +0000 Subject: [PATCH v7 3/3] KVM: arm64: Support FFA_MSG_SEND_DIRECT_REQ2 in host handler Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260830-host-direct-messages-v7-3-45f6e6db72c2@google.com> References: <20260830-host-direct-messages-v7-0-45f6e6db72c2@google.com> In-Reply-To: <20260830-host-direct-messages-v7-0-45f6e6db72c2@google.com> To: Marc Zyngier , Joey Gouly , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Yeoreum Yun , Ben Horgan , Oliver Upton Cc: Sebastien Ene , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Per Larsen , Fuad Tabba X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788131315; l=2862; i=perlarsen@google.com; s=20250508; h=from:subject:message-id; bh=nnwVuYK389tkxvmLcVFxyVM3lQJCgHwgjV/Ux8ncI+U=; b=B75pX6j34kDpulGyZCb2fOLdzdqf4Xz1eBSV9Ek8GgCprbLn+K3pZaRwIjYFOMPJnbpiB2eq9 bC5KQxSFqbRD+6xQVwHLGI5tN0I3xE+UbBqJULS9j5oqUyyJt1P9Dac X-Developer-Key: i=perlarsen@google.com; a=ed25519; pk=jjc/Ta4VmrLRmMoahP6d1mBcKzvWU+nsmdtYe2oS2kQ= X-Endpoint-Received: by B4 Relay for perlarsen@google.com/20250508 with auth_id=402 X-Original-From: Per Larsen Reply-To: perlarsen@google.com From: Per Larsen FF-A 1.2 adds the DIRECT_REQ2 messaging interface which is similar to the existing FFA_MSG_SEND_DIRECT_{REQ,RESP} functions and can use the existing handler function. Add support for FFA_MSG_SEND_DIRECT_REQ2 in the host ffa handler. Reviewed-by: Yeoreum Yun Signed-off-by: Per Larsen --- arch/arm64/kvm/hyp/nvhe/ffa.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/ffa.c b/arch/arm64/kvm/hyp/nvhe/ffa.c index 96cf6be969de..eeb8d5b6f3e0 100644 --- a/arch/arm64/kvm/hyp/nvhe/ffa.c +++ b/arch/arm64/kvm/hyp/nvhe/ffa.c @@ -702,11 +702,12 @@ static bool ffa_call_supported(u64 func_id) case FFA_NOTIFICATION_GET: case FFA_NOTIFICATION_INFO_GET: /* Optional interfaces added in FF-A 1.2 */ - case FFA_MSG_SEND_DIRECT_REQ2: /* Optional per 7.5.1 */ case FFA_MSG_SEND_DIRECT_RESP2: /* Optional per 7.5.1 */ case FFA_CONSOLE_LOG: /* Optional per 13.1: not in Table 13.1 */ case FFA_PARTITION_INFO_GET_REGS: /* Optional for virtual instances per 1= 3.1 */ return false; + case FFA_MSG_SEND_DIRECT_REQ2: /* Optional per 7.5.1 */ + return hyp_ffa_version >=3D FFA_VERSION_1_2; } =20 return true; @@ -880,7 +881,8 @@ static void do_ffa_part_get(struct arm_smccc_1_2_regs *= res, hyp_spin_unlock(&host_buffers.lock); } =20 -static void do_ffa_direct_msg(struct arm_smccc_1_2_regs *res, +static void do_ffa_direct_msg(const u64 func_id, + struct arm_smccc_1_2_regs *res, struct kvm_cpu_context *ctxt) { DECLARE_REG(u64, endp, ctxt, 1); @@ -894,8 +896,12 @@ static void do_ffa_direct_msg(struct arm_smccc_1_2_reg= s *res, return; } =20 - /* filter out framework messages and validate SBZ/MBZ bits */ - if (flags) { + /* + * filter out framework messages and validate SBZ/MBZ flag bits. + * FFA_MSG_SEND_DIRECT_REQ2 implies flag-less partition message. + */ + if ((func_id =3D=3D FFA_MSG_SEND_DIRECT_REQ || + func_id =3D=3D FFA_FN64_MSG_SEND_DIRECT_REQ) && flags) { ffa_to_smccc_error(res, FFA_RET_INVALID_PARAMETERS); return; } @@ -961,15 +967,20 @@ bool kvm_host_ffa_handler(struct kvm_cpu_context *hos= t_ctxt, u32 func_id) case FFA_PARTITION_INFO_GET: do_ffa_part_get(&res, host_ctxt); goto out_handled; + case FFA_MSG_SEND_DIRECT_REQ2: + if (!ffa_call_supported(func_id)) + goto out_not_supported; + fallthrough; case FFA_MSG_SEND_DIRECT_REQ: case FFA_FN64_MSG_SEND_DIRECT_REQ: - do_ffa_direct_msg(&res, host_ctxt); + do_ffa_direct_msg(func_id, &res, host_ctxt); goto out_handled; } =20 if (ffa_call_supported(func_id)) return false; /* Pass through */ =20 +out_not_supported: ffa_to_smccc_error(&res, FFA_RET_NOT_SUPPORTED); out_handled: ffa_set_retval(host_ctxt, &res); --=20 2.55.0.897.gb25b4bd76c-goog