From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01DC1C4360D for ; Sun, 8 Sep 2019 21:11:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A6EEB20854 for ; Sun, 8 Sep 2019 21:11:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="NyzBvW7x" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730325AbfIHVLn (ORCPT ); Sun, 8 Sep 2019 17:11:43 -0400 Received: from esa6.hc3370-68.iphmx.com ([216.71.155.175]:19249 "EHLO esa6.hc3370-68.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729238AbfIHVLm (ORCPT ); Sun, 8 Sep 2019 17:11:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1567977101; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=I6JRjNC6jGloUsMWw5bRRxRNOT8ykZ15S5WsOIB4YKE=; b=NyzBvW7x//QsR8/LmdrbeW9g4BvkTrbnu8NaFZuXV4kmrnm0FcJt6xf5 cKpB4sPiQ1TAs+eYiQPv3V7jzPhV4hmIfGJ3vx+n5jatIMYsIOKj0vnwD sntSV6A/o6WZ/17TxIgo2Z9vfWW1WuCotGjncAsugnUz2AC8xP5pOpp0/ w=; Authentication-Results: esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="igor.druzhinin@citrix.com"; x-sender="igor.druzhinin@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.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=esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="igor.druzhinin@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: QBSdi5HD2a9n4ngJuFf05ktyxatNog/I/LGJqyVA8tONNkpDxNeLmZlzpeB3eU+/ImS1IYCTAP F9WYilOHcrPTrb7yhDKN0+HX0nFZUCVjkhyjbxFX2T3VXvrKCquXYzjGlkHn+7c+JSlkUoQ2m+ 8KUoab9XGaRvNf2pONgtnzIZvVfQM3O5GPJf59RowzScX75gAXtkEeTZDCcRyOsIDr0Y6e0y+R 2Xme73dmt1PhOuNPqeuaFxsGOmfita0GF/7Bsr3fk+90zqKEKpkmitkeyMbW92KZiZh0EvI3mi p0c= X-SBRS: 2.7 X-MesageID: 5523475 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,481,1559534400"; d="scan'208";a="5523475" Subject: Re: [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> From: Igor Druzhinin Message-ID: Date: Sun, 8 Sep 2019 22:11:39 +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: <43b7da04-5c42-80d8-898b-470ee1c91ed2@oracle.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/09/2019 19:28, Boris Ostrovsky wrote: > On 9/6/19 7:00 PM, Igor Druzhinin wrote: >> >> On 06/09/2019 23:30, Boris Ostrovsky wrote: >>> >>> Where is MCFG parsed? pci_arch_init()? >>>> It happens twice: >> 1) first time early one in pci_arch_init() that is arch_initcall - that >> time pci_mmcfg_list will be freed immediately there because MCFG area is >> not reserved in E820; >> 2) second time late one in acpi_init() which is subsystem_initcall right >> before where PCI enumeration starts - this time ACPI tables will be >> checked for a reserved resource and pci_mmcfg_list will be finally >> populated. >> >> The problem is that on a system that doesn't have MCFG area reserved in >> E820 pci_mmcfg_list is empty before acpi_init() and our PCI hooks are >> called in the same place. So MCFG is still not in use by Xen at this >> point since we haven't reached our xen_mcfg_late(). > > > Would it be possible for us to parse MCFG ourselves in pci_xen_init()? I > realize that we'd be doing this twice (or maybe even three times since > apparently both pci_arch_init()  and acpi_ini() do it). > I don't thine it makes sense: a) it needs to be done after ACPI is initialized since we need to parse it to figure out the exact reserved region - that's why it's currently done in acpi_init() (see commit message for the reasons why) b) given (a) we cannot do it ourselves before acpi_init and after is too late as we're already past ACPI PCI enumeration c) we'd have to do it in the same place I call xen_mcfg_late() and it'd be code duplication of what's already done by the existing code. Igor From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5659AC433EF for ; Sun, 8 Sep 2019 21:12:20 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 21D6B20854 for ; Sun, 8 Sep 2019 21:12:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="iZg9Vjlq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 21D6B20854 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i74TJ-0001jj-5c; Sun, 08 Sep 2019 21:11:45 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1i74TI-0001je-6q for xen-devel@lists.xenproject.org; Sun, 08 Sep 2019 21:11:44 +0000 X-Inumbo-ID: 4166403c-d27d-11e9-b299-bc764e2007e4 Received: from esa6.hc3370-68.iphmx.com (unknown [216.71.155.175]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4166403c-d27d-11e9-b299-bc764e2007e4; Sun, 08 Sep 2019 21:11:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1567977102; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=I6JRjNC6jGloUsMWw5bRRxRNOT8ykZ15S5WsOIB4YKE=; b=iZg9VjlqN0l9FTHfJ2bWc65tvcaFe9Jd1ZZEAzBL9twlMfy7T10kAVdd dW5koWnaDCVj352gLoCqJ4uCc2T8YlJLUU/XmLpq7mmkBIBLRsJerb5ZB gJakK15JsGxf4FVo34rzqF4pbdZisgCO6Bk8Lm2KrbZrn+R7k66V12du0 0=; Authentication-Results: esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="igor.druzhinin@citrix.com"; x-sender="igor.druzhinin@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa6.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=esa6.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 (esa6.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=esa6.hc3370-68.iphmx.com; envelope-from="igor.druzhinin@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: QBSdi5HD2a9n4ngJuFf05ktyxatNog/I/LGJqyVA8tONNkpDxNeLmZlzpeB3eU+/ImS1IYCTAP F9WYilOHcrPTrb7yhDKN0+HX0nFZUCVjkhyjbxFX2T3VXvrKCquXYzjGlkHn+7c+JSlkUoQ2m+ 8KUoab9XGaRvNf2pONgtnzIZvVfQM3O5GPJf59RowzScX75gAXtkEeTZDCcRyOsIDr0Y6e0y+R 2Xme73dmt1PhOuNPqeuaFxsGOmfita0GF/7Bsr3fk+90zqKEKpkmitkeyMbW92KZiZh0EvI3mi p0c= X-SBRS: 2.7 X-MesageID: 5523475 X-Ironport-Server: esa6.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,481,1559534400"; d="scan'208";a="5523475" To: Boris Ostrovsky , , 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> From: Igor Druzhinin Message-ID: Date: Sun, 8 Sep 2019 22:11:39 +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: <43b7da04-5c42-80d8-898b-470ee1c91ed2@oracle.com> Content-Language: en-US Subject: Re: [Xen-devel] [PATCH] xen/pci: try to reserve MCFG areas earlier 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: jgross@suse.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" T24gMDgvMDkvMjAxOSAxOToyOCwgQm9yaXMgT3N0cm92c2t5IHdyb3RlOgo+IE9uIDkvNi8xOSA3 OjAwIFBNLCBJZ29yIERydXpoaW5pbiB3cm90ZToKPj4KPj4gT24gMDYvMDkvMjAxOSAyMzozMCwg Qm9yaXMgT3N0cm92c2t5IHdyb3RlOgo+Pj4KPj4+IFdoZXJlIGlzIE1DRkcgcGFyc2VkPyBwY2lf YXJjaF9pbml0KCk/Cj4+Pj4gSXQgaGFwcGVucyB0d2ljZToKPj4gMSkgZmlyc3QgdGltZSBlYXJs eSBvbmUgaW4gcGNpX2FyY2hfaW5pdCgpIHRoYXQgaXMgYXJjaF9pbml0Y2FsbCAtIHRoYXQKPj4g dGltZSBwY2lfbW1jZmdfbGlzdCB3aWxsIGJlIGZyZWVkIGltbWVkaWF0ZWx5IHRoZXJlIGJlY2F1 c2UgTUNGRyBhcmVhIGlzCj4+IG5vdCByZXNlcnZlZCBpbiBFODIwOwo+PiAyKSBzZWNvbmQgdGlt ZSBsYXRlIG9uZSBpbiBhY3BpX2luaXQoKSB3aGljaCBpcyBzdWJzeXN0ZW1faW5pdGNhbGwgcmln aHQKPj4gYmVmb3JlIHdoZXJlIFBDSSBlbnVtZXJhdGlvbiBzdGFydHMgLSB0aGlzIHRpbWUgQUNQ SSB0YWJsZXMgd2lsbCBiZQo+PiBjaGVja2VkIGZvciBhIHJlc2VydmVkIHJlc291cmNlIGFuZCBw Y2lfbW1jZmdfbGlzdCB3aWxsIGJlIGZpbmFsbHkKPj4gcG9wdWxhdGVkLgo+Pgo+PiBUaGUgcHJv YmxlbSBpcyB0aGF0IG9uIGEgc3lzdGVtIHRoYXQg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