Skip to content

Commit 12cfeb6

Browse files
committed
firmware: arm_ffa: Skip creation of the notification bitmaps
JIRA: https://issues.redhat.com/browse/RHEL-102691 commit 2b9c66d Author: Jens Wiklander <jens.wiklander@linaro.org> Date: Thu, 11 Apr 2024 13:57:32 +0100 When the FF-A driver is running inside a guest VM under an hypervisor, the driver/guest VM doesn't have the permission/capability to request the creation of notification bitmaps. For a VM, the hypervisor reserves memory for its VM and hypervisor framework notification bitmaps and the SPMC reserves memory for its SP and SPMC framework notification bitmaps before the hypervisor initializes it. The hypervisor does not initialize a VM if memory cannot be reserved for all its notification bitmaps. So the creation of all the necessary bitmaps are already done when the driver initialises and hence it can be skipped. We rely on FFA_FEATURES(FFA_NOTIFICATION_BITMAP_CREATE) to fail when running in the guest to handle this in the driver. Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org> Link: https://lore.kernel.org/r/20240411-ffa_npi_support-v2-1-927a670254e6@arm.com Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
1 parent 26df26d commit 12cfeb6

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

drivers/firmware/arm_ffa/driver.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,17 +1442,15 @@ static void ffa_notifications_setup(void)
14421442
int ret, irq;
14431443

14441444
ret = ffa_features(FFA_NOTIFICATION_BITMAP_CREATE, 0, NULL, NULL);
1445-
if (ret) {
1446-
pr_info("Notifications not supported, continuing with it ..\n");
1447-
return;
1448-
}
1445+
if (!ret) {
1446+
ret = ffa_notification_bitmap_create();
1447+
if (ret) {
1448+
pr_err("Notification bitmap create error %d\n", ret);
1449+
return;
1450+
}
14491451

1450-
ret = ffa_notification_bitmap_create();
1451-
if (ret) {
1452-
pr_info("Notification bitmap create error %d\n", ret);
1453-
return;
1452+
drv_info->bitmap_created = true;
14541453
}
1455-
drv_info->bitmap_created = true;
14561454

14571455
irq = ffa_sched_recv_irq_map();
14581456
if (irq <= 0) {

0 commit comments

Comments
 (0)