From: Paul Durrant <paul.durrant@citrix.com> To: xen-devel@lists.xenproject.org Cc: "Kevin Tian" <kevin.tian@intel.com>, "Wei Liu" <wei.liu2@citrix.com>, "Suravee Suthikulpanit" <suravee.suthikulpanit@amd.com>, "Andrew Cooper" <andrew.cooper3@citrix.com>, "Paul Durrant" <paul.durrant@citrix.com>, "Jan Beulich" <jbeulich@suse.com>, "Brian Woods" <brian.woods@amd.com>, "Roger Pau Monné" <roger.pau@citrix.com> Subject: [PATCH 2/5] iommu / x86: move call to scan_pci_devices() out of vendor code Date: Wed, 8 May 2019 14:24:00 +0100 [thread overview] Message-ID: <20190508132403.1454-3-paul.durrant@citrix.com> (raw) In-Reply-To: <20190508132403.1454-1-paul.durrant@citrix.com> It's not vendor specific so it shouldn't really be there. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> --- Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Cc: Brian Woods <brian.woods@amd.com> Cc: Kevin Tian <kevin.tian@intel.com> Cc: Jan Beulich <jbeulich@suse.com> Cc: Andrew Cooper <andrew.cooper3@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Cc: "Roger Pau Monné" <roger.pau@citrix.com> --- xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 ++- xen/drivers/passthrough/vtd/iommu.c | 4 ---- xen/drivers/passthrough/x86/iommu.c | 9 ++++++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c index dbc71ca7d5..872bbe21c2 100644 --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c @@ -182,7 +182,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 7b9e09a084..f9c76f594c 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 034ac903dd..895c7fb564 100644 --- a/xen/drivers/passthrough/x86/iommu.c +++ b/xen/drivers/passthrough/x86/iommu.c @@ -28,6 +28,8 @@ struct iommu_ops __read_mostly iommu_ops; int __init iommu_hardware_setup(void) { + int rc; + if ( !iommu_init_ops ) return -ENODEV; @@ -37,7 +39,12 @@ int __init iommu_hardware_setup(void) /* x2apic setup may have previously initialised the struct. */ ASSERT(iommu_ops.init == iommu_init_ops->ops->init); - return iommu_init_ops->setup(); + rc = iommu_init_ops->setup(); + + if ( !rc ) + rc = scan_pci_devices(); + + return rc; } int iommu_enable_x2apic(void) -- 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
WARNING: multiple messages have this Message-ID (diff)
From: Paul Durrant <paul.durrant@citrix.com> To: <xen-devel@lists.xenproject.org> Cc: "Kevin Tian" <kevin.tian@intel.com>, "Wei Liu" <wei.liu2@citrix.com>, "Suravee Suthikulpanit" <suravee.suthikulpanit@amd.com>, "Andrew Cooper" <andrew.cooper3@citrix.com>, "Paul Durrant" <paul.durrant@citrix.com>, "Jan Beulich" <jbeulich@suse.com>, "Brian Woods" <brian.woods@amd.com>, "Roger Pau Monné" <roger.pau@citrix.com> Subject: [Xen-devel] [PATCH 2/5] iommu / x86: move call to scan_pci_devices() out of vendor code Date: Wed, 8 May 2019 14:24:00 +0100 [thread overview] Message-ID: <20190508132403.1454-3-paul.durrant@citrix.com> (raw) Message-ID: <20190508132400.fAuRFHywViDqSOqq3bNZ1whxZufB320fPlv26WEzSFM@z> (raw) In-Reply-To: <20190508132403.1454-1-paul.durrant@citrix.com> It's not vendor specific so it shouldn't really be there. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> --- Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Cc: Brian Woods <brian.woods@amd.com> Cc: Kevin Tian <kevin.tian@intel.com> Cc: Jan Beulich <jbeulich@suse.com> Cc: Andrew Cooper <andrew.cooper3@citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> Cc: "Roger Pau Monné" <roger.pau@citrix.com> --- xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 ++- xen/drivers/passthrough/vtd/iommu.c | 4 ---- xen/drivers/passthrough/x86/iommu.c | 9 ++++++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c index dbc71ca7d5..872bbe21c2 100644 --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c @@ -182,7 +182,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 7b9e09a084..f9c76f594c 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 034ac903dd..895c7fb564 100644 --- a/xen/drivers/passthrough/x86/iommu.c +++ b/xen/drivers/passthrough/x86/iommu.c @@ -28,6 +28,8 @@ struct iommu_ops __read_mostly iommu_ops; int __init iommu_hardware_setup(void) { + int rc; + if ( !iommu_init_ops ) return -ENODEV; @@ -37,7 +39,12 @@ int __init iommu_hardware_setup(void) /* x2apic setup may have previously initialised the struct. */ ASSERT(iommu_ops.init == iommu_init_ops->ops->init); - return iommu_init_ops->setup(); + rc = iommu_init_ops->setup(); + + if ( !rc ) + rc = scan_pci_devices(); + + return rc; } int iommu_enable_x2apic(void) -- 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-05-08 13:24 UTC|newest] Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-05-08 13:23 [PATCH 0/5] iommu groups + cleanup Paul Durrant 2019-05-08 13:23 ` [Xen-devel] " Paul Durrant 2019-05-08 13:23 ` [PATCH 1/5] iommu: trivial re-organisation to avoid unnecessary test Paul Durrant 2019-05-08 13:23 ` [Xen-devel] " Paul Durrant 2019-05-13 15:22 ` Jan Beulich 2019-05-13 15:22 ` [Xen-devel] " Jan Beulich 2019-05-08 13:24 ` Paul Durrant [this message] 2019-05-08 13:24 ` [Xen-devel] [PATCH 2/5] iommu / x86: move call to scan_pci_devices() out of vendor code Paul Durrant 2019-05-13 15:35 ` Jan Beulich 2019-05-13 15:35 ` [Xen-devel] " Jan Beulich 2019-05-14 16:13 ` Paul Durrant 2019-05-14 16:13 ` [Xen-devel] " Paul Durrant 2019-05-15 6:29 ` Jan Beulich 2019-05-15 6:29 ` [Xen-devel] " Jan Beulich 2019-05-08 13:24 ` [PATCH 3/5] iommu: move iommu_get_ops() into common code Paul Durrant 2019-05-08 13:24 ` [Xen-devel] " Paul Durrant 2019-05-13 16:11 ` Jan Beulich 2019-05-13 16:11 ` [Xen-devel] " Jan Beulich 2019-05-14 16:19 ` Paul Durrant 2019-05-14 16:19 ` [Xen-devel] " Paul Durrant 2019-05-14 21:36 ` Julien Grall 2019-05-14 21:36 ` [Xen-devel] " Julien Grall 2019-05-15 6:32 ` Jan Beulich 2019-05-15 6:32 ` [Xen-devel] " Jan Beulich 2019-05-08 13:24 ` [PATCH 4/5] iommu: introduce iommu_groups Paul Durrant 2019-05-08 13:24 ` [Xen-devel] " Paul Durrant 2019-05-15 8:44 ` Roger Pau Monné 2019-05-15 8:44 ` [Xen-devel] " Roger Pau Monné 2019-05-31 13:48 ` Paul Durrant 2019-05-31 13:48 ` [Xen-devel] " Paul Durrant 2019-05-15 14:17 ` Jan Beulich 2019-05-15 14:17 ` [Xen-devel] " Jan Beulich 2019-05-31 13:55 ` Paul Durrant 2019-05-31 13:55 ` [Xen-devel] " Paul Durrant 2019-05-31 14:13 ` Jan Beulich 2019-05-31 14:13 ` [Xen-devel] " Jan Beulich 2019-05-31 14:21 ` Paul Durrant 2019-05-31 14:21 ` [Xen-devel] " Paul Durrant 2019-05-15 14:24 ` Jan Beulich 2019-05-15 14:24 ` [Xen-devel] " Jan Beulich 2019-05-08 13:24 ` [PATCH 5/5] iommu / pci: re-implement XEN_DOMCTL_get_device_group Paul Durrant 2019-05-08 13:24 ` [Xen-devel] " Paul Durrant 2019-05-15 9:06 ` Roger Pau Monné 2019-05-15 9:06 ` [Xen-devel] " Roger Pau Monné 2019-06-03 9:58 ` Paul Durrant 2019-06-03 9:58 ` [Xen-devel] " Paul Durrant
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=20190508132403.1454-3-paul.durrant@citrix.com \ --to=paul.durrant@citrix.com \ --cc=andrew.cooper3@citrix.com \ --cc=brian.woods@amd.com \ --cc=jbeulich@suse.com \ --cc=kevin.tian@intel.com \ --cc=roger.pau@citrix.com \ --cc=suravee.suthikulpanit@amd.com \ --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: linkBe 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).