[XEN PATCH v4 0/5] FF-A notifications

Jens Wiklander posted 5 patches 2 weeks, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20240502145645.1201613-1-jens.wiklander@linaro.org
xen/arch/arm/gic.c              |  12 +-
xen/arch/arm/include/asm/gic.h  |   2 +-
xen/arch/arm/irq.c              |  18 +-
xen/arch/arm/tee/Makefile       |   1 +
xen/arch/arm/tee/ffa.c          | 108 +++++---
xen/arch/arm/tee/ffa_notif.c    | 453 ++++++++++++++++++++++++++++++++
xen/arch/arm/tee/ffa_partinfo.c |   9 +-
xen/arch/arm/tee/ffa_private.h  |  60 ++++-
xen/arch/arm/tee/ffa_shm.c      |  33 +--
xen/include/public/arch-arm.h   |  14 +
10 files changed, 647 insertions(+), 63 deletions(-)
create mode 100644 xen/arch/arm/tee/ffa_notif.c
[XEN PATCH v4 0/5] FF-A notifications
Posted by Jens Wiklander 2 weeks, 3 days ago
Hi,

This patch set adds support for FF-A notifications. We only support
global notifications, per vCPU notifications remain unsupported.

The first three patches are further cleanup and can be merged before the
rest if desired.

A physical SGI is used to make Xen aware of pending FF-A notifications. The
physical SGI is selected by the SPMC in the secure world. Since it must not
already be used by Xen the SPMC is in practice forced to donate one of the
secure SGIs, but that's normally not a problem. The SGI handling in Xen is
updated to support registration of handlers for SGIs that aren't statically
assigned, that is, SGI IDs above GIC_SGI_MAX.

Two items stand out in the last patch, "xen/arm: ffa: support notification":
- The interrupt handler must be registered for each online CPU, but this
  will usually happen for the secondary CPUs after FF-A has been initialized
  so we may need to take some further action in the error path
- The interrupt handler need to get hold of the domain struct of a guest as
  indicated by the SPMC. In this patch set we use
  rcu_lock_live_remote_domain_by_id() to get a safe reference to the domain
  struct.

Thanks,
Jens

v3->v4:
- "xen/arm: ffa: support notification" and
  "xen/arm: allow dynamically assigned SGI handlers" updated as requestsed,
  details in each patch.

v2->v3:
- "xen/arm: ffa: support notification" and
  "xen/arm: allow dynamically assigned SGI handlers" updated as requestsed,
  details in each patch.

v1->v2:
- "xen/arm: ffa: support notification" and
  "xen/arm: allow dynamically assigned SGI handlers" updated as requestsed,
  details in each patch.
- Added Bertrands R-B for "xen/arm: ffa: refactor ffa_handle_call()",
  "xen/arm: ffa: use ACCESS_ONCE()", and
  "xen/arm: ffa: simplify ffa_handle_mem_share()"

Jens Wiklander (5):
  xen/arm: ffa: refactor ffa_handle_call()
  xen/arm: ffa: use ACCESS_ONCE()
  xen/arm: ffa: simplify ffa_handle_mem_share()
  xen/arm: allow dynamically assigned SGI handlers
  xen/arm: ffa: support notification

 xen/arch/arm/gic.c              |  12 +-
 xen/arch/arm/include/asm/gic.h  |   2 +-
 xen/arch/arm/irq.c              |  18 +-
 xen/arch/arm/tee/Makefile       |   1 +
 xen/arch/arm/tee/ffa.c          | 108 +++++---
 xen/arch/arm/tee/ffa_notif.c    | 453 ++++++++++++++++++++++++++++++++
 xen/arch/arm/tee/ffa_partinfo.c |   9 +-
 xen/arch/arm/tee/ffa_private.h  |  60 ++++-
 xen/arch/arm/tee/ffa_shm.c      |  33 +--
 xen/include/public/arch-arm.h   |  14 +
 10 files changed, 647 insertions(+), 63 deletions(-)
 create mode 100644 xen/arch/arm/tee/ffa_notif.c

-- 
2.34.1