Skip to content

Commit

Permalink
firmware: arm_ffa: Skip creation of the notification bitmaps
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jenswi-linaro authored and sudeep-holla committed Apr 15, 2024
1 parent 4cece76 commit 2b9c66d
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions drivers/firmware/arm_ffa/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,17 +1442,15 @@ static void ffa_notifications_setup(void)
int ret, irq;

ret = ffa_features(FFA_NOTIFICATION_BITMAP_CREATE, 0, NULL, NULL);
if (ret) {
pr_info("Notifications not supported, continuing with it ..\n");
return;
}
if (!ret) {
ret = ffa_notification_bitmap_create();
if (ret) {
pr_err("Notification bitmap create error %d\n", ret);
return;
}

ret = ffa_notification_bitmap_create();
if (ret) {
pr_info("Notification bitmap create error %d\n", ret);
return;
drv_info->bitmap_created = true;
}
drv_info->bitmap_created = true;

irq = ffa_sched_recv_irq_map();
if (irq <= 0) {
Expand Down

0 comments on commit 2b9c66d

Please sign in to comment.