From: Wei Liu Date: Tue, 26 Nov 2013 18:25:17 +0000 (+0000) Subject: OvmfPkg: enable Xen specific path X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=refs%2Fheads%2Fv3;p=people%2Fliuw%2Fovmf.git OvmfPkg: enable Xen specific path 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 --- diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 760bd4106..d4851ed5a 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 { - 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 268d722fd..d9072e71a 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 { - 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 53945d0bb..71b178e4c 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 { - 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 c2e7ba99f..8daf9f4fb 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 3d5cbbbc2..7fe9d471c 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]