Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp14906ybe; Tue, 10 Sep 2019 13:40:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwwK2H+d44BcSO+iXY0JIJp+JGwhCvdDSLhUBkee+It19/2H5gjSbXo/zkC/jNDlblZBBz X-Received: by 2002:aa7:d40d:: with SMTP id z13mr32084376edq.229.1568148005373; Tue, 10 Sep 2019 13:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568148005; cv=none; d=google.com; s=arc-20160816; b=gw5EhSr/vccI4vX1T9sXdMfUEbTi0rnXd/cgfgeztuS2Yy0l4rM4nT7tHnYSLqsgmZ +h3S58QTVnSk5rZhiSWhMptWvn4sKubpzgRt+379wmOEMXJ42f3RbguCDZzZMigkpuqR ROAhT11f9bt9nG9Dznmap18wGgTs5xr+ptliHZPFWGbffgJxSNfQjuilFnfBLaeMJbyV hHCtAryRLeTE3OWg+IAoCFBEEAEqxw3e27vsSI1f9E+I9WeUGPsDA83HEECljLMqH0/Z nGH+jzSQGmC/k7wJz7HqtFzmjKIYEvo0pn16MWCHKDeHUv8Qo/kyENwjwHL3cHZJhfbo sA/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr :dkim-signature; bh=tmTMQYYNi7FotMdSwVHL97ACGrJi9sz5tkxt9vY/4hk=; b=MoitxanSPyxN43gjy++ErcJssSeE/YYC+KuU5uukIDzjrtHHmmPGsge65aBYv1t2fc /3STDUo7Wwx8InVzImXZ5docGu+IFQyz2Dpp5fYtbbVXMV0Gi7cVg/z4Iq56QG76yrwv WnMZe1XHz3X0LPYipQzoMn3a3zS1Z24OIdTtBHVHTOZEP7P3ahGtLkn9jLHOYBm1QRvk 725/cGSLnXrMySsaaDxeeYEkNfB7JG+0/YRW1LeOGE/dgHKSAft97EUC7jMdpt5Qzz24 HGWrNUWVfPyMPNVDMPL+BuFFMGbEvb5Y/vabM5EOoPmeg1cK5NQ/qjCrM7iqF23Mcef5 tJmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@citrix.com header.s=securemail header.b=OmWwFMcJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k23si9827952ejr.329.2019.09.10.13.39.40; Tue, 10 Sep 2019 13:40:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@citrix.com header.s=securemail header.b=OmWwFMcJ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726240AbfIJUhC (ORCPT + 99 others); Tue, 10 Sep 2019 16:37:02 -0400 Received: from esa2.hc3370-68.iphmx.com ([216.71.145.153]:3967 "EHLO esa2.hc3370-68.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725770AbfIJUhC (ORCPT ); Tue, 10 Sep 2019 16:37:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1568147822; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=PQX2XV0vVmXhFIlKkjJKf1ji0vclOmRYdx+xosldAik=; b=OmWwFMcJRffOs7x6PgZIi7HA+X/HEr71iHlB58m4kNVK5RPtHb/IHrRp ttCeyMpnH5SgIcQViN+jfGmAWCvTlSRdmxIxSzrphZqyAuWTb/ESY5tnn 5sUX4OjZL6P5DYwkoaoR9zvaSjGwSpe5JqOPnZPEYRdVdaZDF8zP0H5ZL 4=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=igor.druzhinin@citrix.com; spf=Pass smtp.mailfrom=igor.druzhinin@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of igor.druzhinin@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="igor.druzhinin@citrix.com"; x-sender="igor.druzhinin@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of igor.druzhinin@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="igor.druzhinin@citrix.com"; x-sender="igor.druzhinin@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="igor.druzhinin@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 6Al88nOj1y14/m72nAPf2nC7ggByJ2zYOOvHJNU1oXsjAIBEiR/C874dTwKtkLpjZpv6rXgHoc ZJv97sDCDMsd3wl8d8fOQyB+45HsExWuOF/bAdF0ALhdHkwCvc5BRttBJ4e4fLlf+W7s5lyysC U//fmTRFSSWr+1wW3hTwV+lANEQeXGewhsOHK0ggRqsRfUPGkdVg7g5MIekcziJnEDXqAsmvdU yIE7w5F2BItYpD8bGXoFdznrXrZ7zPegfobWq0SDLsUCsGpG4MUfNSEtUJqfS5mL6Zc7GWG9vH 43M= X-SBRS: 2.7 X-MesageID: 5399823 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,490,1559534400"; d="scan'208";a="5399823" Subject: Re: [Xen-devel] [PATCH] xen/pci: try to reserve MCFG areas earlier To: Boris Ostrovsky , , CC: References: <1567556431-9809-1-git-send-email-igor.druzhinin@citrix.com> <5054ad91-5b87-652c-873a-b31758948bd7@oracle.com> <43b7da04-5c42-80d8-898b-470ee1c91ed2@oracle.com> <1695c88d-e5ad-1854-cdef-3cd95c812574@oracle.com> <4d3bf854-51de-99e4-9a40-a64c581bdd10@citrix.com> <43e492ff-f967-7218-65c4-d16581fabea3@oracle.com> <416ff4b7-3186-f61a-75fa-bcfc968f8117@citrix.com> From: Igor Druzhinin Message-ID: Date: Tue, 10 Sep 2019 21:36:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/09/2019 18:48, Boris Ostrovsky wrote: > On 9/10/19 5:46 AM, Igor Druzhinin wrote: >> On 10/09/2019 02:47, Boris Ostrovsky wrote: >>> On 9/9/19 5:48 PM, Igor Druzhinin wrote: >>>> On 09/09/2019 20:19, Boris Ostrovsky wrote: >>>> >>>>> The other question I have is why you think it's worth keeping >>>>> xen_mcfg_late() as a late initcall. How could MCFG info be updated >>>>> between acpi_init() and late_initcalls being run? I'd think it can only >>>>> happen when a new device is hotplugged. >>>>> >>>> It was a precaution against setup_mcfg_map() calls that might add new >>>> areas that are not in MCFG table but for some reason have _CBA method. >>>> It's obviously a "firmware is broken" scenario so I don't have strong >>>> feelings to keep it here. Will prefer to remove in v2 if you want. >>> Isn't setup_mcfg_map() called before the first xen_add_device() which is where you are calling xen_mcfg_late()? >>> >> setup_mcfg_map() calls are done in order of root bus discovery which >> happens *after* the previous root bus has been enumerated. So the order >> is: call setup_mcfg_map() for root bus 0, find that >> pci_mmcfg_late_init() has finished MCFG area registration, perform PCI >> enumeration of bus 0, call xen_add_device() for every device there, call >> setup_mcfg_map() for root bus X, etc. > > Ah, yes. Multiple busses. > > If that's the case then why don't we need to call xen_mcfg_late() for > the first device on each bus? > Ideally, yes - we'd like to call it for every bus discovered. But boot time buses are already in MCFG (otherwise system boot might not simply work as Jan pointed out) so it's not strictly required. The only case is a potential PCI bus hot-plug but I'm not sure it actually works in practice and we certainly didn't support it before. It might be solved theoretically by subscribing to acpi_bus_type that is available after acpi_init(). Igor