devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Cc: mark.rutland@arm.com, virtio-dev@lists.oasis-open.org,
	lorenzo.pieralisi@arm.com, tnowicki@caviumnetworks.com,
	devicetree@vger.kernel.org, marc.zyngier@arm.com,
	linux-pci@vger.kernel.org, joro@8bytes.org, will.deacon@arm.com,
	virtualization@lists.linux-foundation.org, eric.auger@redhat.com,
	iommu@lists.linux-foundation.org, robh+dt@kernel.org,
	bhelgaas@google.com, robin.murphy@arm.com,
	kvmarm@lists.cs.columbia.edu
Subject: Re: [PATCH v5 5/7] iommu: Add virtio-iommu driver
Date: Tue, 27 Nov 2018 13:10:10 -0500	[thread overview]
Message-ID: <20181127130527-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <e76a51ba-7a0f-3fca-a1ae-640131f9dfe1@arm.com>

On Tue, Nov 27, 2018 at 05:55:20PM +0000, Jean-Philippe Brucker wrote:
> On 23/11/2018 21:56, Michael S. Tsirkin wrote:
> >> +config VIRTIO_IOMMU
> >> +	bool "Virtio IOMMU driver"
> >> +	depends on VIRTIO=y
> >> +	select IOMMU_API
> >> +	select INTERVAL_TREE
> >> +	select ARM_DMA_USE_IOMMU if ARM
> >> +	help
> >> +	  Para-virtualised IOMMU driver with virtio.
> >> +
> >> +	  Say Y here if you intend to run this kernel as a guest.
> >> +
> > 
> > Given it is arm specific right now, shouldn't this depend on ARM?
> > E.g. there's a hack for x86 right now.
> 
> Sure, I'll make it depend on ARM64 for now
> 
> [..]
> >> +static int viommu_probe(struct virtio_device *vdev)
> >> +{
> >> +	struct device *parent_dev = vdev->dev.parent;
> >> +	struct viommu_dev *viommu = NULL;
> >> +	struct device *dev = &vdev->dev;
> >> +	u64 input_start = 0;
> >> +	u64 input_end = -1UL;
> >> +	int ret;
> >> +
> >> +	if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1) ||
> >> +	    !virtio_has_feature(vdev, VIRTIO_IOMMU_F_MAP_UNMAP))
> > 
> > Why bother with a feature bit for this then btw?
> 
> We'll need a new feature bit for sharing page tables with the hardware,
> because they require different requests (attach_table/invalidate instead
> of map/unmap.) A future device supporting page table sharing won't
> necessarily need to support map/unmap.
> 
> Thanks,
> Jean

I don't see virtio iommu being extended to support ARM specific
requests. This just won't scale, too many different
descriptor formats out there.

If you want to go that way down the road, you should avoid
virtio iommu, instead emulate and share code with the ARM SMMU (probably
with a different vendor id so you can implement the
report on map for devices without PRI).

Others on the TC might feel differently.

If someone's looking into adding virtio iommu support in hardware,
that's a different matter. Which is it?

-- 
MST

  reply	other threads:[~2018-11-27 18:10 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 19:37 [PATCH v5 0/7] Add virtio-iommu driver Jean-Philippe Brucker
2018-11-22 19:37 ` [PATCH v5 1/7] dt-bindings: virtio-mmio: Add IOMMU description Jean-Philippe Brucker
2018-11-22 19:37 ` [PATCH v5 2/7] dt-bindings: virtio: Add virtio-pci-iommu node Jean-Philippe Brucker
2018-11-22 19:37 ` [PATCH v5 3/7] of: Allow the iommu-map property to omit untranslated devices Jean-Philippe Brucker
2018-11-22 19:37 ` [PATCH v5 4/7] PCI: OF: Initialize dev->fwnode appropriately Jean-Philippe Brucker
2018-11-22 19:37 ` [PATCH v5 5/7] iommu: Add virtio-iommu driver Jean-Philippe Brucker
     [not found]   ` <20181122193801.50510-6-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-11-23  8:27     ` Auger Eric
2018-11-23 21:48   ` Michael S. Tsirkin
2018-11-27 17:58     ` Jean-Philippe Brucker
2018-11-27 18:10       ` Michael S. Tsirkin
2018-11-23 21:56   ` Michael S. Tsirkin
2018-11-27 17:55     ` Jean-Philippe Brucker
2018-11-27 18:10       ` Michael S. Tsirkin [this message]
2018-12-07 18:52         ` Jean-Philippe Brucker
     [not found]           ` <e1dde79c-0bc4-ea99-1bb0-9e70b56955fb-5wv7dgnIgG8@public.gmane.org>
2018-12-12 14:56             ` [virtio-dev] " Michael S. Tsirkin
     [not found]               ` <20181212093709-mutt-send-email-mst-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-12-12 15:27                 ` Auger Eric
2018-12-13 12:37                   ` Robin Murphy
2018-12-13 14:13                     ` Auger Eric
2018-11-23 22:02   ` Michael S. Tsirkin
2018-11-27 17:50     ` Jean-Philippe Brucker
2018-11-27 18:04       ` Michael S. Tsirkin
2018-11-27 18:10         ` Jean-Philippe Brucker
2018-11-27 18:53           ` Michael S. Tsirkin
2018-12-10 15:06             ` Jean-Philippe Brucker
2018-12-10 22:53               ` Michael S. Tsirkin
     [not found]                 ` <20181210175132-mutt-send-email-mst-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-12-11 16:29                   ` Jean-Philippe Brucker
2018-11-27 18:13       ` Michael S. Tsirkin
2018-11-22 19:38 ` [PATCH v5 6/7] iommu/virtio: Add probe request Jean-Philippe Brucker
2018-11-22 19:38 ` [PATCH v5 7/7] iommu/virtio: Add event queue Jean-Philippe Brucker
2018-11-23  8:28 ` [PATCH v5 0/7] Add virtio-iommu driver Auger Eric
2018-11-27  7:09   ` Bharat Bhushan
     [not found] ` <20181122193801.50510-1-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-11-27 16:53   ` Michael S. Tsirkin
2018-11-27 17:09     ` Auger Eric
     [not found]       ` <6c061729-c404-ac25-f86f-7fe222bf5bc7-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-11-27 17:16         ` Michael S. Tsirkin
2018-11-27 18:02           ` Auger Eric
2018-12-03 13:27           ` Auger Eric

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=20181127130527-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eric.auger@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jean-philippe.brucker@arm.com \
    --cc=joro@8bytes.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=tnowicki@caviumnetworks.com \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=will.deacon@arm.com \
    /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 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).