From: "Michael S. Tsirkin" <mst@redhat.com>
To: Diana Craciun <diana.craciun@nxp.com>
Cc: qemu-devel@nongnu.org, eric.auger@redhat.com,
mike.caraman@nxp.com, qemu-arm@nongnu.org, marcel@redhat.com,
bharat.bhushan@nxp.com, christoffer.dall@linaro.org,
laurentiu.tudor@nxp.com
Subject: Re: [Qemu-arm] [PATCH v2 0/2] Add global device ID in virt machine
Date: Thu, 25 May 2017 01:12:16 +0300 [thread overview]
Message-ID: <20170525011034-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1495537965-4187-1-git-send-email-diana.craciun@nxp.com>
On Tue, May 23, 2017 at 02:12:43PM +0300, Diana Craciun wrote:
> The NXP DPAA2 is a hardware architecture designed for high-speeed network
> packet processing. The DPAA2 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 DPAA2 hardware components are MSIs. We will add
> support for direct assigning these DPAA2 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.
>
> The implementation is generic as there might be in the future other non-pci devices
> that are using MSIs or IOMMU. Any architecture can use it, though currently
> only the ARM architecture is using the function that retrieves the stream ID. I
> did not change all the replacements of the pci_requester_id (with pci_stream_id)
> in the code (although if the constant is 0, the stream_id is equal with requester_id).
> The other architectures (e.g. intel iommu code) assume that the ID is the
> requester ID.
>
> Tested on NXP LS2080 platform.
>
> History:
I am confused. I get it that non-PCI things want something else
in their requester ID, but why require it for PCI devices?
How about using Constant == 0 for PCI? This way you do
not need to touch PCI at all as DeviceID == RequesterID ...
> v1->v2
> ------
> - the stream ID was added as a field in the pci device structure in order
> not to traverse the PCI hierarchy each time a MSI is sent.
>
>
> 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/i386/amd_iommu.c | 2 +-
> hw/i386/intel_iommu.c | 2 +-
> 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 | 25 +++++++++++++++++++++++++
> 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 | 8 ++++++++
> kvm-all.c | 4 ++--
> 14 files changed, 78 insertions(+), 10 deletions(-)
>
> --
> 2.5.5
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Diana Craciun <diana.craciun@nxp.com>
Cc: qemu-devel@nongnu.org, qemu-arm@nongnu.org,
christoffer.dall@linaro.org, marcel@redhat.com,
eric.auger@redhat.com, bharat.bhushan@nxp.com,
mike.caraman@nxp.com, laurentiu.tudor@nxp.com
Subject: Re: [Qemu-devel] [PATCH v2 0/2] Add global device ID in virt machine
Date: Thu, 25 May 2017 01:12:16 +0300 [thread overview]
Message-ID: <20170525011034-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1495537965-4187-1-git-send-email-diana.craciun@nxp.com>
On Tue, May 23, 2017 at 02:12:43PM +0300, Diana Craciun wrote:
> The NXP DPAA2 is a hardware architecture designed for high-speeed network
> packet processing. The DPAA2 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 DPAA2 hardware components are MSIs. We will add
> support for direct assigning these DPAA2 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.
>
> The implementation is generic as there might be in the future other non-pci devices
> that are using MSIs or IOMMU. Any architecture can use it, though currently
> only the ARM architecture is using the function that retrieves the stream ID. I
> did not change all the replacements of the pci_requester_id (with pci_stream_id)
> in the code (although if the constant is 0, the stream_id is equal with requester_id).
> The other architectures (e.g. intel iommu code) assume that the ID is the
> requester ID.
>
> Tested on NXP LS2080 platform.
>
> History:
I am confused. I get it that non-PCI things want something else
in their requester ID, but why require it for PCI devices?
How about using Constant == 0 for PCI? This way you do
not need to touch PCI at all as DeviceID == RequesterID ...
> v1->v2
> ------
> - the stream ID was added as a field in the pci device structure in order
> not to traverse the PCI hierarchy each time a MSI is sent.
>
>
> 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/i386/amd_iommu.c | 2 +-
> hw/i386/intel_iommu.c | 2 +-
> 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 | 25 +++++++++++++++++++++++++
> 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 | 8 ++++++++
> kvm-all.c | 4 ++--
> 14 files changed, 78 insertions(+), 10 deletions(-)
>
> --
> 2.5.5
next prev parent reply other threads:[~2017-05-24 22:12 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-23 11:12 [Qemu-devel] [PATCH v2 0/2] Add global device ID in virt machine Diana Craciun
2017-05-23 11:12 ` Diana Craciun
2017-05-23 11:12 ` [Qemu-arm] [PATCH v2 1/2] Increased the size of requester_id field from MemTxAttrs Diana Craciun
2017-05-23 11:12 ` [Qemu-devel] " Diana Craciun
2017-07-26 12:22 ` [Qemu-arm] " Auger Eric
2017-07-26 12:22 ` Auger Eric
2017-08-11 14:32 ` [Qemu-arm] " Diana Madalina Craciun
2017-08-11 14:32 ` Diana Madalina Craciun
2017-08-11 16:50 ` [Qemu-arm] " Peter Maydell
2017-08-11 16:50 ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2017-05-23 11:12 ` [Qemu-devel] [PATCH v2 2/2] Add a unique ID in the virt machine to be used as device ID Diana Craciun
2017-05-23 11:12 ` Diana Craciun
2017-07-26 12:22 ` Auger Eric
2017-07-26 12:22 ` Auger Eric
2017-07-31 15:16 ` Edgar E. Iglesias
2017-07-31 15:16 ` Edgar E. Iglesias
2017-07-31 15:39 ` [Qemu-arm] " Edgar E. Iglesias
2017-07-31 15:39 ` Edgar E. Iglesias
2017-08-11 14:35 ` Diana Madalina Craciun
2017-08-11 14:35 ` Diana Madalina Craciun
2017-08-11 15:50 ` [Qemu-arm] " Edgar E. Iglesias
2017-08-11 15:50 ` Edgar E. Iglesias
2017-08-22 15:13 ` Diana Madalina Craciun
2017-08-22 15:13 ` Diana Madalina Craciun
2017-08-22 19:04 ` [Qemu-arm] " Michael S. Tsirkin
2017-08-22 19:04 ` Michael S. Tsirkin
2017-08-23 20:09 ` [Qemu-arm] " Edgar E. Iglesias
2017-08-23 20:09 ` Edgar E. Iglesias
2017-09-01 14:32 ` [Qemu-arm] " Diana Madalina Craciun
2017-09-01 14:32 ` Diana Madalina Craciun
2017-09-01 15:32 ` [Qemu-arm] " Michael S. Tsirkin
2017-09-01 15:32 ` Michael S. Tsirkin
2017-09-01 13:21 ` Diana Madalina Craciun
2017-09-01 13:21 ` Diana Madalina Craciun
2017-08-11 14:34 ` [Qemu-arm] " Diana Madalina Craciun
2017-08-11 14:34 ` [Qemu-devel] " Diana Madalina Craciun
2017-05-24 22:12 ` Michael S. Tsirkin [this message]
2017-05-24 22:12 ` [Qemu-devel] [PATCH v2 0/2] Add global device ID in virt machine Michael S. Tsirkin
2017-05-31 12:02 ` [Qemu-arm] " Diana Madalina Craciun
2017-05-31 12:02 ` [Qemu-devel] " Diana Madalina Craciun
2017-07-05 23:44 ` [Qemu-arm] " Michael S. Tsirkin
2017-07-05 23:44 ` [Qemu-devel] " Michael S. Tsirkin
2017-07-31 13:22 ` [Qemu-arm] " Diana Madalina Craciun
2017-07-31 13:22 ` [Qemu-devel] " Diana Madalina Craciun
2017-07-31 14:06 ` [Qemu-arm] " Michael S. Tsirkin
2017-07-31 14:06 ` [Qemu-devel] " Michael S. Tsirkin
2017-07-31 15:13 ` Diana Madalina Craciun
2017-07-31 15:13 ` Diana Madalina Craciun
2017-08-01 2:05 ` [Qemu-arm] " Michael S. Tsirkin
2017-08-01 2:05 ` [Qemu-devel] " Michael S. Tsirkin
2017-08-01 8:30 ` [Qemu-arm] " Edgar E. Iglesias
2017-08-01 8:30 ` [Qemu-devel] " Edgar E. Iglesias
2017-08-11 14:31 ` [Qemu-devel] " Diana Madalina Craciun
2017-08-11 14:31 ` Diana Madalina Craciun
2017-07-04 7:15 ` [Qemu-arm] " Diana Madalina Craciun
2017-07-04 7:15 ` [Qemu-devel] " Diana Madalina Craciun
2017-07-10 17:10 ` Peter Maydell
2017-07-10 17:10 ` Peter Maydell
2017-07-21 11:47 ` [Qemu-arm] " Mike Caraman
2017-07-21 11:47 ` Mike Caraman
2017-07-31 13:16 ` Diana Madalina Craciun
2017-07-31 13:16 ` Diana Madalina Craciun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170525011034-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=bharat.bhushan@nxp.com \
--cc=christoffer.dall@linaro.org \
--cc=diana.craciun@nxp.com \
--cc=eric.auger@redhat.com \
--cc=laurentiu.tudor@nxp.com \
--cc=marcel@redhat.com \
--cc=mike.caraman@nxp.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.