qemu-arm.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH RFC 0/2] Add global device ID in virt machine
@ 2017-03-23 13:36 Diana Craciun
  2017-03-23 13:36 ` [Qemu-devel] [PATCH RFC 1/2] Increased the size of requester_id field from MemTxAttrs Diana Craciun
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Diana Craciun @ 2017-03-23 13:36 UTC (permalink / raw)
  To: qemu-devel, qemu-arm
  Cc: Diana Craciun, eric.auger, mike.caraman, bharat.bhushan,
	christoffer.dall, laurentiu.tudor

The NXP DPAA2 is a hardware architecture designed for high-speeed network
packet processing. The DPPA2 hardware components are managed by a hardware
component called the Management Complex (or MC) which provides an
object-base abstraction for software drivers to use the DPAA2 hardware.
For more details you can see: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/staging/fsl-mc/README.txt?h=v4.10

The interrupts generated by the DPPA2 hardware components are MSIs. We will add
support for direct assigning these DPPA2 components/objects to a virtual 
machine. However, this will add the need to expand the MSI usage in QEMU.

Currently the MSIs in QEMU are pretty much tied to PCI. For ARM the
GIC ITS is using a device ID for interrupt translation. Currently, for
PCI, the requester ID is used as device ID. This will not work when
we add another entity that needs also a device ID which is supposed to
be unique across the system.

My proposal is to add a static allocation in the virt machine. I considered
that this allocation is specific to each machine/platform. Currently only
virt machine has it, but other implementations may use the same mechanism
as well.
So, I used a static allocation with this formula:

DeviceID = zero_extend( RequesterID[15:0] ) + 0x10000 * Constant

This formula was taken from SBSA spec (Appendix I: DeviceID generation and
ITS groups). In case of QEMU the constant will be different for each entity.
In this way a unique DeviceID will be generated and the device ID will be
derived from a requesterID (in case of PCI) or other means in case of other
entities.

In order to have a clear picture of what I wanted to say, I have
implemented an RFC. There is a potential problem with this RFC,
the PCI tree is traversed each time a message is sent which can affect
performance. However if the general idea is good, solutions can be found
such as caching the device ID in the device itself.

Diana Craciun (2):
  Increased the size of requester_id field from MemTxAttrs
  Add a unique ID in the virt machine to be used as device ID

 hw/arm/virt.c                          | 26 ++++++++++++++++++++++++++
 hw/intc/arm_gicv3_its_common.c         |  2 +-
 hw/intc/arm_gicv3_its_kvm.c            |  2 +-
 hw/pci-host/gpex.c                     |  6 ++++++
 hw/pci/msi.c                           |  2 +-
 hw/pci/pci.c                           | 19 +++++++++++++++++++
 include/exec/memattrs.h                |  4 ++--
 include/hw/arm/virt.h                  |  1 +
 include/hw/intc/arm_gicv3_its_common.h |  2 +-
 include/hw/pci-host/gpex.h             |  2 ++
 include/hw/pci/pci.h                   |  2 ++
 kvm-all.c                              |  4 ++--
 12 files changed, 64 insertions(+), 8 deletions(-)

-- 
2.5.5


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

end of thread, other threads:[~2017-05-23 10:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-23 13:36 [Qemu-devel] [PATCH RFC 0/2] Add global device ID in virt machine Diana Craciun
2017-03-23 13:36 ` [Qemu-devel] [PATCH RFC 1/2] Increased the size of requester_id field from MemTxAttrs Diana Craciun
2017-04-04 12:27   ` [Qemu-arm] " Peter Maydell
2017-05-23 10:45     ` Diana Madalina Craciun
2017-03-23 13:36 ` [Qemu-devel] [PATCH RFC 2/2] Add a unique ID in the virt machine to be used as device ID Diana Craciun
2017-03-23 15:18 ` [Qemu-devel] [PATCH RFC 0/2] Add global device ID in virt machine no-reply

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).