From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=162.221.156.55; helo=smtp03.citrix.com; envelope-from=prvs=961469de7=igor.druzhinin@citrix.com; receiver=edk2-devel@lists.01.org Received: from SMTP03.CITRIX.COM (smtp03.citrix.com [162.221.156.55]) (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 D627C2194EB7B for ; Wed, 6 Mar 2019 06:27:04 -0800 (PST) X-IronPort-AV: E=Sophos;i="5.58,448,1544486400"; d="scan'208";a="79820331" To: Laszlo Ersek , CC: , , , , References: <1551876056-28223-1-git-send-email-igor.druzhinin@citrix.com> <1551876056-28223-4-git-send-email-igor.druzhinin@citrix.com> From: Igor Druzhinin Message-ID: <9b193263-06b1-b344-2ef3-5bd42e856c63@citrix.com> Date: Wed, 6 Mar 2019 14:26:22 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: 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 14:27:07 -0000 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit 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. Igor