From patchwork Tue Sep 27 15:57:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 9352199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1109960757 for ; Tue, 27 Sep 2016 16:00:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02E742927A for ; Tue, 27 Sep 2016 16:00:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB6EF29290; Tue, 27 Sep 2016 16:00:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C2F429294 for ; Tue, 27 Sep 2016 16:00:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boulx-0007et-OQ; Tue, 27 Sep 2016 15:58:21 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boulx-0007dB-03 for xen-devel@lists.xenproject.org; Tue, 27 Sep 2016 15:58:21 +0000 Received: from [85.158.139.211] by server-17.bemta-5.messagelabs.com id 95/C7-03778-B179AE75; Tue, 27 Sep 2016 15:58:19 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRWlGSWpSXmKPExsXitHSDva7k9Ff hBltPMVt83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBkHdl9lLpjIX7H9hmUD42OeLkZODgkBf4kZ 584zgthsAjoSF+fuZOti5OAQEVCRuL3XoIuRi4NZYCWTxNUvN1hA4sICThKf22RAylkEVCVer 1vFBBLmFXCReL8yEmKirsTDc79ZQWxOAVeJ3rYFTCC2EFDJ3ZkfweK8AoISJ2c+YQGxmQU0JV q3/2aHsOUlmrfOZoaoV5Ton/eADWImt8Tt01OZJzDyz0LSPgtJ+ywk7QsYmVcxahSnFpWlFuk aGuolFWWmZ5TkJmbm6BoamOrlphYXJ6an5iQmFesl5+duYgSGHwMQ7GBc2e58iFGSg0lJlFej /VW4EF9SfkplRmJxRnxRaU5q8SFGGQ4OJQlej6lAOcGi1PTUirTMHGAkwKQlOHiURHh5pgGle YsLEnOLM9MhUqcYFaXEeRtA+gRAEhmleXBtsOi7xCgrJczLCHSIEE9BalFuZgmq/CtGcQ5GJW FeBZDxPJl5JXDTXwEtZgJavPTEC5DFJYkIKakGRkGFuusCLrtuVT2527nCue291idF5c6nEwQ z77sI3+O/O8cw68AG2W2SFoHzAguKF/f/fSssn7lhhhT7qsdTKg/d8Nfdt3HeulDW7631NwrZ OSd8f8qxTjq1ROPP1eBWp8izV6ZeF2h/zVUS83uCzuLlfzfvrFER1eaoefH+/8SPzn6n5JZl/ FJiKc5INNRiLipOBABXL3kzuQIAAA== X-Env-Sender: prvs=071b8e69e=roger.pau@citrix.com X-Msg-Ref: server-5.tower-206.messagelabs.com!1474991886!60100383!5 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17313 invoked from network); 27 Sep 2016 15:58:16 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-5.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 27 Sep 2016 15:58:16 -0000 X-IronPort-AV: E=Sophos;i="5.30,405,1470700800"; d="scan'208";a="389169511" From: Roger Pau Monne To: Date: Tue, 27 Sep 2016 17:57:03 +0200 Message-ID: <1474991845-27962-9-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 2.7.4 (Apple Git-66) In-Reply-To: <1474991845-27962-1-git-send-email-roger.pau@citrix.com> References: <1474991845-27962-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Kevin Tian , Feng Wu , Jan Beulich , Andrew Cooper , Suravee Suthikulpanit , boris.ostrovsky@oracle.com, Roger Pau Monne Subject: [Xen-devel] [PATCH v2 08/30] xen/x86: do the PCI scan unconditionally X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Instead of being tied to the presence of an IOMMU Signed-off-by: Roger Pau Monné Suggested-by: Andrew Cooper --- Cc: Jan Beulich Cc: Andrew Cooper Cc: Suravee Suthikulpanit Cc: Kevin Tian Cc: Feng Wu --- xen/arch/x86/setup.c | 2 ++ xen/drivers/passthrough/amd/pci_amd_iommu.c | 3 ++- xen/drivers/passthrough/vtd/iommu.c | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 8ae897a..1d27a6f 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1443,6 +1443,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); diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c index 94a25a4..d12575d 100644 --- 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; } static int allocate_domain_resources(struct domain_iommu *hd) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 48f120b..919993e 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -2299,8 +2299,6 @@ int __init intel_vtd_setup(void) P(iommu_hap_pt_share, "Shared EPT tables"); #undef P - scan_pci_devices(); - ret = init_vtd_hw(); if ( ret ) goto error;