From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by mx.groups.io with SMTP id smtpd.web08.11014.1611062421741050136 for ; Tue, 19 Jan 2021 05:20:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@citrix.com header.s=securemail header.b=WJ3fg5wU; spf=pass (domain: citrix.com, ip: 216.71.145.153, mailfrom: anthony.perard@citrix.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1611062421; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ZBpkdIKunsFtYq2qhusrh4u6spCJo14KF7b3hJ3SVek=; b=WJ3fg5wUkNAGc3JZOCdehC0A2cgCsjxClhjlYkIMCZIGqL0CCxgLITjz 6qZSHC1mX+rj8iBzSLOUn8TlxxqzPTAWWtNPFsvz8dLVBsTGbvlGph36j 2atwZA392Uk2rMisBR9qu2fy/a8Nrr7+k3Rn+hA2orRhwj2K4C6Ga1POW 8=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: Y7JP5Uw5CoXFFDm8xpMVtDrpIO6kGj0vTm2S7QAW8LVqF7CxYgMVmRo6q/5ST1Rl8TryWySSES SwjaVwZ3RZPaTVHkEuqUlUmkJdZK6pUMqVQjaosGeWQl2o1RWIeb1VmO4QHaghVW6xFgr9bCZF 9sLdyc6ph9HIfl94jCbvdhirGhR95mvLEuIWjeQ2ifYbC50oePuKelfsS4wythASaIyjbT3pQJ aBPBmYaL6o2XfxuK0XddnqupgZehyybW+4d8zOd7jS3LhbyOF6DyY4tQn/RdwJ5fZezG6BfQrS lH8= X-SBRS: 5.1 X-MesageID: 35418157 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.79,358,1602561600"; d="scan'208";a="35418157" Date: Tue, 19 Jan 2021 13:20:17 +0000 From: "Anthony PERARD" To: Igor Druzhinin CC: , , , , , Subject: Re: [PATCH] OvmfPkg/XenPlatformPei: Grab 64-bit PCI MMIO hole size from OVMF info table Message-ID: References: <1610336718-7064-1-git-send-email-igor.druzhinin@citrix.com> MIME-Version: 1.0 In-Reply-To: <1610336718-7064-1-git-send-email-igor.druzhinin@citrix.com> Return-Path: anthony.perard@citrix.com Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Mon, Jan 11, 2021 at 03:45:18AM +0000, Igor Druzhinin wrote: > diff --git a/OvmfPkg/XenPlatformPei/MemDetect.c b/OvmfPkg/XenPlatformPei/MemDetect.c > index 1f81eee..4175a2f 100644 > --- a/OvmfPkg/XenPlatformPei/MemDetect.c > +++ b/OvmfPkg/XenPlatformPei/MemDetect.c > @@ -227,6 +227,7 @@ GetFirstNonAddress ( > UINT64 FirstNonAddress; > UINT64 Pci64Base, Pci64Size; > RETURN_STATUS PcdStatus; > + EFI_STATUS Status; > > FirstNonAddress = BASE_4GB + GetSystemMemorySizeAbove4gb (); > > @@ -245,7 +246,10 @@ GetFirstNonAddress ( > // Otherwise, in order to calculate the highest address plus one, we must > // consider the 64-bit PCI host aperture too. Fetch the default size. > // > - Pci64Size = PcdGet64 (PcdPciMmio64Size); > + Status = XenGetPciMmioInfo (NULL, NULL, &Pci64Base, &Pci64Size); Pci64Base is overridden later (25 line bellow) by the value from FirstNonAddress, shouldn't this be avoided? Pci64Base = ALIGN_VALUE (FirstNonAddress, (UINT64)SIZE_1GB); > diff --git a/OvmfPkg/XenPlatformPei/Xen.h b/OvmfPkg/XenPlatformPei/Xen.h > index 2605481..c6e5fbb 100644 > --- a/OvmfPkg/XenPlatformPei/Xen.h > +++ b/OvmfPkg/XenPlatformPei/Xen.h > @@ -34,6 +34,16 @@ typedef struct { > EFI_PHYSICAL_ADDRESS E820; > UINT32 E820EntriesCount; > } EFI_XEN_OVMF_INFO; > + > +// This extra table gives layout of PCI apertures in a Xen guest > +#define OVMF_INFO_PCI_TABLE 0 > + > +typedef struct { > + EFI_PHYSICAL_ADDRESS LowStart; > + EFI_PHYSICAL_ADDRESS LowEnd; > + EFI_PHYSICAL_ADDRESS HiStart; > + EFI_PHYSICAL_ADDRESS HiEnd; In the hvmloader patch, these are uint64. It doesn't seems like a good idea to use the type EFI_PHYSICAL_ADDRESS here. Could you change to UINT64 here? (even if EFI_PHYSICAL_ADDRESS seems to always be UINT64, in the source code.) > +} EFI_XEN_OVMF_PCI_INFO; > #pragma pack() > > #endif /* __XEN_H__ */ Thanks, -- Anthony PERARD