From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Wei Liu <wei.liu2@citrix.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
Julien Grall <julien.grall@arm.com>,
xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 4/4] x86/iommu: add PVH support to the inclusive options
Date: Tue, 31 Jul 2018 17:15:22 +0200 [thread overview]
Message-ID: <20180731151522.gnhoydkm42vloldi@mac> (raw)
In-Reply-To: <5B60779E02000078001D9898@prv1-mh.provo.novell.com>
On Tue, Jul 31, 2018 at 08:52:14AM -0600, Jan Beulich wrote:
> >>> On 27.07.18 at 17:31, <roger.pau@citrix.com> wrote:
> > Several people have reported hardware issues (malfunctioning USB
> > controllers) due to iommu page faults. Those faults are caused by
> > missing RMRR (VTd) or IRVS (AMD-Vi) entries in the ACPI tables. Those
> > can be worked around on VTd hardware by manually adding RMRR entries
> > on the command line, this is however limited to Intel hardware and
> > quite cumbersome to do.
> >
> > In order to solve those issues add PVH support to the inclusive option
> > that identity maps all regions marked as reserved in the memory map.
> > Note that regions used by devices emulated by Xen (LAPIC, IO-APIC or
> > PCIe MCFG regions) are specifically avoided. Note that this option
> > currently relies on no MSIX MMIO areas residing in a reserved region,
> > or else Xen won't be able to trap those accesses.
>
> But that would be a firmware bug anyway: These are sub-ranges
> of PCI device BARs, and those must not overlap reserved ranges
> in E820.
Considering this is already a workaround for broken firmware I won't
be surprised that on certain hardware BARs overlap with reserved
ranges.
> > --- a/xen/drivers/passthrough/x86/iommu.c
> > +++ b/xen/drivers/passthrough/x86/iommu.c
> > @@ -20,6 +20,8 @@
> > #include <xen/softirq.h>
> > #include <xsm/xsm.h>
> >
> > +#include <asm/apicdef.h>
> > +#include <asm/io_apic.h>
>
> Why? You're looking for the guest view of things, which I don't
> think you can derive from definitions in these two headers.
I can use the domain state for the lapic and the ioapic...
> > + /* ... or the PCIe MCFG regions. */
> > + for ( i = 0; i < pci_mmcfg_config_num; i++ )
> > + {
> > + unsigned long addr = PFN_DOWN(pci_mmcfg_config[i].address);
> > +
> > + if ( pfn >= addr + (pci_mmcfg_config[i].start_bus_number << 8) &&
> > + pfn < addr + (pci_mmcfg_config[i].end_bus_number << 8) )
> > + return false;
> > + }
>
> Same here - this would better use domain state.
... but pci mcfg regions are currently added after the iommu
initialization in the HVM dom0 builder. I can shuffle that call so
that iommu initialization is performed after the mcfg regions are
added.
Thanks, Roger.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-07-31 15:16 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-27 15:31 [PATCH 0/4] x86/iommu: PVH Dom0 workarounds for missing RMRR/IRSV entries Roger Pau Monne
2018-07-27 15:31 ` [PATCH 1/4] iommu: remove unneeded return from iommu_hwdom_init Roger Pau Monne
2018-07-31 7:19 ` Paul Durrant
2018-07-27 15:31 ` [PATCH 2/4] iommu: generalize iommu_inclusive_mapping Roger Pau Monne
2018-07-31 7:18 ` Paul Durrant
2018-07-31 8:16 ` Roger Pau Monné
2018-07-31 8:27 ` Paul Durrant
2018-07-31 8:33 ` Roger Pau Monné
2018-07-31 8:37 ` Paul Durrant
2018-07-31 8:49 ` Jan Beulich
2018-07-31 9:05 ` Roger Pau Monné
2018-07-31 9:14 ` Jan Beulich
2018-07-31 9:34 ` Roger Pau Monné
2018-07-31 9:37 ` Paul Durrant
2018-07-31 9:41 ` Jan Beulich
2018-07-31 9:45 ` Paul Durrant
2018-07-31 8:45 ` Jan Beulich
2018-07-31 14:39 ` Jan Beulich
2018-07-31 15:33 ` Roger Pau Monné
2018-08-01 8:20 ` Jan Beulich
2018-08-01 8:32 ` Andrew Cooper
2018-08-01 9:10 ` Jan Beulich
2018-08-01 9:20 ` Andrew Cooper
2018-08-01 9:59 ` Jan Beulich
2018-08-01 10:25 ` Andrew Cooper
2018-08-01 8:33 ` Paul Durrant
2018-08-01 9:11 ` Jan Beulich
2018-08-02 6:53 ` Tian, Kevin
2018-08-01 8:47 ` Roger Pau Monné
2018-07-27 15:31 ` [PATCH 3/4] x86/iommu: reorder conditions used in the inclusive iommu mappings Roger Pau Monne
2018-07-31 7:29 ` Paul Durrant
2018-07-31 8:26 ` Roger Pau Monné
2018-07-27 15:31 ` [PATCH 4/4] x86/iommu: add PVH support to the inclusive options Roger Pau Monne
2018-07-31 7:36 ` Paul Durrant
2018-07-31 8:28 ` Roger Pau Monné
2018-07-31 14:52 ` Jan Beulich
2018-07-31 15:15 ` Roger Pau Monné [this message]
2018-07-31 15:27 ` Roger Pau Monné
2018-07-31 15:34 ` Jan Beulich
2018-07-31 15:33 ` Jan Beulich
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=20180731151522.gnhoydkm42vloldi@mac \
--to=roger.pau@citrix.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=julien.grall@arm.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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).