Skip to content

Commit a4e8473

Browse files
LeviYeoReumSudeep Holla
authored andcommitted
firmware: arm_ffa: Remove vm_id argument in ffa_rxtx_unmap()
According to the FF-A specification (DEN0077, v1.1, §13.7), when FFA_RXTX_UNMAP is invoked from any instance other than non-secure physical, the w1 register must be zero (MBZ). If a non-zero value is supplied in this context, the SPMC must return FFA_INVALID_PARAMETER. The Arm FF-A driver operates exclusively as a guest or non-secure physical instance where the partition ID is always zero and is not invoked from a hypervisor context where w1 carries a VM ID. In this execution model, the partition ID observed by the driver is always zero, and passing a VM ID is unnecessary and potentially invalid. Remove the vm_id parameter from ffa_rxtx_unmap() and ensure that the SMC call is issued with w1 implicitly zeroed, as required by the specification. This prevents invalid parameter errors and aligns the implementation with the defined FF-A ABI behavior. Fixes: 3bbfe98 ("firmware: arm_ffa: Add initial Arm FFA driver support") Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com> Message-Id: <20260304120953.847671-1-yeoreum.yun@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
1 parent 6de23f8 commit a4e8473

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/firmware/arm_ffa/driver.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ static int ffa_rxtx_map(phys_addr_t tx_buf, phys_addr_t rx_buf, u32 pg_cnt)
205205
return 0;
206206
}
207207

208-
static int ffa_rxtx_unmap(u16 vm_id)
208+
static int ffa_rxtx_unmap(void)
209209
{
210210
ffa_value_t ret;
211211

212212
invoke_ffa_fn((ffa_value_t){
213-
.a0 = FFA_RXTX_UNMAP, .a1 = PACK_TARGET_INFO(vm_id, 0),
213+
.a0 = FFA_RXTX_UNMAP,
214214
}, &ret);
215215

216216
if (ret.a0 == FFA_ERROR)
@@ -2097,7 +2097,7 @@ static int __init ffa_init(void)
20972097

20982098
pr_err("failed to setup partitions\n");
20992099
ffa_notifications_cleanup();
2100-
ffa_rxtx_unmap(drv_info->vm_id);
2100+
ffa_rxtx_unmap();
21012101
free_pages:
21022102
if (drv_info->tx_buffer)
21032103
free_pages_exact(drv_info->tx_buffer, rxtx_bufsz);
@@ -2112,7 +2112,7 @@ static void __exit ffa_exit(void)
21122112
{
21132113
ffa_notifications_cleanup();
21142114
ffa_partitions_cleanup();
2115-
ffa_rxtx_unmap(drv_info->vm_id);
2115+
ffa_rxtx_unmap();
21162116
free_pages_exact(drv_info->tx_buffer, drv_info->rxtx_bufsz);
21172117
free_pages_exact(drv_info->rx_buffer, drv_info->rxtx_bufsz);
21182118
kfree(drv_info);

0 commit comments

Comments
 (0)