From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E2BDC211D07AD for ; Wed, 6 Mar 2019 09:39:38 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 376443089EC9; Wed, 6 Mar 2019 17:39:37 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-122-235.rdu2.redhat.com [10.10.122.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 881EF1001DC1; Wed, 6 Mar 2019 17:39:35 +0000 (UTC) To: Igor Druzhinin , edk2-devel@lists.01.org Cc: jordan.l.justen@intel.com, ard.biesheuvel@linaro.org, anthony.perard@citrix.com, julien.grall@arm.com, xen-devel@lists.xenproject.org References: <1551876056-28223-1-git-send-email-igor.druzhinin@citrix.com> <1551876056-28223-4-git-send-email-igor.druzhinin@citrix.com> <9b193263-06b1-b344-2ef3-5bd42e856c63@citrix.com> From: Laszlo Ersek Message-ID: <92d242f1-5f46-d4ba-dc0d-a298557bf6ea@redhat.com> Date: Wed, 6 Mar 2019 18:39:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <9b193263-06b1-b344-2ef3-5bd42e856c63@citrix.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 06 Mar 2019 17:39:37 +0000 (UTC) Subject: Re: [PATCH RESEND 3/3] OvmfPkg/XenSupport: turn off address decoding before BAR sizing X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Mar 2019 17:39:39 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 03/06/19 15:26, Igor Druzhinin wrote: > On 06/03/2019 13:22, Laszlo Ersek wrote: >> On 03/06/19 13:40, Igor Druzhinin wrote: >>> On Xen, hvmloader firmware leaves address decoding enabled for >>> enumerated PCI device before jumping into OVMF. OVMF seems to >>> expect it to be disabled and tries to size PCI BARs in several places >>> without disabling it which causes BAR64, for example, being >>> incorrectly placed by QEMU. >>> >>> Fix it by disabling PCI address decoding explicitly before the >>> first attempt to size BARs on Xen. >>> >>> Contributed-under: TianoCore Contribution Agreement 1.1 >>> Signed-off-by: Igor Druzhinin >>> --- >>> OvmfPkg/Library/PciHostBridgeLib/XenSupport.c | 34 +++++++++++++++++++++++++++ >>> 1 file changed, 34 insertions(+) >>> >>> diff --git a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c b/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c >>> index 408fb24..9940335 100644 >>> --- a/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c >>> +++ b/OvmfPkg/Library/PciHostBridgeLib/XenSupport.c >>> @@ -55,6 +55,33 @@ PcatPciRootBridgeBarExisted ( >>> EnableInterrupts (); >>> } >>> >>> +#define EFI_PCI_COMMAND_DECODE ((UINT16)(EFI_PCI_COMMAND_IO_SPACE | \ >>> + EFI_PCI_COMMAND_MEMORY_SPACE)) >> >> I thought I asked you not to define a macro here that started with the >> "EFI_" prefix :/ >> >> http://mid.mail-archive.com/dd8e3c9e-cb76-d3fe-6a10-c0a41c714b56@redhat.com >> > > This is a resend of v1 patch series to get Xen folks into CC and gather > comments. I expect v2. My bad, thanks for the clarification. On edk2-devel we very rarely post RESENDs without updates, and so I missed the implications now. Thanks Laszlo