Skip to contentSkip to conversation

MdeModulePkg: introduce PcdPciDisableBusEnumeration

PATCH Superseded Wei Liu 6 participants 26 messages Nov 26, 2013 – Nov 29, 2013 16 messages not in the archive

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Wei Liu

author
#1 lore raw

PATCH v3 1/8 MdeModulePkg: introduce PcdPciDisableBusEnumeration

Platforms such as Xen already enumerates PCI bridges and devices. Use this PCD to control EDK2 behavior.

PcdPciDisableBusEnumeration is placed under [PcdFixedAtBuild, PcdDynamic, PcdDynamicEx], so that it is possible to alter it during runtime.

The default setting of this PCD is false (allow full PCI enumeration) to preserve the same behavior before this change.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c      |    5 ++++-
 MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf |    1 +
 MdeModulePkg/MdeModulePkg.dec                |    3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)
MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c +4 -1
index 5afbb82..cc6be8b 100644
@@ -284,7 +284,10 @@ PciBusDriverBindingStart (
           );
   }  
 
-  gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE));
+  if (PcdGetBool (PcdPciDisableBusEnumeration))
+    gFullEnumeration = FALSE;
+  else
+    gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE));
 
   //
   // Open Device Path Protocol for PCI root bridge
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf +1 -0
index 34eb672..917889c 100644
@@ -108,6 +108,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSrIovSupport
   gEfiMdeModulePkgTokenSpaceGuid.PcdAriSupport
   gEfiMdeModulePkgTokenSpaceGuid.PcdMrIovSupport
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
 
 # [Event]
 #   ##
MdeModulePkg/MdeModulePkg.dec +3 -0
index b627eb1..e86868b 100644
@@ -737,6 +737,9 @@
   ## This PCD specifies whether the Multi Root I/O virtualization support.
   gEfiMdeModulePkgTokenSpaceGuid.PcdMrIovSupport|FALSE|BOOLEAN|0x10000046
 
+  ## This PCD specifies whether full PCI enumeration is disabled.
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE|BOOLEAN|0x10000048
+
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## Single root I/O virtualization virtual function memory BAR alignment
   #  BITN set indicates 2 of n+12 power
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH v3 2/8 OvmfPkg: introduce E820.h

In reply to a message not in the archive

E820 definitions copied from IntelFrameworkModulePkg/Csm/ LegacyBiosDxe/LegacyBiosInterface.h.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/IndustryStandard/E820.h |   46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 OvmfPkg/Include/IndustryStandard/E820.h
OvmfPkg/Include/IndustryStandard/E820.h new file +46 -0
new file mode 100644
index 0000000..e7e0c25
@@ -0,0 +1,46 @@
+/** @file
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013, Citrix Systems UK Ltd.
+
+This program and the accompanying materials
+are licensed and made available under the terms and conditions
+of the BSD License which accompanies this distribution.  The
+full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+
+#ifndef __E820_H__
+#define __E820_H__
+
+#pragma pack(1)
+
+typedef enum {
+  EfiAcpiAddressRangeMemory   = 1,
+  EfiAcpiAddressRangeReserved = 2,
+  EfiAcpiAddressRangeACPI     = 3,
+  EfiAcpiAddressRangeNVS      = 4
+} EFI_ACPI_MEMORY_TYPE;
+
+typedef struct {
+  UINT64                BaseAddr;
+  UINT64                Length;
+  EFI_ACPI_MEMORY_TYPE  Type;
+} EFI_E820_ENTRY64;
+
+typedef struct {
+  UINT32                BassAddrLow;
+  UINT32                BaseAddrHigh;
+  UINT32                LengthLow;
+  UINT32                LengthHigh;
+  EFI_ACPI_MEMORY_TYPE  Type;
+} EFI_E820_ENTRY;
+
+#pragma pack()
+
+#endif /* __E820_H__ */
Signature · 1 line
1.7.10.4
author
#3 lore raw

PATCH v3 3/8 OvmfPkg: define EFI_XEN_OVMF_INFO and extend XenInfo

In reply to a message not in the archive

EFI_XEN_OVMF_INFO is defined to accept configurations from hvmloader. It must match the definition on Xen side.

XenInfo is extended to include necessary bits as well. Currently only E820 map is in use.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/Guid/XenInfo.h |    7 +++++++
 OvmfPkg/PlatformPei/Xen.h      |   44 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 OvmfPkg/PlatformPei/Xen.h
OvmfPkg/Include/Guid/XenInfo.h +7 -0
index d512b0b..6146080 100644
@@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef __XEN_INFO_H__
 #define __XEN_INFO_H__
 
+#include <Uefi/UefiBaseType.h>
+
 #define EFI_XEN_INFO_GUID \
     { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } }
 
@@ -35,6 +37,11 @@ typedef struct {
   /// Hypervisor minor version.
   ///
   UINT16 VersionMinor;
+  ///
+  /// E820 map
+  ///
+  EFI_PHYSICAL_ADDRESS E820;
+  UINT32 E820EntriesCount;
 } EFI_XEN_INFO;
 
 extern EFI_GUID gEfiXenInfoGuid;
OvmfPkg/PlatformPei/Xen.h new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
1.7.10.4
author
#4 lore raw

PATCH v3 4/8 OvmfPkg: extract OVMF info passed by Xen hvmloader

In reply to a message not in the archive

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/PlatformPei/Xen.c |   23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
OvmfPkg/PlatformPei/Xen.c +22 -1
index a720b91..737cb15 100644
@@ -26,13 +26,15 @@
 #include <Library/HobLib.h>
 #include <Library/MemoryAllocationLib.h>
 #include <Library/PcdLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <IndustryStandard/E820.h>
 #include <Guid/XenInfo.h>
 
 #include "Platform.h"
+#include "Xen.h"
 
 EFI_XEN_INFO mXenInfo;
 
-
 /**
   Connects to the Hypervisor.
  
@@ -50,6 +52,9 @@ XenConnect (
   UINT32 TransferReg;
   UINT32 TransferPages;
   UINT32 XenVersion;
+  EFI_XEN_OVMF_INFO *Info = (EFI_XEN_OVMF_INFO *) OVMF_INFO_PHYSICAL_ADDRESS;
+
+  ZeroMem (&mXenInfo, sizeof(mXenInfo));
 
   AsmCpuid (XenLeaf + 2, &TransferPages, &TransferReg, NULL, NULL);
   mXenInfo.HyperPages = AllocatePages (TransferPages);
@@ -72,6 +77,22 @@ XenConnect (
   /* TBD: Locate hvm_info and reserve it away. */
   mXenInfo.HvmInfo = NULL;
 
+  if (!AsciiStrCmp ((CHAR8 *) Info->Signature, "XenHVMOVMF")) {
+    EFI_E820_ENTRY64 *E820Map;
+
+    E820Map = AllocateCopyPool (sizeof(EFI_E820_ENTRY64) * Info->E820EntriesCount,
+                                (VOID *)Info->E820);
+    ASSERT (E820Map != NULL);
+
+    if (!E820Map) {
+      FreePages (mXenInfo.HyperPages, TransferPages);
+      return EFI_OUT_OF_RESOURCES;
+    }
+
+    mXenInfo.E820 = (EFI_PHYSICAL_ADDRESS)E820Map;
+    mXenInfo.E820EntriesCount = Info->E820EntriesCount;
+  }
+
   BuildGuidDataHob (
     &gEfiXenInfoGuid,
     &mXenInfo,
Signature · 1 line
1.7.10.4
author
#5 lore raw

PATCH v3 5/8 OvmfPkg: detect Xen earlier

In reply to a message not in the archive

This is useful for initializing memory map.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/PlatformPei/Platform.c |    8 +++++++-
 OvmfPkg/PlatformPei/Platform.h |    5 +++++
 OvmfPkg/PlatformPei/Xen.c      |   12 +-----------
 3 files changed, 13 insertions(+), 12 deletions(-)
OvmfPkg/PlatformPei/Platform.c +7 -1
index fb56e99..9b7828f 100644
@@ -338,14 +338,20 @@ InitializePlatform (
   )
 {
   EFI_PHYSICAL_ADDRESS  TopOfMemory;
+  UINT32 XenLeaf;
 
   DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));
 
   DebugDumpCmos ();
 
+  XenLeaf = XenDetect ();
+
   TopOfMemory = MemDetect ();
 
-  InitializeXen ();
+  if (XenLeaf != 0) {
+    DEBUG ((EFI_D_INFO, "Xen was detected\n"));
+    InitializeXen (XenLeaf);
+  }
 
   ReserveEmuVariableNvStore ();
 
OvmfPkg/PlatformPei/Platform.h +5 -0
index 383e6a4..d63d124 100644
@@ -69,6 +69,11 @@ PeiFvInitialization (
 
 EFI_STATUS
 InitializeXen (
+  UINT32 XenLeaf
+  );
+
+UINT32
+XenDetect (
   VOID
   );
 
OvmfPkg/PlatformPei/Xen.c +1 -11
index 737cb15..7779a1c 100644
@@ -140,19 +140,9 @@ XenDetect (
 **/
 EFI_STATUS
 InitializeXen (
-  VOID
+  UINT32 XenLeaf
   )
 {
-  UINT32 XenLeaf;
-
-  XenLeaf = XenDetect ();
-
-  if (XenLeaf == 0) {
-    return EFI_NOT_FOUND;
-  }
-
-  DEBUG ((EFI_D_INFO, "Xen was detected\n"));
-
   XenConnect (XenLeaf);
 
   //
Signature · 1 line
1.7.10.4
author
#6 lore raw

PATCH v3 6/8 OvmfPkg: introduce PublishPeiMemory

In reply to a message not in the archive

MemDetect actully does too many things, the underlying platform might want to have more control over memory layout.

Extract the functionality of publishing PEI memory to a dedicated function.

Also fixed wrong comment while I was there.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/PlatformPei/MemDetect.c |   36 +++++++++++++++++++++++++++++++++++-
 OvmfPkg/PlatformPei/Platform.h  |    5 +++++
 2 files changed, 40 insertions(+), 1 deletion(-)
OvmfPkg/PlatformPei/MemDetect.c +35 -1
index 9f6ca19..dc44745 100644
@@ -83,11 +83,45 @@ GetSystemMemorySizeAbove4gb (
   return LShiftU64 (Size, 16);
 }
 
+/**
+  Publish PEI core memory
+
+  @return EFI_SUCCESS     The PEIM initialized successfully.
+
+**/
+EFI_STATUS
+PublishPeiMemory(
+  VOID
+  )
+{
+  EFI_STATUS                  Status;
+  EFI_PHYSICAL_ADDRESS        MemoryBase;
+  UINT64                      MemorySize;
+  UINT64                      LowerMemorySize;
+
+  LowerMemorySize = GetSystemMemorySizeBelow4gb ();
+
+  MemoryBase = PcdGet32 (PcdOvmfMemFvBase) + PcdGet32 (PcdOvmfMemFvSize);
+  MemorySize = LowerMemorySize - MemoryBase;
+  if (MemorySize > SIZE_64MB) {
+    MemoryBase = LowerMemorySize - SIZE_64MB;
+    MemorySize = SIZE_64MB;
+  }
+
+  //
+  // Publish this memory to the PEI Core
+  //
+  Status = PublishSystemMemory(MemoryBase, MemorySize);
+  ASSERT_EFI_ERROR (Status);
+
+  return Status;
+}
+
 
 /**
   Peform Memory Detection
 
-  @return EFI_SUCCESS     The PEIM initialized successfully.
+  @return Top of memory
 
 **/
 EFI_PHYSICAL_ADDRESS
OvmfPkg/PlatformPei/Platform.h +5 -0
index d63d124..01af2a9 100644
@@ -57,6 +57,11 @@ AddUntestedMemoryRangeHob (
   EFI_PHYSICAL_ADDRESS        MemoryLimit
   );
 
+EFI_STATUS
+PublishPeiMemory(
+  VOID
+  );
+
 EFI_PHYSICAL_ADDRESS
 MemDetect (
   VOID
Signature · 1 line
1.7.10.4
author
#7 lore raw

PATCH v3 7/8 OvmfPkg: introduce XenMemMapInitialization

In reply to a message not in the archive

This function parses Xen OVMF info and arrange memory maps accordingly.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/PlatformPei/Platform.c |   70 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)
OvmfPkg/PlatformPei/Platform.c +70 -0
index 9b7828f..c2e7ba9 100644
@@ -34,6 +34,10 @@
 #include <Guid/MemoryTypeInformation.h>
 #include <Ppi/MasterBootMode.h>
 #include <IndustryStandard/Pci22.h>
+#include <Guid/XenInfo.h>
+#include <IndustryStandard/E820.h>
+#include <Library/ResourcePublicationLib.h>
+#include <Library/MtrrLib.h>
 
 #include "Platform.h"
 #include "Cmos.h"
@@ -163,6 +167,72 @@ AddUntestedMemoryRangeHob (
   AddUntestedMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase));
 }
 
+VOID
+XenMemMapInitialization (
+  VOID
+  )
+{
+  EFI_HOB_GUID_TYPE *GuidHob;
+  EFI_XEN_INFO *Info;
+
+  DEBUG ((EFI_D_ERROR, "Using memory map provided by Xen\n"));
+
+  GuidHob = GetFirstGuidHob (&gEfiXenInfoGuid);
+
+  ASSERT (GuidHob != NULL);
+
+  Info = GET_GUID_HOB_DATA (GuidHob);
+
+  //
+  // Create Memory Type Information HOB
+  //
+  BuildGuidDataHob (
+    &gEfiMemoryTypeInformationGuid,
+    mDefaultMemoryTypeInformation,
+    sizeof(mDefaultMemoryTypeInformation)
+    );
+
+  //
+  // Add PCI IO Port space available for PCI resource allocations.
+  //
+  BuildResourceDescriptorHob (
+    EFI_RESOURCE_IO,
+    EFI_RESOURCE_ATTRIBUTE_PRESENT     |
+    EFI_RESOURCE_ATTRIBUTE_INITIALIZED,
+    0xC000,
+    0x4000
+    );
+
+  //
+  // Video memory + Legacy BIOS region
+  //
+  AddIoMemoryRangeHob (0x0A0000, BASE_1MB);
+
+  //
+  // Parse RAM in E820 map
+  //
+  if (Info->E820EntriesCount > 0) {
+    EFI_E820_ENTRY64 *E820Map, *Entry;
+    UINT16 Loop;
+
+    E820Map = (EFI_E820_ENTRY64 *) Info->E820;
+    for (Loop = 0; Loop < Info->E820EntriesCount; Loop++) {
+      Entry = E820Map + Loop;
+
+      // only care about RAM
+      if (Entry->Type != EfiAcpiAddressRangeMemory)
+        continue;
+
+      if (Entry->BaseAddr >= BASE_4GB)
+        AddUntestedMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length);
+      else
+        AddMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length);
+
+      MtrrSetMemoryAttribute (Entry->BaseAddr, Entry->Length, CacheWriteBack);
+    }
+  }
+}
+
 
 VOID
 MemMapInitialization (
Signature · 1 line
1.7.10.4
author
#8 lore raw

PATCH v3 8/8 OvmfPkg: enable Xen specific path

In reply to a message not in the archive

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

---
 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(-)
OvmfPkg/OvmfPkgIa32.dsc +3 -2
index 760bd41..d4851ed 100644
@@ -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
OvmfPkg/OvmfPkgIa32X64.dsc +3 -2
index 268d722..d9072e7 100644
@@ -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
OvmfPkg/OvmfPkgX64.dsc +3 -2
index 53945d0..71b178e 100644
@@ -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
OvmfPkg/PlatformPei/Platform.c +9 -2
index c2e7ba9..8daf9f4 100644
@@ -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 ();
 
OvmfPkg/PlatformPei/PlatformPei.inf +1 -0
index 3d5cbbb..7fe9d47 100644
@@ -65,6 +65,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
   gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
   gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress
 
 [Ppis]
Signature · 1 line
1.7.10.4

A message that is not in the archive (sent off-list or not yet received): [email protected]

#10 lore raw

Re: [PATCH v3 2/8] OvmfPkg: introduce E820.h

Quoted 17 lines · Wei Liu

E820 definitions copied from IntelFrameworkModulePkg/Csm/ LegacyBiosDxe/LegacyBiosInterface.h.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/IndustryStandard/E820.h |   46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 OvmfPkg/Include/IndustryStandard/E820.h
OvmfPkg/Include/IndustryStandard/E820.h new file +0 -0
new file mode 100644
index 0000000..e7e0c25

OvmfPkg/Include/IndustryStandard/E820.h line 3

Quoted 3 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +3 -0
@@ -0,0 +1,46 @@
+/** @file
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>

<BR> ?

Quoted 14 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +14 -0
+Copyright (c) 2013, Citrix Systems UK Ltd.
+
+This program and the accompanying materials
+are licensed and made available under the terms and conditions
+of the BSD License which accompanies this distribution.  The
+full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+

OvmfPkg/Include/IndustryStandard/E820.h line 27

Quoted 10 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +10 -0
+#ifndef __E820_H__
+#define __E820_H__
+
+#pragma pack(1)
+
+typedef enum {
+  EfiAcpiAddressRangeMemory   = 1,
+  EfiAcpiAddressRangeReserved = 2,
+  EfiAcpiAddressRangeACPI     = 3,
+  EfiAcpiAddressRangeNVS      = 4

Odd, Linux also has E820_UNUSABLE

should that be in there as well?

Quoted 27 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +19 -0
+} EFI_ACPI_MEMORY_TYPE;
+
+typedef struct {
+  UINT64                BaseAddr;
+  UINT64                Length;
+  EFI_ACPI_MEMORY_TYPE  Type;
+} EFI_E820_ENTRY64;
+
+typedef struct {
+  UINT32                BassAddrLow;
+  UINT32                BaseAddrHigh;
+  UINT32                LengthLow;
+  UINT32                LengthHigh;
+  EFI_ACPI_MEMORY_TYPE  Type;
+} EFI_E820_ENTRY;
+
+#pragma pack()
+
+#endif /* __E820_H__ */
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#11 lore raw

Re: [PATCH v3 2/8] OvmfPkg: introduce E820.h

Quoted 7 lines · Konrad Rzeszutek Wilk

Review

Quoted 5 lines
(quoted diff) +5 -0
+typedef enum {
+  EfiAcpiAddressRangeMemory   = 1,
+  EfiAcpiAddressRangeReserved = 2,
+  EfiAcpiAddressRangeACPI     = 3,
+  EfiAcpiAddressRangeNVS      = 4

Odd, Linux also has E820_UNUSABLE

== AddressRangeUnusuable = 5 in the ACPI 5.0 spec, which also defines AddressRangeDisabled = 6.

Quoted 1 line

should that be in there as well?

I suppose it only really matters if something is using it...

author
#12 lore raw

Re: [PATCH v3 2/8] OvmfPkg: introduce E820.h

In reply to Konrad Rzeszutek Wilk
Quoted 12 lines · Konrad Rzeszutek Wilk
Quoted 11 lines · Wei Liu

E820 definitions copied from IntelFrameworkModulePkg/Csm/ LegacyBiosDxe/LegacyBiosInterface.h.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/IndustryStandard/E820.h |   46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 OvmfPkg/Include/IndustryStandard/E820.h
Quoted 12 lines

OvmfPkg/Include/IndustryStandard/E820.h line 3

Quoted 9 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +3 -0
new file mode 100644
index 0000000..e7e0c25
@@ -0,0 +1,46 @@
+/** @file
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>

<BR> ?

Copy-n-paste error, phew.

<BR> stands for new line in HTML. I have no idea how it came up in the original header.

Quoted 27 lines
Quoted 14 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +14 -0
+Copyright (c) 2013, Citrix Systems UK Ltd.
+
+This program and the accompanying materials
+are licensed and made available under the terms and conditions
+of the BSD License which accompanies this distribution.  The
+full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+

OvmfPkg/Include/IndustryStandard/E820.h line 27

Quoted 10 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +10 -0
+#ifndef __E820_H__
+#define __E820_H__
+
+#pragma pack(1)
+
+typedef enum {
+  EfiAcpiAddressRangeMemory   = 1,
+  EfiAcpiAddressRangeReserved = 2,
+  EfiAcpiAddressRangeACPI     = 3,
+  EfiAcpiAddressRangeNVS      = 4

Odd, Linux also has E820_UNUSABLE

Quoted 1 line

should that be in there as well?

The original header from where I copied these definitions doens't have that and nobody is using that at the moment. I think we can add that in later.

Wei.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#14 lore raw

Re: [PATCH v3 2/8] OvmfPkg: introduce E820.h

Quoted 26 lines · Wei Liu
Quoted 12 lines · Konrad Rzeszutek Wilk
Quoted 11 lines · Wei Liu

E820 definitions copied from IntelFrameworkModulePkg/Csm/ LegacyBiosDxe/LegacyBiosInterface.h.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/IndustryStandard/E820.h |   46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 OvmfPkg/Include/IndustryStandard/E820.h
Quoted 12 lines

OvmfPkg/Include/IndustryStandard/E820.h line 3

Quoted 9 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +3 -0
new file mode 100644
index 0000000..e7e0c25
@@ -0,0 +1,46 @@
+/** @file
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>

<BR> ?

Quoted 4 lines

Copy-n-paste error, phew.

<BR> stands for new line in HTML. I have no idea how it came up in the original header.

Actually Intel wants that appended to all Intel copyright lines in EDK II files.

I'm not sure why, but I suspected something related to forcing a newline in doxygen.

Hot seems to keep an eye on it, so maybe he knows.

-Jordan

Quoted 39 lines
Quoted 27 lines
Quoted 14 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +14 -0
+Copyright (c) 2013, Citrix Systems UK Ltd.
+
+This program and the accompanying materials
+are licensed and made available under the terms and conditions
+of the BSD License which accompanies this distribution.  The
+full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+

OvmfPkg/Include/IndustryStandard/E820.h line 27

Quoted 10 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +10 -0
+#ifndef __E820_H__
+#define __E820_H__
+
+#pragma pack(1)
+
+typedef enum {
+  EfiAcpiAddressRangeMemory   = 1,
+  EfiAcpiAddressRangeReserved = 2,
+  EfiAcpiAddressRangeACPI     = 3,
+  EfiAcpiAddressRangeNVS      = 4

Odd, Linux also has E820_UNUSABLE

Quoted 1 line

should that be in there as well?

The original header from where I copied these definitions doens't have that and nobody is using that at the moment. I think we can add that in later.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): CAFe8ug8f+hasj4YbEqs0_JAbR1iD7FoGHadmv68N4dimiQj1zg@mail.gmail.com

author
#16 lore raw

Re: [PATCH v3 2/8] OvmfPkg: introduce E820.h

Quoted 32 lines · Jordan Justen
Quoted 26 lines · Wei Liu
Quoted 12 lines · Konrad Rzeszutek Wilk
Quoted 11 lines · Wei Liu

E820 definitions copied from IntelFrameworkModulePkg/Csm/ LegacyBiosDxe/LegacyBiosInterface.h.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/IndustryStandard/E820.h |   46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 OvmfPkg/Include/IndustryStandard/E820.h
Quoted 12 lines

OvmfPkg/Include/IndustryStandard/E820.h line 3

Quoted 9 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +3 -0
new file mode 100644
index 0000000..e7e0c25
@@ -0,0 +1,46 @@
+/** @file
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>

<BR> ?

Quoted 4 lines

Copy-n-paste error, phew.

<BR> stands for new line in HTML. I have no idea how it came up in the original header.

Quoted 7 lines

Actually Intel wants that appended to all Intel copyright lines in EDK II files.

I'm not sure why, but I suspected something related to forcing a newline in doxygen.

Hot seems to keep an eye on it, so maybe he knows.

Oh that's really unusal requirement. ;-)

Quoted 4 lines

-Jordan

Quoted 2 lines
Quoted 2 lines

OvmfPkg/Include/IndustryStandard/E820.h line 5

Quoted 2 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +2 -0
+Copyright (c) 2013, Citrix Systems UK Ltd.
+

In that case should I append <BR> to the above line?

Hot, can you clarify this to a humble non-Intel developer? :-P

Thanks
Wei.

#17 lore raw

Re: [PATCH v3 2/8] OvmfPkg: introduce E820.h

In reply to a message not in the archive

Below is quoted from the EDKII coding standard spec:

7.3.2 Copyright Notice
The first line of the last paragraph of the file description is made up of the copyright notice. The copyright notice must consist of the following text with the FIRST and LAST symbols replaced with the year the file was created and the year the file was last edited, respectively.
Copyright (C) FIRST - LAST, Intel Corporation. All rights reserved.<BR>
A file that has been created but not edited in subsequent years would have a copyright notice with a single date, such as:
Copyright (C) 2007, Intel Corporation. All rights reserved.<BR>
If this file is subsequently edited, the copyright notice would be updated as follows. Copyright (C) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
The FIRST - LAST format for the copyright date, as described above, is the only format allowed. Do not use a comma separated list or keep updating a single date. The <BR> at the end of the line is required. Since Doxygen uses XML for its internal format, spaces and new lines are treated as a single space. The <BR> will force Doxygen to start the following text, the license notice, on a new line.

Thanks,
Hot

-----Original Message-----
From: Jordan Justen [mailto:[email protected]]
Sent: Thursday, November 28, 2013 8:19 AM
To: Wei Liu
Cc: Konrad Rzeszutek Wilk; [email protected]; xen-devel; Tian, Hot; Justen, Jordan L
Subject: Re: [Xen-devel] [PATCH v3 2/8] OvmfPkg: introduce E820.h

Quoted 26 lines · Wei Liu
Quoted 12 lines · Konrad Rzeszutek Wilk
Quoted 11 lines · Wei Liu

E820 definitions copied from IntelFrameworkModulePkg/Csm/ LegacyBiosDxe/LegacyBiosInterface.h.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/IndustryStandard/E820.h |   46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 OvmfPkg/Include/IndustryStandard/E820.h
Quoted 12 lines

OvmfPkg/Include/IndustryStandard/E820.h line 3

Quoted 9 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +3 -0
new file mode 100644
index 0000000..e7e0c25
@@ -0,0 +1,46 @@
+/** @file
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>

<BR> ?

Quoted 4 lines

Copy-n-paste error, phew.

<BR> stands for new line in HTML. I have no idea how it came up in the original header.

Actually Intel wants that appended to all Intel copyright lines in EDK II files.

I'm not sure why, but I suspected something related to forcing a newline in doxygen.

Hot seems to keep an eye on it, so maybe he knows.

-Jordan

Quoted 39 lines
Quoted 27 lines
Quoted 14 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +14 -0
+Copyright (c) 2013, Citrix Systems UK Ltd.
+
+This program and the accompanying materials
+are licensed and made available under the terms and conditions
+of the BSD License which accompanies this distribution.  The
+full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+

OvmfPkg/Include/IndustryStandard/E820.h line 27

Quoted 10 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +10 -0
+#ifndef __E820_H__
+#define __E820_H__
+
+#pragma pack(1)
+
+typedef enum {
+  EfiAcpiAddressRangeMemory   = 1,
+  EfiAcpiAddressRangeReserved = 2,
+  EfiAcpiAddressRangeACPI     = 3,
+  EfiAcpiAddressRangeNVS      = 4

Odd, Linux also has E820_UNUSABLE

Quoted 1 line

should that be in there as well?

The original header from where I copied these definitions doens't have that and nobody is using that at the moment. I think we can add that in later.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): 97159AD15C0F454180C255F8DA66135510FBD4ED@SHSMSX104.ccr.corp.intel.com

author
#19 lore raw

Re: [PATCH v3 2/8] OvmfPkg: introduce E820.h

Quoted 2 lines · Hot

Below is quoted from the EDKII coding standard spec:

Sorry I can understand the above paragraph, but I still cannot get the expection for non-Intel copyright line.

Quoted 2 lines

7.3.2 Copyright Notice
The first line of the last paragraph of the file description is made up of the copyright

You seem to be expecting only one line of copyright notice?

Quoted 6 lines

notice. The copyright notice must consist of the following text with the FIRST and LAST symbols replaced with the year the file was created and the year the file was last edited, respectively.
Copyright (C) FIRST - LAST, Intel Corporation. All rights reserved.<BR>
A file that has been created but not edited in subsequent years would have a copyright notice with a single date, such as:

Quoted 9 lines

Copyright (C) 2007, Intel Corporation. All rights reserved.<BR>
If this file is subsequently edited, the copyright notice would be updated as follows. Copyright (C) 2007 - 2010, Intel Corporation. All rights reserved.<BR> The FIRST - LAST format for the copyright date, as described above, is the only format allowed. Do not use a comma separated list or keep updating a single date. The <BR> at the end of the line is required. Since Doxygen uses XML for its internal format, spaces and new lines are treated as a single space. The <BR> will force Doxygen to start the following text, the license notice, on a new line.

I mimic the pattern in OvmfPkg/VirtioBlkDxe/VirtioBlk.c and get.

/** @file

Copyright (c) 2013, Citrix Systems UK Ltd.
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>

This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

**/

Is the above one OK?

Wei.

Quoted 90 lines

Thanks,
Hot

-----Original Message-----
From: Jordan Justen [mailto:[email protected]]
Sent: Thursday, November 28, 2013 8:19 AM
To: Wei Liu
Cc: Konrad Rzeszutek Wilk; [email protected]; xen-devel; Tian, Hot; Justen, Jordan L
Subject: Re: [Xen-devel] [PATCH v3 2/8] OvmfPkg: introduce E820.h

Quoted 26 lines · Wei Liu
Quoted 12 lines · Konrad Rzeszutek Wilk
Quoted 11 lines · Wei Liu

E820 definitions copied from IntelFrameworkModulePkg/Csm/ LegacyBiosDxe/LegacyBiosInterface.h.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/IndustryStandard/E820.h |   46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 OvmfPkg/Include/IndustryStandard/E820.h
Quoted 12 lines

OvmfPkg/Include/IndustryStandard/E820.h line 3

Quoted 9 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +3 -0
new file mode 100644
index 0000000..e7e0c25
@@ -0,0 +1,46 @@
+/** @file
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>

<BR> ?

Quoted 4 lines

Copy-n-paste error, phew.

<BR> stands for new line in HTML. I have no idea how it came up in the original header.

Actually Intel wants that appended to all Intel copyright lines in EDK II files.

I'm not sure why, but I suspected something related to forcing a newline in doxygen.

Hot seems to keep an eye on it, so maybe he knows.

-Jordan

Quoted 39 lines
Quoted 27 lines
Quoted 14 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +14 -0
+Copyright (c) 2013, Citrix Systems UK Ltd.
+
+This program and the accompanying materials
+are licensed and made available under the terms and conditions
+of the BSD License which accompanies this distribution.  The
+full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+

OvmfPkg/Include/IndustryStandard/E820.h line 27

Quoted 10 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +10 -0
+#ifndef __E820_H__
+#define __E820_H__
+
+#pragma pack(1)
+
+typedef enum {
+  EfiAcpiAddressRangeMemory   = 1,
+  EfiAcpiAddressRangeReserved = 2,
+  EfiAcpiAddressRangeACPI     = 3,
+  EfiAcpiAddressRangeNVS      = 4

Odd, Linux also has E820_UNUSABLE

Quoted 1 line

should that be in there as well?

The original header from where I copied these definitions doens't have that and nobody is using that at the moment. I think we can add that in later.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#21 lore raw

Re: [PATCH v3 2/8] OvmfPkg: introduce E820.h

You may follow your company's legal guidance on copyright format.

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: Thursday, November 28, 2013 10:35 AM
To: Tian, Hot
Cc: Jordan Justen; Wei Liu; Konrad Rzeszutek Wilk; [email protected]; xen-devel; Justen, Jordan L
Subject: Re: [Xen-devel] [PATCH v3 2/8] OvmfPkg: introduce E820.h

Quoted 2 lines · Hot

Below is quoted from the EDKII coding standard spec:

Sorry I can understand the above paragraph, but I still cannot get the expection for non-Intel copyright line.

Quoted 2 lines

7.3.2 Copyright Notice
The first line of the last paragraph of the file description is made up of the copyright

You seem to be expecting only one line of copyright notice?

Quoted 6 lines

notice. The copyright notice must consist of the following text with the FIRST and LAST symbols replaced with the year the file was created and the year the file was last edited, respectively.
Copyright (C) FIRST - LAST, Intel Corporation. All rights reserved.<BR>
A file that has been created but not edited in subsequent years would have a copyright notice with a single date, such as:

Quoted 9 lines

Copyright (C) 2007, Intel Corporation. All rights reserved.<BR>
If this file is subsequently edited, the copyright notice would be updated as follows. Copyright (C) 2007 - 2010, Intel Corporation. All rights reserved.<BR> The FIRST - LAST format for the copyright date, as described above, is the only format allowed. Do not use a comma separated list or keep updating a single date. The <BR> at the end of the line is required. Since Doxygen uses XML for its internal format, spaces and new lines are treated as a single space. The <BR> will force Doxygen to start the following text, the license notice, on a new line.

I mimic the pattern in OvmfPkg/VirtioBlkDxe/VirtioBlk.c and get.

/** @file

Copyright (c) 2013, Citrix Systems UK Ltd.
Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>

This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

**/

Is the above one OK?

Wei.

Quoted 90 lines

Thanks,
Hot

-----Original Message-----
From: Jordan Justen [mailto:[email protected]]
Sent: Thursday, November 28, 2013 8:19 AM
To: Wei Liu
Cc: Konrad Rzeszutek Wilk; [email protected]; xen-devel; Tian, Hot; Justen, Jordan L
Subject: Re: [Xen-devel] [PATCH v3 2/8] OvmfPkg: introduce E820.h

Quoted 26 lines · Wei Liu
Quoted 12 lines · Konrad Rzeszutek Wilk
Quoted 11 lines · Wei Liu

E820 definitions copied from IntelFrameworkModulePkg/Csm/ LegacyBiosDxe/LegacyBiosInterface.h.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/IndustryStandard/E820.h |   46 +++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 OvmfPkg/Include/IndustryStandard/E820.h
Quoted 12 lines

OvmfPkg/Include/IndustryStandard/E820.h line 3

Quoted 9 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +3 -0
new file mode 100644
index 0000000..e7e0c25
@@ -0,0 +1,46 @@
+/** @file
+
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>

<BR> ?

Quoted 4 lines

Copy-n-paste error, phew.

<BR> stands for new line in HTML. I have no idea how it came up in the original header.

Actually Intel wants that appended to all Intel copyright lines in EDK II files.

I'm not sure why, but I suspected something related to forcing a newline in doxygen.

Hot seems to keep an eye on it, so maybe he knows.

-Jordan

Quoted 39 lines
Quoted 27 lines
Quoted 14 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +14 -0
+Copyright (c) 2013, Citrix Systems UK Ltd.
+
+This program and the accompanying materials
+are licensed and made available under the terms and conditions
+of the BSD License which accompanies this distribution.  The
+full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+

OvmfPkg/Include/IndustryStandard/E820.h line 27

Quoted 10 lines
OvmfPkg/Include/IndustryStandard/E820.h new file +10 -0
+#ifndef __E820_H__
+#define __E820_H__
+
+#pragma pack(1)
+
+typedef enum {
+  EfiAcpiAddressRangeMemory   = 1,
+  EfiAcpiAddressRangeReserved = 2,
+  EfiAcpiAddressRangeACPI     = 3,
+  EfiAcpiAddressRangeNVS      = 4

Odd, Linux also has E820_UNUSABLE

Quoted 1 line

should that be in there as well?

The original header from where I copied these definitions doens't have that and nobody is using that at the moment. I think we can add that in later.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#23 lore raw

Wei,

I recommend you put the declaration of the new PCD in the next section if MdeModulePkg.dec so it supports PatchableInModule as well.

Thanks,

Mike

-----Original Message-----
From: Wei Liu [mailto:[email protected]]
Sent: Tuesday, November 26, 2013 11:26 AM
To: [email protected]; [email protected]
Subject: [edk2] [PATCH v3 1/8] MdeModulePkg: introduce PcdPciDisableBusEnumeration

Platforms such as Xen already enumerates PCI bridges and devices. Use this PCD to control EDK2 behavior.

PcdPciDisableBusEnumeration is placed under [PcdFixedAtBuild, PcdDynamic, PcdDynamicEx], so that it is possible to alter it during runtime.

The default setting of this PCD is false (allow full PCI enumeration) to preserve the same behavior before this change.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c      |    5 ++++-
 MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf |    1 +
 MdeModulePkg/MdeModulePkg.dec                |    3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)
MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c +4 -1
index 5afbb82..cc6be8b 100644
@@ -284,7 +284,10 @@ PciBusDriverBindingStart (
           );
   }  
 
-  gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE));
+  if (PcdGetBool (PcdPciDisableBusEnumeration))
+    gFullEnumeration = FALSE;
+  else
+    gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE));
 
   //
   // Open Device Path Protocol for PCI root bridge
MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf +1 -0
index 34eb672..917889c 100644
@@ -108,6 +108,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSrIovSupport
   gEfiMdeModulePkgTokenSpaceGuid.PcdAriSupport
   gEfiMdeModulePkgTokenSpaceGuid.PcdMrIovSupport
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
 
 # [Event]
 #   ##
MdeModulePkg/MdeModulePkg.dec +3 -0
index b627eb1..e86868b 100644
@@ -737,6 +737,9 @@
   ## This PCD specifies whether the Multi Root I/O virtualization support.
   gEfiMdeModulePkgTokenSpaceGuid.PcdMrIovSupport|FALSE|BOOLEAN|0x10000046
 
+  ## This PCD specifies whether full PCI enumeration is disabled.
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE|BOOLEAN|0x10000048
+
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## Single root I/O virtualization virtual function memory BAR alignment
   #  BITN set indicates 2 of n+12 power
Signature · 13 lines
1.7.10.4


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

A message that is not in the archive (sent off-list or not yet received): E92EE9817A31E24EB0585FDF735412F562527BAC@ORSMSX106.amr.corp.intel.com

author
#25 lore raw
Quoted 4 lines · Michael D

Wei,

I recommend you put the declaration of the new PCD in the next section if MdeModulePkg.dec so it supports PatchableInModule as well.

Thanks Mike. I will do this.

Wei.

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#27 lore raw

Re: [PATCH v3 3/8] OvmfPkg: define EFI_XEN_OVMF_INFO and extend XenInfo

Quoted 19 lines · Wei Liu

EFI_XEN_OVMF_INFO is defined to accept configurations from hvmloader. It must match the definition on Xen side.

XenInfo is extended to include necessary bits as well. Currently only E820 map is in use.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/Guid/XenInfo.h |    7 +++++++
 OvmfPkg/PlatformPei/Xen.h      |   44 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 OvmfPkg/PlatformPei/Xen.h
OvmfPkg/Include/Guid/XenInfo.h +0 -0
index d512b0b..6146080 100644

OvmfPkg/Include/Guid/XenInfo.h WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. · line 19

Quoted 5 lines
OvmfPkg/Include/Guid/XenInfo.h +2 -0
@@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef __XEN_INFO_H__
 #define __XEN_INFO_H__
 
+#include <Uefi/UefiBaseType.h>
+

I don't think we want this #include in Guid/XenInfo.h.

Can you make sure that the locations that #include Guid/XenInfo.h include PiPei.h, PiDxe.h, or Uefi.h before Guid/XenInfo.h?

OvmfPkg/Include/Guid/XenInfo.h typedef struct { · line 44

Quoted 12 lines
OvmfPkg/Include/Guid/XenInfo.h +5 -0
 #define EFI_XEN_INFO_GUID \
     { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } }
 
@@ -35,6 +37,11 @@ typedef struct {
   /// Hypervisor minor version.
   ///
   UINT16 VersionMinor;
+  ///
+  /// E820 map
+  ///
+  EFI_PHYSICAL_ADDRESS E820;
+  UINT32 E820EntriesCount;

Can you add this chunk into the next patch which initializes E820/E820EntriesCount?

With those 2 changes, patches 3 & 4 are

Quoted 61 lines
OvmfPkg/Include/Guid/XenInfo.h +0 -0
 } EFI_XEN_INFO;
 
 extern EFI_GUID gEfiXenInfoGuid;
OvmfPkg/PlatformPei/Xen.h new file +44 -1
new file mode 100644
index 0000000..1885ede
@@ -0,0 +1,44 @@
+/** @file
+  Ovmf info structure passed by Xen
+
+Copyright (c) 2013, Wei Liu <[email protected]>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __XEN_H__
+#define __XEN_H__
+
+#include <Uefi/UefiBaseType.h>
+
+// Physical address of OVMF info
+#define OVMF_INFO_PHYSICAL_ADDRESS 0x00001000
+
+// This structure must match the definition on Xen side
+#pragma pack(1)
+typedef struct {
+  CHAR8 Signature[14]; // XenHVMOVMF\0
+  UINT8 Length;        // Length of this structure
+  UINT8 Checksum;      // Set such that the sum over bytes 0..length == 0
+  //
+  // Physical address of an array of TablesCount elements.
+  //
+  // Each element contains the physical address of a BIOS table.
+  //
+  EFI_PHYSICAL_ADDRESS Tables;
+  UINT32 TablesCount;
+  //
+  // Physical address of the E820 table, contains E820EntriesCount entries.
+  //
+  EFI_PHYSICAL_ADDRESS E820;
+  UINT32 E820EntriesCount;
+} EFI_XEN_OVMF_INFO;
+#pragma pack()
+
+#endif /* __XEN_H__ */
--

1.7.10.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): CAFe8ug869P1DJUwp=CXcMRDVAhjXG5RtRFaZDRFBuqSYjy57nA@mail.gmail.com

#29 lore raw

Re: [PATCH v3 3/8] OvmfPkg: define EFI_XEN_OVMF_INFO and extend XenInfo

Quoted 34 lines · Jordan Justen
Quoted 19 lines · Wei Liu

EFI_XEN_OVMF_INFO is defined to accept configurations from hvmloader. It must match the definition on Xen side.

XenInfo is extended to include necessary bits as well. Currently only E820 map is in use.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/Guid/XenInfo.h |    7 +++++++
 OvmfPkg/PlatformPei/Xen.h      |   44 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 OvmfPkg/PlatformPei/Xen.h
OvmfPkg/Include/Guid/XenInfo.h +0 -0
index d512b0b..6146080 100644

OvmfPkg/Include/Guid/XenInfo.h WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. · line 19

Quoted 5 lines
OvmfPkg/Include/Guid/XenInfo.h +2 -0
@@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef __XEN_INFO_H__
 #define __XEN_INFO_H__
 
+#include <Uefi/UefiBaseType.h>
+

I don't think we want this #include in Guid/XenInfo.h.

Can you make sure that the locations that #include Guid/XenInfo.h include PiPei.h, PiDxe.h, or Uefi.h before Guid/XenInfo.h?

Quoted 3 lines
OvmfPkg/Include/Guid/XenInfo.h +0 -0
 #define EFI_XEN_INFO_GUID \
     { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } }
 
Quoted 12 lines

OvmfPkg/Include/Guid/XenInfo.h typedef struct { · line 44

Quoted 9 lines
OvmfPkg/Include/Guid/XenInfo.h +5 -0
@@ -35,6 +37,11 @@ typedef struct {
   /// Hypervisor minor version.
   ///
   UINT16 VersionMinor;
+  ///
+  /// E820 map
+  ///
+  EFI_PHYSICAL_ADDRESS E820;
+  UINT32 E820EntriesCount;

Can you add this chunk into the next patch which initializes E820/E820EntriesCount?

Actually ... this doesn't need to be added into EFI_XEN_INFO, since PlatformPei is the only thing looking at the tables, right?

So, maybe you just need a new function:
EFI_STATUS
XenGetE820Entries (
EFI_E820_ENTRY64 **Entries,
UINTN *Count
);

-Jordan

Quoted 64 lines

With those 2 changes, patches 3 & 4 are

Quoted 61 lines
OvmfPkg/Include/Guid/XenInfo.h +0 -0
 } EFI_XEN_INFO;
 
 extern EFI_GUID gEfiXenInfoGuid;
OvmfPkg/PlatformPei/Xen.h new file +44 -1
new file mode 100644
index 0000000..1885ede
@@ -0,0 +1,44 @@
+/** @file
+  Ovmf info structure passed by Xen
+
+Copyright (c) 2013, Wei Liu <[email protected]>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef __XEN_H__
+#define __XEN_H__
+
+#include <Uefi/UefiBaseType.h>
+
+// Physical address of OVMF info
+#define OVMF_INFO_PHYSICAL_ADDRESS 0x00001000
+
+// This structure must match the definition on Xen side
+#pragma pack(1)
+typedef struct {
+  CHAR8 Signature[14]; // XenHVMOVMF\0
+  UINT8 Length;        // Length of this structure
+  UINT8 Checksum;      // Set such that the sum over bytes 0..length == 0
+  //
+  // Physical address of an array of TablesCount elements.
+  //
+  // Each element contains the physical address of a BIOS table.
+  //
+  EFI_PHYSICAL_ADDRESS Tables;
+  UINT32 TablesCount;
+  //
+  // Physical address of the E820 table, contains E820EntriesCount entries.
+  //
+  EFI_PHYSICAL_ADDRESS E820;
+  UINT32 E820EntriesCount;
+} EFI_XEN_OVMF_INFO;
+#pragma pack()
+
+#endif /* __XEN_H__ */
--

1.7.10.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): CAFe8ug_WTQU3E2S=7LLrmMS7jWL94GsbAgKiPVRM7new-2aLOw@mail.gmail.com

author
#31 lore raw

Re: [PATCH v3 3/8] OvmfPkg: define EFI_XEN_OVMF_INFO and extend XenInfo

Quoted 48 lines · Jordan Justen
Quoted 34 lines · Jordan Justen
Quoted 19 lines · Wei Liu

EFI_XEN_OVMF_INFO is defined to accept configurations from hvmloader. It must match the definition on Xen side.

XenInfo is extended to include necessary bits as well. Currently only E820 map is in use.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/Include/Guid/XenInfo.h |    7 +++++++
 OvmfPkg/PlatformPei/Xen.h      |   44 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+)
 create mode 100644 OvmfPkg/PlatformPei/Xen.h
OvmfPkg/Include/Guid/XenInfo.h +0 -0
index d512b0b..6146080 100644

OvmfPkg/Include/Guid/XenInfo.h WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. · line 19

Quoted 5 lines
OvmfPkg/Include/Guid/XenInfo.h +2 -0
@@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #ifndef __XEN_INFO_H__
 #define __XEN_INFO_H__
 
+#include <Uefi/UefiBaseType.h>
+

I don't think we want this #include in Guid/XenInfo.h.

Can you make sure that the locations that #include Guid/XenInfo.h include PiPei.h, PiDxe.h, or Uefi.h before Guid/XenInfo.h?

Quoted 3 lines
OvmfPkg/Include/Guid/XenInfo.h +0 -0
 #define EFI_XEN_INFO_GUID \
     { 0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d } }
 
Quoted 12 lines

OvmfPkg/Include/Guid/XenInfo.h typedef struct { · line 44

Quoted 9 lines
OvmfPkg/Include/Guid/XenInfo.h +5 -0
@@ -35,6 +37,11 @@ typedef struct {
   /// Hypervisor minor version.
   ///
   UINT16 VersionMinor;
+  ///
+  /// E820 map
+  ///
+  EFI_PHYSICAL_ADDRESS E820;
+  UINT32 E820EntriesCount;

Can you add this chunk into the next patch which initializes E820/E820EntriesCount?

Quoted 3 lines

Actually ... this doesn't need to be added into EFI_XEN_INFO, since PlatformPei is the only thing looking at the tables, right?

At this stage, yes, we don't need HOB for this.

Quoted 7 lines

So, maybe you just need a new function:
EFI_STATUS
XenGetE820Entries (
EFI_E820_ENTRY64 **Entries,
UINTN *Count
);

Looks like a good approach.

Wei.

Quoted 2 lines

-Jordan

A message that is not in the archive (sent off-list or not yet received): [email protected]

#33 lore raw

Re: [edk2] [PATCH v3 7/8] OvmfPkg: introduce XenMemMapInitialization

Quoted 72 lines · Wei Liu

This function parses Xen OVMF info and arrange memory maps accordingly.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/PlatformPei/Platform.c |   70 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)
OvmfPkg/PlatformPei/Platform.c +49 -0
index 9b7828f..c2e7ba9 100644
@@ -34,6 +34,10 @@
 #include <Guid/MemoryTypeInformation.h>
 #include <Ppi/MasterBootMode.h>
 #include <IndustryStandard/Pci22.h>
+#include <Guid/XenInfo.h>
+#include <IndustryStandard/E820.h>
+#include <Library/ResourcePublicationLib.h>
+#include <Library/MtrrLib.h>
 
 #include "Platform.h"
 #include "Cmos.h"
@@ -163,6 +167,72 @@ AddUntestedMemoryRangeHob (
   AddUntestedMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase));
 }
 
+VOID
+XenMemMapInitialization (
+  VOID
+  )
+{
+  EFI_HOB_GUID_TYPE *GuidHob;
+  EFI_XEN_INFO *Info;
+
+  DEBUG ((EFI_D_ERROR, "Using memory map provided by Xen\n"));
+
+  GuidHob = GetFirstGuidHob (&gEfiXenInfoGuid);
+
+  ASSERT (GuidHob != NULL);
+
+  Info = GET_GUID_HOB_DATA (GuidHob);
+
+  //
+  // Create Memory Type Information HOB
+  //
+  BuildGuidDataHob (
+    &gEfiMemoryTypeInformationGuid,
+    mDefaultMemoryTypeInformation,
+    sizeof(mDefaultMemoryTypeInformation)
+    );
+
+  //
+  // Add PCI IO Port space available for PCI resource allocations.
+  //
+  BuildResourceDescriptorHob (
+    EFI_RESOURCE_IO,
+    EFI_RESOURCE_ATTRIBUTE_PRESENT     |
+    EFI_RESOURCE_ATTRIBUTE_INITIALIZED,
+    0xC000,
+    0x4000
+    );
+
+  //
+  // Video memory + Legacy BIOS region
+  //
+  AddIoMemoryRangeHob (0x0A0000, BASE_1MB);
+
+  //
+  // Parse RAM in E820 map
+  //
+  if (Info->E820EntriesCount > 0) {

OvmfPkg/PlatformPei/Platform.c AddUntestedMemoryRangeHob ( · line 224

Quoted 10 lines
OvmfPkg/PlatformPei/Platform.c +10 -0
+    EFI_E820_ENTRY64 *E820Map, *Entry;
+    UINT16 Loop;
+
+    E820Map = (EFI_E820_ENTRY64 *) Info->E820;
+    for (Loop = 0; Loop < Info->E820EntriesCount; Loop++) {
+      Entry = E820Map + Loop;
+
+      // only care about RAM
+      if (Entry->Type != EfiAcpiAddressRangeMemory)
+        continue;

I think you are going to change this code base on the XenGetE820Entries discussion in the patch 3 thread.

I just wanted to add that we always use curly-brackets:
if () {
}
even if the body is just a single line.

-Jordan

Quoted 28 lines
OvmfPkg/PlatformPei/Platform.c +11 -1
+
+      if (Entry->BaseAddr >= BASE_4GB)
+        AddUntestedMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length);
+      else
+        AddMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length);
+
+      MtrrSetMemoryAttribute (Entry->BaseAddr, Entry->Length, CacheWriteBack);
+    }
+  }
+}
+
 
 VOID
 MemMapInitialization (
--

1.7.10.4

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by
#35 lore raw

Re: [edk2] [PATCH v3 6/8] OvmfPkg: introduce PublishPeiMemory

Quoted 21 lines · Wei Liu

MemDetect actully does too many things, the underlying platform might want to have more control over memory layout.

Extract the functionality of publishing PEI memory to a dedicated function.

Also fixed wrong comment while I was there.

Contributed-under: TianoCore Contribution Agreement 1.0

---
 OvmfPkg/PlatformPei/MemDetect.c |   36 +++++++++++++++++++++++++++++++++++-
 OvmfPkg/PlatformPei/Platform.h  |    5 +++++
 2 files changed, 40 insertions(+), 1 deletion(-)
OvmfPkg/PlatformPei/MemDetect.c +0 -0
index 9f6ca19..dc44745 100644
@@ -83,11 +83,45 @@ GetSystemMemorySizeAbove4gb (
   return LShiftU64 (Size, 16);

OvmfPkg/PlatformPei/MemDetect.c GetSystemMemorySizeAbove4gb ( · line 93

Quoted 10 lines
OvmfPkg/PlatformPei/MemDetect.c +8 -0
 }
 
+/**
+  Publish PEI core memory
+
+  @return EFI_SUCCESS     The PEIM initialized successfully.
+
+**/
+EFI_STATUS
+PublishPeiMemory(

Space before open-paren.

OvmfPkg/PlatformPei/MemDetect.c GetSystemMemorySizeAbove4gb ( · line 102

Quoted 9 lines
OvmfPkg/PlatformPei/MemDetect.c +9 -0
+  VOID
+  )
+{
+  EFI_STATUS                  Status;
+  EFI_PHYSICAL_ADDRESS        MemoryBase;
+  UINT64                      MemorySize;
+  UINT64                      LowerMemorySize;
+
+  LowerMemorySize = GetSystemMemorySizeBelow4gb ();

I'm going to say

for patches 5 & 6, but I am not too happy with them.

For 5, I think maybe it would be nice to not require the details of 'XenLeaf' to leak out of Xen.c. I think XenDetect should return BOOLEAN, and store XenLeaf in a static global in Xen.c.

For 6, I think it is inconsistent that Xen continues to use CMOS here, but moves to the E820 tables otherwise. (GetSystemMemorySizeBelow4gb could have a different path for Xen, or maybe PublishPeiMemory could have an input parameter of MemoryLimit32Bit and get called by MemDetect too.)

But, these don't seem critical, so to reduce thrash for you I'll let you move forward with these patches as-is.

Quoted 30 lines
OvmfPkg/PlatformPei/MemDetect.c +17 -1
+  MemoryBase = PcdGet32 (PcdOvmfMemFvBase) + PcdGet32 (PcdOvmfMemFvSize);
+  MemorySize = LowerMemorySize - MemoryBase;
+  if (MemorySize > SIZE_64MB) {
+    MemoryBase = LowerMemorySize - SIZE_64MB;
+    MemorySize = SIZE_64MB;
+  }
+
+  //
+  // Publish this memory to the PEI Core
+  //
+  Status = PublishSystemMemory(MemoryBase, MemorySize);
+  ASSERT_EFI_ERROR (Status);
+
+  return Status;
+}
+
 
 /**
   Peform Memory Detection
 
-  @return EFI_SUCCESS     The PEIM initialized successfully.
+  @return Top of memory
 
 **/
 EFI_PHYSICAL_ADDRESS
OvmfPkg/PlatformPei/Platform.h +0 -0
index d63d124..01af2a9 100644

OvmfPkg/PlatformPei/Platform.h AddUntestedMemoryRangeHob ( · line 61

Quoted 5 lines
OvmfPkg/PlatformPei/Platform.h +2 -0
@@ -57,6 +57,11 @@ AddUntestedMemoryRangeHob (
   EFI_PHYSICAL_ADDRESS        MemoryLimit
   );
 
+EFI_STATUS
+PublishPeiMemory(

Space before open-paren.

-Jordan

Quoted 20 lines
OvmfPkg/PlatformPei/Platform.h +3 -1
+  VOID
+  );
+
 EFI_PHYSICAL_ADDRESS
 MemDetect (
   VOID
--

1.7.10.4

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

A message that is not in the archive (sent off-list or not yet received): CAFe8ug_StkH7SrtuTN7aPxxriG8Y7dV57WA8MDHthDUqSd5FXA@mail.gmail.com

author
#37 lore raw

Re: [edk2] [PATCH v3 6/8] OvmfPkg: introduce PublishPeiMemory

On Thu, Nov 28, 2013 at 08:31:11PM -0800, Jordan Justen wrote:
[...]

Quoted 18 lines

Review

Quoted 9 lines
(quoted diff) +9 -0
+  VOID
+  )
+{
+  EFI_STATUS                  Status;
+  EFI_PHYSICAL_ADDRESS        MemoryBase;
+  UINT64                      MemorySize;
+  UINT64                      LowerMemorySize;
+
+  LowerMemorySize = GetSystemMemorySizeBelow4gb ();

I'm going to say

for patches 5 & 6, but I am not too happy with them.

For 5, I think maybe it would be nice to not require the details of 'XenLeaf' to leak out of Xen.c. I think XenDetect should return BOOLEAN, and store XenLeaf in a static global in Xen.c.

Quoted 9 lines

For 6, I think it is inconsistent that Xen continues to use CMOS here, but moves to the E820 tables otherwise. (GetSystemMemorySizeBelow4gb could have a different path for Xen, or maybe PublishPeiMemory could have an input parameter of MemoryLimit32Bit and get called by MemDetect too.)

But, these don't seem critical, so to reduce thrash for you I'll let you move forward with these patches as-is.

Thanks for reviewing.

Wei.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#39 lore raw

Re: [PATCH v3 8/8] OvmfPkg: enable Xen specific path

Quoted 19 lines · Wei Liu

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

---
 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(-)
OvmfPkg/OvmfPkgIa32.dsc +0 -0
index 760bd41..d4851ed 100644

OvmfPkg/OvmfPkgIa32.dsc line 225

Quoted 5 lines
OvmfPkg/OvmfPkgIa32.dsc +1 -1
@@ -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.

Quoted 12 lines
OvmfPkg/OvmfPkgIa32.dsc +1 -0
   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
 
 
 ################################################################################

OvmfPkg/OvmfPkgIa32.dsc line 346

Quoted 5 lines
OvmfPkg/OvmfPkgIa32.dsc +1 -1
@@ -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.

-Jordan

Quoted 112 lines
OvmfPkg/OvmfPkgIa32.dsc +0 -0
   }
   IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
   MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
OvmfPkg/OvmfPkgIa32X64.dsc +3 -2
index 268d722..d9072e7 100644
@@ -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
OvmfPkg/OvmfPkgX64.dsc +3 -2
index 53945d0..71b178e 100644
@@ -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
OvmfPkg/PlatformPei/Platform.c +9 -2
index c2e7ba9..8daf9f4 100644
@@ -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 ();
 
OvmfPkg/PlatformPei/PlatformPei.inf +1 -1
index 3d5cbbb..7fe9d47 100644
@@ -65,6 +65,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
   gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
   gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
   gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress
 
 [Ppis]
--

1.7.10.4

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

A message that is not in the archive (sent off-list or not yet received): CAFe8ug9km5R2eQV-MwvQMeUWnpi26oiBTgu8DDAjMz7WGXhAmQ@mail.gmail.com

author
#41 lore raw

Re: [PATCH v3 8/8] OvmfPkg: enable Xen specific path

Quoted 15 lines · Jordan Justen
Quoted 14 lines · Wei Liu

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

---
 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(-)
Quoted 14 lines

OvmfPkg/OvmfPkgIa32.dsc line 225

Quoted 10 lines
OvmfPkg/OvmfPkgIa32.dsc +1 -1
index 760bd41..d4851ed 100644
@@ -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

Quoted 10 lines
Quoted 10 lines
OvmfPkg/OvmfPkgIa32.dsc +1 -0
   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
 
 
Quoted 10 lines

OvmfPkg/OvmfPkgIa32.dsc line 346

Quoted 7 lines
OvmfPkg/OvmfPkgIa32.dsc +1 -1
 ################################################################################
@@ -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.