This patch sets PcdPciDisableBusEnumeration to true then makes use of
PublishPeiMemory and XenMemMapInitialization to construct memory map for
Xen guest.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
OvmfPkg/OvmfPkgIa32.dsc | 5 +++--
OvmfPkg/OvmfPkgIa32X64.dsc | 5 +++--
OvmfPkg/OvmfPkgX64.dsc | 5 +++--
OvmfPkg/PlatformPei/Platform.c | 11 +++++++++--
OvmfPkg/PlatformPei/PlatformPei.inf | 1 +
5 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 760bd41..d4851ed 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -222,7 +222,7 @@
!else
DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
!endif
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+ PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
[LibraryClasses.common.DXE_DRIVER]
@@ -320,6 +320,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE
################################################################################
@@ -342,7 +343,7 @@
MdeModulePkg/Core/Pei/PeiMain.inf
MdeModulePkg/Universal/PCD/Pei/Pcd.inf {
<LibraryClasses>
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+ PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
}
IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 268d722..d9072e7 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -227,7 +227,7 @@
!else
DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
!endif
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+ PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
[LibraryClasses.common.DXE_DRIVER]
@@ -326,6 +326,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE
################################################################################
@@ -348,7 +349,7 @@
MdeModulePkg/Core/Pei/PeiMain.inf
MdeModulePkg/Universal/PCD/Pei/Pcd.inf {
<LibraryClasses>
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+ PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
}
IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 53945d0..71b178e 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -227,7 +227,7 @@
!else
DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
!endif
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+ PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
[LibraryClasses.common.DXE_DRIVER]
@@ -325,6 +325,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE
################################################################################
@@ -347,7 +348,7 @@
MdeModulePkg/Core/Pei/PeiMain.inf
MdeModulePkg/Universal/PCD/Pei/Pcd.inf {
<LibraryClasses>
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+ PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
}
IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index c2e7ba9..8daf9f4 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -416,7 +416,11 @@ InitializePlatform (
XenLeaf = XenDetect ();
- TopOfMemory = MemDetect ();
+ if (XenLeaf != 0) {
+ PublishPeiMemory ();
+ PcdSetBool (PcdPciDisableBusEnumeration, TRUE);
+ } else
+ TopOfMemory = MemDetect ();
if (XenLeaf != 0) {
DEBUG ((EFI_D_INFO, "Xen was detected\n"));
@@ -427,7 +431,10 @@ InitializePlatform (
PeiFvInitialization ();
- MemMapInitialization (TopOfMemory);
+ if (XenLeaf != 0)
+ XenMemMapInitialization ();
+ else
+ MemMapInitialization (TopOfMemory);
MiscInitialization ();
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf
b/OvmfPkg/PlatformPei/PlatformPei.inf
index 3d5cbbb..7fe9d47 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -65,6 +65,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress
[Ppis]
--
1.7.10.4
On Tue, Nov 26, 2013 at 11:26 AM, Wei Liu <wei.liu2@citrix.com> wrote:> This patch sets PcdPciDisableBusEnumeration to true then makes use of > PublishPeiMemory and XenMemMapInitialization to construct memory map for > Xen guest. > > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Wei Liu <wei.liu2@citrix.com> > --- > OvmfPkg/OvmfPkgIa32.dsc | 5 +++-- > OvmfPkg/OvmfPkgIa32X64.dsc | 5 +++-- > OvmfPkg/OvmfPkgX64.dsc | 5 +++-- > OvmfPkg/PlatformPei/Platform.c | 11 +++++++++-- > OvmfPkg/PlatformPei/PlatformPei.inf | 1 + > 5 files changed, 19 insertions(+), 8 deletions(-) > > diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc > index 760bd41..d4851ed 100644 > --- a/OvmfPkg/OvmfPkgIa32.dsc > +++ b/OvmfPkg/OvmfPkgIa32.dsc > @@ -222,7 +222,7 @@ > !else > DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf > !endif > - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.infWhat impact does this have on size for DEBUG and RELEASE builds. We could just override it for the PciBus driver.> UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf > > [LibraryClasses.common.DXE_DRIVER] > @@ -320,6 +320,7 @@ > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE > > > ################################################################################ > @@ -342,7 +343,7 @@ > MdeModulePkg/Core/Pei/PeiMain.inf > MdeModulePkg/Universal/PCD/Pei/Pcd.inf { > <LibraryClasses> > - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.infI don''t think we need to change this. -Jordan> } > IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf > MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc > index 268d722..d9072e7 100644 > --- a/OvmfPkg/OvmfPkgIa32X64.dsc > +++ b/OvmfPkg/OvmfPkgIa32X64.dsc > @@ -227,7 +227,7 @@ > !else > DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf > !endif > - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf > > [LibraryClasses.common.DXE_DRIVER] > @@ -326,6 +326,7 @@ > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE > > > ################################################################################ > @@ -348,7 +349,7 @@ > MdeModulePkg/Core/Pei/PeiMain.inf > MdeModulePkg/Universal/PCD/Pei/Pcd.inf { > <LibraryClasses> > - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > } > IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf > MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc > index 53945d0..71b178e 100644 > --- a/OvmfPkg/OvmfPkgX64.dsc > +++ b/OvmfPkg/OvmfPkgX64.dsc > @@ -227,7 +227,7 @@ > !else > DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf > !endif > - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf > > [LibraryClasses.common.DXE_DRIVER] > @@ -325,6 +325,7 @@ > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE > > > ################################################################################ > @@ -347,7 +348,7 @@ > MdeModulePkg/Core/Pei/PeiMain.inf > MdeModulePkg/Universal/PCD/Pei/Pcd.inf { > <LibraryClasses> > - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > } > IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf > MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c > index c2e7ba9..8daf9f4 100644 > --- a/OvmfPkg/PlatformPei/Platform.c > +++ b/OvmfPkg/PlatformPei/Platform.c > @@ -416,7 +416,11 @@ InitializePlatform ( > > XenLeaf = XenDetect (); > > - TopOfMemory = MemDetect (); > + if (XenLeaf != 0) { > + PublishPeiMemory (); > + PcdSetBool (PcdPciDisableBusEnumeration, TRUE); > + } else > + TopOfMemory = MemDetect (); > > if (XenLeaf != 0) { > DEBUG ((EFI_D_INFO, "Xen was detected\n")); > @@ -427,7 +431,10 @@ InitializePlatform ( > > PeiFvInitialization (); > > - MemMapInitialization (TopOfMemory); > + if (XenLeaf != 0) > + XenMemMapInitialization (); > + else > + MemMapInitialization (TopOfMemory); > > MiscInitialization (); > > diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf > index 3d5cbbb..7fe9d47 100644 > --- a/OvmfPkg/PlatformPei/PlatformPei.inf > +++ b/OvmfPkg/PlatformPei/PlatformPei.inf > @@ -65,6 +65,7 @@ > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize > gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved > + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration > gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress > > [Ppis] > -- > 1.7.10.4 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel
On Thu, Nov 28, 2013 at 08:39:10PM -0800, Jordan Justen wrote:> On Tue, Nov 26, 2013 at 11:26 AM, Wei Liu <wei.liu2@citrix.com> wrote: > > This patch sets PcdPciDisableBusEnumeration to true then makes use of > > PublishPeiMemory and XenMemMapInitialization to construct memory map for > > Xen guest. > > > > Contributed-under: TianoCore Contribution Agreement 1.0 > > Signed-off-by: Wei Liu <wei.liu2@citrix.com> > > --- > > OvmfPkg/OvmfPkgIa32.dsc | 5 +++-- > > OvmfPkg/OvmfPkgIa32X64.dsc | 5 +++-- > > OvmfPkg/OvmfPkgX64.dsc | 5 +++-- > > OvmfPkg/PlatformPei/Platform.c | 11 +++++++++-- > > OvmfPkg/PlatformPei/PlatformPei.inf | 1 + > > 5 files changed, 19 insertions(+), 8 deletions(-) > > > > diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc > > index 760bd41..d4851ed 100644 > > --- a/OvmfPkg/OvmfPkgIa32.dsc > > +++ b/OvmfPkg/OvmfPkgIa32.dsc > > @@ -222,7 +222,7 @@ > > !else > > DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf > > !endif > > - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > > What impact does this have on size for DEBUG and RELEASE builds. We > could just override it for the PciBus driver. >After reverting the above change and only override PciBusDxe, the size of debug build is still the same. I think there''s very high chance that sizes for release build are the same as well. But I think it is generally a good idea to only override it for the PciBus driver. Debug build with this patch: MAINFV [69%Full] 8388608 total, 5803152 used, 2585456 free SECFV [19%Full] 212992 total, 42584 used, 170408 free FVMAIN_COMPACT [53%Full] 1753088 total, 929904 used, 823184 free DXEFV [99%Full] 5570560 total, 5560600 used, 9960 free Override for PciBusDxe, debug build: MAINFV [69%Full] 8388608 total, 5803152 used, 2585456 free SECFV [19%Full] 212992 total, 42584 used, 170408 free FVMAIN_COMPACT [53%Full] 1753088 total, 929904 used, 823184 free DXEFV [99%Full] 5570560 total, 5560600 used, 9960 free> > UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf > > > > [LibraryClasses.common.DXE_DRIVER] > > @@ -320,6 +320,7 @@ > > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 > > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 > > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 > > + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE > > > > > > ################################################################################ > > @@ -342,7 +343,7 @@ > > MdeModulePkg/Core/Pei/PeiMain.inf > > MdeModulePkg/Universal/PCD/Pei/Pcd.inf { > > <LibraryClasses> > > - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > > + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > > I don''t think we need to change this. >Yes, you''re right. I will fix this. Wei.