All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC v2 0/6] zynqmp: Add forwarding of platform specific firmware calls
@ 2017-02-07 19:41 Edgar E. Iglesias
  2017-02-07 19:42 ` [RFC v2 1/6] xen/arm: traps: Reorder early overwrite of FID Edgar E. Iglesias
                   ` (5 more replies)
  0 siblings, 6 replies; 44+ messages in thread
From: Edgar E. Iglesias @ 2017-02-07 19:41 UTC (permalink / raw)
  To: xen-devel; +Cc: edgar.iglesias, julien.grall, sstabellini

From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>

The ZynqMP software stack has an extensive Firmware API based on EEMI:
https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf
https://www.xilinx.com/support/documentation/user_guides/ug1199-zynq-power-management.pdf

Software at EL1 is increasingly dependant on this API. In fact,
a large set of use-cases for Linux already require access to firmware.

Services provided by the API, among other things include:
* Clock Management
* PHY Configuration
* Power Management
* FPGA configuration
* etc

Adding support for accessing firmware can be done in two steps.

1. Allow the hw domain (dom0) to call into firmware. This enables
   all devices to work with PV setups.

2. Allow other guests to use the Firmware API. This will be needed
   to fully support device pass-through.
   We cannot give un-supervised access to unprivileged guests, so
   the idea is to mediate these calls in Xen or in dom0.
   Mediation mainly consists of verfifying access to calls,
   modifying calls and sometimes blocking them.

This patch series implements step #2.

There are quite a few options on how to implement step #2, e.g:
1. Trap HVC/SMC calls from unpriv guests and handle them in dom0.
   This could be done in a user-space agent.
2. Add a PV protocol carrying these calls.
3. Add several generic PV protocols carrying a set of platform independent
   generic calls that get translated or mapped to firmware calls
   in dom0. E.g PV-Clock, PV-Power, PV-FPGA.
4. Same as #1 but doing it all in Xen.
5. Others??

A benefit with #1 and #4 is that we could support unmodified bare-metal
guests. Such guests would continue to issue SMC calls from EL1 just as
if they were running without a hypervisor.

This patch series implements step #2 according to option #4.

EEMI has 3 kinds of resources it operates on.
1. Nodes (can be anything, a device, a CPU, a bus, a PLL)
2. Reset lines
3. MMIO accesses (i.e direct register access)

This implementation relies on the assumption that these
can be associated to a real device with some kind of
register area controlling it. If a guest has access to these
registers (e.g by being granted access via iomem), the
guest is allowed to control the node.

So, we map Nodes and rest-lines to memory addresses and check if
the guest issuing the call has access the device's control regs.

For direct MMIO calls, we map addresses and bitfields within registers
into nodes that get checked for guest ownership.

Guests are only allowed to power up/down and reset devices that are
in their control.

Certain calls, nodes and registers cannot be mapped (yet) to guests.
These fall mostly under dom0's control. A few calls are never allowed
(e.g turning off the current CPU or powering off DDR).

Any feedback would be much appreciated.

Thanks and Best regards!
Edgar

ChangeLog:

v1 -> v2:
* Advance PC after successfully processing an SMC
* Add implementation of a ZynqMP EEMI Mediator

Edgar E. Iglesias (6):
  xen/arm: traps: Reorder early overwrite of FID
  xen/arm: Introduce platform_hvc
  xen/arm: Allow platform_hvc to handle guest SMC calls
  xen/arm: Introduce call_smcc64
  xen/arm: zynqmp: Forward plaform specific firmware calls
  xen/arm: zynqmp: Remove blacklist of ZynqMP's PM node

 xen/arch/arm/platform.c                            |   8 +
 xen/arch/arm/platforms/Makefile                    |   1 +
 xen/arch/arm/platforms/xilinx-zynqmp-eemi.c        | 794 +++++++++++++++++++++
 xen/arch/arm/platforms/xilinx-zynqmp.c             |  22 +-
 xen/arch/arm/traps.c                               |  15 +-
 xen/include/asm-arm/platform.h                     |   5 +
 xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h | 337 +++++++++
 xen/include/asm-arm/platforms/xilinx-zynqmp-mm.h   | 284 ++++++++
 xen/include/asm-arm/processor.h                    |  40 ++
 9 files changed, 1498 insertions(+), 8 deletions(-)
 create mode 100644 xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
 create mode 100644 xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
 create mode 100644 xen/include/asm-arm/platforms/xilinx-zynqmp-mm.h

-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2017-08-01 11:40 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 19:41 [RFC v2 0/6] zynqmp: Add forwarding of platform specific firmware calls Edgar E. Iglesias
2017-02-07 19:42 ` [RFC v2 1/6] xen/arm: traps: Reorder early overwrite of FID Edgar E. Iglesias
2017-02-13 22:06   ` Stefano Stabellini
2017-02-07 19:42 ` [RFC v2 2/6] xen/arm: Introduce platform_hvc Edgar E. Iglesias
2017-02-13 22:08   ` Stefano Stabellini
2017-07-31 21:30     ` Edgar E. Iglesias
2017-02-07 19:42 ` [RFC v2 3/6] xen/arm: Allow platform_hvc to handle guest SMC calls Edgar E. Iglesias
2017-02-07 20:38   ` Tamas K Lengyel
2017-02-07 20:51     ` Julien Grall
2017-02-08  0:24       ` Tamas K Lengyel
2017-02-08  8:31         ` Edgar E. Iglesias
2017-02-08 16:40           ` Tamas K Lengyel
2017-02-08 16:58             ` Julien Grall
2017-02-08 17:21               ` Tamas K Lengyel
2017-02-08 17:29               ` Edgar E. Iglesias
2017-02-08 19:40                 ` Edgar E. Iglesias
2017-02-08 20:15                   ` Tamas K Lengyel
2017-02-08 22:04                     ` Julien Grall
2017-02-08 23:28                       ` Tamas K Lengyel
2017-02-09  0:08                         ` Julien Grall
2017-02-09  1:20                           ` Stefano Stabellini
2017-02-09  9:12                             ` Edgar E. Iglesias
2017-02-09  9:27                               ` Edgar E. Iglesias
2017-02-09 18:22                                 ` Stefano Stabellini
2017-02-09 18:25                                   ` Tamas K Lengyel
2017-02-09 18:43                                     ` Stefano Stabellini
2017-02-09 19:32                                       ` Tamas K Lengyel
2017-07-31 22:23                                         ` Edgar E. Iglesias
2017-08-01 10:37                                           ` Julien Grall
2017-08-01 11:40                                             ` Edgar E. Iglesias
2017-02-09 16:46                           ` Volodymyr Babchuk
2017-02-09 18:11                           ` Tamas K Lengyel
2017-02-09 18:39                             ` Julien Grall
2017-02-09 19:42                               ` Tamas K Lengyel
2017-02-09 20:01                                 ` Edgar E. Iglesias
2017-02-09 20:36                                   ` Tamas K Lengyel
2017-02-09 14:46                       ` Edgar E. Iglesias
2017-02-07 19:42 ` [RFC v2 4/6] xen/arm: Introduce call_smcc64 Edgar E. Iglesias
2017-02-13 22:11   ` Stefano Stabellini
2017-02-07 19:42 ` [RFC v2 5/6] xen/arm: zynqmp: Forward plaform specific firmware calls Edgar E. Iglesias
2017-02-14  0:02   ` Stefano Stabellini
2017-02-17 18:47   ` Julien Grall
2017-02-07 19:42 ` [RFC v2 6/6] xen/arm: zynqmp: Remove blacklist of ZynqMP's PM node Edgar E. Iglesias
2017-02-14  0:03   ` Stefano Stabellini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.