From nobody Thu Mar 28 16:23:47 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1557321932; cv=none; d=zoho.com; s=zohoarc; b=muBpZc5nJFuywJ1w7jOux+XWT5DV0/YjimsSENwbPdFjkRNncPNEK5xF9UfWld8ChjDM9/blxbOr6qYn8av8cmuTWbRl8DV91knkbEPEVeB4jjFrhGwNzNZZJ053wkOVQfaPtk9KoM67NxnokF66Gh452408BaxdPk8Ri5ysSkQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557321932; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=qIJnQUmlBHGncOWLiKlvTtLz4q6+89WVFcyWS+PZeb8=; b=UALYS/j+EufIdvoA7+0dkfa1AY3JK2rdcn8schhdOcYVpJL7WcwZpGZ+ijWThFL3IFoK8Shgj6FAemPKwUlvluq9V1vmYutyYfYN1fovmRIeGuuyR4T1SfBbuJghr4tUxoVz/9pChUTeg/dbUskdyYyYfIQUU7RK5mEXbNr5yxQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1557321931944475.9072906902592; Wed, 8 May 2019 06:25:31 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOMYR-0000dU-K0; Wed, 08 May 2019 13:24:15 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hOMYQ-0000dK-Kz for xen-devel@lists.xenproject.org; Wed, 08 May 2019 13:24:14 +0000 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 926dea57-7194-11e9-843c-bc764e045a96; Wed, 08 May 2019 13:24:13 +0000 (UTC) X-Inumbo-ID: 926dea57-7194-11e9-843c-bc764e045a96 X-IronPort-AV: E=Sophos;i="5.60,446,1549929600"; d="scan'208";a="85265437" From: Paul Durrant To: Date: Wed, 8 May 2019 14:24:00 +0100 Message-ID: <20190508132403.1454-3-paul.durrant@citrix.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190508132403.1454-1-paul.durrant@citrix.com> References: <20190508132403.1454-1-paul.durrant@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 2/5] iommu / x86: move call to scan_pci_devices() out of vendor code X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Kevin Tian , Wei Liu , Suravee Suthikulpanit , Andrew Cooper , Paul Durrant , Jan Beulich , Brian Woods , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" It's not vendor specific so it shouldn't really be there. Signed-off-by: Paul Durrant --- Cc: Suravee Suthikulpanit Cc: Brian Woods Cc: Kevin Tian Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu Cc: "Roger Pau Monn=C3=A9" --- 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/pass= through/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) =20 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; } =20 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 =20 - ret =3D scan_pci_devices(); - if ( ret ) - goto error; - ret =3D 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; =20 int __init iommu_hardware_setup(void) { + int rc; + if ( !iommu_init_ops ) return -ENODEV; =20 @@ -37,7 +39,12 @@ int __init iommu_hardware_setup(void) /* x2apic setup may have previously initialised the struct. */ ASSERT(iommu_ops.init =3D=3D iommu_init_ops->ops->init); =20 - return iommu_init_ops->setup(); + rc =3D iommu_init_ops->setup(); + + if ( !rc ) + rc =3D scan_pci_devices(); + + return rc; } =20 int iommu_enable_x2apic(void) --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel