[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 1/4] iommu / x86: move call to scan_pci_devices() out of vendor code


  • To: Paul Durrant <paul.durrant@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Woods, Brian" <Brian.Woods@xxxxxxx>
  • Date: Tue, 16 Jul 2019 14:07:40 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=amd.com;dmarc=pass action=none header.from=amd.com;dkim=pass header.d=amd.com;arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CXsVSmIsB5iZtSdYkAl7LCjQV5m9ZwUCATNjeHSuGko=; b=MA7GCx7niTxFb51aPIPN2xCef8qB3Y1z2d5evzm3W/OjOri0SgxuL470Zra/knXpOME0szA/CFIeK2ogupJeEwHrfF/ZbvTeMlr0kILam0RM5LNOq7wbT/L5UIvicT8ADLc3vg3vhbzN3GMC1DkSuufRtSUmPsA4wmM/p6CEnmXYDXevoGDCMoGU0xRWNpBWPU8/pIzJtzFf8489uJfV4Bi4eZYsIUHtmZQyI6ebTFPBUzRJ4erSq9lwYBLK9CSvKSJUFT6nQs+yBUtcrHRgzX8z1gL6Ohd6SxYsMk7TStyvOevMEG7l3hCYeB6su3jayGVLSU0/ueCd3Ui0Pchp5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OB6HEPQwDMirJaUP+MQSn7tDOBY+4oqtp1nNpsJhcikv5Vi7PyWzmtBucL7pA4bupb7sg8g4Z1hX2oGPbuh/5RiOTOL/wZsWLfcPU5g/quVmT2YjAPTOmngJFBzUA5oED3ID77e733EIdFZiaS5JcnRF9cckDOWJ2diVDlDI0QJev8bua8DCX27v7DZZtFr5i65aPyuGEzGaSfiSAdsSm8UR2SHSOf0pJDXatzlvQx1wzq3IvFuMfvTml5yHuG+g6MfPH9RAJjx+C89czAK/ciafwQMF0DP10vH8q/0ZYojugxooDEyCjcx6vXG5ZiMcvtu4NgTdrjcMiRfD1BoWEQ==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Brian.Woods@xxxxxxx;
  • Cc: Kevin Tian <kevin.tian@xxxxxxxxx>, "Suthikulpanit, Suravee" <Suravee.Suthikulpanit@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "Woods, Brian" <Brian.Woods@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 16 Jul 2019 14:07:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVOwoJmACSitCOz0OFuPG+4gPVs6bNSZRk
  • Thread-topic: [PATCH v2 1/4] iommu / x86: move call to scan_pci_devices() out of vendor code

On July 15, 2019 7:37:17 AM Paul Durrant <paul.durrant@xxxxxxxxxx> wrote:

> It's not vendor specific so it doesn't really belong there.
>
>
> Scanning the PCI topology also really doesn't have much to do with IOMMU
> initialization. It doesn't depend on there even being an IOMMU. This patch
> moves to the call to the beginning of iommu_hardware_setup() but only
> places it there because the topology information would be otherwise unused.
>
>
> Subsequent patches will actually make use of the PCI topology during
> (x86) IOMMU initialization.
>
>
> Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>

Acked-by: Brian Woods <brian.woods@xxxxxxx>

> ---
> Cc: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
> Cc: Brian Woods <brian.woods@xxxxxxx>
> Cc: Kevin Tian <kevin.tian@xxxxxxxxx>
> Cc: Jan Beulich <jbeulich@xxxxxxxx>
> Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Cc: Wei Liu <wl@xxxxxxx>
> Cc: "Roger Pau Monné" <roger.pau@xxxxxxxxxx>
>
>
> v2:
> - Expanded commit comment.
> - Moved PCI scan to before IOMMU initialization, rather than after it.
> ---
> xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 ++-
> xen/drivers/passthrough/vtd/iommu.c         | 4 ----
> xen/drivers/passthrough/x86/iommu.c         | 6 ++++++
> 3 files changed, 8 insertions(+), 5 deletions(-)
>
>
> diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c 
> b/xen/drivers/passthrough/amd/pci_amd_iommu.c
> index 4afbcd1609..3338a8e0e8 100644
> --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
> +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
> @@ -180,7 +180,8 @@ static int __init 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;
> }
>
> int amd_iommu_alloc_root(struct domain_iommu *hd)
> diff --git a/xen/drivers/passthrough/vtd/iommu.c 
> b/xen/drivers/passthrough/vtd/iommu.c
> index 8b27d7e775..b0e3bf26b5 100644
> --- a/xen/drivers/passthrough/vtd/iommu.c
> +++ b/xen/drivers/passthrough/vtd/iommu.c
> @@ -2372,10 +2372,6 @@ static int __init vtd_setup(void)
>     P(iommu_hap_pt_share, "Shared EPT tables");
> #undef P
>
> -    ret = scan_pci_devices();
> -    if ( ret )
> -        goto error;
> -
>     ret = init_vtd_hw();
>     if ( ret )
>         goto error;
> diff --git a/xen/drivers/passthrough/x86/iommu.c 
> b/xen/drivers/passthrough/x86/iommu.c
> index 0fa6dcc3fd..a7438c9c25 100644
> --- a/xen/drivers/passthrough/x86/iommu.c
> +++ b/xen/drivers/passthrough/x86/iommu.c
> @@ -28,9 +28,15 @@ struct iommu_ops __read_mostly iommu_ops;
>
> int __init iommu_hardware_setup(void)
> {
> +    int rc;
> +
>     if ( !iommu_init_ops )
>         return -ENODEV;
>
> +    rc = scan_pci_devices();
> +    if ( rc )
> +        return rc;
> +
>     if ( !iommu_ops.init )
>         iommu_ops = *iommu_init_ops->ops;
>     else
> --
> 2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.