All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: Roger Pau Monne <roger.pau@citrix.com>, Jan Beulich <JBeulich@suse.com>
Cc: "Wu, Feng" <feng.wu@intel.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v3.1 07/15] xen/x86: do the PCI scan unconditionally
Date: Wed, 30 Nov 2016 05:53:26 +0000	[thread overview]
Message-ID: <AADFC41AFE54684AB9EE6CBC0274A5D18E06F98C@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <20161129125742.wt6e5wiujyvr6cco@MacBook-Pro-de-Roger.local>

> From: Roger Pau Monne [mailto:roger.pau@citrix.com]
> Sent: Tuesday, November 29, 2016 8:58 PM
> 
> On Tue, Nov 29, 2016 at 05:47:42AM -0700, Jan Beulich wrote:
> > >>> On 29.11.16 at 13:33, <roger.pau@citrix.com> wrote:
> > > On Thu, Nov 03, 2016 at 07:54:24AM -0400, Boris Ostrovsky wrote:
> > >>
> > >>
> > >> On 11/03/2016 07:35 AM, Jan Beulich wrote:
> > >> > > > > On 03.11.16 at 11:58, <roger.pau@citrix.com> wrote:
> > >> > > On Mon, Oct 31, 2016 at 10:47:15AM -0600, Jan Beulich wrote:
> > >> > > > > > > On 29.10.16 at 10:59, <roger.pau@citrix.com> wrote:
> > >> > > > > --- a/xen/arch/x86/setup.c
> > >> > > > > +++ b/xen/arch/x86/setup.c
> > >> > > > > @@ -1491,6 +1491,8 @@ void __init noreturn __start_xen(unsigned long
> > > mbi_p)
> > >> > > > >
> > >> > > > >      early_msi_init();
> > >> > > > >
> > >> > > > > +    scan_pci_devices();
> > >> > > > > +
> > >> > > > >      iommu_setup();    /* setup iommu if available */
> > >> > > > >
> > >> > > > >      smp_prepare_cpus(max_cpus);
> > >> > > > > --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
> > >> > > > > +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
> > >> > > > > @@ -219,7 +219,8 @@ int __init amd_iov_detect(void)
> > >> > > > >
> > >> > > > >      if ( !amd_iommu_perdev_intremap )
> > >> > > > >          printk(XENLOG_WARNING "AMD-Vi: Using global interrupt remap
> > > table is not recommended (see XSA-36)!\n");
> > >> > > > > -    return scan_pci_devices();
> > >> > > > > +
> > >> > > > > +    return 0;
> > >> > > > >  }
> > >> > > >
> > >> > > > I'm relatively certain that I did point out on a prior version that the
> > >> > > > error handling here gets lost. At the very least the commit message
> > >> > > > should provide a reason for doing so; even better would be if there
> > >> > > > was no behavioral change (other than the point in time where this
> > >> > > > happens slightly changing).
> > >> > >
> > >> > > Behaviour here is different on Intel or AMD hardware, on Intel failure to
> > >> > > scan the PCI bus will not be fatal, and the IOMMU will be enabled anyway. On
> > >> > > AMD OTOH failure to scan the PCI bus will cause the IOMMU to be disabled.
> > >> > > I expect we should be able to behave equally for both Intel and AMD, so
> > >> > > which one should be used?
> > >> >
> > >> > I'm afraid I have to defer to the vendor IOMMU maintainers for
> > >> > that one, as I don't know the reason for the difference in behavior.
> > >> > An aspect that may play into here is that for AMD the IOMMU is
> > >> > represented by a PCI device, while for Intel it's just a part of one
> > >> > of the core chipset devices.
> > >>
> > >> That's probably the reason although it looks like the only failure that
> > >> scan_pci_devices() can return is -ENOMEM, in which case disabling IOMMU may
> > >> not be the biggest problem.
> > >
> > > I don't think we have reached consensus regarding what to do here. IMHO, if we
> > > have to keep the same behavior it makes no sense to move the call, in which
> > > case I will just remove this patch. OTOH, I think that as Boris says, if
> > > scan_pci_devices fails there's something very wrong, in which case we should
> > > just panic.
> >
> > While I can see your point, I think we should get away from both
> > assuming only certain kinds of failures can occur in the callers of
> > functions as well as panic()ing for initialization failure of optional
> > functionality. Anything depending on such optional stuff should
> > simply get disabled in turn.
> >
> > As to the specific case here - I think rather than ditching error
> > handling, it would better be added uniformly (i.e. disabling the
> > IOMMU regardless of vendor). Otoh, if leaving the patch out is
> > an option, I wouldn't mind that route; I had got the impression
> > though that you were of the opinion that it's a requirement.
> 
> OK, for PVHv2 Dom0 scanning the PCI devices is a requirement, so I think the
> best way to solve this is to also fail IOMMU initialization for Intel if the PCI
> scan fails, and this will also prevent a PVHv2 Dom0 from booting, since the
> IOMMU is a requirement.
> 

I'm OK with this policy change. Although there is no strict dependency
between VT-d and PCI scan, the purpose of VT-d is for PCI-based 
device assignment.

Thanks
Kevin

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-11-30  5:53 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-29  8:59 [PATCH v3.1 00/15] Initial PVHv2 Dom0 support Roger Pau Monne
2016-10-29  8:59 ` [PATCH v3.1 01/15] xen/x86: remove XENFEAT_hvm_pirqs for PVHv2 guests Roger Pau Monne
2016-10-31 16:32   ` Jan Beulich
2016-11-03 12:35     ` Roger Pau Monne
2016-11-03 12:52       ` Jan Beulich
2016-11-03 14:25         ` Konrad Rzeszutek Wilk
2016-11-03 15:05         ` Roger Pau Monne
2016-11-03 14:22       ` Konrad Rzeszutek Wilk
2016-11-03 15:01         ` Roger Pau Monne
2016-11-03 15:43         ` Roger Pau Monne
2016-10-29  8:59 ` [PATCH v3.1 02/15] xen/x86: fix return value of *_set_allocation functions Roger Pau Monne
2016-10-29 22:11   ` Tim Deegan
2016-10-29  8:59 ` [PATCH v3.1 03/15] xen/x86: allow calling {sh/hap}_set_allocation with the idle domain Roger Pau Monne
2016-10-31 16:34   ` Jan Beulich
2016-11-01 10:45     ` Tim Deegan
2016-11-02 17:14       ` Roger Pau Monne
2016-11-03 10:20         ` Roger Pau Monne
2016-11-03 10:33           ` Tim Deegan
2016-11-03 11:31           ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 04/15] xen/x86: assert that local_events_need_delivery is not called by " Roger Pau Monne
2016-10-31 16:37   ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 05/15] x86/paging: introduce paging_set_allocation Roger Pau Monne
2016-10-31 16:42   ` Jan Beulich
2016-11-01 10:29     ` Tim Deegan
2016-10-29  8:59 ` [PATCH v3.1 06/15] xen/x86: split the setup of Dom0 permissions to a function Roger Pau Monne
2016-10-31 16:44   ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 07/15] xen/x86: do the PCI scan unconditionally Roger Pau Monne
2016-10-31 16:47   ` Jan Beulich
2016-11-03 10:58     ` Roger Pau Monne
2016-11-03 11:35       ` Jan Beulich
2016-11-03 11:54         ` Boris Ostrovsky
2016-11-29 12:33           ` Roger Pau Monne
2016-11-29 12:47             ` Jan Beulich
2016-11-29 12:57               ` Roger Pau Monne
2016-11-30  5:53                 ` Tian, Kevin [this message]
2016-11-30  9:02                   ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 08/15] x86/vtd: fix mapping of RMRR regions Roger Pau Monne
2016-11-04  9:16   ` Jan Beulich
2016-11-04  9:45     ` Roger Pau Monne
2016-11-04 10:34       ` Jan Beulich
2016-11-04 12:25         ` Roger Pau Monne
2016-11-04 12:53           ` Jan Beulich
2016-11-04 13:03             ` Roger Pau Monne
2016-11-04 13:16               ` Jan Beulich
2016-11-04 15:33                 ` Roger Pau Monne
2016-11-04 16:13                   ` Jan Beulich
2016-11-04 16:19                     ` Roger Pau Monne
2016-11-04 17:08                       ` Jan Beulich
2016-11-04 17:25                         ` Roger Pau Monne
2016-11-07  8:36                           ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 09/15] xen/x86: allow the emulated APICs to be enabled for the hardware domain Roger Pau Monne
2016-11-04  9:19   ` Jan Beulich
2016-11-04  9:47     ` Roger Pau Monne
2016-11-04 10:21       ` Jan Beulich
2016-11-04 12:09         ` Roger Pau Monne
2016-11-04 12:50           ` Jan Beulich
2016-11-04 13:06             ` Roger Pau Monne
2016-10-29  8:59 ` [PATCH v3.1 10/15] xen/x86: split Dom0 build into PV and PVHv2 Roger Pau Monne
2016-11-11 16:53   ` Jan Beulich
2016-11-16 18:02     ` Roger Pau Monne
2016-11-17 10:49       ` Jan Beulich
2016-11-28 17:49         ` Roger Pau Monne
2016-11-29  9:34           ` Jan Beulich
2016-10-29  8:59 ` [PATCH v3.1 11/15] xen/mm: introduce a function to map large chunks of MMIO Roger Pau Monne
2016-11-11 16:58   ` Jan Beulich
2016-11-29 12:41     ` Roger Pau Monne
2016-11-29 13:00       ` Jan Beulich
2016-11-29 15:32         ` Roger Pau Monne
2016-11-11 20:17   ` Konrad Rzeszutek Wilk
2016-10-29  8:59 ` [PATCH v3.1 12/15] xen/x86: populate PVHv2 Dom0 physical memory map Roger Pau Monne
2016-11-11 17:16   ` Jan Beulich
2016-11-28 11:26     ` Roger Pau Monne
2016-11-28 11:41       ` Jan Beulich
2016-11-28 13:30         ` Roger Pau Monne
2016-11-28 13:49           ` Jan Beulich
2016-11-28 16:02             ` Roger Pau Monne
2016-10-29  8:59 ` [PATCH v3.1 13/15] xen/x86: parse Dom0 kernel for PVHv2 Roger Pau Monne
2016-11-11 20:30   ` Konrad Rzeszutek Wilk
2016-11-28 12:14     ` Roger Pau Monne
2016-10-29  9:00 ` [PATCH v3.1 14/15] xen/x86: hack to setup PVHv2 Dom0 CPUs Roger Pau Monne
2016-10-29  9:00 ` [PATCH v3.1 15/15] xen/x86: setup PVHv2 Dom0 ACPI tables Roger Pau Monne
2016-11-14 16:15   ` Jan Beulich
2016-11-30 12:40     ` Roger Pau Monne
2016-11-30 14:09       ` Jan Beulich
2016-11-30 14:23         ` Roger Pau Monne
2016-11-30 16:38           ` Jan Beulich
2016-10-31 14:35 ` [PATCH v3.1 00/15] Initial PVHv2 Dom0 support Boris Ostrovsky
2016-10-31 14:43   ` Andrew Cooper
2016-10-31 16:35     ` Roger Pau Monne

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=AADFC41AFE54684AB9EE6CBC0274A5D18E06F98C@SHSMSX101.ccr.corp.intel.com \
    --to=kevin.tian@intel.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=feng.wu@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=suravee.suthikulpanit@amd.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 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.