Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp4255591ybe; Mon, 9 Sep 2019 06:42:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyikIbBcC6yOjBRaCDQKeXcPd5up4JUT78kXX1zturMOZJ6wyuqGWY5AUVxJqXQiGV7RR4S X-Received: by 2002:a17:906:af8c:: with SMTP id mj12mr20214967ejb.58.1568036571551; Mon, 09 Sep 2019 06:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568036571; cv=none; d=google.com; s=arc-20160816; b=pUSUEMQznNna/Z98wNmF6ydUQkRGju1eOlSFqQV75MzGAmp/GzL68yj7ZrBuw6p039 QxdRPGpvfOBDoeonRgZiLQ3jbN/f7k8RA9uR5lbl4taDYCoimDxh5+dFXVq7+aYOzl8Z x6VGQqjOfqxfwk3qPQSiHvp4meCA6hs+VRFnW+iKPYuByE6bh1JljZD1KVixvicNoay2 xCbW+dYaiW+ive1dTAZ1/j7l1g7P/I85SK4ke64NooOIcWWxnpW0i4XcmkUhzRqRlsZO 4wmfBts3vaLuD5R6hkCSZaqUHfPXY/n8rbKgpD8Xl79N2kaaH5iEQctewts03jBqfq8b IHpw== 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=d6JYgVfq+MX4RdQEEBM8tskE5Lkl5223vzAVfMvP4M4=; b=MO9silGiaKjkR5FuwF1+Z4yBw9n3n2ZhfEZgjXtLO+o2zI8odneknotqbJ6VkoMC7c +J6pSBb3sqt6OcLbawpXkbTprr7EMujp73L8SWTwHGmuoqOXy9xLMmx7juDSeOktSWjx KEl4fVNzj72HI7+aNLogfRcFTydUSpBRTll/KE+CHhqug33eH/3ikE4jmKhKYUNLdI4I VbWbzR8OIrnJON8IseYJQz/f5WdIUGSy8KZPDbrgUv1MgXLJHI8fIpKCi1QdjM65fMy7 7HR2Gf55J4vos7m8hQdjcxoSsjCrY6my4Lvg4/Xnk/07I1DbozV3RtjLE+6//p3qG614 6SEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@citrix.com header.s=securemail header.b=NyzBvW7x; 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 z35si9533839edb.146.2019.09.09.06.42.27; Mon, 09 Sep 2019 06:42:51 -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=NyzBvW7x; 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 S1730102AbfIHVLn (ORCPT + 99 others); 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