From: Auger Eric <eric.auger@redhat.com>
To: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>,
"iommu@lists.linux-foundation.org"
<iommu@lists.linux-foundation.org>,
"devel@acpica.org" <devel@acpica.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"virtio-dev@lists.oasis-open.org"
<virtio-dev@lists.oasis-open.org>
Cc: "jasowang@redhat.com" <jasowang@redhat.com>,
"mst@redhat.com" <mst@redhat.com>,
"lv.zheng@intel.com" <lv.zheng@intel.com>,
"robert.moore@intel.com" <robert.moore@intel.com>,
"joro@8bytes.org" <joro@8bytes.org>,
"alex.williamson@redhat.com" <alex.williamson@redhat.com>,
Sudeep Holla <Sudeep.Holla@arm.com>,
"hanjun.guo@linaro.org" <hanjun.guo@linaro.org>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>,
"lenb@kernel.org" <lenb@kernel.org>,
"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
Marc Zyngier <Marc.Zyngier@arm.com>,
Robin Murphy <Robin.Murphy@arm.com>,
Will Deacon <Will.Deacon@arm.com>,
"bharat.bhushan@nxp.com" <bharat.bhushan@nxp.com>,
"Jayachandran.Nair@cavium.com" <Jayachandran.Nair@cavium.com>,
"ashok.raj@intel.com" <ashok.raj@intel.com>,
peterx@red
Subject: Re: [RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request
Date: Fri, 19 Jan 2018 18:22:30 +0100 [thread overview]
Message-ID: <bfefc181-4c25-8798-b304-dce2c68b1ba8@redhat.com> (raw)
In-Reply-To: <b9ede9e9-25a6-2848-e152-ffc61d560be8@arm.com>
Hi Jean-Philippe,
On 19/01/18 17:21, Jean-Philippe Brucker wrote:
> On 16/01/18 23:26, Auger Eric wrote:
> [...]
>>> + switch (mem->subtype) {
>>> + case VIRTIO_IOMMU_RESV_MEM_T_MSI:
>>> + region = iommu_alloc_resv_region(addr, size, prot,
>>> + IOMMU_RESV_MSI);
>> if (!region)
>> return -ENOMEM;
>>> + break;
>>> + case VIRTIO_IOMMU_RESV_MEM_T_RESERVED:
>>> + default:
>>> + region = iommu_alloc_resv_region(addr, size, 0,
>>> + IOMMU_RESV_RESERVED);
>> same.
>
> I'll add them, thanks
>
>> There is another issue related to the exclusion of iovas belonging to
>> reserved regions. Typically on x86, when attempting to run
>> virtio-blk-pci with iommu I eventually saw the driver using iova
>> belonging to the IOAPIC regions to map phys addr and this stalled qemu
>> with a drown trace:
>>
>> "virtio: bogus descriptor or out of resources"
>>
>> those regions need to be excluded from the iova allocator. This was
>> resolved by adding
>> if (iommu_dma_init_domain(domain,
>> vdev->viommu->geometry.aperture_start,
>> vdev->viommu->geometry.aperture_end,
>> dev))
>> in viommu_attach_dev()
>
> The most recent hack for x86 [1] does call iommu_dma_init_domain() in
> attach_dev(). Is it buggy?
Oh OK. Actually I have never used that branch and in my version the last
arg of iommu_dma_init_domain was NULL hence the issue. But I was
thinking more generally that care must be taken to exclude all those
regions.
Thanks
Eric
>
> We probably shouldn't call iommu_dma_init_domain() unconditionally
> (outside of CONFIG_X86 that is), since it's normally done by the arch
> (arch/arm64/mm/dma-mapping.c)
>
> Thanks,
> Jean
>
> [1]
> http://www.linux-arm.org/git?p=linux-jpb.git;a=commitdiff;h=e910e224b58712151dda06df595a53ff07edef63
> on branch virtio-iommu/v0.5-x86
>
next prev parent reply other threads:[~2018-01-19 17:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-17 18:52 [RFC PATCH v2 0/5] Add virtio-iommu driver Jean-Philippe Brucker
2017-11-17 18:52 ` [RFC PATCH v2 1/5] iommu: " Jean-Philippe Brucker
2017-11-29 15:17 ` [virtio-dev] " Jean-Philippe Brucker
2018-01-15 15:12 ` Auger Eric
2018-01-16 17:45 ` Jean-Philippe Brucker
2017-11-17 18:52 ` [RFC PATCH v2 2/5] iommu/virtio-iommu: Add probe request Jean-Philippe Brucker
2018-01-16 9:25 ` Auger Eric
2018-01-16 17:46 ` Jean-Philippe Brucker
2018-01-16 23:26 ` Auger Eric
2018-01-19 16:21 ` Jean-Philippe Brucker
2018-01-19 17:22 ` Auger Eric [this message]
2017-11-17 18:52 ` [RFC PATCH v2 3/5] iommu/virtio-iommu: Add event queue Jean-Philippe Brucker
2018-01-16 10:10 ` Auger Eric
2018-01-16 17:48 ` Jean-Philippe Brucker
2017-11-17 18:52 ` [RFC PATCH v2 4/5] ACPI/IORT: Support paravirtualized IOMMU Jean-Philippe Brucker
2017-11-29 15:17 ` [virtio-dev] " Jean-Philippe Brucker
2017-11-17 18:52 ` [RFC PATCH v2 5/5] ACPI/IORT: Move IORT to the ACPI folder 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=bfefc181-4c25-8798-b304-dce2c68b1ba8@redhat.com \
--to=eric.auger@redhat.com \
--cc=Jayachandran.Nair@cavium.com \
--cc=Lorenzo.Pieralisi@arm.com \
--cc=Marc.Zyngier@arm.com \
--cc=Robin.Murphy@arm.com \
--cc=Sudeep.Holla@arm.com \
--cc=Will.Deacon@arm.com \
--cc=alex.williamson@redhat.com \
--cc=ashok.raj@intel.com \
--cc=bharat.bhushan@nxp.com \
--cc=devel@acpica.org \
--cc=hanjun.guo@linaro.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jasowang@redhat.com \
--cc=jean-philippe.brucker@arm.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=mst@redhat.com \
--cc=peterx@red \
--cc=rjw@rjwysocki.net \
--cc=robert.moore@intel.com \
--cc=virtio-dev@lists.oasis-open.org \
--cc=virtualization@lists.linux-foundation.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 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).