devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
To: iommu@lists.linux-foundation.org, kvm@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	virtio-dev@lists.oasis-open.org, devicetree@vger.kernel.org,
	kvmarm@lists.cs.columbia.edu
Cc: joro@8bytes.org, alex.williamson@redhat.com, robh+dt@kernel.org,
	mark.rutland@arm.com, mst@redhat.com, jasowang@redhat.com,
	marc.zyngier@arm.com, robin.murphy@arm.com, will.deacon@arm.com,
	lorenzo.pieralisi@arm.com, eric.auger@redhat.com,
	peterx@redhat.com, bharat.bhushan@nxp.com,
	tnowicki@caviumnetworks.com, jayachandran.nair@cavium.com,
	kevin.tian@intel.com
Subject: Re: [PATCH v2 3/5] iommu/virtio: Add probe request
Date: Tue, 26 Jun 2018 18:59:26 +0100	[thread overview]
Message-ID: <057c626c-f870-f99e-93f0-058cd75b02b9@arm.com> (raw)
In-Reply-To: <20180621190655.56391-4-jean-philippe.brucker@arm.com>

On 21/06/18 20:06, Jean-Philippe Brucker wrote:
> +static int viommu_add_resv_mem(struct viommu_endpoint *vdev,
> +			       struct virtio_iommu_probe_resv_mem *mem,
> +			       size_t len)
> +{
> +	struct iommu_resv_region *region = NULL;
> +	unsigned long prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO;
> +
> +	u64 start = le64_to_cpu(mem->start);
> +	u64 end = le64_to_cpu(mem->end);
> +	size_t size = end - start + 1;
> +
> +	if (len < sizeof(*mem))
> +		return -EINVAL;
> +
> +	switch (mem->subtype) {
> +	default:
> +		if (mem->subtype != VIRTIO_IOMMU_RESV_MEM_T_RESERVED &&
> +		    mem->subtype != VIRTIO_IOMMU_RESV_MEM_T_MSI)

Hm, I messed it up while rebasing. I'll remove this condition.

Thanks,
Jean

> +			dev_warn(vdev->dev, "unknown resv mem subtype 0x%x\n",
> +				 mem->subtype);
> +		/* Fall-through */
> +	case VIRTIO_IOMMU_RESV_MEM_T_RESERVED:
> +		region = iommu_alloc_resv_region(start, size, 0,
> +						 IOMMU_RESV_RESERVED);
> +		break;
> +	case VIRTIO_IOMMU_RESV_MEM_T_MSI:
> +		region = iommu_alloc_resv_region(start, size, prot,
> +						 IOMMU_RESV_MSI);
> +		break;
> +	}
> +
> +	list_add(&vdev->resv_regions, &region->list);
> +	return 0;
> +}

  parent reply	other threads:[~2018-06-26 17:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21 19:06 [PATCH v2 0/5] Add virtio-iommu driver Jean-Philippe Brucker
2018-06-21 19:06 ` [PATCH v2 1/5] dt-bindings: virtio: Specify #iommu-cells value for a virtio-iommu Jean-Philippe Brucker
2018-06-25 19:27   ` Rob Herring
2018-06-26 17:58     ` Jean-Philippe Brucker
     [not found]       ` <89d31865-ee35-ef8c-f7b3-f3acf2bbd30e-5wv7dgnIgG8@public.gmane.org>
2018-06-27 17:46         ` Rob Herring
     [not found]           ` <CAL_JsqLdahF+2VsH9h658z9guO0XmqHM75QLaHApZLNP8twUNA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-07-04 11:45             ` Robin Murphy
2018-06-21 19:06 ` [PATCH v2 2/5] iommu: Add virtio-iommu driver Jean-Philippe Brucker
     [not found]   ` <20180621190655.56391-3-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-06-22  0:51     ` Michael S. Tsirkin
     [not found]       ` <20180622033720-mutt-send-email-mst-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2018-06-25 17:52         ` Jean-Philippe Brucker
2018-06-21 19:06 ` [PATCH v2 3/5] iommu/virtio: Add probe request Jean-Philippe Brucker
     [not found]   ` <20180621190655.56391-4-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-06-22  0:55     ` Michael S. Tsirkin
2018-06-25 17:52       ` Jean-Philippe Brucker
2018-06-26 17:59   ` Jean-Philippe Brucker [this message]
2018-06-21 19:06 ` [PATCH v2 4/5] iommu/virtio: Add event queue Jean-Philippe Brucker
2018-06-21 19:06 ` [PATCH v2 5/5] vfio: Allow type-1 IOMMU instantiation for ARM Jean-Philippe Brucker
     [not found] ` <20180621190655.56391-1-jean-philippe.brucker-5wv7dgnIgG8@public.gmane.org>
2018-06-26 18:07   ` [PATCH v2 0/5] Add virtio-iommu driver Michael S. Tsirkin
2018-06-27 18:04     ` Jean-Philippe Brucker
2018-06-27 19:59       ` Michael S. Tsirkin
2018-06-28  9:40         ` Peter Maydell
2018-07-04 11:25         ` Jean-Philippe Brucker

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=057c626c-f870-f99e-93f0-058cd75b02b9@arm.com \
    --to=jean-philippe.brucker@arm.com \
    --cc=alex.williamson@redhat.com \
    --cc=bharat.bhushan@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=eric.auger@redhat.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=jasowang@redhat.com \
    --cc=jayachandran.nair@cavium.com \
    --cc=joro@8bytes.org \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=mst@redhat.com \
    --cc=peterx@redhat.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).