Re: [edk2-devel] [PATCH v5 3/3] ShellPkg/UefiShellDebug1CommandsLib: Update to support SmBios 3.3.0

2019-10-08 Thread Gao, Zhichao
How about change the function name from ProcessorArchitectureType to 
DisplayProcessorArchitectureType?

And why separate the processor arch type display into two section:
i.e. first display " ProcessorSpecificBlock.ProcessorArchType: 0xXX" thru 
PRINT_STRUCT_VALUE_H, second display the value's meaning thru 
ProcessorArchitectureType, such as " 128-bit RISC-V (RV128)".
I suggest to put them into one function DisplayProcessorArchitectureType like 
other functions did. Such as the blowing format:
VOID
DisplayMCHostInterfaceType (
  IN UINT8 Key,
  IN UINT8 Option
  )
{
  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN 
(STR_SMBIOSVIEW_QUERYTABLE_MC_HOST_INTERFACE_TYPE), gShellDebug1HiiHandle);
  PRINT_INFO_OPTION (Key, Option);
  PRINT_TABLE_ITEM (MCHostInterfaceTypeTable, Key);
}

Thanks,
Zhichao

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Abner Chang
> Sent: Tuesday, October 8, 2019 4:04 PM
> To: devel@edk2.groups.io
> Cc: abner.ch...@hpe.com; Carsey, Jaben ; Ni,
> Ray ; Gao, Zhichao ; Leif
> Lindholm ; Gilbert Chen 
> Subject: [edk2-devel] [PATCH v5 3/3]
> ShellPkg/UefiShellDebug1CommandsLib: Update to support SmBios 3.3.0
> 
> Shell command smbiosview updates for SMBIOS 3.3.0 spec.
> 
> Bugzilla link,
> https://bugzilla.tianocore.org/show_bug.cgi?id=2202
> 
> Signed-off-by: Abner Chang 
> 
> Cc: Jaben Carsey 
> Cc: Ray Ni 
> Cc: Zhichao Gao 
> Cc: Leif Lindholm 
> Cc: Gilbert Chen 
> ---
>  .../SmbiosView/PrintInfo.c | 23 +++-
>  .../SmbiosView/PrintInfo.h | 13 -
>  .../SmbiosView/QueryTable.c| 63 
> +-
>  .../UefiShellDebug1CommandsLib.uni |  3 +-
>  4 files changed, 98 insertions(+), 4 deletions(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> index cfd7a2b..ff0c1db 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> @@ -3,7 +3,7 @@
> 
>Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
>(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
> -  (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
> +  (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -1169,6 +1169,15 @@ SmbiosPrintStructure (
>  break;
> 
>//
> +  // Processor Additional Information (Type 44)  //  case 44:
> +PRINT_STRUCT_VALUE_H (Struct, Type44, RefHandle);
> +PRINT_STRUCT_VALUE_H (Struct, Type44,
> ProcessorSpecificBlock.ProcessorArchType);
> +ProcessorArchitectureType (Struct->Type44-
> >ProcessorSpecificBlock.ProcessorArchType, Option);
> +break;
> +
> +  //
>// Inactive (Type 126)
>//
>case 126:
> @@ -2350,6 +2359,18 @@ DisplayProcessorFamily2 (
>Print (L"Video Processor\n");
>break;
> 
> +case 0x200:
> +  Print (L"RISC-V RV32\n");
> +  break;
> +
> +case 0x201:
> +  Print (L"RISC-V RV64\n");
> +  break;
> +
> +case 0x202:
> +  Print (L"RISC-V RV128\n");
> +  break;
> +
>  default:
>   ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN
> (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY),
> gShellDebug1HiiHandle);
>}
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
> index a8c32ab..22f59d6 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
> @@ -2,7 +2,7 @@
>Module to clarify the element info of the smbios structure.
> 
>Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
> -  (C) Copyright 2017 Hewlett Packard Enterprise Development LP
> +  (C) Copyright 2017 - 2019 Hewlett Packard Enterprise Development
> + LP
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -427,4 +427,15 @@ DisplayTpmDeviceCharacteristics (
>IN UINT8   Option
>);
> 
> +/**
> +  Display Processor Architecture Type (Type 44).
> +
> +  @param[in] Type   The key of the structure.
> +  @param[in] Option The optional information.
> +**/
> +VOID
> +ProcessorArchitectureType (
> +  IN UINT8 Type,
> +  IN UINT8 Option
> +  );
>  #endif
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.
> c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.
> c
> index bfb7c3b..54e9a52 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.
> c
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.
> +++ c
> @@ -3,7 +3,7 @@
>And give a interface of query a string out of a table.
> 
>Copyright (c) 2005 - 2018, 

Re: [edk2-devel] [PATCH v1 1/1] NetworkPkg/SnpDxe: Remove ExitBootServices event

2019-10-08 Thread Siyuan, Fu
Hi, Maciej

Have you tested what will happen if this SNP co-work with those UNDI drivers 
which don't have an ExitBootService event callback to shut down its DMA 
activity? And what's the impact to OS if UNDI's DMA is not shut down?

Best Regards
Siyuan 

> -Original Message-
> From: Rabeda, Maciej 
> Sent: 2019年10月9日 0:16
> To: devel@edk2.groups.io
> Cc: Fu, Siyuan ; Wu, Jiaxin 
> Subject: [PATCH v1 1/1] NetworkPkg/SnpDxe: Remove ExitBootServices
> event
> 
> Patch addresses Bugzilla #1972.
> During ExitBootServices stage, drivers should not call any
> functions known to use Memory Allocation Services. One of such
> functions (as per UEFI spec) is UNDI->Shutdown().
> 
> Since UNDI drivers during ExitBootServices phase are expected
> to put the adapter to such a state that it will not perform any DMA
> operations, there is no need to interface UNDI by SNP driver during
> that phase.
> 
> Finally, since ExitBootServices event notification function in SNP
> only calls UNDI->Shutdown() and Stop() functions, there is no need
> to create this event at all.
> 
> Signed-off-by: Maciej Rabeda 
> Cc: Siyuan Fu 
> Cc: Jiaxin Wu 
> ---
>  NetworkPkg/SnpDxe/Snp.c  | 45 
>  NetworkPkg/SnpDxe/Snp.h  |  2 -
>  NetworkPkg/SnpDxe/SnpDxe.inf |  3 --
>  3 files changed, 50 deletions(-)
> 
> diff --git a/NetworkPkg/SnpDxe/Snp.c b/NetworkPkg/SnpDxe/Snp.c
> index a23af05078bc..7646a3ce0293 100644
> --- a/NetworkPkg/SnpDxe/Snp.c
> +++ b/NetworkPkg/SnpDxe/Snp.c
> @@ -8,31 +8,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  #include "Snp.h"
> 
> -/**
> -  One notified function to stop UNDI device when gBS->ExitBootServices()
> called.
> -
> -  @param  Event   Pointer to this event
> -  @param  Context Event handler private data
> -
> -**/
> -VOID
> -EFIAPI
> -SnpNotifyExitBootServices (
> -  EFI_EVENT Event,
> -  VOID  *Context
> -  )
> -{
> -  SNP_DRIVER *Snp;
> -
> -  Snp  = (SNP_DRIVER *)Context;
> -
> -  //
> -  // Shutdown and stop UNDI driver
> -  //
> -  PxeShutdown (Snp);
> -  PxeStop (Snp);
> -}
> -
>  /**
>Send command to UNDI. It does nothing currently.
> 
> @@ -647,21 +622,6 @@ SimpleNetworkDriverStart (
>PxeShutdown (Snp);
>PxeStop (Snp);
> 
> -  //
> -  // Create EXIT_BOOT_SERIVES Event
> -  //
> -  Status = gBS->CreateEventEx (
> -  EVT_NOTIFY_SIGNAL,
> -  TPL_NOTIFY,
> -  SnpNotifyExitBootServices,
> -  Snp,
> -  ,
> -  >ExitBootServicesEvent
> -  );
> -  if (EFI_ERROR (Status)) {
> -goto Error_DeleteSNP;
> -  }
> -
>//
>//  add SNP to the undi handle
>//
> @@ -778,11 +738,6 @@ SimpleNetworkDriverStop (
>  return Status;
>}
> 
> -  //
> -  // Close EXIT_BOOT_SERIVES Event
> -  //
> -  gBS->CloseEvent (Snp->ExitBootServicesEvent);
> -
>Status = gBS->CloseProtocol (
>Controller,
>_31,
> diff --git a/NetworkPkg/SnpDxe/Snp.h b/NetworkPkg/SnpDxe/Snp.h
> index e6b62930397d..f83a4f075adc 100644
> --- a/NetworkPkg/SnpDxe/Snp.h
> +++ b/NetworkPkg/SnpDxe/Snp.h
> @@ -120,8 +120,6 @@ typedef struct {
>  VOID  *MapCookie;
>} MapList[MAX_MAP_LENGTH];
> 
> -  EFI_EVENT  ExitBootServicesEvent;
> -
>//
>// Whether UNDI support reporting media status from GET_STATUS
> command,
>// i.e. PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED or
> diff --git a/NetworkPkg/SnpDxe/SnpDxe.inf
> b/NetworkPkg/SnpDxe/SnpDxe.inf
> index afeb1526cc10..8d045cfcf4ca 100644
> --- a/NetworkPkg/SnpDxe/SnpDxe.inf
> +++ b/NetworkPkg/SnpDxe/SnpDxe.inf
> @@ -64,9 +64,6 @@
>DebugLib
>NetLib
> 
> -[Guids]
> -  gEfiEventExitBootServicesGuid ## SOMETIMES_CONSUMES ##
> Event
> -
>  [Protocols]
>gEfiSimpleNetworkProtocolGuid ## BY_START
>gEfiDevicePathProtocolGuid## TO_START
> --
> 2.17.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48621): https://edk2.groups.io/g/devel/message/48621
Mute This Topic: https://groups.io/mt/3145/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms][PATCH V1 17/17] SimicsOpenBoardPkg: Assign unique token namespace

2019-10-08 Thread Agyeman, Prince
Reviewed-by: Prince Agyeman 

-Original Message-
From: Kubacki, Michael A 
Sent: Monday, October 7, 2019 10:17 PM
To: devel@edk2.groups.io
Cc: Agyeman, Prince ; Wei, David Y 

Subject: [edk2-platforms][PATCH V1 17/17] SimicsOpenBoardPkg: Assign unique 
token namespace

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2249

PCDs declared in the SimicsOpenBoardPkg currently use the GUID 
gBoardModuleTokenSpaceGuid. The same name is used in other board packages and a 
package has been added called BoardModulePkg so this name is now misleading.

This change assigns a unique GUID value and a name specific to the package to 
provide differentiation from PCDs in other board packages.

Cc: Agyeman Prince 
Cc: Wei David Y 
Signed-off-by: Michael Kubacki 
---
 Platform/Intel/SimicsOpenBoardPkg/OpenBoardPkg.dec 
 | 72 ++--
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
 | 14 ++--
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf   
 | 12 ++--
 
Platform/Intel/SimicsOpenBoardPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf 
| 14 ++--
 Platform/Intel/SimicsOpenBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
 | 10 +--
 
Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
 | 10 +--
 Platform/Intel/SimicsOpenBoardPkg/SecCore/SecMain.inf  
 | 18 ++---
 Platform/Intel/SimicsOpenBoardPkg/SimicsPei/SimicsPei.inf  
 | 36 +-
 Platform/Intel/SimicsOpenBoardPkg/SimicsVideoDxe/SimicsVideoDxe.inf
 |  2 +-
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/DecomprScratchEnd.fdf.inc  
 |  6 +-
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf.inc   
 | 16 ++---
 11 files changed, 105 insertions(+), 105 deletions(-)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/OpenBoardPkg.dec 
b/Platform/Intel/SimicsOpenBoardPkg/OpenBoardPkg.dec
index 40487820fa..421c464023 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/OpenBoardPkg.dec
+++ b/Platform/Intel/SimicsOpenBoardPkg/OpenBoardPkg.dec
@@ -17,57 +17,57 @@
   Include
 
 [Guids]
-  gBoardModuleTokenSpaceGuid  = {0xeed35f57, 0x4ff2, 0x4244, {0xb8, 0x3a, 
0xea, 0x71, 0x5f, 0xd3, 0x59, 0xa5}}
+  gSimicsOpenBoardPkgTokenSpaceGuid  = {0x75fd61da, 0x3931, 0x49aa, 
+ {0x8f, 0x11, 0x18, 0x25, 0xf6, 0x31, 0x21, 0xd2}}
   gSimicsBoardConfigGuid  = {0xeed35f57, 0x4ff2, 0x4244, {0xb8, 0x3a, 0xea, 
0x71, 0x5f, 0xd3, 0x59, 0xa5}}
 
 [PcdsFixedAtBuild]
-  gBoardModuleTokenSpaceGuid.PcdSimicsPeiMemFvBase|0x0|UINT32|0
-  gBoardModuleTokenSpaceGuid.PcdSimicsPeiMemFvSize|0x0|UINT32|1
-  gBoardModuleTokenSpaceGuid.PcdSimicsDxeMemFvBase|0x0|UINT32|0x15
-  gBoardModuleTokenSpaceGuid.PcdSimicsDxeMemFvSize|0x0|UINT32|0x16
+  gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsPeiMemFvBase|0x0|UINT32|0
+  gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsPeiMemFvSize|0x0|UINT32|1
+
+ gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsDxeMemFvBase|0x0|UINT32|0x1
+ 5
+
+ gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsDxeMemFvSize|0x0|UINT32|0x1
+ 6
 
   #TODO: Remove these two when we integrate new PlatformPei
-  gBoardModuleTokenSpaceGuid.PcdSimicsMemFvBase|0x0080|UINT32|2
-  gBoardModuleTokenSpaceGuid.PcdSimicsMemFvSize|0x0050|UINT32|3
+
+ gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsMemFvBase|0x0080|UINT32
+ |2
+
+ gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsMemFvSize|0x0050|UINT32
+ |3
 
-  gBoardModuleTokenSpaceGuid.PcdSimicsFlashNvStorageEventLogBase|0x0|UINT32|0x8
-  gBoardModuleTokenSpaceGuid.PcdSimicsFlashNvStorageEventLogSize|0x0|UINT32|0x9
-  gBoardModuleTokenSpaceGuid.PcdSimicsFirmwareFdSize|0x0|UINT32|0xa
-  gBoardModuleTokenSpaceGuid.PcdSimicsFirmwareBlockSize|0|UINT32|0xb
-  gBoardModuleTokenSpaceGuid.PcdSimicsFlashNvStorageVariableBase|0x0|UINT32|0xc
-  gBoardModuleTokenSpaceGuid.PcdSimicsFlashNvStorageFtwSpareBase|0x0|UINT32|0xd
-  
gBoardModuleTokenSpaceGuid.PcdSimicsFlashNvStorageFtwWorkingBase|0x0|UINT32|0xe
-  gBoardModuleTokenSpaceGuid.PcdSimicsFdBaseAddress|0x0|UINT32|0xf
-  gBoardModuleTokenSpaceGuid.PcdSimicsSecPageTablesBase|0x0|UINT32|0x11
-  gBoardModuleTokenSpaceGuid.PcdSimicsSecPageTablesSize|0x0|UINT32|0x12
-  gBoardModuleTokenSpaceGuid.PcdSimicsSecPeiTempRamBase|0x0|UINT32|0x13
-  gBoardModuleTokenSpaceGuid.PcdSimicsSecPeiTempRamSize|0x0|UINT32|0x14
-  gBoardModuleTokenSpaceGuid.PcdSimicsLockBoxStorageBase|0x0|UINT32|0x18
-  gBoardModuleTokenSpaceGuid.PcdSimicsLockBoxStorageSize|0x0|UINT32|0x19
-  gBoardModuleTokenSpaceGuid.PcdGuidedExtractHandlerTableSize|0x0|UINT32|0x1a
-  gBoardModuleTokenSpaceGuid.PcdSimicsDecompressionScratchEnd|0x0|UINT32|0x1f
+
+ gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsFlashNvStorageEventLogBase|
+ 0x0|UINT32|0x8
+
+ gSimicsOpenBoardPkgTokenSpaceGuid.PcdSimicsFlashNvStorageEventLogSize|
+ 0x0|UINT32|0x9
+ 

Re: [edk2-devel] [edk2-platforms][PATCH V1 16/17] SimicsOpenBoardPkg/BoardX58Ich10: DSC cleanup

2019-10-08 Thread Agyeman, Prince
Reviewed-by: Prince Agyeman 

-Original Message-
From: Kubacki, Michael A 
Sent: Monday, October 7, 2019 10:17 PM
To: devel@edk2.groups.io
Cc: Agyeman, Prince ; Wei, David Y 

Subject: [edk2-platforms][PATCH V1 16/17] SimicsOpenBoardPkg/BoardX58Ich10: DSC 
cleanup

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2244

This change refactors OpenBoardPkg.dsc and OpenBoardPkgPcd.dsc to consolidate 
redundant sections and better group file content to improve maintainability and 
readability.

The same pattern made in this change for BoardX58Ich10 is being applied to all 
existing board packages in Platform/Intel to improve overall consistency.

Cc: Agyeman Prince 
Cc: Wei David Y 
Signed-off-by: Michael Kubacki 
---
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc| 282 
+++--
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc | 418 
+---
 2 files changed, 361 insertions(+), 339 deletions(-)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc 
b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
index 40f864ae17..4f8ab4170d 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
@@ -1,6 +1,7 @@
 ## @file
+#  The main build description file for the X58Ich10 board.
 #
-# Copyright (c) 2019 Intel Corporation. All rights reserved. 
+# Copyright (c) 2019, Intel Corporation. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -33,7 +34,7 @@
   DEFINE SMM_REQUIRE = TRUE
 
   #
-  #PLATFORMX64_ENABLE is set to TRUE when PEI is IA32 and DXE is X64 platform
+  # PLATFORMX64_ENABLE is set to TRUE when PEI is IA32 and DXE is X64 
+ platform
   #
   DEFINE PLATFORMX64_ENABLE = TRUE
   DEFINE NETWORK_TLS_ENABLE = FALSE
@@ -45,7 +46,7 @@
 
 

 #
-# SKU Identification section - list of all SKU IDs supported by this Platform.
+# SKU Identification section - list of all SKU IDs supported by this board.
 #
 

 [SkuIds]
@@ -53,173 +54,232 @@
 
 

 #
-# Library Class section - list of all Library Classes needed by this Platform.
+# Includes section - other DSC file contents included for this board build.
 #
 

 
-  !include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
-  !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
-  !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
-  !include $(PCH_PKG)/IchCommonLib.dsc
+###
+# Library Includes
+###
+!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreCommonLib.dsc
+!include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiLib.dsc
+!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeLib.dsc
+!include $(PCH_PKG)/IchCommonLib.dsc
+
+###
+# Component Includes
+###
+[Components.IA32]
+!include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiInclude.dsc
+!include $(SKT_PKG)/SktPkgPei.dsc
+
+[Components.X64]
+!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc
+!include AdvancedFeaturePkg/Include/Dsc/CoreAdvancedDxeInclude.dsc
+
+###
+# Build Option Includes
+###
+!include $(BOARD_PKG)/$(BOARD_NAME)/OpenBoardPkgBuildOption.dsc
+
+###
+#
+#
+# Library Class section - list of all Library Classes needed by this board.
+#
+###
+#
 
 [LibraryClasses]
-  ReportFvLib|$(BOARD_PKG)/Library/PeiReportFvLib/PeiReportFvLib.inf
+  ###
+  # Edk2 Packages
+  ###
   BootLogoLib|MdeModulePkg/Library/BootLogoLib/BootLogoLib.inf
+
+ CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull
+ /CpuExceptionHandlerLibNull.inf
+ S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScr
+ iptLib.inf
   SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
+
+  #
+  # Platform Package
+  #
+
+ AslUpdateLib|$(PLATFORM_PACKAGE)/Acpi/Library/DxeAslUpdateLib/DxeAslUp
+ dateLib.inf
+ BoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/BoardInitLibNull
+ /BoardInitLibNull.inf
+ PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSim
+ ple/PciSegmentInfoLibSimple.inf
+ TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNu
+ ll/TestPointCheckLibNull.inf
+
+  ###

Re: [edk2-devel] [edk2-platforms][PATCH V1 15/17] SimicsOpenBoardPkg/BoardX58Ich10: Remove OpenBoardPkgConfig.dsc

2019-10-08 Thread Agyeman, Prince
Reviewed-by: Prince Agyeman 

-Original Message-
From: Kubacki, Michael A 
Sent: Monday, October 7, 2019 10:17 PM
To: devel@edk2.groups.io
Cc: Agyeman, Prince ; Wei, David Y 

Subject: [edk2-platforms][PATCH V1 15/17] SimicsOpenBoardPkg/BoardX58Ich10: 
Remove OpenBoardPkgConfig.dsc

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2244

The location for PCD configuration is currently inconsistent in 
SimicsOpenBoardPkg. A large set of FeaturePCD definitions are in 
OpenBoardPkgConfig.dsc while other PCD definitions (including
FeaturePCD) are located in OpenBoardPkgPcd.dsc.

This change consolidates PCD configuration for the BoardX58Ich10 board to 
OpenBoardPkgPcd.dsc and removes OpenBoardPkgConfig.dsc.

Cc: Agyeman Prince 
Cc: Wei David Y 
Signed-off-by: Michael Kubacki 
---
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc   |  1 -
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgConfig.dsc | 56 

 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc| 43 
+++
 3 files changed, 43 insertions(+), 57 deletions(-)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc 
b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
index be29737c16..40f864ae17 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
@@ -40,7 +40,6 @@
   DEFINE NETWORK_ISCSI_ENABLE   = FALSE
   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
 
-  !include $(BOARD_PKG)/$(BOARD_NAME)/OpenBoardPkgConfig.dsc
   !include $(BOARD_PKG)/$(BOARD_NAME)/OpenBoardPkgPcd.dsc
   !include NetworkPkg/NetworkDefines.dsc.inc
 
diff --git 
a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgConfig.dsc 
b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgConfig.dsc
deleted file mode 100644
index 75de60e5bc..00
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgConfig.dsc
+++ /dev/null
@@ -1,56 +0,0 @@
-## @file
-#
-# Copyright (c) 2019 Intel Corporation. All rights reserved.  -# -# 
SPDX-License-Identifier: BSD-2-Clause-Patent -# -##
-
-#
-# TRUE is ENABLE. FALSE is DISABLE.
-#
-
-[PcdsFixedAtBuild]
-  gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4
-
-[PcdsFeatureFlag]
-  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
-  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
-  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
-  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
-  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
-  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2
-  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
-  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 3
-  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
-  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|TRUE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 4
-  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
-!endif
-
-!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 5
-  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|TRUE
-  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|TRUE
-!endif
-
-  !if $(TARGET) == DEBUG
-gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|TRUE
-  !else
-gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
-  !endif
-
-  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
-
-  gAdvancedFeaturePkgTokenSpaceGuid.PcdNetworkEnable|TRUE
-  gAdvancedFeaturePkgTokenSpaceGuid.PcdSmbiosEnable|TRUE
-
diff --git 
a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc 
b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
index 3bf10ee524..ad5e0c5a38 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkgPcd.ds
+++ c
@@ -11,7 +11,50 @@
 # Pcd Section - list of all EDK II PCD Entries defined by this Platform  #  

+[PcdsFixedAtBuild]
+  gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4
+
 [PcdsFeatureFlag.common]
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
+!endif
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE
+!endif
+
+!if 

Re: [edk2-devel] [edk2-platforms][PATCH V1 14/17] SimicsOpenBoardPkg/BoardX58Ich10: Relocate DSC includes

2019-10-08 Thread Agyeman, Prince
Reviewed-by: Prince Agyeman 

-Original Message-
From: Kubacki, Michael A 
Sent: Monday, October 7, 2019 10:17 PM
To: devel@edk2.groups.io
Cc: Agyeman, Prince ; Wei, David Y 

Subject: [edk2-platforms][PATCH V1 14/17] SimicsOpenBoardPkg/BoardX58Ich10: 
Relocate DSC includes

This change moves the following DSC file includes to the top of the 
OpenBoardPkg.dsc file. This is to improve visibility and align placement of the 
include with other board DSC files.

 * OpenBoardPkgConfig.dsc
 * OpenBoardPkgPcd.dsc
 * CorePeiLib.dsc
 * CoreDxeLib.dsc

Cc: Agyeman Prince 
Cc: Wei David Y 
Signed-off-by: Michael Kubacki 
---
 Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc | 21 
+++-
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc 
b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
index 59e13154a7..be29737c16 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
+++ b/Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.dsc
@@ -39,7 +39,11 @@
   DEFINE NETWORK_TLS_ENABLE = FALSE
   DEFINE NETWORK_ISCSI_ENABLE   = FALSE
   DEFINE NETWORK_ALLOW_HTTP_CONNECTIONS = TRUE
+
+  !include $(BOARD_PKG)/$(BOARD_NAME)/OpenBoardPkgConfig.dsc
+  !include $(BOARD_PKG)/$(BOARD_NAME)/OpenBoardPkgPcd.dsc
   !include NetworkPkg/NetworkDefines.dsc.inc
+
 

 #
 # SKU Identification section - list of all SKU IDs supported by this Platform.
@@ -54,12 +58,9 @@
 #
 

 
-[PcdsFeatureFlag]
-  #
-  # Platform On/Off features are defined here
-  #
-  !include $(BOARD_PKG)/$(BOARD_NAME)/OpenBoardPkgConfig.dsc
   !include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+  !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+  !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
   !include $(PCH_PKG)/IchCommonLib.dsc
 
 [LibraryClasses]
@@ -76,17 +77,13 @@
   
SiliconPolicyInitLib|$(BOARD_PKG)/Policy/Library/SiliconPolicyInitLib/SiliconPolicyInitLib.inf
   
SiliconPolicyUpdateLib|$(BOARD_PKG)/Policy/Library/SiliconPolicyUpdateLib/SiliconPolicyUpdateLib.inf
   
PciSegmentInfoLib|MinPlatformPkg/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
-
-  !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
-
   
S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf
   AslUpdateLib|MinPlatformPkg/Acpi/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf
   LogoLib|$(BOARD_PKG)/Library/DxeLogoLib/DxeLogoLib.inf
+
 [LibraryClasses.common.SEC]
   
ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf
 
-[LibraryClasses.common.PEI_CORE]
-
 [LibraryClasses.common.PEIM]
   
PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf
   MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
@@ -97,16 +94,12 @@
 !endif
   TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/PeiTestPointLib.inf
 
-  !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
-
 [LibraryClasses.common.DXE_DRIVER]
   
PlatformBootManagerLib|$(BOARD_PKG)/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
 
 [LibraryClasses.common.DXE_SMM_DRIVER]
   
SpiFlashCommonLib|$(PCH_PKG)/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf
 
-  !include $(BOARD_PKG)/$(BOARD_NAME)/OpenBoardPkgPcd.dsc
-
 [Components.IA32]
   $(BOARD_PKG)/SecCore/SecMain.inf {
 
--
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48617): https://edk2.groups.io/g/devel/message/48617
Mute This Topic: https://groups.io/mt/34439450/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 1/4] UefiCpuPkg/MpInitLib: honor the platform's boot CPU count in AP detection

2019-10-08 Thread Dong, Eric
Hi Laszlo,

> -Original Message-
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> Laszlo Ersek
> Sent: Tuesday, October 8, 2019 7:27 PM
> To: edk2-devel-groups-io 
> Cc: Dong, Eric ; Igor Mammedov
> ; Ni, Ray 
> Subject: [edk2-devel] [PATCH 1/4] UefiCpuPkg/MpInitLib: honor the platform's
> boot CPU count in AP detection
> 
> If a platform boots with a CPU topology that is not fully populated (that
> is, the boot CPU count is smaller than PcdCpuMaxLogicalProcessorNumber),
> then the platform cannot use the "fast AP detection" logic added in commit
> 6e1987f19af7. Said logic depends on the boot CPU count being equal to
> PcdCpuMaxLogicalProcessorNumber.
> 
> The platform may not be able to use the variant added in commit
> 0594ec417c89 either, for different reasons; see for example commit
> 861218740d6d.
> 
> Allow platforms to specify the exact boot CPU count, independently of
> PcdCpuMaxLogicalProcessorNumber.
> 
> Cc: Eric Dong 
> Cc: Igor Mammedov 
> Cc: Ray Ni 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1515
> Signed-off-by: Laszlo Ersek 
> ---
>  UefiCpuPkg/UefiCpuPkg.dec | 11 +
>  UefiCpuPkg/UefiCpuPkg.uni |  4 ++
>  UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |  1 +
>  UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |  3 +-
>  UefiCpuPkg/Library/MpInitLib/MpLib.c  | 42 
>  5 files changed, 43 insertions(+), 18 deletions(-)
> 
> diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec
> index 031a2ccd680a..d6b33fd9b465 100644
> --- a/UefiCpuPkg/UefiCpuPkg.dec
> +++ b/UefiCpuPkg/UefiCpuPkg.dec
> @@ -227,6 +227,17 @@ [PcdsFixedAtBuild, PcdsPatchableInModule,
> PcdsDynamic, PcdsDynamicEx]
>## Specifies timeout value in microseconds for the BSP to detect all APs 
> for
> the first time.
># @Prompt Timeout for the BSP to detect all APs for the first time.
> 
> gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5|UI
> NT32|0x0004
> +  ## Specifies the number of Logical Processors that are available in the
> +  #  preboot environment after platform reset, including BSP and APs. 
> Possible
> +  #  values:
> +  #  zero (default) - This PCD is ignored, and
> +  #   PcdCpuApInitTimeOutInMicroSeconds limits the initial AP
> +  #   detection by the BSP.
> +  #  nonzero- PcdCpuApInitTimeOutInMicroSeconds is ignored. The 
> initial
> +  #   AP detection finishes when the detected CPU count (BSP
> +  #   plus APs) reaches the value of this PCD.
> +  # @Prompt Number of Logical Processors available after platform reset.
> +
> gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber|0|UINT32
> |0x0008
>## Specifies the base address of the first microcode Patch in the microcode
> Region.
># @Prompt Microcode Region base address.
> 
> gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchAddress|0x0|UINT64|0x
> 0005
> diff --git a/UefiCpuPkg/UefiCpuPkg.uni b/UefiCpuPkg/UefiCpuPkg.uni
> index fbf768072668..a7e279c5cb14 100644
> --- a/UefiCpuPkg/UefiCpuPkg.uni
> +++ b/UefiCpuPkg/UefiCpuPkg.uni
> @@ -37,6 +37,10 @@
> 
>  #string
> STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuApInitTimeOutInMicroSeconds_HEL
> P  #language en-US "Specifies timeout value in microseconds for the BSP to
> detect all APs for the first time."
> 
> +#string
> STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuBootLogicalProcessorNumber_PRO
> MPT  #language en-US "Number of Logical Processors available after platform
> reset."
> +
> +#string
> STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuBootLogicalProcessorNumber_HELP
> #language en-US "Specifies the number of Logical Processors that are available
> in the preboot environment after platform reset, including BSP and APs."
> +
>  #string
> STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuMicrocodePatchAddress_PROMPT
> #language en-US "Microcode Region base address."
> 
>  #string
> STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuMicrocodePatchAddress_HELP
> #language en-US "Specifies the base address of the first microcode Patch in
> the microcode Region."
> diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> index 37b3f64e578a..cd912ab0c5ee 100644
> --- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> @@ -61,6 +61,7 @@ [Guids]
> 
>  [Pcd]
>gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber##
> CONSUMES
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber   ##
> CONSUMES
>gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds  ##
> SOMETIMES_CONSUMES
>gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize  ## 
> CONSUMES
>gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchAddress##
> CONSUMES
> diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
> b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
> index 82b77b63ea87..1538185ef99a 100644
> 

Re: [edk2-devel] Cancelled Event: TianoCore Design / Bug Triage - EMEA #cal-cancelled

2019-10-08 Thread Stephano Cetola
I'm going to cancel these meetings going forward as we have not been receiving 
regular designs to review.

If I do get any design review requests, I will schedule this meeting on a "as 
needed" basis.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48615): https://edk2.groups.io/g/devel/message/48615
Mute This Topic: https://groups.io/mt/34448876/21656
Mute #cal-cancelled: https://groups.io/mk?hashtag=cal-cancelled=3846945
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] Cancelled Event: TianoCore Design / Bug Triage - EMEA #cal-cancelled

2019-10-08 Thread devel@edk2.groups.io Calendar
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Groups.io Inc//Groups.io Calendar//EN
METHOD:CANCEL
CALSCALE:GREGORIAN
BEGIN:VEVENT
STATUS:CANCELLED
UID:calendar.15...@groups.io
DTSTAMP:20191009T000616Z
ORGANIZER;CN=Stephano Cetola:mailto:stephano.cet...@linux.intel.com
DTSTART:20190529T15Z
DTEND:20190529T16Z
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=WE
SUMMARY:TianoCore Design / Bug Triage - EMEA
DESCRIPTION:Meeting URL\n\nhttps://bluejeans.com/889357567?src=join_info\n\nMeeting ID\n\n889 357 567\n\nWant to dial in from a phone?\n\nDial one of the following numbers:\n\n+1.408.740.7256 (US (San Jose))\n\n+1.408.317.9253 (US (Primary, San Jose))\n\n(see all numbers - https://www.bluejeans.com/numbers)\n\nEnter the meeting ID and passcode followed by #
LOCATION:https://bluejeans.com/889357567?src=join_info
SEQUENCE:0
END:VEVENT
END:VCALENDAR


invite.ics
Description: application/ics


Re: [edk2-devel] [PATCH 00/35] edk2: clean up the usage of standardized (VOID*) typedefs

2019-10-08 Thread Laszlo Ersek
On 09/17/19 21:49, Laszlo Ersek wrote:
> Repository: https://github.com/lersek/edk2.git
> Branch: voidptr
> 
> The UEFI / PI / Shell specifications define a number of standard types
> as pointers to VOID. This is arguably a design mistake; those types
> should have been pointers to distinct incomplete union or structure
> types. Here's why:
> 
> Roughly paraphrasing the constraints from ISO C99 "6.5.16.1 Simple
> assignment" and "6.5.4 Cast operators", any pointer-to-object type
> converts implicitly to, and from, pointer-to-void, provided const /
> volatile qualifications are not relaxed. Such implicit conversions
> prevent compilers from catching at least the following two kinds of
> coding mistakes:
> 
> - mixing up one type with another (for example, EFI_HANDLE with
>   EFI_EVENT),
> 
> - getting the depth of indirection wrong (for example, mixing up
>   (EFI_HANDLE*) with EFI_HANDLE).
> 
> This series first separates these standard types from each other, in the
> first patch, which is *not* being proposed for merging. This unmasks a
> number of warts (semantic issues, or actual bugs) in the source code, in
> the form of build breakages. The rest of the series works through those
> breakages, cleaning and fixing the code.
> 
> Every DSC file in the edk2 tree was built for at least one of the NOOPT,
> DEBUG, RELEASE targets (NOOPT being preferred), with the GCC48 toolchain
> (for IA32 / X64) and the GCC5 toolchain (for ARM / AARCH64). Of course,
> the build arches were restricted to the SUPPORTED_ARCHITECTURES stated
> in the individual DSC files.
> 
> There were two exceptions to the above rule: DynamicTablesPkg was only
> build-tested with AARCH64 (despite its SUPPORTED_ARCHITECTURES), given
> that 32-bit ARM has no ACPI bindings. StandaloneMmPkg too was only
> build-tested with AARCH64; it doesn't actually support IA32/X64 yet.
> 
> Regarding boot & runtime tests, ArmVirtQemu on AARCH64 was tested with
> booting to the OS (RHEL7). Furthermore, I exercised OVMF with my usual
> boot and S3 tests, covering IA32, IA32X64, and X64. Finally, some other
> individual tests (noted per patch) were done with OVMF.

This patch series is now ready to be pushed (it's fully reviewed),
except for the following two patches:

* [edk2-devel] [PATCH 01/35]
  DO NOT APPLY: edk2: turn standard handle types into pointers to
  non-VOID

* [edk2-devel] [PATCH 25/35]
  OvmfPkg/VideoDxe: document EFI_EDID_OVERRIDE_PROTOCOL.GetEdid() call

Regarding 01/35, it was never meant to be pushed (certainly not in this
form); plus it would likely be too early for a number of out-of-tree
platforms.

We have discussed enabling "strict UEFI types" (even by default,
possibly). That's a great goal. And I don't have any time for pursuing
it. :( So yes, I'm aware the problems will likely reproduce over time;
I'm sorry about that.

Regarding 25/35, the original (unpatched) code might actually prove
correct there (needing a fix in the EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID
definition instead). That depends on
, however.

I've reached out to Andy Hayes here:

985de369-7880-b6cc-46e7-5a2edca6582b@redhat.com">http://mid.mail-archive.com/985de369-7880-b6cc-46e7-5a2edca6582b@redhat.com
https://edk2.groups.io/g/devel/message/48487

but I've not received any feedback yet.

So tomorrow I plan to re-run some sanity builds, with all patches except
#01 and #25 applied. If the builds still complete, I'm going to push the
other 33 patches.

Thanks,
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48613): https://edk2.groups.io/g/devel/message/48613
Mute This Topic: https://groups.io/mt/34180197/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 18/35] NetworkPkg/DxeNetLib: fix type typo in NetLibGetMacAddress()

2019-10-08 Thread Laszlo Ersek
On 10/08/19 02:32, Fu, Siyuan wrote:
> Just return from vacation. Sorry for late response.
> 
> Reviewed-by: Siyuan Fu 

Thank you and Mike both!
Laszlo

>> -Original Message-
>> From: devel@edk2.groups.io  On Behalf Of Philippe
>> Mathieu-Daudé
>> Sent: 2019年9月24日 19:00
>> To: devel@edk2.groups.io; ler...@redhat.com
>> Cc: Wu, Jiaxin ; Fu, Siyuan 
>> Subject: Re: [edk2-devel] [PATCH 18/35] NetworkPkg/DxeNetLib: fix type
>> typo in NetLibGetMacAddress()
>>
>> On 9/17/19 9:49 PM, Laszlo Ersek wrote:
>>> NetLibGetSnpHandle() returns an EFI_HANDLE, not an (EFI_HANDLE*).
>>> NetLibGetMacAddress() only uses the return value ("SnpHandle") for a
>>> NULL-check. Fix the type of "SnpHandle".
>>>
>>> This patch is a no-op.
>>>
>>> Cc: Jiaxin Wu 
>>> Cc: Siyuan Fu 
>>> Signed-off-by: Laszlo Ersek 
>>> ---
>>>
>>> Notes:
>>> lightly tested: MAC strings are displayed in UiApp
>>>
>>>  NetworkPkg/Library/DxeNetLib/DxeNetLib.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/NetworkPkg/Library/DxeNetLib/DxeNetLib.c
>> b/NetworkPkg/Library/DxeNetLib/DxeNetLib.c
>>> index 8e2f720666ea..a39c20be3d34 100644
>>> --- a/NetworkPkg/Library/DxeNetLib/DxeNetLib.c
>>> +++ b/NetworkPkg/Library/DxeNetLib/DxeNetLib.c
>>> @@ -2182,7 +2182,7 @@ NetLibGetMacAddress (
>>>EFI_SIMPLE_NETWORK_MODE  SnpModeData;
>>>EFI_MANAGED_NETWORK_PROTOCOL *Mnp;
>>>EFI_SERVICE_BINDING_PROTOCOL *MnpSb;
>>> -  EFI_HANDLE   *SnpHandle;
>>> +  EFI_HANDLE   SnpHandle;
>>>EFI_HANDLE   MnpChildHandle;
>>>
>>>ASSERT (MacAddress != NULL);
>>>
>>
>> Since SnpHandle is only checked for being non-null, this change is
>> indeed a no-op, else it would probably fixed some bug.
>>
>> Reviewed-by: Philippe Mathieu-Daude 
>>
>> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48612): https://edk2.groups.io/g/devel/message/48612
Mute This Topic: https://groups.io/mt/34180219/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch 11/12] OvmfPkg: Enable CLANG9 tool chain

2019-10-08 Thread Laszlo Ersek
On 10/08/19 17:02, Gao, Liming wrote:
> Laszlo:
> 
>> -Original Message-
>> From: Laszlo Ersek 
>> Sent: Tuesday, October 1, 2019 4:42 AM
>> To: devel@edk2.groups.io; Gao, Liming 
>> Subject: Re: [edk2-devel] [Patch 11/12] OvmfPkg: Enable CLANG9 tool chain
>>
>> Hi Liming,
>>
>> On 09/27/19 09:46, Liming Gao wrote:
>>> 1. Apply CLANG9 Linker option.
>>
>> I'm confused by this, in two regards.
>>
>> - Why do we refer to CLANG9 first as being in the GCC toolchain family
>> (see near mmx/sse), and then under a totally different family name
>> (CLANGPE?)
> 
> CLANGPE is used to override GCC option. GCC is used to append GCC options. 
> You can see XCODE5 take the same way. 
> CLANG9 tool chain doesn't recognize -z common-page-size=0x1000 option. 
> So, here CLANGPE is used to specify /ALIGN:4096 option. 

Wait, so the "GCC" toolchain *family* applies to:
- actual GCC toolchains (such as GCC48, GCC49, GCC5)
- XCODE toolchains (such as XCODE5)
- CLANG toolchains (such as CLANG9)

but the "XCODE" toolchain *family* only applies to XCODE toolchains
(such as XCODE5), and similarly, the CLANGPE toolchain *family* only
applies to CLANG toolchains (such as CLANG9)?

Put differently, is XCODE in two toolchain families at the same time
(GCC and XCODE)?

Similarly, is CLANG9 in two toolchain families at the same time (GCC and
CLANGPE)?

Wait... from "BaseTools/Conf/tools_def.template":

> #
> #
> # XCODE5 support
> #
>
> *_XCODE5_*_*_FAMILY= GCC
> *_XCODE5_*_*_BUILDRULEFAMILY   = XCODE

This makes me very unhappy. I don't know how anyone can follow this.

What is the difference between "FAMILY" and "BUILDRULEFAMILY"?

When I see

   GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
   XCODE:*_*_*_DLINK_FLAGS =

how can I know that the first line applies due to "FAMILY", but the
second line also applies due to "BUILDRULEFAMILY" (and overrides the
first line)?

Hmmm

https://edk2-docs.gitbooks.io/edk-ii-build-specification/5_meta-data_file_specifications/52_tools_def_txt.html

"""
FAMILY -- A flag to the build command that will be used to ensure the
  correct commands and flags are used in the generated Makefile
  or GNUMakefile, as well as to use the correct options for
  independent tools, such as the ACPI compiler. This is
  typically used to identify the type of Makefile that needs to
  be generated.

BUILDRULEFAMILY -- This flag is used by some tool chain tags to set a
   special FAMILY value when processing the
   build_rule.txt file. Normally, the FAMILY attribute
   is used to identify the type of makefile the tools
   need to generate. Tools such as XCODE will use GCC as
   the FAMILY, but uses different (from GCC) processing
   rules. If present and if a build rule (in
   build_rules.txt) contains an attribute with the value
   specified in this entry, that rule will be processed
   and the rule with the FAMILY attribute will be
   ignored.
"""

Well, I can't say that it's entirely clear to me what applies when. :/

In particular because in this patch, we don't use BUILDRULEFAMILY for
overrides in "build_rules.txt", we use BUILDRULEFAMILY for overrides in
DSC files.


Anyway, let's say that we use the following syntax for linker flag
overrides:

[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
  XCODE:*_*_*_DLINK_FLAGS =
  CLANGPE: *_*_*_DLINK_FLAGS = /ALIGN:4096

Fine.

But then, why don't we similarly use:

[BuildOptions]
  GCC:*_*_*_CC_FLAGS   = -mno-mmx -mno-sse
  XCODE:*_*_*_CC_FLAGS =
  CLANGPE:*_*_*_CC_FLAGS   =

for CC flag overrides?

Because, the proposal is:

!if $(TOOL_CHAIN_TAG) != "XCODE5" && $(TOOL_CHAIN_TAG) != "CLANG9"
  GCC:*_*_*_CC_FLAGS   = -mno-mmx -mno-sse
!endif

I mean, in one case (for the linker flags), we rely on BUILDRULEFAMILY
for specifying the override.

But in the other case (for the C compilation flags), we do not rely on
BUILDRULEFAMILY; instead we check $(TOOL_CHAIN_TAG).

Is this difference justified? Why?


The rest of your answers sounds good to me. Thanks!
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48610): https://edk2.groups.io/g/devel/message/48610
Mute This Topic: https://groups.io/mt/34309064/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [staging/edk2-ci]: Create branch to test EDK II CI concepts

2019-10-08 Thread Michael D Kinney
Hello,

I am creating the edk2-ci branch in the edk2-staging
repo to test out some of the concepts from the RFCs to
add CI to the edk2 repo.

https://edk2.groups.io/g/rfc/message/93
https://edk2.groups.io/g/rfc/message/96

Best regards,

Mike

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48609): https://edk2.groups.io/g/devel/message/48609
Mute This Topic: https://groups.io/mt/34447973/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH V2 1/9] MdeModulePkg/Variable: Consolidate common parsing functions

2019-10-08 Thread Kubacki, Michael A
Reply inline.

> -Original Message-
> From: Wang, Jian J 
> Sent: Monday, October 7, 2019 11:08 PM
> To: Kubacki, Michael A ;
> devel@edk2.groups.io
> Cc: Bi, Dandan ; Ard Biesheuvel
> ; Dong, Eric ; Laszlo Ersek
> ; Gao, Liming ; Kinney, Michael
> D ; Ni, Ray ; Wu, Hao A
> ; Yao, Jiewen 
> Subject: RE: [PATCH V2 1/9] MdeModulePkg/Variable: Consolidate common
> parsing functions
> 
> Michael,
> 
> One comment below.
> 
> > -Original Message-
> > From: Kubacki, Michael A 
> > Sent: Saturday, September 28, 2019 9:47 AM
> > To: devel@edk2.groups.io
> > Cc: Bi, Dandan ; Ard Biesheuvel
> > ; Dong, Eric ; Laszlo
> Ersek
> > ; Gao, Liming ; Kinney,
> Michael D
> > ; Ni, Ray ; Wang, Jian J
> > ; Wu, Hao A ; Yao, Jiewen
> > 
> > Subject: [PATCH V2 1/9] MdeModulePkg/Variable: Consolidate common
> parsing
> > functions
> >
> > This change moves the following functions into a dedicated file
> > so they may be used in other variable files as needed. Furthermore,
> > it reduces the overall size of the common Variable.c file.
> >
> >  * DataSizeOfVariable ()
> >  * FindVariableEx ()
> >  * GetEndPointer ()
> >  * GetNextVariablePtr ()
> >  * GetStartPointer ()
> >  * GetVariableDataOffset ()
> >  * GetVariableDataPtr ()
> >  * GetVariableHeaderSize ()
> >  * GetVariableNamePtr ()
> >  * GetVariableStoreStatus ()
> >  * GetVendorGuidPtr ()
> >  * IsValidVariableHeader ()
> >  * NameSizeOfVariable ()
> >  * SetDataSizeOfVariable ()
> >  * SetNameSizeOfVariable ()
> >  * UpdateVariableInfo ()
> >  * VariableCompareTimeStampInternal ()
> >  * VariableServiceGetNextVariableInternal ()
> >
> > Cc: Dandan Bi 
> > Cc: Ard Biesheuvel 
> > Cc: Eric Dong 
> > Cc: Laszlo Ersek 
> > Cc: Liming Gao 
> > Cc: Michael D Kinney 
> > Cc: Ray Ni 
> > Cc: Jian J Wang 
> > Cc: Hao A Wu 
> > Cc: Jiewen Yao 
> > Signed-off-by: Michael Kubacki 
> > ---
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> |   2
> > +
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf  |
> 2 +
> >
> MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> |
> > 7 +
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h   | 119 -
> ---
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h|
> 306
> > 
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c   | 726
> +--
> > 
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c  |   3
> +-
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c|
> 731
> > 
> >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c|   1
> +
> >  9 files changed, 1052 insertions(+), 845 deletions(-)
> >
> > diff --git
> >
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> >
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > index 641376c9c5..c35e5fe787 100644
> > ---
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > +++
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> > @@ -36,6 +36,8 @@
> >Variable.c
> >VariableDxe.c
> >Variable.h
> > +  VariableParsing.c
> > +  VariableParsing.h
> >PrivilegePolymorphic.h
> >Measurement.c
> >TcgMorLockDxe.c
> > diff --git
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> > index 0a160d269d..626738b9c7 100644
> > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> > @@ -45,6 +45,8 @@
> >Variable.c
> >VariableTraditionalMm.c
> >VariableSmm.c
> > +  VariableParsing.c
> > +  VariableParsing.h
> >VarCheck.c
> >Variable.h
> >PrivilegePolymorphic.h
> > diff --git
> >
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.i
> nf
> >
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.
> inf
> > index 21bc81163b..1ba8f9ebfb 100644
> > ---
> >
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.i
> nf
> > +++
> >
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.
> inf
> > @@ -45,6 +45,8 @@
> >Variable.c
> >VariableSmm.c
> >VariableStandaloneMm.c
> > +  VariableParsing.c
> > +  VariableParsing.h
> >VarCheck.c
> >Variable.h
> >PrivilegePolymorphic.h
> > @@ -99,6 +101,11 @@
> >## SOMETIMES_PRODUCES   ## Variable:L"Lang"
> >gEfiGlobalVariableGuid
> >
> > +  ## SOMETIMES_CONSUMES   ## Variable:L"db"
> > +  ## SOMETIMES_CONSUMES   ## Variable:L"dbx"
> > +  ## SOMETIMES_CONSUMES   ## Variable:L"dbt"
> > +  gEfiImageSecurityDatabaseGuid
> 
> Why add the guid here? It's only consumed by Measurement.c, which is not
> included
> in this inf file.
> 

It looks like it can be removed. I will do this in V3.

> > +
> >gEfiMemoryOverwriteControlDataGuid## SOMETIMES_CONSUMES
> ##
> > 

Re: [edk2-devel] [PATCH V2 1/9] MdeModulePkg/Variable: Consolidate common parsing functions

2019-10-08 Thread Kubacki, Michael A
The rationale for moving the generic parsing functions out would be better to 
capture in the
commit message. That will be added to V3.

Thanks,
Michael

> -Original Message-
> From: Wu, Hao A 
> Sent: Monday, October 7, 2019 7:12 PM
> To: Kubacki, Michael A ;
> devel@edk2.groups.io
> Cc: Bi, Dandan ; Ard Biesheuvel
> ; Dong, Eric ; Laszlo Ersek
> ; Gao, Liming ; Kinney, Michael
> D ; Ni, Ray ; Wang, Jian J
> ; Yao, Jiewen 
> Subject: RE: [PATCH V2 1/9] MdeModulePkg/Variable: Consolidate common
> parsing functions
> 
> > -Original Message-
> > From: Kubacki, Michael A
> > Sent: Friday, October 04, 2019 1:36 AM
> > To: Wu, Hao A; devel@edk2.groups.io
> > Cc: Bi, Dandan; Ard Biesheuvel; Dong, Eric; Laszlo Ersek; Gao, Liming;
> Kinney,
> > Michael D; Ni, Ray; Wang, Jian J; Yao, Jiewen
> > Subject: RE: [PATCH V2 1/9] MdeModulePkg/Variable: Consolidate
> common
> > parsing functions
> >
> > The main reason is cohesiveness in the VariableParsing.c file. These are
> > functions that
> > are commonly needed for general variable data structure parsing
> operations.
> > Most of
> > them just read a member or two in a VARIABLE_STORE_HEADER or
> > VARIABLE_HEADER
> > data structure,  perform a simple calculation if needed, and return some
> > value. More
> > complex functions such as FindVariableEx (), do this in iteration across the
> > variable store.
> > If a function is needed that performs these tasks, it is easier to have them
> > grouped into a
> > cohesive file than search which one is in Variable.c and VariableParsing.c 
> > on
> a
> > case-by-case
> > basis. UpdateVariableInfo () is the exception here, I can move this to a
> > separate file
> > if you prefer.
> 
> 
> I am fine to leave this function under VariableParsing.c.
> 
> 
> >
> > Also, Variable.c is, in my opinion, far too large. It is on trend to only 
> > grow
> > larger:
> >   * Today: ~4,600 LOC
> >   * ~2 years ago: ~4,200 LOC
> >   * ~4 years ago: ~4,100 LOC
> >   * ~5 years ago: ~3,440 LOC
> >   * ~8 years ago: ~2,600 LOC
> >
> > I think moving out generic parsing services such as these better groups
> > related
> > functionality in the short-term but also aids future refactoring efforts in 
> > the
> > file.
> 
> 
> Thanks for the clarification.
> 
> I suggest to update the commit message and add the above detailed criteria
> for
> those functions that got moved to the new file.
> 
> Best Regards,
> Hao Wu
> 
> 
> >
> > Thanks,
> > Michael
> >
> > > -Original Message-
> > > From: Wu, Hao A 
> > > Sent: Thursday, October 3, 2019 1:03 AM
> > > To: Kubacki, Michael A ;
> > > devel@edk2.groups.io
> > > Cc: Bi, Dandan ; Ard Biesheuvel
> > > ; Dong, Eric ; Laszlo
> > Ersek
> > > ; Gao, Liming ; Kinney,
> > Michael
> > > D ; Ni, Ray ; Wang, Jian
> J
> > > ; Yao, Jiewen 
> > > Subject: RE: [PATCH V2 1/9] MdeModulePkg/Variable: Consolidate
> > common
> > > parsing functions
> > >
> > > A couple of inline comments below:
> > >
> > >
> > > > -Original Message-
> > > > From: Kubacki, Michael A
> > > > Sent: Saturday, September 28, 2019 9:47 AM
> > > > To: devel@edk2.groups.io
> > > > Cc: Bi, Dandan; Ard Biesheuvel; Dong, Eric; Laszlo Ersek; Gao, Liming;
> > > Kinney,
> > > > Michael D; Ni, Ray; Wang, Jian J; Wu, Hao A; Yao, Jiewen
> > > > Subject: [PATCH V2 1/9] MdeModulePkg/Variable: Consolidate
> common
> > > > parsing functions
> > > >
> > > > This change moves the following functions into a dedicated file
> > > > so they may be used in other variable files as needed. Furthermore,
> > > > it reduces the overall size of the common Variable.c file.
> > > >
> > > >  * DataSizeOfVariable ()
> > > >  * FindVariableEx ()
> > > >  * GetEndPointer ()
> > > >  * GetNextVariablePtr ()
> > > >  * GetStartPointer ()
> > > >  * GetVariableDataOffset ()
> > > >  * GetVariableDataPtr ()
> > > >  * GetVariableHeaderSize ()
> > > >  * GetVariableNamePtr ()
> > > >  * GetVariableStoreStatus ()
> > > >  * GetVendorGuidPtr ()
> > > >  * IsValidVariableHeader ()
> > > >  * NameSizeOfVariable ()
> > > >  * SetDataSizeOfVariable ()
> > > >  * SetNameSizeOfVariable ()
> > > >  * UpdateVariableInfo ()
> > > >  * VariableCompareTimeStampInternal ()
> > > >  * VariableServiceGetNextVariableInternal ()
> > >
> > >
> > > May I know what are the criteria for the above functions being moved to
> a
> > > separate file?
> > >
> > > At first, I think all of them will be consumed by the new codes that
> > > implement
> > > the runtime cache. But I found that, for functions like
> > > GetVariableDataOffset(),
> > > GetVariableStoreStatus() and etc., their usages are still remained within
> file
> > > Variable.c (seems not related with the runtime cache).
> > >
> > >
> > > >
> > > > Cc: Dandan Bi 
> > > > Cc: Ard Biesheuvel 
> > > > Cc: Eric Dong 
> > > > Cc: Laszlo Ersek 
> > > > Cc: Liming Gao 
> > > > Cc: Michael D Kinney 
> > > > Cc: Ray Ni 
> > > > Cc: Jian J Wang 
> > > > Cc: Hao A Wu 
> > > > Cc: Jiewen Yao 
> > > > Signed-off-by: Michael Kubacki 

Re: [edk2-devel] [PATCH V2 3/9] MdeModulePkg/Variable: Parameterize VARIABLE_INFO_ENTRY buffer

2019-10-08 Thread Kubacki, Michael A
I will clarify that aspect in the commit message.

Thanks,
Michael

> -Original Message-
> From: Wu, Hao A 
> Sent: Monday, October 7, 2019 7:12 PM
> To: devel@edk2.groups.io; Kubacki, Michael A 
> Cc: Bi, Dandan ; Ard Biesheuvel
> ; Dong, Eric ; Laszlo Ersek
> ; Gao, Liming ; Kinney, Michael D
> ; Ni, Ray ; Wang, Jian J
> ; Yao, Jiewen 
> Subject: RE: [edk2-devel] [PATCH V2 3/9] MdeModulePkg/Variable:
> Parameterize VARIABLE_INFO_ENTRY buffer
> 
> > -Original Message-
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Kubacki, Michael A
> > Sent: Friday, October 04, 2019 2:06 AM
> > To: Wu, Hao A; devel@edk2.groups.io
> > Cc: Bi, Dandan; Ard Biesheuvel; Dong, Eric; Laszlo Ersek; Gao, Liming;
> > Kinney, Michael D; Ni, Ray; Wang, Jian J; Yao, Jiewen
> > Subject: Re: [edk2-devel] [PATCH V2 3/9] MdeModulePkg/Variable:
> > Parameterize VARIABLE_INFO_ENTRY buffer
> >
> > Your understanding is correct.
> 
> 
> Thanks for the confirmation.
> Could you help to refine the commit message in the next series? Thanks.
> 
> Best Regards,
> Hao Wu
> 
> 
> >
> > Thanks,
> > Michael
> >
> > > -Original Message-
> > > From: Wu, Hao A 
> > > Sent: Thursday, October 3, 2019 1:04 AM
> > > To: Kubacki, Michael A ;
> > > devel@edk2.groups.io
> > > Cc: Bi, Dandan ; Ard Biesheuvel
> > > ; Dong, Eric ;
> > > Laszlo
> > Ersek
> > > ; Gao, Liming ; Kinney,
> > Michael
> > > D ; Ni, Ray ; Wang,
> > > Jian J ; Yao, Jiewen 
> > > Subject: RE: [PATCH V2 3/9] MdeModulePkg/Variable: Parameterize
> > > VARIABLE_INFO_ENTRY buffer
> > >
> > > > -Original Message-
> > > > From: Kubacki, Michael A
> > > > Sent: Saturday, September 28, 2019 9:47 AM
> > > > To: devel@edk2.groups.io
> > > > Cc: Bi, Dandan; Ard Biesheuvel; Dong, Eric; Laszlo Ersek; Gao,
> > > > Liming; Kinney, Michael D; Ni, Ray; Wang, Jian J; Wu, Hao A; Yao,
> > > > Jiewen
> > > > Subject: [PATCH V2 3/9] MdeModulePkg/Variable: Parameterize
> > > > VARIABLE_INFO_ENTRY buffer
> > > >
> > > > UpdateVariableInfo () currently accepts parameters regarding
> > > > updates to be made to a global variable of type
> > > > VARIABLE_INFO_ENTRY. This change passes the structure by pointer
> > > > to UpdateVariableInfo () so structures can be updated outside the fixed
> global variable.
> > >
> > >
> > > For:
> > > "... so structures can be updated outside the fixed global variable "
> > >
> > > Do you mean:
> > >
> > > VARIABLE_INFO_ENTRY structure pointers other than ""
> > > can be passed to UpdateVariableInfo().
> > >
> > > Is my understanding correct? If so,
> > > Reviewed-by: Hao A Wu 
> > >
> > > Best Regards,
> > > Hao Wu
> > >
> > >
> > > >
> > > > Cc: Dandan Bi 
> > > > Cc: Ard Biesheuvel 
> > > > Cc: Eric Dong 
> > > > Cc: Laszlo Ersek 
> > > > Cc: Liming Gao 
> > > > Cc: Michael D Kinney 
> > > > Cc: Ray Ni 
> > > > Cc: Jian J Wang 
> > > > Cc: Hao A Wu 
> > > > Cc: Jiewen Yao 
> > > > Signed-off-by: Michael Kubacki 
> > > > ---
> > > >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h | 18
> > > > +
> > > >  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c| 14
> > +++---
> > > -
> > > >  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c | 41
> > > > +++-
> > > >  3 files changed, 39 insertions(+), 34 deletions(-)
> > > >
> > > > diff --git
> > > > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h
> > > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h
> > > > index 0d231511ea..6f2000f3ee 100644
> > > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h
> > > > +++
> > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h
> > > > @@ -286,13 +286,14 @@ GetNextVariableEx (
> > > >the transaction. Data is allocated by this routine, but never
> > > >freed.
> > > >
> > > > -  @param[in] VariableName   Name of the Variable to track.
> > > > -  @param[in] VendorGuid Guid of the Variable to track.
> > > > -  @param[in] Volatile   TRUE if volatile FALSE if non-volatile.
> > > > -  @param[in] Read   TRUE if GetVariable() was called.
> > > > -  @param[in] Write  TRUE if SetVariable() was called.
> > > > -  @param[in] Delete TRUE if deleted via SetVariable().
> > > > -  @param[in] Cache  TRUE for a cache hit.
> > > > +  @param[in]  VariableName   Name of the Variable to track.
> > > > +  @param[in]  VendorGuid Guid of the Variable to track.
> > > > +  @param[in]  Volatile   TRUE if volatile FALSE if 
> > > > non-volatile.
> > > > +  @param[in]  Read   TRUE if GetVariable() was called.
> > > > +  @param[in]  Write  TRUE if SetVariable() was called.
> > > > +  @param[in]  Delete TRUE if deleted via SetVariable().
> > > > +  @param[in]  Cache  TRUE for a cache hit.
> > > > +  @param[in,out]  VariableInfo   Pointer to a pointer of
> > > > VARIABLE_INFO_ENTRY structures.
> > > >
> > > >  **/
> > > >  VOID
> > > > 

Re: [edk2-devel] [PATCH 4/4] OvmfPkg/PlatformPei: rewrite MaxCpuCountInitialization() for CPU hotplug

2019-10-08 Thread Laszlo Ersek
On 10/08/19 17:06, Igor Mammedov wrote:
> On Tue,  8 Oct 2019 13:27:14 +0200
> Laszlo Ersek  wrote:
>
>> MaxCpuCountInitialization() currently handles the following options:
>>
>> (1) QEMU does not report the boot CPU count.
>>
>> In this case, PlatformPei makes MpInitLib enumerate APs up to the
>> default PcdCpuMaxLogicalProcessorNumber value (64) minus 1, or until
>> the default PcdCpuApInitTimeOutInMicroSeconds (50,000) elapses.
>> (Whichever is reached first.)
>>
>> Time-limited AP enumeration had never been reliable on QEMU/KVM, which
>> is why commit 45a70db3c3a5 strated handling case (2) below, in OVMF.
>>
>> (2) QEMU reports the boot CPU count.
>>
>> In this case, PlatformPei sets PcdCpuMaxLogicalProcessorNumber to the
>> reported boot CPU count, and PcdCpuApInitTimeOutInMicroSeconds to
>> practically "infinity" (MAX_UINT32, ~71 minutes). That causes
>> MpInitLib to enumerate exactly the available (boot) APs.
>>
>> With CPU hotplug in mind, this method is not good enough. While
>> UefiCpuPkg expects PcdCpuMaxLogicalProcessorNumber to include both
>> boot (i.e., cold-plugged), and all *potentially* hot-plugged, logical
>> processors, the boot CPU count reported by QEMU does not cover the
>> second category.
>
> Can you elaborate why it doesn't cover the second category?

(Elaborate just in this thread, or elaborate in the commit message?)

The boot CPU count reported by QEMU does not cover all potentially
hot-plugged logical processors ... because it is not supposed to.

Namely, FW_CFG_NB_CPUS exposes "pcms->boot_cpus", and that is not
supposed to cover all potentially hot-plugged CPUs, only the boot-time
CPUs.

Whereas PcdCpuMaxLogicalProcessorNumber needs to include all potentially
hot-plugged CPUs too. For that, we need to expose "ms->smp.max_cpus"
from QEMU.

Does this answer your question?

>> Rewrite MaxCpuCountInitialization() for handling the following cases:
>>
>> (1) The behavior of case (1) does not change. (No UefiCpuPkg PCDs are set
>> to values different from the defaults.)
>>
>> (2) QEMU reports the boot CPU count, but not the potential maximum CPU
>> count.
>>
>> In this case, the behavior remains unchanged.
>>
>> The way MpInitLib is instructed to do the same differs however: we now
>> set the new PcdCpuBootLogicalProcessorNumber to the boot CPU count
>> (together with PcdCpuMaxLogicalProcessorNumber).
>> PcdCpuApInitTimeOutInMicroSeconds is irrelevant.
>>
>> (3) QEMU reports both the boot CPU count, and the potential maximum CPU
>> count.
>>
>> We tell UefiCpuPkg about the potential maximum through
>> PcdCpuMaxLogicalProcessorNumber. We also tell MpInitLib the boot CPU
>> count for precise and quick AP enumeration, via
>> PcdCpuBootLogicalProcessorNumber. PcdCpuApInitTimeOutInMicroSeconds is
>> irrelevant.
> What for max cpu count is/will be used?

Before this patch:

- "pcms->boot_cpus" determines the boot CPU count for OVMF
- "pcms->boot_cpus" determines the maximum CPU count for OVMF

- when OVMF is built without SMM_REQUIRE:
  - OS-time CPU hotplug works (no firmware involvement)
  - after OS-time CPU hotplug, S3 resume breaks (firmware can't handle
unexpected CPUs appearing beyond original maximum)

- when OVMF is built with SMM_REQUIRE:
  - OS-time CPU hotplug does not work (yet)

After this patch:

- "pcms->boot_cpus" determines the boot CPU count for OVMF
- "ms->smp.max_cpus" determines the maximum CPU count for OVMF [*]

- when OVMF is built without SMM_REQUIRE:
  - OS-time CPU hotplug works (no firmware involvement)
  - after OS-time CPU hotplug, S3 resume works (any new CPUs are
within the original maximum, therefore they are expected) [*]

- when OVMF is built with SMM_REQUIRE:
  - OS-time CPU hotplug does not work (yet)

The differences are marked with [*].

>> This patch is a pre-requisite for enabling CPU hotplug with SMM_REQUIRE.
>> As a side effect, it also enables S3 to work with CPU hotplug at once,
>> *without* SMM_REQUIRE.
> Does OVMF reread boot CPU count on resume from QEMU?

Yes, it does.

When a CPU is hotplugged at OS runtime, "pcms->boot_cpus" increases in
QEMU.

Before the patch, the "pcms->boot_cpus" increase causes
PcdCpuMaxLogicalProcessorNumber to increase as well. That breaks S3
resume. PcdCpuMaxLogicalProcessorNumber must not change from initial
boot to S3 resume.

After the patch, the "pcms->boot_cpus" increase does not increase
PcdCpuMaxLogicalProcessorNumber. PcdCpuMaxLogicalProcessorNumber remains
the same (namely, "ms->smp.max_cpus"). Therefore, the CPU structures
allocated during normal boot, for "ms->smp.max_cpus", will accommodate
the CPUs that have been hotplugged prior to S3 resume.

I tested the S3 behavior, plus the values mentioned above are also
logged to the OVMF debug log, by this patch:

> +  DEBUG ((DEBUG_INFO, "%a: BootCpuCount=%d mMaxCpuCount=%u\n", __FUNCTION__,
> +BootCpuCount, mMaxCpuCount));

This is 

Re: [edk2-devel] [PATCH 2/4] OvmfPkg/OvmfXen.dsc: remove PcdCpu* dynamic defaults

2019-10-08 Thread Laszlo Ersek
On 10/08/19 15:11, Philippe Mathieu-Daudé wrote:
> On 10/8/19 1:27 PM, Laszlo Ersek wrote:
>> PcdCpuMaxLogicalProcessorNumber and PcdCpuApInitTimeOutInMicroSeconds are
>> only referenced in "OvmfPkg/PlatformPei/PlatformPei.inf", and OvmfXen
>> does
>> not include that module. Remove the unnecessary dynamic PCD defaults from
>> "OvmfXen.dsc".
>>
>> Cc: Anthony Perard 
>> Cc: Ard Biesheuvel 
>> Cc: Igor Mammedov 
>> Cc: Jordan Justen 
>> Cc: Julien Grall 
>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1515
>> Signed-off-by: Laszlo Ersek 
>> ---
>>   OvmfPkg/OvmfXen.dsc | 4 
>>   1 file changed, 4 deletions(-)
>>
>> diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
>> index 5a31f75f05d0..6deafea034c0 100644
>> --- a/OvmfPkg/OvmfXen.dsc
>> +++ b/OvmfPkg/OvmfXen.dsc
>> @@ -481,10 +481,6 @@ [PcdsDynamicDefault]
>>     gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack|FALSE
>>     gEfiMdeModulePkgTokenSpaceGuid.PcdPropertiesTableEnable|FALSE
>>   -  # UefiCpuPkg PCDs related to initial AP bringup and general AP
>> management.
>> -  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|64
>> -  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5
>> -
>>     # Set memory encryption mask
>>    
>> gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
>>  
> 
> Reviewed-by: Philippe Mathieu-Daude 

Thanks!

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48604): https://edk2.groups.io/g/devel/message/48604
Mute This Topic: https://groups.io/mt/34441229/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 0/4] UefiCpuPkg, OvmfPkg: separate PCDs for boot CPU count vs. max CPU count

2019-10-08 Thread Laszlo Ersek
On 10/08/19 13:35, Ard Biesheuvel wrote:
> On Tue, 8 Oct 2019 at 13:27, Laszlo Ersek  wrote:
>>
>> Repo:   https://github.com/lersek/edk2.git
>> Branch: max_cpus_bz_1515
>> Ref:https://bugzilla.tianocore.org/show_bug.cgi?id=1515
>>
>> UefiCpuPkg/MpInitLib currently lacks support for the following use case:
>>
>> - time-limited AP enumeration is not reliable on the platform
>>   (individual AP check-in may take arbitrarily long), and
>>
>> - APs may finish the wakeup routine, and report in to the BSP, in any
>>   sequence whatsoever, and
>>
>> - the number of boot CPUs (which is known in advance) is strictly less
>>   than the number of maximum CPUs (which is also known in advance).
>>
>> In the above case, the platform cannot tell UefiCpuPkg/MpInitLib to wait
>> exactly until all boot APs check in. That is, the platform can't request
>> that the AP enumeration never time out, but also not wait for too long.
>>
>> For supporting this use case, the patch series introduces
>> PcdCpuBootLogicalProcessorNumber to UefiCpuPkg, and makes MpInitLib wait
>> for exactly that many CPUs (= BSP + APs) to show up during CPU
>> enumeration.
>>
>> Working towards VCPU hotplug with OVMF, OvmfPkg/PlatformPei fetches both
>> the boot and the max CPU counts from QEMU, co-operating with the
>> following QEMU patch set:
>>
>>   [qemu-devel] [PATCH 0/4] hw/i386: pass "MachineState.smp.max_cpus" to OVMF
>>   http://mid.mail-archive.com/20191008105259.5378-1-lersek@redhat.com
>>
>> and passes them to UefiCpuPkg via PcdCpuBootLogicalProcessorNumber and
>> PcdCpuMaxLogicalProcessorNumber.
>>
>> As a result, PcdCpuApInitTimeOutInMicroSeconds becomes irrelevant for,
>> and unused by, OVMF -- time-limited AP enumeration is never going to be
>> used.
>>
>> When OVMF is built with -D SMM_REQUIRE, this patch series is just a
>> small building block, towards the full VCPU hotplug feature. However,
>> when OVMF is built without -D SMM_REQUIRE, this series (together with
>> the counterpart patch set for QEMU) completes the VCPU hotplug feature:
>> it allows S3 resume to work with VCPUs hot-plugged previously (at OS
>> runtime, of course).
>>
>> Cc: Anthony Perard 
>> Cc: Ard Biesheuvel 
>> Cc: Eric Dong 
>> Cc: Igor Mammedov 
>> Cc: Jordan Justen 
>> Cc: Julien Grall 
>> Cc: Ray Ni 
>>
>> Thanks
>> Laszlo
>>
>> Laszlo Ersek (4):
>>   UefiCpuPkg/MpInitLib: honor the platform's boot CPU count in AP
>> detection
> 
> Assuming this ^^^ patch gets accepted by the maintainers,
> 
>>   OvmfPkg/OvmfXen.dsc: remove PcdCpu* dynamic defaults
>>   OvmfPkg/IndustryStandard: define FW_CFG_X86_TOPOLOGY structure type
>>   OvmfPkg/PlatformPei: rewrite MaxCpuCountInitialization() for CPU
>> hotplug
>>
> 
> Acked-by: Ard Biesheuvel 
> 
> for the OvmfPkg changes.
> 

Thanks!
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48603): https://edk2.groups.io/g/devel/message/48603
Mute This Topic: https://groups.io/mt/34441227/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [Patch 05/12] MdePkg BaseIoLibIntrinsic: Remove __inline__ attribute for IO functions

2019-10-08 Thread Laszlo Ersek
On 10/08/19 16:47, Gao, Liming wrote:

> [Liming] I verify GCC5 tool chain. I will verify GCC48/GCC49 and
> XCODE5.
> 
> I don’t know the specific reason about __inline__. If there is no
> impact on
> 
> other GCC tool chain, I prefer to remove them.

> [Liming] This seems the remaining clean up task. So, I prefer to remove
> __inline__ if no impact on GCC tool chain.

OK. Given your testing with GCC48, I'm fine.

Thanks
Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48602): https://edk2.groups.io/g/devel/message/48602
Mute This Topic: https://groups.io/mt/34309058/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms][PATCH V1 12/17] WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: DSC cleanup

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> 
> Subject: [edk2-platforms][PATCH V1 12/17]
> WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: DSC cleanup
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2243
> 
> This change refactors OpenBoardPkg.dsc and OpenBoardPkgPcd.dsc to
> consolidate redundant sections and better group file content to
> improve maintainability and readability.
> 
> The same pattern made in this change for WhiskeylakeURvp is being
> applied to all existing board packages in Platform/Intel to improve
> overall consistency.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Signed-off-by: Michael Kubacki 
> ---
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.
> dsc| 502 +++-
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg
> Pcd.dsc | 441 +
>  2 files changed, 510 insertions(+), 433 deletions(-)
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> index 1d07fdea84..d6eb66a880 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> @@ -1,20 +1,13 @@
>  ## @file
> -#  Platform description.
> -#
> +#  The main build description file for the WhiskeylakeURvp board.
>  #
>  #  Copyright (c) 2019, Intel Corporation. All rights reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> -#
>  ##
> 
>  [Defines]
> -  #
> -  # Set platform specific package/folder name, same as passed from
> PREBUILD script.
> -  # PLATFORM_PACKAGE would be the same as PLATFORM_NAME as well
> as package build folder
> -  # DEFINE only takes effect at R9 DSC and FDF.
> -  #
>DEFINE  PLATFORM_PACKAGE  = MinPlatformPkg
>DEFINE  PLATFORM_SI_PACKAGE   = CoffeelakeSiliconPkg
>DEFINE  PLATFORM_SI_BIN_PACKAGE   = CoffeelakeSiliconBinPkg
> @@ -24,7 +17,7 @@
>DEFINE  PROJECT   =
> $(PLATFORM_BOARD_PACKAGE)/$(BOARD)
> 
>#
> -  # Platform On/Off features are defined here
> +  # Include PCD configuration for this board.
>#
>!include OpenBoardPkgPcd.dsc
> 
> @@ -42,8 +35,6 @@
>SUPPORTED_ARCHITECTURES = IA32|X64
>BUILD_TARGETS   = DEBUG|RELEASE
>SKUID_IDENTIFIER= ALL
> -
> -
>FLASH_DEFINITION=
> $(PROJECT)/OpenBoardPkg.fdf
> 
>FIX_LOAD_TOP_MEMORY_ADDRESS = 0x0
> @@ -56,163 +47,238 @@
> 
> 
> 
> 
>  #
> -# SKU Identification section - list of all SKU IDs supported by this
> -#  Platform.
> +# SKU Identification section - list of all SKU IDs supported by this board.
>  #
> 
> 
> 
>  [SkuIds]
> -  0|DEFAULT  # The entry: 0|DEFAULT is reserved and
> always required.
> +  0|DEFAULT  # 0|DEFAULT is reserved and always required.
>0x60|WhiskeylakeURvp
> 
> 
> 
> 
>  #
> -# Library Class section - list of all Library Classes needed by this 
> Platform.
> +# Includes section - other DSC file contents included for this board build.
>  #
> 
> 
> 
> 
> -  !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreCommonLib.dsc
> -  !include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiLib.dsc
> -  !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeLib.dsc
> +###
> +# Library Includes
> +###
> +!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreCommonLib.dsc
> +!include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiLib.dsc
> +!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeLib.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgCommonLib.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgPeiLib.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgDxeLib.dsc
> +
> +###
> +# Component Includes
> +###
> +[Components.IA32]
> +!include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiInclude.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgPei.dsc
> +
> +[Components.X64]
> +!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgDxe.dsc
> +
> +###
> +# Build Option Includes
> +###
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgBuildOption.dsc
> +!include OpenBoardPkgBuildOption.dsc
> +
> +###

Re: [edk2-devel] [edk2-platforms][PATCH V1 11/17] WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Update FSP base PCDs

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> 
> Subject: [edk2-platforms][PATCH V1 11/17]
> WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Update FSP base PCDs
> 
> Sets the FSP-T, FSP-M, and FSP-S base address PCDs based on the flash map.
> 
> Previously these were hardcoded in the DSC file.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Signed-off-by: Michael Kubacki 
> ---
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.
> fdf | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.fdf
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.fdf
> index 611078e4b4..30ce0b9b79 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.fdf
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.fdf
> @@ -55,6 +55,9 @@ SET
> gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeSize=
> gSiPkgTokenSpaceG
>  SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeOffset  =
> gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset
>  SET gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheAddress =
> gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress
>  SET gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheSize=
> gSiPkgTokenSpaceGuid.PcdBiosSize
> +SET gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress   =
> $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) +
> $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset)
> +SET gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress   =
> $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) +
> $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset)
> +SET gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress   =
> $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) +
> $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset)
>  SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress=
> gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress
>  SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize   =
> gSiPkgTokenSpaceGuid.PcdBiosSize
> 
> 
> 
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48599): https://edk2.groups.io/g/devel/message/48599
Mute This Topic: https://groups.io/mt/34439447/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms][PATCH V1 10/17] CoffeelakeSiliconPkg: Add DSC include file section tags

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V ; Chiu, Chasel
> 
> Subject: [edk2-platforms][PATCH V1 10/17] CoffeelakeSiliconPkg: Add DSC
> include file section tags
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2246
> 
> The DSC LibraryClass files in CoffeelakeSiliconPkg that are intended to be
> included elsewhere such as SiPkgPeiLib.dsc, SiPkgDxeLib.dsc, and
> SiPkgCommonLib.dsc should have section tags so that they are not
> dependent on the top-level DSC file to place the include file in the correct
> location in the DSC file and better define the applicability of their library
> content.
> 
> This change adds section tags for the library class related files.
> The component files may be built differently in the consuming package
> depending on their architecture requirements so those are not modified.
> 
> Cc: Sai Chaganty 
> Cc: Chasel Chiu 
> Signed-off-by: Michael Kubacki 
> ---
>  Silicon/Intel/CoffeelakeSiliconPkg/SiPkgCommonLib.dsc | 1 +
>  Silicon/Intel/CoffeelakeSiliconPkg/SiPkgDxeLib.dsc| 1 +
>  Silicon/Intel/CoffeelakeSiliconPkg/SiPkgPeiLib.dsc| 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgCommonLib.dsc
> b/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgCommonLib.dsc
> index 2df08c6d01..7a9911e825 100644
> --- a/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgCommonLib.dsc
> +++ b/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgCommonLib.dsc
> @@ -13,6 +13,7 @@
>  #
>  DEFINE  PCH = Cnl
> 
> +[LibraryClasses.common]
>  #
>  # Cpu
>  #
> diff --git a/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgDxeLib.dsc
> b/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgDxeLib.dsc
> index 214de06d58..e21004c993 100644
> --- a/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgDxeLib.dsc
> +++ b/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgDxeLib.dsc
> @@ -7,6 +7,7 @@
>  #
>  ##
> 
> +[LibraryClasses.common.DXE_CORE,LibraryClasses.common.DXE_SMM_DRIV
> ER,Li
> +braryClasses.common.SMM_CORE,LibraryClasses.common.DXE_DRIVER,Libr
> aryCl
> +asses.common.DXE_RUNTIME_DRIVER,LibraryClasses.common.UEFI_DRIVER
> ]
>  #
>  # Silicon Init Dxe Library
>  #
> diff --git a/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgPeiLib.dsc
> b/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgPeiLib.dsc
> index 6e244a6ded..bc3fcabd4d 100644
> --- a/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgPeiLib.dsc
> +++ b/Silicon/Intel/CoffeelakeSiliconPkg/SiPkgPeiLib.dsc
> @@ -7,6 +7,7 @@
>  #
>  ##
> 
> +[LibraryClasses]
>  #
>  # Silicon Init Pei Library
>  #
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48598): https://edk2.groups.io/g/devel/message/48598
Mute This Topic: https://groups.io/mt/34439446/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms][PATCH V1 09/17] WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Remove OpenBoardPkgConfig.dsc

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> 
> Subject: [edk2-platforms][PATCH V1 09/17]
> WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Remove
> OpenBoardPkgConfig.dsc
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2243
> 
> The location for PCD configuration is currently inconsistent in
> WhiskeylakeOpenBoardPkg. A large set of FeaturePCD definitions are in
> OpenBoardPkgConfig.dsc while other PCD definitions (including
> FeaturePCD) are located in OpenBoardPkgPcd.dsc.
> 
> This change consolidates PCD configuration for the WhiskeylakeURvp board
> to OpenBoardPkgPcd.dsc and removes OpenBoardPkgConfig.dsc.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Signed-off-by: Michael Kubacki 
> ---
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.
> dsc   |   1 -
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg
> Config.dsc | 128 
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg
> Pcd.dsc| 116 ++
>  3 files changed, 116 insertions(+), 129 deletions(-)
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> index 9a516cad60..1d07fdea84 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> k
> +++ g.dsc
> @@ -26,7 +26,6 @@
>#
># Platform On/Off features are defined here
>#
> -  !include OpenBoardPkgConfig.dsc
>!include OpenBoardPkgPcd.dsc
> 
> 
> 
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kgConfig.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kgConfig.dsc
> deleted file mode 100644
> index c68fecf50e..00
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kgConfig.dsc
> +++ /dev/null
> @@ -1,128 +0,0 @@
> -## @file
> -#  Platform configuration file.
> -#
> -#
> -#  Copyright (c) 2019, Intel Corporation. All rights reserved. -# -#
> SPDX-License-Identifier: BSD-2-Clause-Patent -# -# -##
> -
> -[PcdsFixedAtBuild]
> -  #
> -  # Please select BootStage here.
> -  # Stage 1 - enable debug (system deadloop after debug init)
> -  # Stage 2 - mem init (system deadloop after mem init)
> -  # Stage 3 - boot to shell only
> -  # Stage 4 - boot to OS
> -  # Stage 5 - boot to OS with security boot enabled
> -  #
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4
> -
> -[PcdsFeatureFlag]
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 3
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|TRUE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 4
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 5
> -  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|TRUE
> -  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|TRUE
> -!endif
> -
> -  gBoardModuleTokenSpaceGuid.PcdTbtEnable|FALSE
> -  #
> -  # More fine granularity control below:
> -  #
> -
> -  gBoardModuleTokenSpaceGuid.PcdMultiBoardSupport|TRUE
> -
> -#
> -# TRUE is ENABLE. FALSE is DISABLE.
> -#
> -#
> -# BIOS build switches configuration
> -#
> -  gSiPkgTokenSpaceGuid.PcdOptimizeCompilerEnable|TRUE
> -
> -# CPU
> -  gSiPkgTokenSpaceGuid.PcdSourceDebugEnable|FALSE
> -
> -# SA
> -  gSiPkgTokenSpaceGuid.PcdIgdEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdPegEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSgEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSaDmiEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSaOcEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdVtdEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdPeiDisplayEnable|TRUE
> -
> -# ME
> -  gSiPkgTokenSpaceGuid.PcdAtaEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdPttEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdJhiEnable|TRUE
> -
> -  gSiPkgTokenSpaceGuid.PcdAcpiEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdBdatEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdIntegratedTouchEnable|TRUE
> -  

Re: [edk2-devel] [edk2-platforms][PATCH V1 08/17] WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Relocate PCD DSC include

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> 
> Subject: [edk2-platforms][PATCH V1 08/17]
> WhiskeylakeOpenBoardPkg/WhiskeylakeURvp: Relocate PCD DSC include
> 
> This change moves the include of OpenBoardPkgPcd.dsc to the top of
> OpenBoardPkg.dsc to improve visibility and align the placement with other
> board DSC files.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Signed-off-by: Michael Kubacki 
> ---
> 
> Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPkg.
> dsc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> index eea809140c..9a516cad60 100644
> ---
> a/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> kg.dsc
> +++
> b/Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardP
> k
> +++ g.dsc
> @@ -27,6 +27,7 @@
># Platform On/Off features are defined here
>#
>!include OpenBoardPkgConfig.dsc
> +  !include OpenBoardPkgPcd.dsc
> 
> 
> 
> 
>  #
> @@ -190,7 +191,6 @@
>  [LibraryClasses.X64.DXE_RUNTIME_DRIVER]
> 
> ResetSystemLib|$(PLATFORM_SI_PACKAGE)/Pch/Library/DxeRuntimeResetSys
> temLib/DxeRuntimeResetSystemLib.inf
> 
> DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.i
> nf
> -  !include OpenBoardPkgPcd.dsc
> 
>  [Components.IA32]
>#
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48596): https://edk2.groups.io/g/devel/message/48596
Mute This Topic: https://groups.io/mt/34439444/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms][PATCH V1 06/17] KabylakeOpenBoardPkg/GalagoPro3: DSC cleanup

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Jeremy Soller 
> Subject: [edk2-platforms][PATCH V1 06/17]
> KabylakeOpenBoardPkg/GalagoPro3: DSC cleanup
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2242
> 
> This change refactors OpenBoardPkg.dsc and OpenBoardPkgPcd.dsc to
> consolidate redundant sections and better group file content to
> improve maintainability and readability.
> 
> The same pattern made in this change for GalagoPro3 is being
> applied to all existing board packages in Platform/Intel to improve
> overall consistency.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Jeremy Soller 
> Signed-off-by: Michael Kubacki 
> ---
>  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> | 478 +++-
>  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc |
> 476 ++-
>  2 files changed, 506 insertions(+), 448 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> index 75f774d26b..5f77c8db0a 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> @@ -1,5 +1,5 @@
>  ## @file
> -#  System 76 GalagoPro3 board description file.
> +#  The main build description file for the GalagoPro3 board.
>  #
>  # Copyright (c) 2019, Intel Corporation. All rights reserved.
>  #
> @@ -7,11 +7,6 @@
>  #
>  ##
>  [Defines]
> -  #
> -  # Set platform specific package/folder name, same as passed from
> PREBUILD script.
> -  # PLATFORM_PACKAGE would be the same as PLATFORM_NAME as well
> as package build folder
> -  # DEFINE only takes effect at R9 DSC and FDF.
> -  #
>DEFINE  PLATFORM_PACKAGE= MinPlatformPkg
>DEFINE  PLATFORM_SI_PACKAGE =
> KabylakeSiliconPkg
>DEFINE  PLATFORM_SI_BIN_PACKAGE =
> KabylakeSiliconBinPkg
> @@ -21,7 +16,7 @@
>DEFINE  PROJECT =
> $(PLATFORM_BOARD_PACKAGE)/$(BOARD)
> 
>#
> -  # Platform On/Off features are defined here
> +  # Include PCD configuration for this board.
>#
>!include OpenBoardPkgPcd.dsc
> 
> @@ -53,8 +48,7 @@
> 
> 
> 
> 
>  #
> -# SKU Identification section - list of all SKU IDs supported by this
> -#  Platform.
> +# SKU Identification section - list of all SKU IDs supported by this board.
>  #
> 
> 
> 
>  [SkuIds]
> @@ -63,220 +57,261 @@
> 
> 
> 
> 
>  #
> -# Library Class section - list of all Library Classes needed by this 
> Platform.
> +# Includes section - other DSC file contents included for this board build.
>  #
> 
> 
> 
> 
> +###
> +# Library Includes
> +###
>  !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreCommonLib.dsc
>  !include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiLib.dsc
>  !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeLib.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgCommonLib.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgPeiLib.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgDxeLib.dsc
> +
> +###
> +# Component Includes
> +###
> +[Components.IA32]
> +!include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiInclude.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgPei.dsc
> +
> +[Components.X64]
> +!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgDxe.dsc
> +
> +###
> +# Build Option Includes
> +###
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgBuildOption.dsc
> +!include OpenBoardPkgBuildOption.dsc
> +
> +###
> #
> +#
> +# Library Class section - list of all Library Classes needed by this board.
> +#
> +###
> #
> 
>  [LibraryClasses.common]
> -
> -  PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
> -
> ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/Pei
> ReportFvLib.inf
> -
> -
> PciHostBridgeLib|$(PLATFORM_PACKAGE)/Pci/Library/PciHostBridgeLibSimple
> /PciHostBridgeLibSimple.inf
> -
> PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSim
> ple/PciSegmentInfoLibSimple.inf
> -
> PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformB
> 

Re: [edk2-devel] [edk2-platforms][PATCH V1 03/17] KabylakeOpenBoardPkg/KabylakeRvp3: DSC cleanup

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> 
> Subject: [edk2-platforms][PATCH V1 03/17]
> KabylakeOpenBoardPkg/KabylakeRvp3: DSC cleanup
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2242
> 
> This change refactors OpenBoardPkg.dsc and OpenBoardPkgPcd.dsc to
> consolidate redundant sections and better group file content to
> improve maintainability and readability.
> 
> The same pattern made in this change for KabylakeRvp3 is being
> applied to all existing board packages in Platform/Intel to improve
> overall consistency.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Signed-off-by: Michael Kubacki 
> ---
>  Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> | 521 ++-
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
> | 547 ++--
>  2 files changed, 539 insertions(+), 529 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> index a3378d3c5d..efc4c2dca8 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> @@ -1,5 +1,5 @@
>  ## @file
> -#  Platform description.
> +#  The main build description file for the KabylakeRvp3 board.
>  #
>  # Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
>  #
> @@ -7,11 +7,6 @@
>  #
>  ##
>  [Defines]
> -  #
> -  # Set platform specific package/folder name, same as passed from
> PREBUILD script.
> -  # PLATFORM_PACKAGE would be the same as PLATFORM_NAME as well
> as package build folder
> -  # DEFINE only takes effect at R9 DSC and FDF.
> -  #
>DEFINE  PLATFORM_PACKAGE= MinPlatformPkg
>DEFINE  PLATFORM_SI_PACKAGE =
> KabylakeSiliconPkg
>DEFINE  PLATFORM_SI_BIN_PACKAGE =
> KabylakeSiliconBinPkg
> @@ -20,7 +15,7 @@
>DEFINE  PROJECT =
> $(PLATFORM_BOARD_PACKAGE)/$(BOARD)
> 
>#
> -  # Platform On/Off features are defined here
> +  # Include PCD configuration for this board.
>#
>!include OpenBoardPkgPcd.dsc
> 
> @@ -68,8 +63,6 @@
>SUPPORTED_ARCHITECTURES = IA32|X64
>BUILD_TARGETS   = DEBUG|RELEASE
>SKUID_IDENTIFIER= ALL
> -
> -
>FLASH_DEFINITION=
> $(PROJECT)/OpenBoardPkg.fdf
> 
>FIX_LOAD_TOP_MEMORY_ADDRESS = 0x0
> @@ -82,172 +75,205 @@
> 
> 
> 
> 
>  #
> -# SKU Identification section - list of all SKU IDs supported by this
> -#  Platform.
> +# SKU Identification section - list of all SKU IDs supported by this board.
>  #
> 
> 
> 
>  [SkuIds]
> -  0|DEFAULT  # The entry: 0|DEFAULT is reserved and
> always required.
> -  4|KabylakeRvp3
> +  0x00|DEFAULT# 0|DEFAULT is reserved and always
> required.
> +  0x04|KabylakeRvp3
>0x60|KabyLakeYLpddr3Rvp3
> 
> 
> 
> 
>  #
> -# Library Class section - list of all Library Classes needed by this 
> Platform.
> +# Includes section - other DSC file contents included for this board build.
>  #
> 
> 
> 
> 
> +###
> +# Library Includes
> +###
>  !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreCommonLib.dsc
>  !include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiLib.dsc
>  !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeLib.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgCommonLib.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgPeiLib.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgDxeLib.dsc
> +
> +###
> +# Component Includes
> +###
> +[Components.IA32]
> +!include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiInclude.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgPei.dsc
> +
> +[Components.X64]
> +!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgDxe.dsc
> +
> +###
> +# Build Option Includes
> +###
> +!include $(PLATFORM_SI_PACKAGE)/SiPkgBuildOption.dsc
> +!include OpenBoardPkgBuildOption.dsc
> +
> +###
> #
> +#
> +# Library Class section - list of all Library Classes needed by this board.
> +#
> +###
> #
> 
>  

Re: [edk2-devel] [edk2-platforms][PATCH V1 04/17] KabylakeOpenBoardPkg/GalagoPro3: Relocate PCD DSC include

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Jeremy Soller 
> Subject: [edk2-platforms][PATCH V1 04/17]
> KabylakeOpenBoardPkg/GalagoPro3: Relocate PCD DSC include
> 
> This change moves the include of OpenBoardPkgPcd.dsc to the top of
> OpenBoardPkg.dsc to improve visibility and align the include location with
> other board DSC files.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Jeremy Soller 
> Signed-off-by: Michael Kubacki 
> ---
>  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc | 3
> +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> index f3dd2b0c91..90ee5dfc53 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> @@ -24,6 +24,7 @@
># Platform On/Off features are defined here
>#
>!include OpenBoardPkgConfig.dsc
> +  !include OpenBoardPkgPcd.dsc
> 
> 
> 
> 
>  #
> @@ -174,8 +175,6 @@
>  [LibraryClasses.X64.DXE_RUNTIME_DRIVER]
> 
> ResetSystemLib|$(PLATFORM_SI_PACKAGE)/Pch/Library/DxeRuntimeResetSys
> temLib/DxeRuntimeResetSystemLib.inf
> 
> -!include OpenBoardPkgPcd.dsc
> -
>  [Components.IA32]
> 
>  #
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48591): https://edk2.groups.io/g/devel/message/48591
Mute This Topic: https://groups.io/mt/34439439/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [edk2-platforms][PATCH V1 05/17] KabylakeOpenBoardPkg/GalagoPro3: Remove OpenBoardPkgConfig.dsc

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> ; Jeremy Soller 
> Subject: [edk2-platforms][PATCH V1 05/17]
> KabylakeOpenBoardPkg/GalagoPro3: Remove OpenBoardPkgConfig.dsc
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2242
> 
> The location for PCD configuration is currently inconsistent in
> KabylakeOpenBoardPkg. A large set of FeaturePCD definitions are in
> OpenBoardPkgConfig.dsc while other PCD definitions (including
> FeaturePCD) are located in OpenBoardPkgPcd.dsc.
> 
> This change consolidates PCD configuration for the GalagoPro3 board to
> OpenBoardPkgPcd.dsc and removes OpenBoardPkgConfig.dsc.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Jeremy Soller 
> Signed-off-by: Michael Kubacki 
> ---
>  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> |   1 -
> 
> Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgConfig.dsc
> | 132 
>  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgPcd.dsc
> | 122 ++
>  3 files changed, 122 insertions(+), 133 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> index 90ee5dfc53..75f774d26b 100644
> --- a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> +++ b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.dsc
> @@ -23,7 +23,6 @@
>#
># Platform On/Off features are defined here
>#
> -  !include OpenBoardPkgConfig.dsc
>!include OpenBoardPkgPcd.dsc
> 
> 
> 
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgConfig.d
> sc
> b/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgConfig.d
> sc
> deleted file mode 100644
> index 3de3f8942c..00
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkgConfig.d
> sc
> +++ /dev/null
> @@ -1,132 +0,0 @@
> -## @file
> -#  System 76 GalagoPro3 board configuration.
> -#
> -# Copyright (c) 2019, Intel Corporation. All rights reserved. -# -#
> SPDX-License-Identifier: BSD-2-Clause-Patent -# -##
> -
> -[PcdsFixedAtBuild]
> -  #
> -  # Please select BootStage here.
> -  # Stage 1 - enable debug (system deadloop after debug init)
> -  # Stage 2 - mem init (system deadloop after mem init)
> -  # Stage 3 - boot to shell only
> -  # Stage 4 - boot to OS
> -  # Stage 5 - boot to OS with security boot enabled
> -  #
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4
> -
> -[PcdsFeatureFlag]
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 3
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|TRUE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 4
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 5
> -  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|TRUE
> -  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|TRUE
> -!endif
> -
> -  gBoardModuleTokenSpaceGuid.PcdTbtEnable|FALSE
> -  #
> -  # More fine granularity control below:
> -  #
> -  gBoardModuleTokenSpaceGuid.PcdMultiBoardSupport|TRUE
> -
> -#
> -# TRUE is ENABLE. FALSE is DISABLE.
> -#
> -
> -#
> -# BIOS build switches configuration
> -#
> -  gSiPkgTokenSpaceGuid.PcdOptimizeCompilerEnable|TRUE
> -
> -# CPU
> -  gSiPkgTokenSpaceGuid.PcdSourceDebugEnable|FALSE
> -  gSiPkgTokenSpaceGuid.PcdTxtEnable|TRUE  #Set to FALSE for GCC Build
> @todo Convert TXT ASM to NASM
> -  gSiPkgTokenSpaceGuid.PcdBiosGuardEnable|TRUE
> -
> -# SA
> -  gSiPkgTokenSpaceGuid.PcdIgdEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdPegEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSgEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSaDmiEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSkycamEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdGmmEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSaOcEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdVtdEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdPeiDisplayEnable|TRUE
> -
> -# ME
> -  gSiPkgTokenSpaceGuid.PcdAmtEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdAtaEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdPttEnable|TRUE
> -  

Re: [edk2-devel] [edk2-platforms][PATCH V1 02/17] KabylakeSiliconPkg: Add DSC include file section tags

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:17 PM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V ; Chiu, Chasel
> 
> Subject: [edk2-platforms][PATCH V1 02/17] KabylakeSiliconPkg: Add DSC
> include file section tags
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2245
> 
> The DSC LibraryClass files in KabylakeSiliconPkg that are intended to be
> included elsewhere such as SiPkgPeiLib.dsc, SiPkgDxeLib.dsc, and
> SiPkgCommonLib.dsc should have section tags so that they are not
> dependent on the top-level DSC file to place the include file in the correct
> location in the DSC file and better define the applicability of their library
> content.
> 
> This change adds section tags for the library class related files.
> The component files may be built differently in the consuming package
> depending on their architecture requirements so those are not modified.
> 
> Cc: Sai Chaganty 
> Cc: Chasel Chiu 
> Signed-off-by: Michael Kubacki 
> ---
>  Silicon/Intel/KabylakeSiliconPkg/SiPkgCommonLib.dsc | 6 --
>  Silicon/Intel/KabylakeSiliconPkg/SiPkgDxeLib.dsc| 5 +++--
>  Silicon/Intel/KabylakeSiliconPkg/SiPkgPeiLib.dsc| 3 ++-
>  3 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/Silicon/Intel/KabylakeSiliconPkg/SiPkgCommonLib.dsc
> b/Silicon/Intel/KabylakeSiliconPkg/SiPkgCommonLib.dsc
> index 920b02e410..fa9dd4a32d 100644
> --- a/Silicon/Intel/KabylakeSiliconPkg/SiPkgCommonLib.dsc
> +++ b/Silicon/Intel/KabylakeSiliconPkg/SiPkgCommonLib.dsc
> @@ -1,11 +1,13 @@
>  ## @file
> -#  Component description file for the SkyLake SiPkg both Pei and Dxe
> libraries DSC file.
> +#  Build description file for Kaby Lake silicon PEI and DXE libraries.
>  #
> -# Copyright (c) 2017, Intel Corporation. All rights reserved.
> +# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> +reserved.
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ##
> +
> +[LibraryClasses.common]
>  #
>  # Silicon Init Common Library
>  #
> diff --git a/Silicon/Intel/KabylakeSiliconPkg/SiPkgDxeLib.dsc
> b/Silicon/Intel/KabylakeSiliconPkg/SiPkgDxeLib.dsc
> index 8c194d8e7c..bc497c3531 100644
> --- a/Silicon/Intel/KabylakeSiliconPkg/SiPkgDxeLib.dsc
> +++ b/Silicon/Intel/KabylakeSiliconPkg/SiPkgDxeLib.dsc
> @@ -1,12 +1,13 @@
>  # @file
> -#  Component description file for the SkyLake SiPkg DXE libraries.
> +#  Build description file for Kaby Lake silicon DXE libraries.
>  #
> -# Copyright (c) 2017, Intel Corporation. All rights reserved.
> +# Copyright (c) 2017 - 2019, Intel Corporation. All rights
> +reserved.
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ##
> 
> +[LibraryClasses.common.DXE_CORE,LibraryClasses.common.DXE_SMM_DRIV
> ER,Li
> +braryClasses.common.SMM_CORE,LibraryClasses.common.DXE_DRIVER,Libr
> aryCl
> +asses.common.DXE_RUNTIME_DRIVER,LibraryClasses.common.UEFI_DRIVER
> ]
>  #
>  # Silicon Init Dxe Library
>  #
> diff --git a/Silicon/Intel/KabylakeSiliconPkg/SiPkgPeiLib.dsc
> b/Silicon/Intel/KabylakeSiliconPkg/SiPkgPeiLib.dsc
> index 86e34ff359..5334598544 100644
> --- a/Silicon/Intel/KabylakeSiliconPkg/SiPkgPeiLib.dsc
> +++ b/Silicon/Intel/KabylakeSiliconPkg/SiPkgPeiLib.dsc
> @@ -1,5 +1,5 @@
>  ## @file
> -#  Component description file for the SkyLake SiPkg PEI libraries.
> +#  Build description file for Kaby Lake silicon PEI libraries.
>  #
>  # Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.  #
> @@ -7,6 +7,7 @@  #  ##
> 
> +[LibraryClasses]
>  #
>  # Silicon Init Pei Library
>  #
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48590): https://edk2.groups.io/g/devel/message/48590
Mute This Topic: https://groups.io/mt/34439437/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v1 1/1] NetworkPkg/SnpDxe: Remove ExitBootServices event

2019-10-08 Thread Rabeda, Maciej
Patch addresses Bugzilla #1972.
During ExitBootServices stage, drivers should not call any
functions known to use Memory Allocation Services. One of such
functions (as per UEFI spec) is UNDI->Shutdown().

Since UNDI drivers during ExitBootServices phase are expected
to put the adapter to such a state that it will not perform any DMA
operations, there is no need to interface UNDI by SNP driver during
that phase.

Finally, since ExitBootServices event notification function in SNP
only calls UNDI->Shutdown() and Stop() functions, there is no need
to create this event at all.

Signed-off-by: Maciej Rabeda 
Cc: Siyuan Fu 
Cc: Jiaxin Wu 
---
 NetworkPkg/SnpDxe/Snp.c  | 45 
 NetworkPkg/SnpDxe/Snp.h  |  2 -
 NetworkPkg/SnpDxe/SnpDxe.inf |  3 --
 3 files changed, 50 deletions(-)

diff --git a/NetworkPkg/SnpDxe/Snp.c b/NetworkPkg/SnpDxe/Snp.c
index a23af05078bc..7646a3ce0293 100644
--- a/NetworkPkg/SnpDxe/Snp.c
+++ b/NetworkPkg/SnpDxe/Snp.c
@@ -8,31 +8,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 #include "Snp.h"
 
-/**
-  One notified function to stop UNDI device when gBS->ExitBootServices() 
called.
-
-  @param  Event   Pointer to this event
-  @param  Context Event handler private data
-
-**/
-VOID
-EFIAPI
-SnpNotifyExitBootServices (
-  EFI_EVENT Event,
-  VOID  *Context
-  )
-{
-  SNP_DRIVER *Snp;
-
-  Snp  = (SNP_DRIVER *)Context;
-
-  //
-  // Shutdown and stop UNDI driver
-  //
-  PxeShutdown (Snp);
-  PxeStop (Snp);
-}
-
 /**
   Send command to UNDI. It does nothing currently.
 
@@ -647,21 +622,6 @@ SimpleNetworkDriverStart (
   PxeShutdown (Snp);
   PxeStop (Snp);
 
-  //
-  // Create EXIT_BOOT_SERIVES Event
-  //
-  Status = gBS->CreateEventEx (
-  EVT_NOTIFY_SIGNAL,
-  TPL_NOTIFY,
-  SnpNotifyExitBootServices,
-  Snp,
-  ,
-  >ExitBootServicesEvent
-  );
-  if (EFI_ERROR (Status)) {
-goto Error_DeleteSNP;
-  }
-
   //
   //  add SNP to the undi handle
   //
@@ -778,11 +738,6 @@ SimpleNetworkDriverStop (
 return Status;
   }
 
-  //
-  // Close EXIT_BOOT_SERIVES Event
-  //
-  gBS->CloseEvent (Snp->ExitBootServicesEvent);
-
   Status = gBS->CloseProtocol (
   Controller,
   _31,
diff --git a/NetworkPkg/SnpDxe/Snp.h b/NetworkPkg/SnpDxe/Snp.h
index e6b62930397d..f83a4f075adc 100644
--- a/NetworkPkg/SnpDxe/Snp.h
+++ b/NetworkPkg/SnpDxe/Snp.h
@@ -120,8 +120,6 @@ typedef struct {
 VOID  *MapCookie;
   } MapList[MAX_MAP_LENGTH];
 
-  EFI_EVENT  ExitBootServicesEvent;
-
   //
   // Whether UNDI support reporting media status from GET_STATUS command,
   // i.e. PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED or
diff --git a/NetworkPkg/SnpDxe/SnpDxe.inf b/NetworkPkg/SnpDxe/SnpDxe.inf
index afeb1526cc10..8d045cfcf4ca 100644
--- a/NetworkPkg/SnpDxe/SnpDxe.inf
+++ b/NetworkPkg/SnpDxe/SnpDxe.inf
@@ -64,9 +64,6 @@
   DebugLib
   NetLib
 
-[Guids]
-  gEfiEventExitBootServicesGuid ## SOMETIMES_CONSUMES ## Event
-
 [Protocols]
   gEfiSimpleNetworkProtocolGuid ## BY_START
   gEfiDevicePathProtocolGuid## TO_START
-- 
2.17.0.windows.1



Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial 
Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | 
Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i 
moze zawierac informacje poufne. W razie przypadkowego otrzymania tej 
wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; 
jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole 
use of the intended recipient(s). If you are not the intended recipient, please 
contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48589): https://edk2.groups.io/g/devel/message/48589
Mute This Topic: https://groups.io/mt/3145/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v1 0/1] Remove UNDI calls from SNP during ExitBootServices

2019-10-08 Thread Rabeda, Maciej
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1974

Removing calls to UNDI->Shutdown() and Stop() functions in ExitBootServices
event notification function. Since SNP event reacting to ExitBootServices
is only calling those two functions, I am removing that as well.

Cc: Siyuan Fu 
Cc: Jiaxin Wu 

Maciej Rabeda (1):
  NetworkPkg/SnpDxe: Remove ExitBootServices event

 NetworkPkg/SnpDxe/Snp.c  | 45 
 NetworkPkg/SnpDxe/Snp.h  |  2 -
 NetworkPkg/SnpDxe/SnpDxe.inf |  3 --
 3 files changed, 50 deletions(-)

-- 
2.17.0.windows.1



Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial 
Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | 
Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i 
moze zawierac informacje poufne. W razie przypadkowego otrzymania tej 
wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; 
jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole 
use of the intended recipient(s). If you are not the intended recipient, please 
contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48588): https://edk2.groups.io/g/devel/message/48588
Mute This Topic: https://groups.io/mt/3144/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] Problem with decompression on EDK2

2019-10-08 Thread Loh, Tien Hock
Ok, noted with thanks Liming. I'll try the tools out. 

Thanks
Tien Hock

> -Original Message-
> From: Gao, Liming 
> Sent: Tuesday, October 8, 2019 10:04 PM
> To: Loh, Tien Hock ; devel@edk2.groups.io;
> ler...@redhat.com
> Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> Subject: RE: [edk2-devel] Problem with decompression on EDK2
> 
> BaseTools VolInfo tool. Its input is the binary FvImage file. In the same
> directory, GuidedSectionTools.txt (built in the FV directory) should be here.
> 
> Thanks
> Liming
> > -Original Message-
> > From: Loh, Tien Hock 
> > Sent: Tuesday, October 1, 2019 10:34 AM
> > To: Gao, Liming ; devel@edk2.groups.io;
> > ler...@redhat.com
> > Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > Subject: RE: [edk2-devel] Problem with decompression on EDK2
> >
> > Hi Liming,
> >
> > Thanks for the quick response.
> > Can you help show me where I can find more information on the
> decompression (ie. how to test the image, etc.)?
> >
> > Thanks
> > Tien Hock
> >
> > > -Original Message-
> > > From: Gao, Liming 
> > > Sent: Sunday, September 29, 2019 3:06 PM
> > > To: Loh, Tien Hock ; devel@edk2.groups.io;
> > > ler...@redhat.com
> > > Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > > Subject: RE: [edk2-devel] Problem with decompression on EDK2
> > >
> > > Tien Hock:
> > >   The image is correct. It can be decompressed by lzma.
> > >   When FD is loaded into 0x5, I suspect that the image data
> > > can't fully read. Then, the decompress will failure.
> > >
> > >   FD image last valid byte offset is 0xC1B8F. Its value is 0x83.
> > > When FD base address is 0x5, this position is 0x111B8F.
> > >   You can read this place and check its value.
> > >
> > > Thanks
> > > Liming
> > > >-Original Message-
> > > >From: Loh, Tien Hock
> > > >Sent: Friday, September 27, 2019 3:05 PM
> > > >To: Gao, Liming ; devel@edk2.groups.io;
> > > >ler...@redhat.com
> > > >Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > > >Subject: RE: [edk2-devel] Problem with decompression on EDK2
> > > >
> > > >Hi Liming,
> > > >
> > > >I've tested another workaround - Move the FD file to a higher RAM
> > > >location (originally, it is loaded into 0x5, now it is at
> > > >0x1000) With the FD file moved to 0x1000, the decompression
> > > >works every time, even with bigger FD. I've attached the my FD file
> > > >in the
> > > mail.
> > > >
> > > >Thanks
> > > >Tien Hock
> > > >
> > > >> -Original Message-
> > > >> From: Gao, Liming 
> > > >> Sent: Friday, September 27, 2019 8:13 AM
> > > >> To: devel@edk2.groups.io; ler...@redhat.com; Loh, Tien Hock
> > > >> 
> > > >> Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > > >> Subject: RE: [edk2-devel] Problem with decompression on EDK2
> > > >>
> > > >> Can you share the generated FD image? I can help check whether it
> > > >> is generated correctly with compression.
> > > >>
> > > >> Thanks
> > > >> Liming
> > > >>
> > > >> >-Original Message-
> > > >> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On
> > > >> >Behalf Of Laszlo Ersek
> > > >> >Sent: Friday, September 27, 2019 3:22 AM
> > > >> >To: devel@edk2.groups.io; Loh, Tien Hock
> > > >> >
> > > >> >Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > > >> >Subject: Re: [edk2-devel] Problem with decompression on EDK2
> > > >> >
> > > >> >On 09/26/19 11:27, Loh, Tien Hock wrote:
> > > >> >> Hi
> > > >> >>
> > > >> >> I have an issue while porting a new platform to EDK2. After
> > > >> >> porting the
> > > >> >Stratix 10 platform (ARM) to EDK2 it works correctly. However,
> > > >> >when I tried to add more INF to the FDF file, it failed to
> > > >> >decompress the image during boot time, log as below
> > > >> >> INFO:DDR: DRAM calibration success.
> > > >> >> INFO:Scrubbing ECC
> > > >> >> INFO:Init HPS NOC's DDR Scheduler.
> > > >> >> NOTICE:  BL2: v2.1(debug):v2.1-15-g5880144-dirty
> > > >> >> NOTICE:  BL2: Built : 14:02:01, Aug 22 2019
> > > >> >> INFO:BL2: Doing platform setup
> > > >> >> INFO:BL2: Loading image id 3
> > > >> >> INFO:Loading image id=3 at address 0xffe1c000
> > > >> >> INFO:Image id=3 loaded: 0xffe1c000 - 0xffe22019
> > > >> >> INFO:BL2: Loading image id 5
> > > >> >> INFO:Loading image id=5 at address 0x5
> > > >> >> INFO:Image id=5 loaded: 0x5 - 0x15
> > > >> >> NOTICE:  BL2: Booting BL31
> > > >> >> INFO:Entry point address = 0xffe1c000
> > > >> >> INFO:SPSR = 0x3cd
> > > >> >> NOTICE:  BL31: v2.1(release):v2.1-604-g3441952
> > > >> >> NOTICE:  BL31: Built : 15:32:55, Sep 25 2019 UEFI firmware
> > > >> >> (version
> > > >> >> 1.0 built at 15:15:26 on Sep 26 2019) Decompress Failed -
> > > >> >> Invalid Parameter
> > > >> >>
> > > >> >> ASSERT_EFI_ERROR (Status = Not Found) ASSERT
> > > >> >> [ArmPlatformPrePiUniCore]
> > > >>
> > >
> >/nfs/png/disks/swuser_work_thloh/push/build/edk2/ArmPlatformPkg/Pr
> > > 

Re: [edk2-devel] [edk2-platforms][PATCH V1 01/17] KabylakeOpenBoardPkg/KabylakeRvp3: Remove OpenBoardPkgConfig.dsc

2019-10-08 Thread Chiu, Chasel


Reviewed-by: Chasel Chiu 

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Tuesday, October 8, 2019 1:16 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel ; Desimone, Nathaniel L
> 
> Subject: [edk2-platforms][PATCH V1 01/17]
> KabylakeOpenBoardPkg/KabylakeRvp3: Remove OpenBoardPkgConfig.dsc
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2242
> 
> The location for PCD configuration is currently inconsistent in
> KabylakeOpenBoardPkg. A large set of FeaturePCD definitions are in
> OpenBoardPkgConfig.dsc while other PCD definitions (including
> FeaturePCD) are located in OpenBoardPkgPcd.dsc.
> 
> This change consolidates PCD configuration for the KabylakeRvp3 board to
> OpenBoardPkgPcd.dsc and removes OpenBoardPkgConfig.dsc.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Signed-off-by: Michael Kubacki 
> ---
>  Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> |   1 -
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgConfig.d
> sc | 138 
> 
> Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgPcd.dsc
> | 132 ++-
>  3 files changed, 130 insertions(+), 141 deletions(-)
> 
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> index 7090852192..a3378d3c5d 100644
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> +++
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
> @@ -22,7 +22,6 @@
>#
># Platform On/Off features are defined here
>#
> -  !include OpenBoardPkgConfig.dsc
>!include OpenBoardPkgPcd.dsc
> 
>  [Defines]
> diff --git
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgConfig
> .dsc
> b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgConfi
> g.dsc
> deleted file mode 100644
> index 15468494dd..00
> ---
> a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkgConfig
> .dsc
> +++ /dev/null
> @@ -1,138 +0,0 @@
> -## @file
> -#  Platform configuration file.
> -#
> -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. -# 
> -#
> SPDX-License-Identifier: BSD-2-Clause-Patent -# -##
> -
> -[PcdsFixedAtBuild]
> -  #
> -  # Please select BootStage here.
> -  # Stage 1 - enable debug (system deadloop after debug init)
> -  # Stage 2 - mem init (system deadloop after mem init)
> -  # Stage 3 - boot to shell only
> -  # Stage 4 - boot to OS
> -  # Stage 5 - boot to OS with security boot enabled
> -  #
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4
> -
> -[PcdsFeatureFlag]
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 3
> -  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|TRUE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 4
> -  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
> -!endif
> -
> -!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 5
> -  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|TRUE
> -  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|TRUE
> -!endif
> -
> -  gBoardModuleTokenSpaceGuid.PcdTbtEnable|FALSE
> -  #
> -  # More fine granularity control below:
> -  #
> -
> -
> -  gBoardModuleTokenSpaceGuid.PcdMultiBoardSupport|TRUE
> -
> -
> -
> -#
> -# TRUE is ENABLE. FALSE is DISABLE.
> -#
> -
> -#
> -# BIOS build switches configuration
> -#
> -  gSiPkgTokenSpaceGuid.PcdOptimizeCompilerEnable|TRUE
> -
> -# CPU
> -  gSiPkgTokenSpaceGuid.PcdSourceDebugEnable|FALSE
> -  gSiPkgTokenSpaceGuid.PcdTxtEnable|TRUE  #Set to FALSE for GCC Build
> @todo Convert TXT ASM to NASM
> -  gSiPkgTokenSpaceGuid.PcdBiosGuardEnable|TRUE
> -
> -# SA
> -  gSiPkgTokenSpaceGuid.PcdIgdEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdPegEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSgEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSaDmiEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSkycamEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdGmmEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdSaOcEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdVtdEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdPeiDisplayEnable|TRUE
> -
> -# ME
> -  gSiPkgTokenSpaceGuid.PcdAmtEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdAtaEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdPttEnable|TRUE
> -  gSiPkgTokenSpaceGuid.PcdJhiEnable|TRUE
> -
> -  gSiPkgTokenSpaceGuid.PcdAcpiEnable|TRUE
> - 

Re: [edk2-devel] [Patch 12/12] OvmfPkg SecMain: Add build option "-fno-omit-frame-pointer" for CLANG9 X64

2019-10-08 Thread Liming Gao
Laszlo:
  I will verify your option (a) and (b). The problem is described in 
https://bugzilla.tianocore.org/show_bug.cgi?id=2024. 
  I know there are some discussion in Jordan patch for PeiCore change. Before 
the conclusion for Jordan change is made, 
  I expect to find the alternate option to resolve CLANG9 tool chain issue 
first. 

Thanks
Liming
> -Original Message-
> From: Laszlo Ersek 
> Sent: Tuesday, October 1, 2019 5:10 AM
> To: devel@edk2.groups.io; Gao, Liming ; Justen, Jordan 
> L 
> Subject: Re: [edk2-devel] [Patch 12/12] OvmfPkg SecMain: Add build option 
> "-fno-omit-frame-pointer" for CLANG9 X64
> 
> + Jordan
> 
> On 09/27/19 09:46, Liming Gao wrote:
> > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2024
> >
> > Signed-off-by: Liming Gao 
> > ---
> >  OvmfPkg/Sec/SecMain.inf | 4 
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/OvmfPkg/Sec/SecMain.inf b/OvmfPkg/Sec/SecMain.inf
> > index 63ba4cb555..cd765cac25 100644
> > --- a/OvmfPkg/Sec/SecMain.inf
> > +++ b/OvmfPkg/Sec/SecMain.inf
> > @@ -69,3 +69,7 @@
> >
> >  [FeaturePcd]
> >gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire
> > +
> > +[BuildOptions]
> > +  # CLANG9 X64 requires it.
> > +  GCC:*_CLANG9_X64_CC_FLAGS = -fno-omit-frame-pointer
> >
> 
> I disagree with this patch for two reasons.
> 
> First, the comment "CLANG9 X64 requires it" is quite lacking. It does
> nothing to explain the issue; it doesn't even provide a pointer in the
> code comment (only in the code message).
> 
> Second, Jordan suggested an alternative approach at the end of
> , which I prefer
> to the one seen above. Can we please try that with CLANG9 too?
> 
> 
> ... Oh wait I see there are new comments in BZ#2024.
> 
> Apparently,
> 
>   #pragma GCC optimize ("no-omit-frame-pointer")
> 
> does not work with CLANG9.
> 
> That's not a problem: we still have two options that are superior to the
> present patch, and should be tested.
> 
> (a) Does Jordan's series linked below fix the problem with CLANG9?
> 
>   [edk2-devel] [PATCH v2 0/6] Fix PEI Core issue during TemporaryRamMigration
>   http://mid.mail-archive.com/20190410084000.19660-1-jordan.l.justen@intel.com
>   https://edk2.groups.io/g/devel/message/38785
> 
> (b) Jordan's full #pragma suggestion was:
> 
> #ifdef __GNUC__
> #pragma GCC push_options
> #pragma GCC optimize ("no-omit-frame-pointer")
> #else
> #pragma optimize ("y", off)
> #endif
> 
> If the '#pragme GCC' branch doesn't help, can we customize the *other*
> branch for CLANG9?
> 
> For example, in patch#4, we rely on defined(__clang__). Therefore, can
> we try the following:
> 
> #ifdef __GNUC__
> #pragma GCC push_options
> #pragma GCC optimize ("no-omit-frame-pointer")
> #elif defined(__clang__)
> #pragma clang optimize off  <- NOTE THIS 
> 
> #else
> #pragma optimize ("y", off)
> #endif
> 
> In summary, the fact that CLANG9 breaks is just a symptom; it shows that
> the PEI Core issue fixed by Jordan is real. We should go for the real
> fix (a).
> 
> Alternatively, use a clang-specific optimization override, as tightly as
> possible; (b) might work.
> 
> -*-
> 
> In fact I think this is the perfect time to fix the PEI Core issue: we
> now have a feature request that depends on fixing the bug in the PEI
> Core. We should fix technical debt in edk2 at least *sometimes*. If we
> are not willing to fix technical debt in edk2 for the sake of new
> features, we will *never* fix technical debt.
> 
> (Well, to be technically correct, we also fix technical debt when it
> turns into security issues. Yay!)
> 
> Please test this series with the present patch removed, and Jordan's v2
> series (linked above) applied.
> 
> Thanks
> Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48585): https://edk2.groups.io/g/devel/message/48585
Mute This Topic: https://groups.io/mt/34309065/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 4/4] OvmfPkg/PlatformPei: rewrite MaxCpuCountInitialization() for CPU hotplug

2019-10-08 Thread Igor Mammedov
On Tue,  8 Oct 2019 13:27:14 +0200
Laszlo Ersek  wrote:

> MaxCpuCountInitialization() currently handles the following options:
> 
> (1) QEMU does not report the boot CPU count.
> 
> In this case, PlatformPei makes MpInitLib enumerate APs up to the
> default PcdCpuMaxLogicalProcessorNumber value (64) minus 1, or until
> the default PcdCpuApInitTimeOutInMicroSeconds (50,000) elapses.
> (Whichever is reached first.)
> 
> Time-limited AP enumeration had never been reliable on QEMU/KVM, which
> is why commit 45a70db3c3a5 strated handling case (2) below, in OVMF.
> 
> (2) QEMU reports the boot CPU count.
> 
> In this case, PlatformPei sets PcdCpuMaxLogicalProcessorNumber to the
> reported boot CPU count, and PcdCpuApInitTimeOutInMicroSeconds to
> practically "infinity" (MAX_UINT32, ~71 minutes). That causes
> MpInitLib to enumerate exactly the available (boot) APs.
> 
> With CPU hotplug in mind, this method is not good enough. While
> UefiCpuPkg expects PcdCpuMaxLogicalProcessorNumber to include both
> boot (i.e., cold-plugged), and all *potentially* hot-plugged, logical
> processors, the boot CPU count reported by QEMU does not cover the
> second category.

Can you elaborate why it doesn't cover the second category?



> Rewrite MaxCpuCountInitialization() for handling the following cases:
> 
> (1) The behavior of case (1) does not change. (No UefiCpuPkg PCDs are set
> to values different from the defaults.)
> 
> (2) QEMU reports the boot CPU count, but not the potential maximum CPU
> count.
> 
> In this case, the behavior remains unchanged.
> 
> The way MpInitLib is instructed to do the same differs however: we now
> set the new PcdCpuBootLogicalProcessorNumber to the boot CPU count
> (together with PcdCpuMaxLogicalProcessorNumber).
> PcdCpuApInitTimeOutInMicroSeconds is irrelevant.
> 
> (3) QEMU reports both the boot CPU count, and the potential maximum CPU
> count.
> 
> We tell UefiCpuPkg about the potential maximum through
> PcdCpuMaxLogicalProcessorNumber. We also tell MpInitLib the boot CPU
> count for precise and quick AP enumeration, via
> PcdCpuBootLogicalProcessorNumber. PcdCpuApInitTimeOutInMicroSeconds is
> irrelevant.
What for max cpu count is/will be used?

> 
> This patch is a pre-requisite for enabling CPU hotplug with SMM_REQUIRE.
> As a side effect, it also enables S3 to work with CPU hotplug at once,
> *without* SMM_REQUIRE.
Does OVMF reread boot CPU count on resume from QEMU?


> Cc: Anthony Perard 
> Cc: Ard Biesheuvel 
> Cc: Eric Dong 
> Cc: Igor Mammedov 
> Cc: Jordan Justen 
> Cc: Julien Grall 
> Cc: Ray Ni 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1515
> Signed-off-by: Laszlo Ersek 
> ---
>  OvmfPkg/OvmfPkgIa32.dsc |  2 +-
>  OvmfPkg/OvmfPkgIa32X64.dsc  |  2 +-
>  OvmfPkg/OvmfPkgX64.dsc  |  2 +-
>  OvmfPkg/PlatformPei/PlatformPei.inf |  2 +-
>  OvmfPkg/PlatformPei/Platform.c  | 83 +---
>  5 files changed, 60 insertions(+), 31 deletions(-)
> 
> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> index 66e944436a69..89b1fc41458d 100644
> --- a/OvmfPkg/OvmfPkgIa32.dsc
> +++ b/OvmfPkg/OvmfPkgIa32.dsc
> @@ -554,7 +554,7 @@ [PcdsDynamicDefault]
>  
># UefiCpuPkg PCDs related to initial AP bringup and general AP management.
>gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|64
> -  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber|0
>  
># Set memory encryption mask
>gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> index 51c2bfb44f14..f978d27a0b55 100644
> --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> @@ -566,7 +566,7 @@ [PcdsDynamicDefault]
>  
># UefiCpuPkg PCDs related to initial AP bringup and general AP management.
>gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|64
> -  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber|0
>  
># Set memory encryption mask
>gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index ba7a75884490..04604ed6b35b 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -565,7 +565,7 @@ [PcdsDynamicDefault]
>  
># UefiCpuPkg PCDs related to initial AP bringup and general AP management.
>gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|64
> -  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5
> +  gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber|0
>  
># Set memory encryption mask
>gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
> diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf 
> 

Re: [edk2-devel] [Patch 11/12] OvmfPkg: Enable CLANG9 tool chain

2019-10-08 Thread Liming Gao
Laszlo:

> -Original Message-
> From: Laszlo Ersek 
> Sent: Tuesday, October 1, 2019 4:42 AM
> To: devel@edk2.groups.io; Gao, Liming 
> Subject: Re: [edk2-devel] [Patch 11/12] OvmfPkg: Enable CLANG9 tool chain
> 
> Hi Liming,
> 
> On 09/27/19 09:46, Liming Gao wrote:
> > 1. Apply CLANG9 Linker option.
> 
> I'm confused by this, in two regards.
> 
> - Why do we refer to CLANG9 first as being in the GCC toolchain family
> (see near mmx/sse), and then under a totally different family name
> (CLANGPE?)

CLANGPE is used to override GCC option. GCC is used to append GCC options. 
You can see XCODE5 take the same way. 
CLANG9 tool chain doesn't recognize -z common-page-size=0x1000 option. 
So, here CLANGPE is used to specify /ALIGN:4096 option. 

> 
> - Regarding the CLANGPE option, does the "/ALIGN:4096" option format
> work on Linux too? (It seems quite unusual).
> 
Yes. CLANG9 tool chain is CLANG compiler + LLVM LLD linker. 
This linker is to generate PE/COFF image. Its linker option is same to VS 
linker. 
This linker works on Linux and Mac. 

> Another question:
> 
> - There is another XCODE5-specific exception in OvmfPkg, namely
> TftpDynamicCommand. Does that build OK with CLANG9?
> 
Yes. LLVM provides llvm-rc to generate resource section. 

> > 2. Add -mno-mmx -mno-sse compiler option
> 
> I think this remark should be clarified -- the options are *excluded*
> from the CLANG9 build.

Right. I will update comments.
> 
> Thanks
> Laszlo
> 
> >
> > Signed-off-by: Liming Gao 
> > ---
> >  OvmfPkg/OvmfPkgIa32.dsc| 4 +++-
> >  OvmfPkg/OvmfPkgIa32X64.dsc | 4 +++-
> >  OvmfPkg/OvmfPkgX64.dsc | 4 +++-
> >  3 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
> > index 66e944436a..0fde8e6e84 100644
> > --- a/OvmfPkg/OvmfPkgIa32.dsc
> > +++ b/OvmfPkg/OvmfPkgIa32.dsc
> > @@ -66,7 +66,7 @@
> >GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
> >INTEL:RELEASE_*_*_CC_FLAGS   = /D MDEPKG_NDEBUG
> >MSFT:RELEASE_*_*_CC_FLAGS= /D MDEPKG_NDEBUG
> > -!if $(TOOL_CHAIN_TAG) != "XCODE5"
> > +!if $(TOOL_CHAIN_TAG) != "XCODE5" && $(TOOL_CHAIN_TAG) != "CLANG9"
> >GCC:*_*_*_CC_FLAGS   = -mno-mmx -mno-sse
> >  !endif
> >
> > @@ -80,12 +80,14 @@
> >  [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
> >GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> >XCODE:*_*_*_DLINK_FLAGS =
> > +  CLANGPE: *_*_*_DLINK_FLAGS = /ALIGN:4096
> >
> >  # Force PE/COFF sections to be aligned at 4KB boundaries to support page 
> > level
> >  # protection of DXE_SMM_DRIVER/SMM_CORE modules
> >  [BuildOptions.common.EDKII.DXE_SMM_DRIVER, 
> > BuildOptions.common.EDKII.SMM_CORE]
> >GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> >XCODE:*_*_*_DLINK_FLAGS =
> > +  CLANGPE: *_*_*_DLINK_FLAGS = /ALIGN:4096
> >
> >  
> > 
> >  #
> > diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
> > index 51c2bfb44f..c17329878e 100644
> > --- a/OvmfPkg/OvmfPkgIa32X64.dsc
> > +++ b/OvmfPkg/OvmfPkgIa32X64.dsc
> > @@ -66,7 +66,7 @@
> >GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
> >INTEL:RELEASE_*_*_CC_FLAGS   = /D MDEPKG_NDEBUG
> >MSFT:RELEASE_*_*_CC_FLAGS= /D MDEPKG_NDEBUG
> > -!if $(TOOL_CHAIN_TAG) != "XCODE5"
> > +!if $(TOOL_CHAIN_TAG) != "XCODE5" && $(TOOL_CHAIN_TAG) != "CLANG9"
> >GCC:*_*_*_CC_FLAGS   = -mno-mmx -mno-sse
> >  !endif
> >  !ifdef $(SOURCE_DEBUG_ENABLE)
> > @@ -85,12 +85,14 @@
> >  [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
> >GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> >XCODE:*_*_*_DLINK_FLAGS =
> > +  CLANGPE: *_*_*_DLINK_FLAGS = /ALIGN:4096
> >
> >  # Force PE/COFF sections to be aligned at 4KB boundaries to support page 
> > level
> >  # protection of DXE_SMM_DRIVER/SMM_CORE modules
> >  [BuildOptions.common.EDKII.DXE_SMM_DRIVER, 
> > BuildOptions.common.EDKII.SMM_CORE]
> >GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
> >XCODE:*_*_*_DLINK_FLAGS =
> > +  CLANGPE: *_*_*_DLINK_FLAGS = /ALIGN:4096
> >
> >  
> > 
> >  #
> > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> > index ba7a758844..af91265d05 100644
> > --- a/OvmfPkg/OvmfPkgX64.dsc
> > +++ b/OvmfPkg/OvmfPkgX64.dsc
> > @@ -66,7 +66,7 @@
> >GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
> >INTEL:RELEASE_*_*_CC_FLAGS   = /D MDEPKG_NDEBUG
> >MSFT:RELEASE_*_*_CC_FLAGS= /D MDEPKG_NDEBUG
> > -!if $(TOOL_CHAIN_TAG) != "XCODE5"
> > +!if $(TOOL_CHAIN_TAG) != "XCODE5" && $(TOOL_CHAIN_TAG) != "CLANG9"
> >GCC:*_*_*_CC_FLAGS   = -mno-mmx -mno-sse
> >  !endif
> >  !ifdef $(SOURCE_DEBUG_ENABLE)
> > @@ -85,12 +85,14 @@
> >  [BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
> >GCC:*_*_*_DLINK_FLAGS = -z 

Re: [edk2-devel] [edk2-platforms: PATCH] Marvell/Drivers: MvPhyDxe: Execute proper initialization callback

2019-10-08 Thread Leif Lindholm
On Mon, Oct 07, 2019 at 02:02:26AM +0200, Marcin Wojtas wrote:
> Hitherto code was executing by mistake the first
> possible initialization routine (valid for 88E1512 PHY),
> regardless the setting in gMarvellTokenSpaceGuid.PcdPhyDeviceIds.
> Fix this.
> 
> Signed-off-by: Marcin Wojtas 

Reviewed-by: Leif Lindholm 
Pushed as 16eb2d4e9c7b.
Thanks!

> ---
>  Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.h |  3 ++-
>  Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.c | 28 +---
>  2 files changed, 15 insertions(+), 16 deletions(-)
> 
> diff --git a/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.h 
> b/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.h
> index 908b768..4d8aacf 100644
> --- a/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.h
> +++ b/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.h
> @@ -49,7 +49,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  
>  typedef enum {
>MV_PHY_DEVICE_1512,
> -  MV_PHY_DEVICE_1112
> +  MV_PHY_DEVICE_1112,
> +  MV_PHY_DEVICE_ID_MAX
>  } MV_PHY_DEVICE_ID;
>  
>  typedef
> diff --git a/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.c 
> b/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.c
> index 2d2aad7..6e4a715 100644
> --- a/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.c
> +++ b/Silicon/Marvell/Drivers/Net/MvPhyDxe/MvPhyDxe.c
> @@ -396,7 +396,7 @@ MvPhyInit (
>PHY_DEVICE *PhyDev;
>UINT8 *DeviceIds;
>UINT8 MdioIndex;
> -  INTN i;
> +  UINT8 PhyId;
>  
>Status = gBS->LocateProtocol (
>,
> @@ -415,6 +415,17 @@ MvPhyInit (
>  return EFI_INVALID_PARAMETER;
>}
>  
> +  DeviceIds = PcdGetPtr (PcdPhyDeviceIds);
> +  PhyId = DeviceIds[PhyIndex];
> +  if (PhyId >= MV_PHY_DEVICE_ID_MAX) {
> +DEBUG ((DEBUG_ERROR,
> +  "%a, Incorrect PHY ID (0x%x) for PHY#%d\n",
> +  __FUNCTION__,
> +  PhyId,
> +  PhyIndex));
> +return EFI_INVALID_PARAMETER;
> +  }
> +
>/* perform setup common for all PHYs */
>PhyDev = AllocateZeroPool (sizeof (PHY_DEVICE));
>PhyDev->Addr = PhySmiAddresses[PhyIndex];
> @@ -427,20 +438,7 @@ MvPhyInit (
>  PhyConnection));
>*OutPhyDev = PhyDev;
>  
> -  DeviceIds = PcdGetPtr (PcdPhyDeviceIds);
> -  for (i = 0; i < PcdGetSize (PcdPhyDeviceIds); i++) {
> -/* find MvPhyDevices fitting entry */
> -if (MvPhyDevices[i].DevId == DeviceIds[i]) {
> -  ASSERT (MvPhyDevices[i].DevInit != NULL);
> -  /* proceed with PHY-specific initialization */
> -  return MvPhyDevices[i].DevInit (Snp, PhyDev);
> -}
> -  }
> -
> -  /* if we are here, no matching DevId was found */
> -  Status = EFI_INVALID_PARAMETER;
> -  FreePool (PhyDev);
> -  return Status;
> +  return MvPhyDevices[PhyId].DevInit (Snp, PhyDev);
>  }
>  
>  EFI_STATUS
> -- 
> 2.7.4
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48581): https://edk2.groups.io/g/devel/message/48581
Mute This Topic: https://groups.io/mt/34421607/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v5 3/3] ShellPkg/UefiShellDebug1CommandsLib: Update to support SmBios 3.3.0

2019-10-08 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

Thanks
-Jaben

> -Original Message-
> From: Abner Chang [mailto:abner.ch...@hpe.com]
> Sent: Tuesday, October 08, 2019 1:04 AM
> To: devel@edk2.groups.io
> Cc: abner.ch...@hpe.com; Carsey, Jaben ; Ni,
> Ray ; Gao, Zhichao ; Leif
> Lindholm ; Gilbert Chen 
> Subject: [PATCH v5 3/3] ShellPkg/UefiShellDebug1CommandsLib: Update to
> support SmBios 3.3.0
> 
> Shell command smbiosview updates for SMBIOS 3.3.0 spec.
> 
> Bugzilla link,
> https://bugzilla.tianocore.org/show_bug.cgi?id=2202
> 
> Signed-off-by: Abner Chang 
> 
> Cc: Jaben Carsey 
> Cc: Ray Ni 
> Cc: Zhichao Gao 
> Cc: Leif Lindholm 
> Cc: Gilbert Chen 
> ---
>  .../SmbiosView/PrintInfo.c | 23 +++-
>  .../SmbiosView/PrintInfo.h | 13 -
>  .../SmbiosView/QueryTable.c| 63 
> +-
>  .../UefiShellDebug1CommandsLib.uni |  3 +-
>  4 files changed, 98 insertions(+), 4 deletions(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> index cfd7a2b..ff0c1db 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> @@ -3,7 +3,7 @@
> 
>Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
>(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
> -  (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
> +  (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -1169,6 +1169,15 @@ SmbiosPrintStructure (
>  break;
> 
>//
> +  // Processor Additional Information (Type 44)
> +  //
> +  case 44:
> +PRINT_STRUCT_VALUE_H (Struct, Type44, RefHandle);
> +PRINT_STRUCT_VALUE_H (Struct, Type44,
> ProcessorSpecificBlock.ProcessorArchType);
> +ProcessorArchitectureType (Struct->Type44-
> >ProcessorSpecificBlock.ProcessorArchType, Option);
> +break;
> +
> +  //
>// Inactive (Type 126)
>//
>case 126:
> @@ -2350,6 +2359,18 @@ DisplayProcessorFamily2 (
>Print (L"Video Processor\n");
>break;
> 
> +case 0x200:
> +  Print (L"RISC-V RV32\n");
> +  break;
> +
> +case 0x201:
> +  Print (L"RISC-V RV64\n");
> +  break;
> +
> +case 0x202:
> +  Print (L"RISC-V RV128\n");
> +  break;
> +
>  default:
>   ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN
> (STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY),
> gShellDebug1HiiHandle);
>}
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
> index a8c32ab..22f59d6 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
> @@ -2,7 +2,7 @@
>Module to clarify the element info of the smbios structure.
> 
>Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
> -  (C) Copyright 2017 Hewlett Packard Enterprise Development LP
> +  (C) Copyright 2017 - 2019 Hewlett Packard Enterprise Development LP
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -427,4 +427,15 @@ DisplayTpmDeviceCharacteristics (
>IN UINT8   Option
>);
> 
> +/**
> +  Display Processor Architecture Type (Type 44).
> +
> +  @param[in] Type   The key of the structure.
> +  @param[in] Option The optional information.
> +**/
> +VOID
> +ProcessorArchitectureType (
> +  IN UINT8 Type,
> +  IN UINT8 Option
> +  );
>  #endif
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.
> c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.
> c
> index bfb7c3b..54e9a52 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.
> c
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.
> c
> @@ -3,7 +3,7 @@
>And give a interface of query a string out of a table.
> 
>Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
> -  (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
> +  (C) Copyright 2016-2019 Hewlett Packard Enterprise Development LP
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -620,6 +620,10 @@ TABLE_ITEM  ProcessorCharacteristicsTable[] = {
>{
>  7,
>  L" Power/Performance Control"
> +  },
> +  {
> +8,
> +L" 128-bit Capable"
>}
>  };
> 
> @@ -3268,6 +3272,44 @@ TABLE_ITEM  MCHostInterfaceTypeTable[] = {
>},
>  };
> 
> +TABLE_ITEM  ProcessorArchitectureTypesTable[] = {
> +  {
> +0,
> +L" Reserved "
> +  },
> +  {
> +1,
> +L" IA32 (x86) "
> +  },
> +  {
> +2,
> +L" x64 (x86-64, intel64, AMD64, EM64T) "
> +  },
> +  {
> +3,
> +L" Intel Itanium architecture "
> +  },
> 

Re: [edk2-devel] [Patch 05/12] MdePkg BaseIoLibIntrinsic: Remove __inline__ attribute for IO functions

2019-10-08 Thread Liming Gao


From: devel@edk2.groups.io  On Behalf Of Andrew Fish via 
Groups.Io
Sent: Tuesday, October 1, 2019 5:12 AM
To: devel@edk2.groups.io; ler...@redhat.com
Cc: Gao, Liming 
Subject: Re: [edk2-devel] [Patch 05/12] MdePkg BaseIoLibIntrinsic: Remove 
__inline__ attribute for IO functions




On Sep 30, 2019, at 3:35 PM, Laszlo Ersek 
mailto:ler...@redhat.com>> wrote:

Hi Liming,

On 09/27/19 09:46, Liming Gao wrote:

__inline__ attribute will make the functions not be exposed as the
library interface. It will cause CLANG9 compiler fail.

Signed-off-by: Liming Gao mailto:liming@intel.com>>
---
MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c | 6 --
1 file changed, 6 deletions(-)

Did you regression-test this change against GCC48 (for example)?

I can't tell why we have the __inline__'s in the first place. They date
back to historical commit e1f414b6a7d8 ("Import some basic libraries
instances for Mde Packages.", 2007-06-22). And that commit does not
explain __inline__.

If we remove __inline__ for the whole GCC toolchain *family*, then I
think we need a better justification than just "makes CLANG9 fail".

[Liming] I verify GCC5 tool chain. I will verify GCC48/GCC49 and XCODE5.
I don’t know the specific reason about __inline__. If there is no impact on
other GCC tool chain, I prefer to remove them.

Yikes,

Looks like __inline__ is the C89 version of inline.

I'm kind of surprised clang with LTO would just not ignore the inline, but then 
I came across

https://en.wikipedia.org/wiki/Inline_function
"gnu89 semantics of inline and extern inline are essentially the exact opposite 
of those in C99[4], 
with the exception that gnu89 permits redefinition of an extern inline function 
as an unqualified function, while C99 inline does 
not[5].
 Thus, gnu89 extern inline without redefinition is like C99 inline, and gnu89 
inline is like C99 extern inline; in other words, in gnu89, a function defined 
inline will always and a function defined extern inline will never emit an 
externally visible function. The rationale for this is that it matches 
variables, for which storage will never be reserved if defined as extern and 
always if defined without. The rationale for C99, in contrast, is that it would 
be astonishing 
if using inline would have a side-effect—to always emit a non-inlined version 
of the function—that is contrary to what its name suggests.
The remarks for C99 about the need to provide exactly one externally visible 
function instance for inlined functions and about the resulting problem with 
unreachable code apply mutatis mutandis to gnu89 as well.
gcc up to and including version 4.2 used gnu89 inline semantics even when 
-std=c99 was explicitly 
specified.[6] With 
version 
5[5], 
gcc switched from gnu89 to the gnu11 dialect, effectively enabling C99 inline 
semantics by default. To use gnu89 semantics instead, they have to be enabled 
explicitly, either with -std=gnu89 or, to only affect inlining, -fgnu89-inline, 
or by adding the gnu_inline attribute to all inline declarations. To ensure C99 
semantics, either -std=c99, -std=c11, -std=gnu99 or -std=gnu11 (without 
-fgnu89-inline) can be 
used.[3]"

And the above makes you look at the C99 definition "In C99, a function defined 
inline will never, and a function defined extern inline will always, emit an 
externally visible function. ". So this make me wonder if clang is getting more 
pedantic about the C99 definition of inline (__inline__). So I wonder if we 
could use an` if ( __STDC_VERSION__ < 199901L)` to turn off the __inline__ to 
fix the clang issue?

It also seems strange to me the __inline__ only exists next to the library 
function. Given it is not in the header (and the code is not in the header) I'm 
not really sure what the compiler can do? When the BaseIoLibIntrinsic library 
gets compiled it is going to create the intrinsic functions. It seems like code 
only comes together a link time? So unless the GCC linker was doing inline code 
generation at link time I'm not sure  how the __inline__ helps. Does the 
compiler tag the object with some kind of hint? If you are doing Link Time 
Optimization (LTO) the __inline__ is kind of a moot point as the code gen will 
always inline simple stuff like this.

I'd point out when we ported to GCC we came from VC++ and always had LTO, so it 
is likely we did not have a good grasp of GCC inlining. Thus there is a 
non-zero chance this code is a no-op even on old GCC versions. But it is worth 
checking out.

[Liming] This seems the remaining clean up task. So, I prefer to remove 
__inline__ if no impact on GCC 

Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/BdsDxe: Also call PlatformBootManagerWaitCallback on 0

2019-10-08 Thread Liming Gao
Push @2de1f611be06ded3a59726a4052a9039be7d459b

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Laszlo Ersek
> Sent: Tuesday, October 1, 2019 7:12 AM
> To: devel@edk2.groups.io; Ni, Ray ; p...@akeo.ie
> Cc: Gao, Zhichao 
> Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/BdsDxe: Also call 
> PlatformBootManagerWaitCallback on 0
> 
> On 09/30/19 03:24, Ni, Ray wrote:
> > Existing close source platform BDS only updates UI in this function.
> > Reviewed-by: Ray Ni 
> 
> Thanks, Ray! Can you please push this patch for Pete?
> 
> Thanks
> Laszlo
> 
> >
> >> -Original Message-
> >> From: devel@edk2.groups.io  On Behalf Of Pete Batard
> >> Sent: Wednesday, September 25, 2019 11:50 PM
> >> To: devel@edk2.groups.io
> >> Cc: Gao, Zhichao ; Ni, Ray 
> >> Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg/BdsDxe: Also call 
> >> PlatformBootManagerWaitCallback on 0
> >>
> >> The existing loop is set to call PlatformBootManagerWaitCallback every
> >> second except the last one. We believe this is a mistake as it prevents
> >> the called code from performing timeout expiration tasks such as, for
> >> instance, ensuring that the last segment of a progress bar is displayed
> >> before continuing (which is a current issue for the RPi3 platform).
> >>
> >> Signed-off-by: Pete Batard 
> >> ---
> >>  MdeModulePkg/Universal/BdsDxe/BdsEntry.c | 1 +
> >>  1 file changed, 1 insertion(+)
> >>
> >> diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c 
> >> b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> >> index f3d5e5ac0615..7968a58f3454 100644
> >> --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> >> +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c
> >> @@ -341,6 +341,7 @@ BdsWait (
> >>TimeoutRemain--;
> >>  }
> >>}
> >> +  PlatformBootManagerWaitCallback (0);
> >>DEBUG ((EFI_D_INFO, "[Bds]Exit the waiting!\n"));
> >>  }
> >>
> >> --
> >> 2.21.0.windows.1
> >>
> >>
> >>
> >
> >
> >
> >
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48578): https://edk2.groups.io/g/devel/message/48578
Mute This Topic: https://groups.io/mt/34288971/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] Problem with decompression on EDK2

2019-10-08 Thread Liming Gao
BaseTools VolInfo tool. Its input is the binary FvImage file. In the same 
directory, GuidedSectionTools.txt (built in the FV directory) should be here. 

Thanks
Liming
> -Original Message-
> From: Loh, Tien Hock 
> Sent: Tuesday, October 1, 2019 10:34 AM
> To: Gao, Liming ; devel@edk2.groups.io; 
> ler...@redhat.com
> Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> Subject: RE: [edk2-devel] Problem with decompression on EDK2
> 
> Hi Liming,
> 
> Thanks for the quick response.
> Can you help show me where I can find more information on the decompression 
> (ie. how to test the image, etc.)?
> 
> Thanks
> Tien Hock
> 
> > -Original Message-
> > From: Gao, Liming 
> > Sent: Sunday, September 29, 2019 3:06 PM
> > To: Loh, Tien Hock ; devel@edk2.groups.io;
> > ler...@redhat.com
> > Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > Subject: RE: [edk2-devel] Problem with decompression on EDK2
> >
> > Tien Hock:
> >   The image is correct. It can be decompressed by lzma.
> >   When FD is loaded into 0x5, I suspect that the image data can't fully
> > read. Then, the decompress will failure.
> >
> >   FD image last valid byte offset is 0xC1B8F. Its value is 0x83. When FD 
> > base
> > address is 0x5, this position is 0x111B8F.
> >   You can read this place and check its value.
> >
> > Thanks
> > Liming
> > >-Original Message-
> > >From: Loh, Tien Hock
> > >Sent: Friday, September 27, 2019 3:05 PM
> > >To: Gao, Liming ; devel@edk2.groups.io;
> > >ler...@redhat.com
> > >Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > >Subject: RE: [edk2-devel] Problem with decompression on EDK2
> > >
> > >Hi Liming,
> > >
> > >I've tested another workaround - Move the FD file to a higher RAM
> > >location (originally, it is loaded into 0x5, now it is at
> > >0x1000) With the FD file moved to 0x1000, the decompression
> > >works every time, even with bigger FD. I've attached the my FD file in the
> > mail.
> > >
> > >Thanks
> > >Tien Hock
> > >
> > >> -Original Message-
> > >> From: Gao, Liming 
> > >> Sent: Friday, September 27, 2019 8:13 AM
> > >> To: devel@edk2.groups.io; ler...@redhat.com; Loh, Tien Hock
> > >> 
> > >> Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > >> Subject: RE: [edk2-devel] Problem with decompression on EDK2
> > >>
> > >> Can you share the generated FD image? I can help check whether it is
> > >> generated correctly with compression.
> > >>
> > >> Thanks
> > >> Liming
> > >>
> > >> >-Original Message-
> > >> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf
> > >> >Of Laszlo Ersek
> > >> >Sent: Friday, September 27, 2019 3:22 AM
> > >> >To: devel@edk2.groups.io; Loh, Tien Hock 
> > >> >Cc: leif.lindh...@linaro.org; ard.biesheu...@linaro.org
> > >> >Subject: Re: [edk2-devel] Problem with decompression on EDK2
> > >> >
> > >> >On 09/26/19 11:27, Loh, Tien Hock wrote:
> > >> >> Hi
> > >> >>
> > >> >> I have an issue while porting a new platform to EDK2. After
> > >> >> porting the
> > >> >Stratix 10 platform (ARM) to EDK2 it works correctly. However, when
> > >> >I tried to add more INF to the FDF file, it failed to decompress the
> > >> >image during boot time, log as below
> > >> >> INFO:DDR: DRAM calibration success.
> > >> >> INFO:Scrubbing ECC
> > >> >> INFO:Init HPS NOC's DDR Scheduler.
> > >> >> NOTICE:  BL2: v2.1(debug):v2.1-15-g5880144-dirty
> > >> >> NOTICE:  BL2: Built : 14:02:01, Aug 22 2019
> > >> >> INFO:BL2: Doing platform setup
> > >> >> INFO:BL2: Loading image id 3
> > >> >> INFO:Loading image id=3 at address 0xffe1c000
> > >> >> INFO:Image id=3 loaded: 0xffe1c000 - 0xffe22019
> > >> >> INFO:BL2: Loading image id 5
> > >> >> INFO:Loading image id=5 at address 0x5
> > >> >> INFO:Image id=5 loaded: 0x5 - 0x15
> > >> >> NOTICE:  BL2: Booting BL31
> > >> >> INFO:Entry point address = 0xffe1c000
> > >> >> INFO:SPSR = 0x3cd
> > >> >> NOTICE:  BL31: v2.1(release):v2.1-604-g3441952
> > >> >> NOTICE:  BL31: Built : 15:32:55, Sep 25 2019 UEFI firmware
> > >> >> (version
> > >> >> 1.0 built at 15:15:26 on Sep 26 2019) Decompress Failed - Invalid
> > >> >> Parameter
> > >> >>
> > >> >> ASSERT_EFI_ERROR (Status = Not Found) ASSERT
> > >> >> [ArmPlatformPrePiUniCore]
> > >>
> > >/nfs/png/disks/swuser_work_thloh/push/build/edk2/ArmPlatformPkg/Pr
> > >eP
> > >> i
> > >> >/PrePi.c(151): !EFI_ERROR (Status)
> > >> >>
> > >> >> This happens if I add more items to the image, and if I reduce the
> > >> >> size of the
> > >> >image, it works correctly again. This could be a clue to what
> > >> >could've gone wrong. Does anyone have any ideas what might've gone
> > wrong?
> > >> >> I traced the decompression to LzmaDecode, and got lost in the code
> > >there.
> > >> >
> > >> >The compressed section in a firmware volume is likely truncated at
> > >> >build time, and does not decompress at boot time. I would expect the
> > >> "build"
> > >> 

Re: [edk2-devel] [PATCH v2] MdePkg:Include: Update SmBios header file

2019-10-08 Thread Liming Gao
OK. I will push them to edk2-staging/tree/RISC-V-V2.

Thanks
Liming
> -Original Message-
> From: Leif Lindholm 
> Sent: Tuesday, October 8, 2019 6:11 PM
> To: Gao, Liming 
> Cc: devel@edk2.groups.io; abner.ch...@hpe.com; Kinney, Michael D 
> ; Chen, Gilbert
> 
> Subject: Re: [edk2-devel] [PATCH v2] MdePkg:Include: Update SmBios header file
> 
> Hi Liming,
> 
> If you push this set (v5), could you possibly also push it to
> https://github.com/tianocore/edk2-staging/tree/RISC-V-V2 ?
> 
> The three patches apply cleanly on this revision, and are a
> prerequisite for the code destined to go in there.
> 
> Best Regards,
> 
> Leif
> 
> On Tue, Oct 08, 2019 at 01:14:35AM +, Gao, Liming wrote:
> > Abner:
> >   Thanks for your notice. I see the public SMBIOS 3.3.0.
> >
> >   For this patch set, I have two minor comments. For other part, 
> > Reviewed-by: Liming Gao 
> > 1) Please add BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2202 in 
> > the commit message.
> > 2) The comment for gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev is not 
> > required to be changed.
> > This field is in SMBIOS 3.0 spec. It is not new added one in SMBIOS 3.3.
> >
> > Thanks
> > Liming
> > >-Original Message-
> > >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > >Abner Chang
> > >Sent: Friday, October 04, 2019 11:06 PM
> > >To: Gao, Liming ; devel@edk2.groups.io
> > >Cc: Kinney, Michael D ; Leif Lindholm
> > >; Chen, Gilbert 
> > >Subject: Re: [edk2-devel] [PATCH v2] MdePkg:Include: Update SmBios header
> > >file
> > >
> > >Just aware that SMBIOS 3.3.0 is published on DMTF,
> > >https://www.dmtf.org/standards/smbios
> > >
> > >The latest version of patch set is PATCH v4, please review it and help to 
> > >push
> > >to mainstream if no further comments. Thanks
> > >Abner
> > >
> > >> -Original Message-
> > >> From: Gao, Liming [mailto:liming@intel.com]
> > >> Sent: Thursday, September 19, 2019 1:23 PM
> > >> To: Chang, Abner (HPS SW/FW Technologist) ;
> > >> devel@edk2.groups.io
> > >> Cc: Kinney, Michael D ; Leif Lindholm
> > >> ; Chen, Gilbert 
> > >> Subject: RE: [PATCH v2] MdePkg:Include: Update SmBios header file
> > >>
> > >> Abner:
> > >>   Please add BZ URL in the commit message, and separate this patch to 
> > >> three
> > >> changes. Each one is for each package of MdePkg, MdeModulePkg and
> > >> ShellPkg.
> > >>
> > >>   As Leif say, SmBios 3.3 spec is not published. This patch will not be 
> > >> pushed
> > >> until SmBios 3.3 is published.
> > >>
> > >> >-Original Message-
> > >> >From: Abner Chang [mailto:abner.ch...@hpe.com]
> > >> >Sent: Thursday, September 19, 2019 11:05 AM
> > >> >To: devel@edk2.groups.io
> > >> >Cc: abner.ch...@hpe.com; Kinney, Michael D
> > >> >; Gao, Liming ; Leif
> > >> >Lindholm ; Gilbert Chen
> > >> >
> > >> >Subject: [PATCH v2] MdePkg:Include: Update SmBios header file
> > >> >
> > >> >Update SmBios header file to conform with SMBIOS v3.3.0.
> > >> >The major update is to add definitions of SMBIOS Type 44h record.
> > >> >
> > >> >Signed-off-by: Abner Chang 
> > >> >
> > >> >Cc: Michael D Kinney 
> > >> >Cc: Liming Gao 
> > >> >Cc: Leif Lindholm 
> > >> >Cc: Gilbert Chen 
> > >> >---
> > >> > MdeModulePkg/MdeModulePkg.dec  |  6 +-
> > >> > MdePkg/Include/IndustryStandard/SmBios.h   | 76
> > >> >+-
> > >> > .../SmbiosView/PrintInfo.c | 23 ++-
> > >> > .../SmbiosView/PrintInfo.h | 13 +++-
> > >> > .../SmbiosView/QueryTable.c| 63 
> > >> > +-
> > >> > .../UefiShellDebug1CommandsLib.uni |  3 +-
> > >> > 6 files changed, 174 insertions(+), 10 deletions(-)
> > >> >
> > >> >diff --git a/MdeModulePkg/MdeModulePkg.dec
> > >> >b/MdeModulePkg/MdeModulePkg.dec index 19935c8..e3a65ab 100644
> > >> >--- a/MdeModulePkg/MdeModulePkg.dec
> > >> >+++ b/MdeModulePkg/MdeModulePkg.dec
> > >> >@@ -1792,10 +1792,10 @@
> > >> >
> > >> >   ## SMBIOS version.
> > >> >   # @Prompt SMBIOS version.
> > >> >-
> > >> >gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0302|UINT16|0
> > >> x0
> > >> >0010055
> > >> >+
> > >> >gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0303|UINT16|0
> > >> x0
> > >> >0010055
> > >> >
> > >> >-  ## SMBIOS Docrev field in SMBIOS 3.0 (64-bit) Entry Point Structure.
> > >> >-  # @Prompt SMBIOS Docrev field in SMBIOS 3.0 (64-bit) Entry Point
> > >> Structure.
> > >> >+  ## SMBIOS Docrev field in SMBIOS 3.3 (64-bit) Entry Point Structure.
> > >> >+  # @Prompt SMBIOS Docrev field in SMBIOS 3.3 (64-bit) Entry Point
> > >> >Structure.
> > >> >
> > >> >gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0|UINT8|0x000
> > >1
> > >> 00
> > >> >6A
> > >> >
> > >> >   ## SMBIOS produce method.
> > >> >diff --git a/MdePkg/Include/IndustryStandard/SmBios.h
> > >> >b/MdePkg/Include/IndustryStandard/SmBios.h
> > >> >index f3b6f18..f504cc8 100644
> > >> >--- 

Re: [edk2-devel] [PATCH v5 0/3] Update to support SmBios 3.3.0

2019-10-08 Thread Liming Gao
Reviewed-by: Liming Gao 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Abner Chang
> Sent: Tuesday, October 8, 2019 4:04 PM
> To: devel@edk2.groups.io
> Cc: abner.ch...@hpe.com
> Subject: [edk2-devel] [PATCH v5 0/3] Update to support SmBios 3.3.0
> 
> Codes changes for SMBIOS spec 3.3.0 (Already public on DMTF).
> 
> Bugzilla link,
> https://bugzilla.tianocore.org/show_bug.cgi?id=2202
> 
> Abner Chang (3):
>   MdeModulePkg: Update to support SmBios 3.3.0
>   MdePkg/Include: Update to support SmBios 3.3.0
>   ShellPkg/UefiShellDebug1CommandsLib: Update to support SmBios 3.3.0
> 
>  MdeModulePkg/MdeModulePkg.dec  |  4 +-
>  MdePkg/Include/IndustryStandard/SmBios.h   | 76 
> +-
>  .../SmbiosView/PrintInfo.c | 23 ++-
>  .../SmbiosView/PrintInfo.h | 13 +++-
>  .../SmbiosView/QueryTable.c| 63 +-
>  .../UefiShellDebug1CommandsLib.uni |  3 +-
>  6 files changed, 173 insertions(+), 9 deletions(-)
> 
> --
> 2.7.4
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48575): https://edk2.groups.io/g/devel/message/48575
Mute This Topic: https://groups.io/mt/34440299/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 2/4] OvmfPkg/OvmfXen.dsc: remove PcdCpu* dynamic defaults

2019-10-08 Thread Philippe Mathieu-Daudé

On 10/8/19 1:27 PM, Laszlo Ersek wrote:

PcdCpuMaxLogicalProcessorNumber and PcdCpuApInitTimeOutInMicroSeconds are
only referenced in "OvmfPkg/PlatformPei/PlatformPei.inf", and OvmfXen does
not include that module. Remove the unnecessary dynamic PCD defaults from
"OvmfXen.dsc".

Cc: Anthony Perard 
Cc: Ard Biesheuvel 
Cc: Igor Mammedov 
Cc: Jordan Justen 
Cc: Julien Grall 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1515
Signed-off-by: Laszlo Ersek 
---
  OvmfPkg/OvmfXen.dsc | 4 
  1 file changed, 4 deletions(-)

diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 5a31f75f05d0..6deafea034c0 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -481,10 +481,6 @@ [PcdsDynamicDefault]
gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack|FALSE
gEfiMdeModulePkgTokenSpaceGuid.PcdPropertiesTableEnable|FALSE
  
-  # UefiCpuPkg PCDs related to initial AP bringup and general AP management.

-  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|64
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5
-
# Set memory encryption mask
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
  



Reviewed-by: Philippe Mathieu-Daude 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48574): https://edk2.groups.io/g/devel/message/48574
Mute This Topic: https://groups.io/mt/34441229/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms][PATCH v2 3/5] Platform/RPi3/PlatformSmbiosDxe: Improve population of SMBIOS entries

2019-10-08 Thread Pete Batard
This patch cleans up the population SMBIOS entries by removing elements
that we don't have data for, as well as properly filling the ones for
which we do, through the newly added queries from RpiFirmwareDxe.

Additional minor improvements are also applied, such as consistent use
of uppercase values.

Signed-off-by: Pete Batard 
---
 Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c   | 
153 ++--
 Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf |   
1 +
 Platform/RaspberryPi/RPi3/RPi3.dsc|   
2 +-
 3 files changed, 76 insertions(+), 80 deletions(-)

diff --git 
a/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c 
b/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
index bc35175279f2..8a4840267780 100644
--- a/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
+++ b/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
@@ -35,12 +35,13 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 
-STATIC RASPBERRY_PI_FIRMWARE_PROTOCOL *mFwProtocol;
+static RASPBERRY_PI_FIRMWARE_PROTOCOL *mFwProtocol;
 
 /***
 SMBIOS data definition  TYPE0  BIOS Information
@@ -49,7 +50,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = {
   { EFI_SMBIOS_TYPE_BIOS_INFORMATION, sizeof (SMBIOS_TABLE_TYPE0), 0 },
   1,// Vendor String
   2,// BiosVersion String
-  0x0,  // BiosSegment
+  0,// BiosSegment
   3,// BiosReleaseDate String
   0x1F, // BiosSize
   { // BiosCharacteristics
@@ -97,23 +98,25 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = {
   //  Boot1394IsSupported   :1;
   //  SmartBatteryIsSupported   :1;
   //  BIOSCharacteristicsExtensionBytes[1]
-0x0e, //  BiosBootSpecIsSupported  :1;
+0x0E, //  BiosBootSpecIsSupported  :1;
   //  FunctionKeyNetworkBootIsSupported:1;
   //  TargetContentDistributionEnabled :1;
   //  UefiSpecificationSupported   :1;
   //  VirtualMachineSupported  :1;
   //  ExtensionByte2Reserved   :3;
   },
-  0xFF,// SystemBiosMajorRelease
-  0xFF,// SystemBiosMinorRelease
-  0xFF,// EmbeddedControllerFirmwareMajorRelease
-  0xFF,// EmbeddedControllerFirmwareMinorRelease
+  0,   // SystemBiosMajorRelease
+  0,   // SystemBiosMinorRelease
+  0,   // EmbeddedControllerFirmwareMajorRelease
+  0,   // EmbeddedControllerFirmwareMinorRelease
 };
 
+CHAR8 mBiosVersion[128] = "EDK2-DEV";
+
 CHAR8 *mBIOSInfoType0Strings[] = {
-  "https://github.com/andreiw/RaspberryPiPkg;, // Vendor String
-  "Raspberry Pi 64-bit UEFI (" __DATE__ " " __TIME__ ")",  // BiosVersion 
String
-  __DATE__,
+  "TianoCore",// Vendor
+  mBiosVersion,   // Version
+  __DATE__ " " __TIME__,  // Release Date
   NULL
 };
 
@@ -132,42 +135,19 @@ SMBIOS_TABLE_TYPE1 mSysInfoType1 = {
   6,// Family String
 };
 
-#define PROD_BASE 8
-#define PROD_KNOWN   13
-#define PROD_UNKNOWN 11
-CHAR8 *ProductNames[] = {
-  /* 8 */ "3",
-  /* 9 */ "Zero",
-  /* 10 */ "CM3",
-  /* 11 */ "???",
-  /* 12 */ "Zero W",
-  /* 13 */ "3B+"
-};
-
-#define MANU_UNKNOWN 0
-#define MANU_KNOWN   4
-#define MANU_BASE1
-CHAR8 *ManufNames[] = {
-  "???",
-  /* 0 */ "Sony",
-  /* 1 */ "Egoman",
-  /* 2 */ "Embest",
-  /* 3 */ "Sony Japan",
-  /* 4 */ "Embest"
-};
-
-CHAR8 mSysInfoManufName[sizeof ("Sony Japan")];
-CHAR8 mSysInfoProductName[sizeof ("64-bit Raspberry Pi XX (rev. 
)")];
+CHAR8 mSysInfoManufName[128];
+CHAR8 mSysInfoProductName[128];
+CHAR8 mSysInfoVersionName[128];
 CHAR8 mSysInfoSerial[sizeof (UINT64) * 2 + 1];
 CHAR8 mSysInfoSKU[sizeof (UINT64) * 2 + 1];
 
 CHAR8 *mSysInfoType1Strings[] = {
   mSysInfoManufName,
   mSysInfoProductName,
-  mSysInfoProductName,
+  mSysInfoVersionName,
   mSysInfoSerial,
   mSysInfoSKU,
-  "edk2",
+  "Raspberry Pi",
   NULL
 };
 
@@ -180,7 +160,7 @@ SMBIOS_TABLE_TYPE2 mBoardInfoType2 = {
   2,// ProductName String
   3,// Version String
   4,// SerialNumber String
-  5,// AssetTag String
+  0,// AssetTag String
   { // FeatureFlag
 1,//  Motherboard   :1;
 0,//  RequiresDaughterCard  :1;
@@ -189,7 +169,7 @@ SMBIOS_TABLE_TYPE2 mBoardInfoType2 = {
 0,//  HotSwappable  :1;
 0,//  Reserved  :3;
   },
-  6,// LocationInChassis String
+  0,// LocationInChassis String
   0,// ChassisHandle;
   

[edk2-devel] [edk2-platforms][PATCH v2 1/5] Platform/RPi3/RpiFirmwareDxe: Add more query functions

2019-10-08 Thread Pete Batard
This patch introduces the capability to also query the Model Name/
Manufacturer Name/CPU Name/Firmware Revision using the RpiFirmware
protocol. This is aims at making the driver more suitable to cater
for platforms other than the Raspberry Pi 3 as well as simplifying
the population of entries in PlatformSmbiosDxe.

Signed-off-by: Pete Batard 
---
 Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c | 155 
+++-
 Platform/RaspberryPi/RPi3/Include/Protocol/RpiFirmware.h  |  58 
++--
 2 files changed, 196 insertions(+), 17 deletions(-)

diff --git a/Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c 
b/Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c
index 9b5ee1946279..378c99bcba05 100644
--- a/Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c
+++ b/Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c
@@ -461,7 +461,7 @@ typedef struct {
   RPI_FW_TAG_HEAD   TagHead;
   RPI_FW_MODEL_REVISION_TAG TagBody;
   UINT32EndTag;
-} RPI_FW_GET_MODEL_REVISION_CMD;
+} RPI_FW_GET_REVISION_CMD;
 #pragma pack()
 
 STATIC
@@ -471,7 +471,7 @@ RpiFirmwareGetModelRevision (
   OUT   UINT32 *Revision
   )
 {
-  RPI_FW_GET_MODEL_REVISION_CMD *Cmd;
+  RPI_FW_GET_REVISION_CMD   *Cmd;
   EFI_STATUSStatus;
   UINT32Result;
 
@@ -506,6 +506,153 @@ RpiFirmwareGetModelRevision (
   return EFI_SUCCESS;
 }
 
+STATIC
+EFI_STATUS
+EFIAPI
+RpiFirmwareGetFirmwareRevision (
+  OUT   UINT32 *Revision
+  )
+{
+  RPI_FW_GET_REVISION_CMD   *Cmd;
+  EFI_STATUSStatus;
+  UINT32Result;
+
+  if (!AcquireSpinLockOrFail ()) {
+DEBUG ((DEBUG_ERROR, "%a: failed to acquire spinlock\n", __FUNCTION__));
+return EFI_DEVICE_ERROR;
+  }
+
+  Cmd = mDmaBuffer;
+  ZeroMem (Cmd, sizeof (*Cmd));
+
+  Cmd->BufferHead.BufferSize  = sizeof (*Cmd);
+  Cmd->BufferHead.Response= 0;
+  Cmd->TagHead.TagId  = RPI_MBOX_GET_REVISION;
+  Cmd->TagHead.TagSize= sizeof (Cmd->TagBody);
+  Cmd->TagHead.TagValueSize   = 0;
+  Cmd->EndTag = 0;
+
+  Status = MailboxTransaction (Cmd->BufferHead.BufferSize, 
RPI_MBOX_VC_CHANNEL, );
+
+  ReleaseSpinLock ();
+
+  if (EFI_ERROR (Status) ||
+  Cmd->BufferHead.Response != RPI_MBOX_RESP_SUCCESS) {
+DEBUG ((DEBUG_ERROR,
+  "%a: mailbox transaction error: Status == %r, Response == 0x%x\n",
+  __FUNCTION__, Status, Cmd->BufferHead.Response));
+return EFI_DEVICE_ERROR;
+  }
+
+  *Revision = Cmd->TagBody.Revision;
+  return EFI_SUCCESS;
+}
+
+STATIC
+CHAR8*
+EFIAPI
+RpiFirmwareGetModelName (
+  IN INTN ModelId
+  )
+{
+  UINT32  Revision;
+
+  // If a negative ModelId is passed, detect it.
+  if ((ModelId < 0) && (RpiFirmwareGetModelRevision () == 
EFI_SUCCESS))
+ModelId = (Revision >> 4) & 0xFF;
+
+  switch (ModelId) {
+  // 
www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
+  case 0x00:
+return "Raspberry Pi Model A";
+  case 0x01:
+return "Raspberry Pi Model B";
+  case 0x02:
+return "Raspberry Pi Model A+";
+  case 0x03:
+return "Raspberry Pi Model B+";
+  case 0x04:
+return "Raspberry Pi 2 Model B";
+  case 0x06:
+return "Raspberry Pi Compute Module 1";
+  case 0x08:
+return "Raspberry Pi 3 Model B";
+  case 0x09:
+return "Raspberry Pi Zero";
+  case 0x0A:
+return "Raspberry Pi Compute Module 3";
+  case 0x0C:
+return "Raspberry Pi Zero W";
+  case 0x0D:
+return "Raspberry Pi 3 Model B+";
+  case 0x0E:
+return "Raspberry Pi 3 Model A+";
+  case 0x11:
+return "Raspberry Pi 4 Model B";
+  default:
+return "Unknown Raspberry Pi Model";
+  }
+}
+
+STATIC
+CHAR8*
+EFIAPI
+RpiFirmwareGetManufacturerName (
+  IN INTN ManufacturerId
+  )
+{
+  UINT32  Revision;
+
+  // If a negative ModelId is passed, detect it.
+  if ((ManufacturerId < 0) && (RpiFirmwareGetModelRevision () == 
EFI_SUCCESS))
+ManufacturerId = (Revision >> 16) & 0x0F;
+
+  switch (ManufacturerId) {
+  // 
www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
+  case 0x00:
+return "Sony UK";
+  case 0x01:
+return "Egoman";
+  case 0x02:
+  case 0x04:
+return "Embest";
+  case 0x03:
+return "Sony Japan";
+  case 0x05:
+return "Stadium";
+  default:
+return "Unknown Manufacturer";
+  }
+}
+
+STATIC
+CHAR8*
+EFIAPI
+RpiFirmwareGetCpuName (
+  IN INTN CpuId
+  )
+{
+  UINT32  Revision;
+
+  // If a negative CpuId is passed, detect it.
+  if ((CpuId < 0) && (RpiFirmwareGetModelRevision () == EFI_SUCCESS))
+CpuId = (Revision >> 12) & 0x0F;
+
+  switch (CpuId) {
+  // 
www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
+  case 0x00:
+return "BCM2835 (ARM11)";
+  case 0x01:
+return "BCM2836 (ARM Cortex-A7)";
+  case 0x02:
+return "BCM2837 (ARM Cortex-A53)";
+  case 0x03:
+return "BCM2711 (ARM Cortex-A72)";
+  

[edk2-devel] [edk2-platforms][PATCH v2 5/5] Platform/RPi3/PlatformSmbiosDxe: Derive RAM size from board revision

2019-10-08 Thread Pete Batard
The board revision is the proper channel to use to detect the amount of
RAM available as bits [20-22] report the effective RAM size for the board
starting with 256 MB (000b) and doubling in size for each value.

Signed-off-by: Pete Batard 
---
 Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 18 
--
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git 
a/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c 
b/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
index 66ffadd0cade..540e3fd61f25 100644
--- a/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
+++ b/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
@@ -863,16 +863,22 @@ MemArrMapInfoUpdateSmbiosType19 (
   )
 {
   EFI_STATUS Status;
-  UINT32 Base;
-  UINT32 Size;
+  UINT32 BoardRevision = 0;
 
-  Status = mFwProtocol->GetArmMem (, );
+  // Note: Type 19 addresses are expressed in KB, not bytes
+  mMemArrMapInfoType19.StartingAddress = 0;
+  // The minimum RAM size used on any Raspberry Pi model is 256 MB
+  mMemArrMapInfoType19.EndingAddress = 256 * 1024;
+  Status = mFwProtocol->GetModelRevision ();
   if (Status != EFI_SUCCESS) {
-DEBUG ((DEBUG_ERROR, "Couldn't get the ARM memory size: %r\n", Status));
+DEBUG ((DEBUG_WARNING, "Couldn't get the board memory size - defaulting to 
256 MB: %r\n", Status));
   } else {
-mMemArrMapInfoType19.StartingAddress = Base / 1024;
-mMemArrMapInfoType19.EndingAddress = (Base + Size - 1) / 1024;
+// 
www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
+// Bits [20-22] indicate the amount of memory starting with 256MB (000b)
+// and doubling in size for each value (001b = 512 MB, 010b = 1GB, etc.)
+mMemArrMapInfoType19.EndingAddress <<= (BoardRevision >> 20) & 0x07;
   }
+  mMemArrMapInfoType19.EndingAddress -= 1;
 
   LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*), 
mMemArrMapInfoType19Strings, NULL);
 }
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48573): https://edk2.groups.io/g/devel/message/48573
Mute This Topic: https://groups.io/mt/34441820/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms][PATCH v2 2/5] Platform/RPi3/RpiFirmwareDxe: Improve serial number population

2019-10-08 Thread Pete Batard
Improve RpiFirmwareGetSerial() to derive a serial number from the
MAC address, in case the platform returns 0 for the serial number.

Also fix a typo where "%s" was used instead of "%a".

Signed-off-by: Pete Batard 
---
 Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c | 11 
+--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c 
b/Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c
index 378c99bcba05..c2344252d2c0 100644
--- a/Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c
+++ b/Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c
@@ -219,7 +219,7 @@ RpiFirmwareSetPowerState (
 
   if (!EFI_ERROR (Status) &&
   PowerState ^ (Cmd->TagBody.PowerState & RPI_MBOX_POWER_STATE_ENABLE)) {
-DEBUG ((DEBUG_ERROR, "%a: failed to %sable power for device %d\n",
+DEBUG ((DEBUG_ERROR, "%a: failed to %aable power for device %d\n",
   __FUNCTION__, PowerState ? "en" : "dis", DeviceId));
 Status = EFI_DEVICE_ERROR;
   }
@@ -393,7 +393,14 @@ RpiFirmwareGetSerial (
   }
 
   *Serial = Cmd->TagBody.Serial;
-  return EFI_SUCCESS;
+  // Some platforms return 0 for serial. For those, try to use the MAC address.
+  if (*Serial == 0) {
+Status = RpiFirmwareGetMacAddress ((UINT8*) Serial);
+// Convert to a more user-friendly value
+*Serial = SwapBytes64 (*Serial << 16);
+  }
+
+  return Status;
 }
 
 #pragma pack()
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48570): https://edk2.groups.io/g/devel/message/48570
Mute This Topic: https://groups.io/mt/34441817/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms][PATCH v2 0/5] Platform/RPi3: Various SMBIOS improvements

2019-10-08 Thread Pete Batard
v1 can be found at https://edk2.groups.io/g/devel/message/46806 - 46808

Changes for v2:
- Split *functional* changes into multipe commits
- Spell out serial number
- *NEW* Derive Type 19 addresses from board revision (RPi4 improvement)

Also, with regards to further splitting that was requested and while I
appreciate that I already got some leniency in that respect, I must state
that my time is limited, therefore, unless I suspect a typo or style fix,
that got corrected in a "while I'm here" fashion, to result in a potential
CVE or make people browsing the codebase genuinely puzzled, I'm afraid that
I will continue to shove those as Also's into the commits I submit, so that
I can at least try to reclaim some valuable time...

Pete Batard (5):
  Platform/RPi3/RpiFirmwareDxe: Add more query functions
  Platform/RPi3/RpiFirmwareDxe: Improve serial number population
  Platform/RPi3/PlatformSmbiosDxe: Improve population of SMBIOS entries
  Platform/RPi3/PlatformSmbiosDxe: Populate BIOS major/minor from PCD
  Platform/RPi3/PlatformSmbiosDxe: Derive RAM size from board revision

 Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c   | 
211 
 Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.inf |   
1 +
 Platform/RaspberryPi/RPi3/Drivers/RpiFirmwareDxe/RpiFirmwareDxe.c | 
166 ++-
 Platform/RaspberryPi/RPi3/Include/Protocol/RpiFirmware.h  |  
58 --
 Platform/RaspberryPi/RPi3/RPi3.dsc|   
2 +-
 5 files changed, 334 insertions(+), 104 deletions(-)

-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48568): https://edk2.groups.io/g/devel/message/48568
Mute This Topic: https://groups.io/mt/34441815/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [edk2-platforms][PATCH v2 4/5] Platform/RPi3/PlatformSmbiosDxe: Populate BIOS major/minor from PCD

2019-10-08 Thread Pete Batard
String parsing code is added to BIOSInfoUpdateSmbiosType0() so that
any numeric "x.y" value being passed in PcdFirmwareVersionString is
now used to populate the BIOS major and minor.

Signed-off-by: Pete Batard 
---
 Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c | 44 
+++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git 
a/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c 
b/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
index 8a4840267780..66ffadd0cade 100644
--- a/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
+++ b/Platform/RaspberryPi/RPi3/Drivers/PlatformSmbiosDxe/PlatformSmbiosDxe.c
@@ -41,7 +41,9 @@
 #include 
 #include 
 
-static RASPBERRY_PI_FIRMWARE_PROTOCOL *mFwProtocol;
+#define SMB_IS_DIGIT(c)  (((c) >= '0') && ((c) <= '9'))
+
+STATIC RASPBERRY_PI_FIRMWARE_PROTOCOL *mFwProtocol;
 
 /***
 SMBIOS data definition  TYPE0  BIOS Information
@@ -618,6 +620,46 @@ BIOSInfoUpdateSmbiosType0 (
   UnicodeStrToAsciiStrS ((CHAR16*)PcdGetPtr (PcdFirmwareVersionString),
 mBiosVersion, sizeof (mBiosVersion));
 
+  // Look for a "x.y" numeric string anywhere in mBiosVersion and
+  // try to parse it to populate the BIOS major and minor.
+  for (i = 0; (i < AsciiStrLen (mBiosVersion)) && (State < 4); i++) {
+switch (State) {
+case 0:
+  if (!SMB_IS_DIGIT (mBiosVersion[i]))
+break;
+  Value[0] = Value[1] = 0;
+  State++;
+  // Fall through
+case 1:
+case 3:
+  if (SMB_IS_DIGIT (mBiosVersion[i])) {
+Value[State / 2] = (Value[State / 2] * 10) + (mBiosVersion[i] - '0');
+if (Value[State / 2] > 255) {
+  while (SMB_IS_DIGIT (mBiosVersion[i + 1]))
+i++;
+  // Reset our state (we may have something like "Firmware X83737.1 
v1.23")
+  State = 0;
+}
+  } else {
+State++;
+  }
+  if (State != 2)
+break;
+  // Fall through
+case 2:
+  if ((mBiosVersion[i] == '.') && (SMB_IS_DIGIT (mBiosVersion[i + 1]))) {
+State++;
+  } else {
+State = 0;
+  }
+  break;
+}
+  }
+  if ((State == 3) || (State == 4)) {
+mBIOSInfoType0.SystemBiosMajorRelease = (UINT8)Value[0];
+mBIOSInfoType0.SystemBiosMinorRelease = (UINT8)Value[1];
+  }
+
   LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER*), 
mBIOSInfoType0Strings, NULL);
 }
 
-- 
2.21.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48572): https://edk2.groups.io/g/devel/message/48572
Mute This Topic: https://groups.io/mt/34441819/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH 0/4] UefiCpuPkg, OvmfPkg: separate PCDs for boot CPU count vs. max CPU count

2019-10-08 Thread Ard Biesheuvel
On Tue, 8 Oct 2019 at 13:27, Laszlo Ersek  wrote:
>
> Repo:   https://github.com/lersek/edk2.git
> Branch: max_cpus_bz_1515
> Ref:https://bugzilla.tianocore.org/show_bug.cgi?id=1515
>
> UefiCpuPkg/MpInitLib currently lacks support for the following use case:
>
> - time-limited AP enumeration is not reliable on the platform
>   (individual AP check-in may take arbitrarily long), and
>
> - APs may finish the wakeup routine, and report in to the BSP, in any
>   sequence whatsoever, and
>
> - the number of boot CPUs (which is known in advance) is strictly less
>   than the number of maximum CPUs (which is also known in advance).
>
> In the above case, the platform cannot tell UefiCpuPkg/MpInitLib to wait
> exactly until all boot APs check in. That is, the platform can't request
> that the AP enumeration never time out, but also not wait for too long.
>
> For supporting this use case, the patch series introduces
> PcdCpuBootLogicalProcessorNumber to UefiCpuPkg, and makes MpInitLib wait
> for exactly that many CPUs (= BSP + APs) to show up during CPU
> enumeration.
>
> Working towards VCPU hotplug with OVMF, OvmfPkg/PlatformPei fetches both
> the boot and the max CPU counts from QEMU, co-operating with the
> following QEMU patch set:
>
>   [qemu-devel] [PATCH 0/4] hw/i386: pass "MachineState.smp.max_cpus" to OVMF
>   http://mid.mail-archive.com/20191008105259.5378-1-lersek@redhat.com
>
> and passes them to UefiCpuPkg via PcdCpuBootLogicalProcessorNumber and
> PcdCpuMaxLogicalProcessorNumber.
>
> As a result, PcdCpuApInitTimeOutInMicroSeconds becomes irrelevant for,
> and unused by, OVMF -- time-limited AP enumeration is never going to be
> used.
>
> When OVMF is built with -D SMM_REQUIRE, this patch series is just a
> small building block, towards the full VCPU hotplug feature. However,
> when OVMF is built without -D SMM_REQUIRE, this series (together with
> the counterpart patch set for QEMU) completes the VCPU hotplug feature:
> it allows S3 resume to work with VCPUs hot-plugged previously (at OS
> runtime, of course).
>
> Cc: Anthony Perard 
> Cc: Ard Biesheuvel 
> Cc: Eric Dong 
> Cc: Igor Mammedov 
> Cc: Jordan Justen 
> Cc: Julien Grall 
> Cc: Ray Ni 
>
> Thanks
> Laszlo
>
> Laszlo Ersek (4):
>   UefiCpuPkg/MpInitLib: honor the platform's boot CPU count in AP
> detection

Assuming this ^^^ patch gets accepted by the maintainers,

>   OvmfPkg/OvmfXen.dsc: remove PcdCpu* dynamic defaults
>   OvmfPkg/IndustryStandard: define FW_CFG_X86_TOPOLOGY structure type
>   OvmfPkg/PlatformPei: rewrite MaxCpuCountInitialization() for CPU
> hotplug
>

Acked-by: Ard Biesheuvel 

for the OvmfPkg changes.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48567): https://edk2.groups.io/g/devel/message/48567
Mute This Topic: https://groups.io/mt/34441227/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 4/4] OvmfPkg/PlatformPei: rewrite MaxCpuCountInitialization() for CPU hotplug

2019-10-08 Thread Laszlo Ersek
MaxCpuCountInitialization() currently handles the following options:

(1) QEMU does not report the boot CPU count.

In this case, PlatformPei makes MpInitLib enumerate APs up to the
default PcdCpuMaxLogicalProcessorNumber value (64) minus 1, or until
the default PcdCpuApInitTimeOutInMicroSeconds (50,000) elapses.
(Whichever is reached first.)

Time-limited AP enumeration had never been reliable on QEMU/KVM, which
is why commit 45a70db3c3a5 strated handling case (2) below, in OVMF.

(2) QEMU reports the boot CPU count.

In this case, PlatformPei sets PcdCpuMaxLogicalProcessorNumber to the
reported boot CPU count, and PcdCpuApInitTimeOutInMicroSeconds to
practically "infinity" (MAX_UINT32, ~71 minutes). That causes
MpInitLib to enumerate exactly the available (boot) APs.

With CPU hotplug in mind, this method is not good enough. While
UefiCpuPkg expects PcdCpuMaxLogicalProcessorNumber to include both
boot (i.e., cold-plugged), and all *potentially* hot-plugged, logical
processors, the boot CPU count reported by QEMU does not cover the
second category.

Rewrite MaxCpuCountInitialization() for handling the following cases:

(1) The behavior of case (1) does not change. (No UefiCpuPkg PCDs are set
to values different from the defaults.)

(2) QEMU reports the boot CPU count, but not the potential maximum CPU
count.

In this case, the behavior remains unchanged.

The way MpInitLib is instructed to do the same differs however: we now
set the new PcdCpuBootLogicalProcessorNumber to the boot CPU count
(together with PcdCpuMaxLogicalProcessorNumber).
PcdCpuApInitTimeOutInMicroSeconds is irrelevant.

(3) QEMU reports both the boot CPU count, and the potential maximum CPU
count.

We tell UefiCpuPkg about the potential maximum through
PcdCpuMaxLogicalProcessorNumber. We also tell MpInitLib the boot CPU
count for precise and quick AP enumeration, via
PcdCpuBootLogicalProcessorNumber. PcdCpuApInitTimeOutInMicroSeconds is
irrelevant.

This patch is a pre-requisite for enabling CPU hotplug with SMM_REQUIRE.
As a side effect, it also enables S3 to work with CPU hotplug at once,
*without* SMM_REQUIRE.

Cc: Anthony Perard 
Cc: Ard Biesheuvel 
Cc: Eric Dong 
Cc: Igor Mammedov 
Cc: Jordan Justen 
Cc: Julien Grall 
Cc: Ray Ni 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1515
Signed-off-by: Laszlo Ersek 
---
 OvmfPkg/OvmfPkgIa32.dsc |  2 +-
 OvmfPkg/OvmfPkgIa32X64.dsc  |  2 +-
 OvmfPkg/OvmfPkgX64.dsc  |  2 +-
 OvmfPkg/PlatformPei/PlatformPei.inf |  2 +-
 OvmfPkg/PlatformPei/Platform.c  | 83 +---
 5 files changed, 60 insertions(+), 31 deletions(-)

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 66e944436a69..89b1fc41458d 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -554,7 +554,7 @@ [PcdsDynamicDefault]
 
   # UefiCpuPkg PCDs related to initial AP bringup and general AP management.
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|64
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber|0
 
   # Set memory encryption mask
   gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 51c2bfb44f14..f978d27a0b55 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -566,7 +566,7 @@ [PcdsDynamicDefault]
 
   # UefiCpuPkg PCDs related to initial AP bringup and general AP management.
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|64
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber|0
 
   # Set memory encryption mask
   gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index ba7a75884490..04604ed6b35b 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -565,7 +565,7 @@ [PcdsDynamicDefault]
 
   # UefiCpuPkg PCDs related to initial AP bringup and general AP management.
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|64
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber|0
 
   # Set memory encryption mask
   gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf 
b/OvmfPkg/PlatformPei/PlatformPei.inf
index d9fd9c8f05b3..30eaebdfae63 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -98,7 +98,7 @@ [Pcd]
   gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy
   gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber
-  

[edk2-devel] [PATCH 2/4] OvmfPkg/OvmfXen.dsc: remove PcdCpu* dynamic defaults

2019-10-08 Thread Laszlo Ersek
PcdCpuMaxLogicalProcessorNumber and PcdCpuApInitTimeOutInMicroSeconds are
only referenced in "OvmfPkg/PlatformPei/PlatformPei.inf", and OvmfXen does
not include that module. Remove the unnecessary dynamic PCD defaults from
"OvmfXen.dsc".

Cc: Anthony Perard 
Cc: Ard Biesheuvel 
Cc: Igor Mammedov 
Cc: Jordan Justen 
Cc: Julien Grall 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1515
Signed-off-by: Laszlo Ersek 
---
 OvmfPkg/OvmfXen.dsc | 4 
 1 file changed, 4 deletions(-)

diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 5a31f75f05d0..6deafea034c0 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -481,10 +481,6 @@ [PcdsDynamicDefault]
   gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack|FALSE
   gEfiMdeModulePkgTokenSpaceGuid.PcdPropertiesTableEnable|FALSE
 
-  # UefiCpuPkg PCDs related to initial AP bringup and general AP management.
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|64
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5
-
   # Set memory encryption mask
   gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
 
-- 
2.19.1.3.g30247aa5d201



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48564): https://edk2.groups.io/g/devel/message/48564
Mute This Topic: https://groups.io/mt/34441229/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 3/4] OvmfPkg/IndustryStandard: define FW_CFG_X86_TOPOLOGY structure type

2019-10-08 Thread Laszlo Ersek
pc-q35-4.2+ and pc-i440fx-4.2+ machine types report CPU topology info in
the "etc/x86-smp-topology" fw_cfg file. Add a structure type for parsing
this blob.

Cc: Ard Biesheuvel 
Cc: Igor Mammedov 
Cc: Jordan Justen 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1515
Signed-off-by: Laszlo Ersek 
---
 OvmfPkg/Include/IndustryStandard/QemuFwCfg.h | 22 
 1 file changed, 22 insertions(+)

diff --git a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h 
b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h
index 7969aba3ca61..fe410d4a3fc2 100644
--- a/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h
+++ b/OvmfPkg/Include/IndustryStandard/QemuFwCfg.h
@@ -95,4 +95,26 @@ typedef struct {
 } FW_CFG_DMA_ACCESS;
 #pragma pack ()
 
+//
+// Structure describing the VCPU topology on IA32 and X64, in the fw_cfg file
+// named "etc/x86-smp-topology".
+//
+// All fields are little endian.
+//
+// The number of sockets (aka packages) can be calculated by dividing
+// MaxLogicalProcessors by (DiesPerSocket * CoresPerDie * ThreadsPerCore), and
+// rounding up the quotient.
+//
+// APIC ID field widths and offsets can be derived with the standard method
+// described in "Intel(R) 64 Architecture Processor Topology Enumeration"
+// 
.
+//
+#pragma pack (1)
+typedef struct {
+  UINT32 DiesPerSocket;
+  UINT32 CoresPerDie;
+  UINT32 ThreadsPerCore;
+  UINT32 MaxLogicalProcessors;
+} FW_CFG_X86_TOPOLOGY;
+#pragma pack ()
 #endif
-- 
2.19.1.3.g30247aa5d201



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48565): https://edk2.groups.io/g/devel/message/48565
Mute This Topic: https://groups.io/mt/34441230/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 1/4] UefiCpuPkg/MpInitLib: honor the platform's boot CPU count in AP detection

2019-10-08 Thread Laszlo Ersek
If a platform boots with a CPU topology that is not fully populated (that
is, the boot CPU count is smaller than PcdCpuMaxLogicalProcessorNumber),
then the platform cannot use the "fast AP detection" logic added in commit
6e1987f19af7. Said logic depends on the boot CPU count being equal to
PcdCpuMaxLogicalProcessorNumber.

The platform may not be able to use the variant added in commit
0594ec417c89 either, for different reasons; see for example commit
861218740d6d.

Allow platforms to specify the exact boot CPU count, independently of
PcdCpuMaxLogicalProcessorNumber.

Cc: Eric Dong 
Cc: Igor Mammedov 
Cc: Ray Ni 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1515
Signed-off-by: Laszlo Ersek 
---
 UefiCpuPkg/UefiCpuPkg.dec | 11 +
 UefiCpuPkg/UefiCpuPkg.uni |  4 ++
 UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |  1 +
 UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |  3 +-
 UefiCpuPkg/Library/MpInitLib/MpLib.c  | 42 
 5 files changed, 43 insertions(+), 18 deletions(-)

diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec
index 031a2ccd680a..d6b33fd9b465 100644
--- a/UefiCpuPkg/UefiCpuPkg.dec
+++ b/UefiCpuPkg/UefiCpuPkg.dec
@@ -227,6 +227,17 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, 
PcdsDynamicEx]
   ## Specifies timeout value in microseconds for the BSP to detect all APs for 
the first time.
   # @Prompt Timeout for the BSP to detect all APs for the first time.
   
gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|5|UINT32|0x0004
+  ## Specifies the number of Logical Processors that are available in the
+  #  preboot environment after platform reset, including BSP and APs. Possible
+  #  values:
+  #  zero (default) - This PCD is ignored, and
+  #   PcdCpuApInitTimeOutInMicroSeconds limits the initial AP
+  #   detection by the BSP.
+  #  nonzero- PcdCpuApInitTimeOutInMicroSeconds is ignored. The initial
+  #   AP detection finishes when the detected CPU count (BSP
+  #   plus APs) reaches the value of this PCD.
+  # @Prompt Number of Logical Processors available after platform reset.
+  
gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber|0|UINT32|0x0008
   ## Specifies the base address of the first microcode Patch in the microcode 
Region.
   # @Prompt Microcode Region base address.
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchAddress|0x0|UINT64|0x0005
diff --git a/UefiCpuPkg/UefiCpuPkg.uni b/UefiCpuPkg/UefiCpuPkg.uni
index fbf768072668..a7e279c5cb14 100644
--- a/UefiCpuPkg/UefiCpuPkg.uni
+++ b/UefiCpuPkg/UefiCpuPkg.uni
@@ -37,6 +37,10 @@
 
 #string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuApInitTimeOutInMicroSeconds_HELP  
#language en-US "Specifies timeout value in microseconds for the BSP to detect 
all APs for the first time."
 
+#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuBootLogicalProcessorNumber_PROMPT  
#language en-US "Number of Logical Processors available after platform reset."
+
+#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuBootLogicalProcessorNumber_HELP  
#language en-US "Specifies the number of Logical Processors that are available 
in the preboot environment after platform reset, including BSP and APs."
+
 #string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuMicrocodePatchAddress_PROMPT  
#language en-US "Microcode Region base address."
 
 #string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuMicrocodePatchAddress_HELP  
#language en-US "Specifies the base address of the first microcode Patch in the 
microcode Region."
diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf 
b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
index 37b3f64e578a..cd912ab0c5ee 100644
--- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
+++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
@@ -61,6 +61,7 @@ [Guids]
 
 [Pcd]
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber## CONSUMES
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber   ## CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds  ## 
SOMETIMES_CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize  ## CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchAddress## CONSUMES
diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf 
b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
index 82b77b63ea87..1538185ef99a 100644
--- a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
+++ b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf
@@ -53,7 +53,8 @@ [LibraryClasses]
 
 [Pcd]
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber## CONSUMES
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds  ## CONSUMES
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber   ## CONSUMES
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds  ## 
SOMETIMES_CONSUMES
   gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize  ## CONSUMES
   

[edk2-devel] [PATCH 0/4] UefiCpuPkg, OvmfPkg: separate PCDs for boot CPU count vs. max CPU count

2019-10-08 Thread Laszlo Ersek
Repo:   https://github.com/lersek/edk2.git
Branch: max_cpus_bz_1515
Ref:https://bugzilla.tianocore.org/show_bug.cgi?id=1515

UefiCpuPkg/MpInitLib currently lacks support for the following use case:

- time-limited AP enumeration is not reliable on the platform
  (individual AP check-in may take arbitrarily long), and

- APs may finish the wakeup routine, and report in to the BSP, in any
  sequence whatsoever, and

- the number of boot CPUs (which is known in advance) is strictly less
  than the number of maximum CPUs (which is also known in advance).

In the above case, the platform cannot tell UefiCpuPkg/MpInitLib to wait
exactly until all boot APs check in. That is, the platform can't request
that the AP enumeration never time out, but also not wait for too long.

For supporting this use case, the patch series introduces
PcdCpuBootLogicalProcessorNumber to UefiCpuPkg, and makes MpInitLib wait
for exactly that many CPUs (= BSP + APs) to show up during CPU
enumeration.

Working towards VCPU hotplug with OVMF, OvmfPkg/PlatformPei fetches both
the boot and the max CPU counts from QEMU, co-operating with the
following QEMU patch set:

  [qemu-devel] [PATCH 0/4] hw/i386: pass "MachineState.smp.max_cpus" to OVMF
  http://mid.mail-archive.com/20191008105259.5378-1-lersek@redhat.com

and passes them to UefiCpuPkg via PcdCpuBootLogicalProcessorNumber and
PcdCpuMaxLogicalProcessorNumber.

As a result, PcdCpuApInitTimeOutInMicroSeconds becomes irrelevant for,
and unused by, OVMF -- time-limited AP enumeration is never going to be
used.

When OVMF is built with -D SMM_REQUIRE, this patch series is just a
small building block, towards the full VCPU hotplug feature. However,
when OVMF is built without -D SMM_REQUIRE, this series (together with
the counterpart patch set for QEMU) completes the VCPU hotplug feature:
it allows S3 resume to work with VCPUs hot-plugged previously (at OS
runtime, of course).

Cc: Anthony Perard 
Cc: Ard Biesheuvel 
Cc: Eric Dong 
Cc: Igor Mammedov 
Cc: Jordan Justen 
Cc: Julien Grall 
Cc: Ray Ni 

Thanks
Laszlo

Laszlo Ersek (4):
  UefiCpuPkg/MpInitLib: honor the platform's boot CPU count in AP
detection
  OvmfPkg/OvmfXen.dsc: remove PcdCpu* dynamic defaults
  OvmfPkg/IndustryStandard: define FW_CFG_X86_TOPOLOGY structure type
  OvmfPkg/PlatformPei: rewrite MaxCpuCountInitialization() for CPU
hotplug

 OvmfPkg/Include/IndustryStandard/QemuFwCfg.h  | 22 ++
 OvmfPkg/OvmfPkgIa32.dsc   |  2 +-
 OvmfPkg/OvmfPkgIa32X64.dsc|  2 +-
 OvmfPkg/OvmfPkgX64.dsc|  2 +-
 OvmfPkg/OvmfXen.dsc   |  4 -
 OvmfPkg/PlatformPei/Platform.c| 83 +---
 OvmfPkg/PlatformPei/PlatformPei.inf   |  2 +-
 UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf |  1 +
 UefiCpuPkg/Library/MpInitLib/MpLib.c  | 42 ++
 UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf |  3 +-
 UefiCpuPkg/UefiCpuPkg.dec | 11 +++
 UefiCpuPkg/UefiCpuPkg.uni |  4 +
 12 files changed, 125 insertions(+), 53 deletions(-)

-- 
2.19.1.3.g30247aa5d201


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48562): https://edk2.groups.io/g/devel/message/48562
Mute This Topic: https://groups.io/mt/34441227/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH v2] MdePkg:Include: Update SmBios header file

2019-10-08 Thread Leif Lindholm
Hi Liming,

If you push this set (v5), could you possibly also push it to
https://github.com/tianocore/edk2-staging/tree/RISC-V-V2 ?

The three patches apply cleanly on this revision, and are a
prerequisite for the code destined to go in there.

Best Regards,

Leif

On Tue, Oct 08, 2019 at 01:14:35AM +, Gao, Liming wrote:
> Abner:
>   Thanks for your notice. I see the public SMBIOS 3.3.0. 
> 
>   For this patch set, I have two minor comments. For other part, Reviewed-by: 
> Liming Gao 
> 1) Please add BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2202 in the 
> commit message. 
> 2) The comment for gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev is not 
> required to be changed. 
> This field is in SMBIOS 3.0 spec. It is not new added one in SMBIOS 3.3.
> 
> Thanks
> Liming
> >-Original Message-
> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> >Abner Chang
> >Sent: Friday, October 04, 2019 11:06 PM
> >To: Gao, Liming ; devel@edk2.groups.io
> >Cc: Kinney, Michael D ; Leif Lindholm
> >; Chen, Gilbert 
> >Subject: Re: [edk2-devel] [PATCH v2] MdePkg:Include: Update SmBios header
> >file
> >
> >Just aware that SMBIOS 3.3.0 is published on DMTF,
> >https://www.dmtf.org/standards/smbios
> >
> >The latest version of patch set is PATCH v4, please review it and help to 
> >push
> >to mainstream if no further comments. Thanks
> >Abner
> >
> >> -Original Message-
> >> From: Gao, Liming [mailto:liming@intel.com]
> >> Sent: Thursday, September 19, 2019 1:23 PM
> >> To: Chang, Abner (HPS SW/FW Technologist) ;
> >> devel@edk2.groups.io
> >> Cc: Kinney, Michael D ; Leif Lindholm
> >> ; Chen, Gilbert 
> >> Subject: RE: [PATCH v2] MdePkg:Include: Update SmBios header file
> >>
> >> Abner:
> >>   Please add BZ URL in the commit message, and separate this patch to three
> >> changes. Each one is for each package of MdePkg, MdeModulePkg and
> >> ShellPkg.
> >>
> >>   As Leif say, SmBios 3.3 spec is not published. This patch will not be 
> >> pushed
> >> until SmBios 3.3 is published.
> >>
> >> >-Original Message-
> >> >From: Abner Chang [mailto:abner.ch...@hpe.com]
> >> >Sent: Thursday, September 19, 2019 11:05 AM
> >> >To: devel@edk2.groups.io
> >> >Cc: abner.ch...@hpe.com; Kinney, Michael D
> >> >; Gao, Liming ; Leif
> >> >Lindholm ; Gilbert Chen
> >> >
> >> >Subject: [PATCH v2] MdePkg:Include: Update SmBios header file
> >> >
> >> >Update SmBios header file to conform with SMBIOS v3.3.0.
> >> >The major update is to add definitions of SMBIOS Type 44h record.
> >> >
> >> >Signed-off-by: Abner Chang 
> >> >
> >> >Cc: Michael D Kinney 
> >> >Cc: Liming Gao 
> >> >Cc: Leif Lindholm 
> >> >Cc: Gilbert Chen 
> >> >---
> >> > MdeModulePkg/MdeModulePkg.dec  |  6 +-
> >> > MdePkg/Include/IndustryStandard/SmBios.h   | 76
> >> >+-
> >> > .../SmbiosView/PrintInfo.c | 23 ++-
> >> > .../SmbiosView/PrintInfo.h | 13 +++-
> >> > .../SmbiosView/QueryTable.c| 63 
> >> > +-
> >> > .../UefiShellDebug1CommandsLib.uni |  3 +-
> >> > 6 files changed, 174 insertions(+), 10 deletions(-)
> >> >
> >> >diff --git a/MdeModulePkg/MdeModulePkg.dec
> >> >b/MdeModulePkg/MdeModulePkg.dec index 19935c8..e3a65ab 100644
> >> >--- a/MdeModulePkg/MdeModulePkg.dec
> >> >+++ b/MdeModulePkg/MdeModulePkg.dec
> >> >@@ -1792,10 +1792,10 @@
> >> >
> >> >   ## SMBIOS version.
> >> >   # @Prompt SMBIOS version.
> >> >-
> >> >gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0302|UINT16|0
> >> x0
> >> >0010055
> >> >+
> >> >gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0303|UINT16|0
> >> x0
> >> >0010055
> >> >
> >> >-  ## SMBIOS Docrev field in SMBIOS 3.0 (64-bit) Entry Point Structure.
> >> >-  # @Prompt SMBIOS Docrev field in SMBIOS 3.0 (64-bit) Entry Point
> >> Structure.
> >> >+  ## SMBIOS Docrev field in SMBIOS 3.3 (64-bit) Entry Point Structure.
> >> >+  # @Prompt SMBIOS Docrev field in SMBIOS 3.3 (64-bit) Entry Point
> >> >Structure.
> >> >
> >> >gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0|UINT8|0x000
> >1
> >> 00
> >> >6A
> >> >
> >> >   ## SMBIOS produce method.
> >> >diff --git a/MdePkg/Include/IndustryStandard/SmBios.h
> >> >b/MdePkg/Include/IndustryStandard/SmBios.h
> >> >index f3b6f18..f504cc8 100644
> >> >--- a/MdePkg/Include/IndustryStandard/SmBios.h
> >> >+++ b/MdePkg/Include/IndustryStandard/SmBios.h
> >> >@@ -1,8 +1,9 @@
> >> > /** @file
> >> >-  Industry Standard Definitions of SMBIOS Table Specification v3.2.0.
> >> >+  Industry Standard Definitions of SMBIOS Table Specification v3.3.0.
> >> >
> >> > Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> >> > (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
> >> >+(C) Copyright 2015 - 2019 Hewlett Packard Enterprise Development
> >> >+LP
> >> > SPDX-License-Identifier: BSD-2-Clause-Patent
> >> >
> >> > **/
> >> >@@ -46,7 +47,7 @@ 

Re: [edk2-devel][edk2-test][PATCH 1/1] uefi-sct/SctPkg: SNP ReceiveFilters may be unsupported

2019-10-08 Thread Eric Jin
Push at 3d98de052fcd47f187190802e6201ac6aaabfda7

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Eric Jin
Sent: Monday, September 30, 2019 2:56 PM
To: Heinrich Schuchardt ; EDK II Development 

Cc: Supreeth Venkatesh ; Stephano Cetola 

Subject: Re: [edk2-devel][edk2-test][PATCH 1/1] uefi-sct/SctPkg: SNP 
ReceiveFilters may be unsupported

Add [edk2-test] in subject
Reviewed-by: Eric Jin 

-Original Message-
From: Heinrich Schuchardt  
Sent: Tuesday, September 17, 2019 1:10 PM
To: EDK II Development 
Cc: Jin, Eric ; Supreeth Venkatesh 
; Stephano Cetola 
; Heinrich Schuchardt 
Subject: [edk2-devel] [PATCH 1/1] uefi-sct/SctPkg: SNP ReceiveFilters may be 
unsupported

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2197

If EFI_SIMPLE_NETWORK.ReceiveFilters() is not supported, it will return 
EFI_UNSUPPORTED. In this case do not expect input parameters to be checked for 
conformance.

Signed-off-by: Heinrich Schuchardt 
---
 .../SimpleNetworkBBTestConformance.c  | 223 +++---
 1 file changed, 138 insertions(+), 85 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
index 9bd21a76..09b47ee6 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxTest/SimpleNetworkBBTestConformance.c
+++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/SimpleNetwork/BlackBoxT
+++ est/SimpleNetworkBBTestConformance.c
@@ -626,22 +626,31 @@ BBTestReceiveFilterConformanceTest (
   // Call ReceiveFilters() function if network interface not start.   //   
Status = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 0, NULL);-  
if ((Status == EFI_NOT_STARTED) && (SnpInterface->Mode->State == 
EfiSimpleNetworkStopped)) {-AssertionType = EFI_TEST_ASSERTION_PASSED;+  if 
(Status == EFI_UNSUPPORTED) {+StandardLib->RecordMessage(+  
 StandardLib,+   EFI_VERBOSE_LEVEL_QUIET,+   
L"ReceiveFilters isn't supported, Status - %r\n",+   Status+
   );   } else {-AssertionType = EFI_TEST_ASSERTION_FAILED;-  
}+if ((Status == EFI_NOT_STARTED) && (SnpInterface->Mode->State == 
EfiSimpleNetworkStopped)) {+  AssertionType = EFI_TEST_ASSERTION_PASSED;+   
 } else {+  AssertionType = EFI_TEST_ASSERTION_FAILED;+} -  
StandardLib->RecordAssertion (- StandardLib,- 
AssertionType,- 
gSimpleNetworkBBTestConformanceAssertionGuid006,- 
L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() when 
network interface not start.",- L"%a:%d:Status - %r",-  
   __FILE__,- (UINTN)__LINE__,- Status- 
);+StandardLib->RecordAssertion (+   
StandardLib,+   AssertionType,+   
gSimpleNetworkBBTestConformanceAssertionGuid006,+   
L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() when 
network interface not start.",+   L"%a:%d:Status - %r",+
   __FILE__,+   (UINTN)__LINE__,+   
Status+   );+  }//   // Assertion Point 5.6.2.2@@ -653,22 
+662,31 @@ BBTestReceiveFilterConformanceTest (
   }Status = SnpInterface->ReceiveFilters (SnpInterface, 0, 0, FALSE, 0, 
NULL);-  if (Status == EFI_DEVICE_ERROR) {-AssertionType = 
EFI_TEST_ASSERTION_PASSED;+  if (Status == EFI_UNSUPPORTED) {+
StandardLib->RecordMessage(+   StandardLib,+   
EFI_VERBOSE_LEVEL_QUIET,+   L"ReceiveFilters isn't supported, 
Status - %r\n",+   Status+   );   } else {-
AssertionType = EFI_TEST_ASSERTION_FAILED;-  }+if (Status == 
EFI_DEVICE_ERROR) {+  AssertionType = EFI_TEST_ASSERTION_PASSED;+} else 
{+  AssertionType = EFI_TEST_ASSERTION_FAILED;+} -  
StandardLib->RecordAssertion (- StandardLib,- 
AssertionType,- 
gSimpleNetworkBBTestConformanceAssertionGuid007,- 
L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() when 
network interface not initialized.",- L"%a:%d:Status - %r",-
 __FILE__,- (UINTN)__LINE__,- 
Status- );+StandardLib->RecordAssertion (+  
 StandardLib,+   AssertionType,+   
gSimpleNetworkBBTestConformanceAssertionGuid007,+   
L"EFI_SIMPLE_NETWORK_PROTOCOL.ReceiveFilters - Invoke ReceiveFilters() when 
network interface not initialized.",+   L"%a:%d:Status - %r",+  
 __FILE__,+   (UINTN)__LINE__,+ 
  Status+  

Re: [edk2-devel] [PATCH v2] MdePkg:Include: Update SmBios header file

2019-10-08 Thread Abner Chang
Thanks Liming,

[PATCH v5] was sent.
I added BZ link in commit message in each patch and reverted the changes on 
PcdSmbiosDocRev.

Abner

> -Original Message-
> From: Gao, Liming [mailto:liming@intel.com]
> Sent: Tuesday, October 8, 2019 9:15 AM
> To: devel@edk2.groups.io; Chang, Abner (HPS SW/FW Technologist)
> 
> Cc: Kinney, Michael D ; Leif Lindholm
> ; Chen, Gilbert 
> Subject: RE: [edk2-devel] [PATCH v2] MdePkg:Include: Update SmBios
> header file
> 
> Abner:
>   Thanks for your notice. I see the public SMBIOS 3.3.0.
> 
>   For this patch set, I have two minor comments. For other part, Reviewed-by:
> Liming Gao 
> 1) Please add BZ: INVALID URI REMOVED
> 3A__bugzilla.tianocore.org_show-5Fbug.cgi-3Fid-
> 3D2202=DwIFAg=C5b8zRQO1miGmBeVZ2LFWg=_SN6FZBN4Vgi4Ulks
> kz6qU3NYRO03nHp9P7Z5q59A3E=gM5jfUqBhKlNrUmWsg_93sw45gXUq
> WoAl7p2YtJ02tE=a2Q0nhgk7ms0Ik28D2zOF_GH9vpbZHsZzNHGChN0r7k
> =  in the commit message.
> 2) The comment for gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev
> is not required to be changed.
> This field is in SMBIOS 3.0 spec. It is not new added one in SMBIOS 3.3.
> 
> Thanks
> Liming
> >-Original Message-
> >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> >Abner Chang
> >Sent: Friday, October 04, 2019 11:06 PM
> >To: Gao, Liming ; devel@edk2.groups.io
> >Cc: Kinney, Michael D ; Leif Lindholm
> >; Chen, Gilbert 
> >Subject: Re: [edk2-devel] [PATCH v2] MdePkg:Include: Update SmBios
> >header file
> >
> >Just aware that SMBIOS 3.3.0 is published on DMTF,
> >INVALID URI REMOVED
> 3A__www.dmtf.org_stand
> >ards_smbios=DwIFAg=C5b8zRQO1miGmBeVZ2LFWg=_SN6FZBN4V
> gi4Ulkskz6qU3
> >NYRO03nHp9P7Z5q59A3E=gM5jfUqBhKlNrUmWsg_93sw45gXUqWoAl7
> p2YtJ02tE=0B
> >MjpMouuP-2RINBiN0FS-YOe7mwBQp_2VdCMurVQW4=
> >
> >The latest version of patch set is PATCH v4, please review it and help
> >to push to mainstream if no further comments. Thanks Abner
> >
> >> -Original Message-
> >> From: Gao, Liming [mailto:liming@intel.com]
> >> Sent: Thursday, September 19, 2019 1:23 PM
> >> To: Chang, Abner (HPS SW/FW Technologist) ;
> >> devel@edk2.groups.io
> >> Cc: Kinney, Michael D ; Leif Lindholm
> >> ; Chen, Gilbert 
> >> Subject: RE: [PATCH v2] MdePkg:Include: Update SmBios header file
> >>
> >> Abner:
> >>   Please add BZ URL in the commit message, and separate this patch to
> >> three changes. Each one is for each package of MdePkg, MdeModulePkg
> >> and ShellPkg.
> >>
> >>   As Leif say, SmBios 3.3 spec is not published. This patch will not
> >> be pushed until SmBios 3.3 is published.
> >>
> >> >-Original Message-
> >> >From: Abner Chang [mailto:abner.ch...@hpe.com]
> >> >Sent: Thursday, September 19, 2019 11:05 AM
> >> >To: devel@edk2.groups.io
> >> >Cc: abner.ch...@hpe.com; Kinney, Michael D
> >> >; Gao, Liming ;
> >> >Leif Lindholm ; Gilbert Chen
> >> >
> >> >Subject: [PATCH v2] MdePkg:Include: Update SmBios header file
> >> >
> >> >Update SmBios header file to conform with SMBIOS v3.3.0.
> >> >The major update is to add definitions of SMBIOS Type 44h record.
> >> >
> >> >Signed-off-by: Abner Chang 
> >> >
> >> >Cc: Michael D Kinney 
> >> >Cc: Liming Gao 
> >> >Cc: Leif Lindholm 
> >> >Cc: Gilbert Chen 
> >> >---
> >> > MdeModulePkg/MdeModulePkg.dec  |  6 +-
> >> > MdePkg/Include/IndustryStandard/SmBios.h   | 76
> >> >+-
> >> > .../SmbiosView/PrintInfo.c | 23 ++-
> >> > .../SmbiosView/PrintInfo.h | 13 +++-
> >> > .../SmbiosView/QueryTable.c| 63 
> >> > +-
> >> > .../UefiShellDebug1CommandsLib.uni |  3 +-
> >> > 6 files changed, 174 insertions(+), 10 deletions(-)
> >> >
> >> >diff --git a/MdeModulePkg/MdeModulePkg.dec
> >> >b/MdeModulePkg/MdeModulePkg.dec index 19935c8..e3a65ab 100644
> >> >--- a/MdeModulePkg/MdeModulePkg.dec
> >> >+++ b/MdeModulePkg/MdeModulePkg.dec
> >> >@@ -1792,10 +1792,10 @@
> >> >
> >> >   ## SMBIOS version.
> >> >   # @Prompt SMBIOS version.
> >> >-
> >>
> >gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0302|UINT16|0
> >> x0
> >> >0010055
> >> >+
> >>
> >gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0303|UINT16|0
> >> x0
> >> >0010055
> >> >
> >> >-  ## SMBIOS Docrev field in SMBIOS 3.0 (64-bit) Entry Point Structure.
> >> >-  # @Prompt SMBIOS Docrev field in SMBIOS 3.0 (64-bit) Entry Point
> >> Structure.
> >> >+  ## SMBIOS Docrev field in SMBIOS 3.3 (64-bit) Entry Point Structure.
> >> >+  # @Prompt SMBIOS Docrev field in SMBIOS 3.3 (64-bit) Entry Point
> >> >Structure.
> >> >
> >>
> >gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0|UINT8|0x000
> >1
> >> 00
> >> >6A
> >> >
> >> >   ## SMBIOS produce method.
> >> >diff --git a/MdePkg/Include/IndustryStandard/SmBios.h
> >> >b/MdePkg/Include/IndustryStandard/SmBios.h
> >> >index f3b6f18..f504cc8 100644
> >> >--- a/MdePkg/Include/IndustryStandard/SmBios.h
> >> >+++ b/MdePkg/Include/IndustryStandard/SmBios.h
> >> >@@ 

[edk2-devel] [PATCH v5 0/3] Update to support SmBios 3.3.0

2019-10-08 Thread Abner Chang
Codes changes for SMBIOS spec 3.3.0 (Already public on DMTF).

Bugzilla link,
https://bugzilla.tianocore.org/show_bug.cgi?id=2202

Abner Chang (3):
  MdeModulePkg: Update to support SmBios 3.3.0
  MdePkg/Include: Update to support SmBios 3.3.0
  ShellPkg/UefiShellDebug1CommandsLib: Update to support SmBios 3.3.0

 MdeModulePkg/MdeModulePkg.dec  |  4 +-
 MdePkg/Include/IndustryStandard/SmBios.h   | 76 +-
 .../SmbiosView/PrintInfo.c | 23 ++-
 .../SmbiosView/PrintInfo.h | 13 +++-
 .../SmbiosView/QueryTable.c| 63 +-
 .../UefiShellDebug1CommandsLib.uni |  3 +-
 6 files changed, 173 insertions(+), 9 deletions(-)

-- 
2.7.4


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48555): https://edk2.groups.io/g/devel/message/48555
Mute This Topic: https://groups.io/mt/34440299/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v5 2/3] MdePkg/Include: Update to support SmBios 3.3.0

2019-10-08 Thread Abner Chang
Update SmBios.h to support SMBIOS 3.3.0 spec.

Bugzilla link,
https://bugzilla.tianocore.org/show_bug.cgi?id=2202

Signed-off-by: Abner Chang 

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Leif Lindholm 
Cc: Gilbert Chen 
---
 MdePkg/Include/IndustryStandard/SmBios.h | 76 ++--
 1 file changed, 73 insertions(+), 3 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/SmBios.h 
b/MdePkg/Include/IndustryStandard/SmBios.h
index f3b6f18..f504cc8 100644
--- a/MdePkg/Include/IndustryStandard/SmBios.h
+++ b/MdePkg/Include/IndustryStandard/SmBios.h
@@ -1,8 +1,9 @@
 /** @file
-  Industry Standard Definitions of SMBIOS Table Specification v3.2.0.
+  Industry Standard Definitions of SMBIOS Table Specification v3.3.0.
 
 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
 (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
+(C) Copyright 2015 - 2019 Hewlett Packard Enterprise Development LP
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -46,7 +47,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define SMBIOS_3_0_TABLE_MAX_LENGTH 0x
 
 //
-// SMBIOS type macros which is according to SMBIOS 2.7 specification.
+// SMBIOS type macros which is according to SMBIOS 3.3.0 specification.
 //
 #define SMBIOS_TYPE_BIOS_INFORMATION 0
 #define SMBIOS_TYPE_SYSTEM_INFORMATION   1
@@ -92,6 +93,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION 41
 #define SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE 42
 #define SMBIOS_TYPE_TPM_DEVICE   43
+#define SMBIOS_TYPE_PROCESSOR_ADDITIONAL_INFORMATION 44
 
 ///
 /// Inactive type is added from SMBIOS 2.2. Reference SMBIOS 2.6, chapter 
3.3.43.
@@ -727,7 +729,10 @@ typedef enum {
   ProcessorFamilyMII   = 0x012E,
   ProcessorFamilyWinChip   = 0x0140,
   ProcessorFamilyDSP   = 0x015E,
-  ProcessorFamilyVideoProcessor= 0x01F4
+  ProcessorFamilyVideoProcessor= 0x01F4,
+  ProcessorFamilyRiscvRV32 = 0x0200,
+  ProcessorFamilyRiscVRV64 = 0x0201,
+  ProcessorFamilyRiscVRV128= 0x0202
 } PROCESSOR_FAMILY2_DATA;
 
 ///
@@ -857,6 +862,19 @@ typedef struct {
 } PROCESSOR_FEATURE_FLAGS;
 
 typedef struct {
+  UINT32  ProcessorReserved1 :1;
+  UINT32  ProcessorUnknown   :1;
+  UINT32  Processor64BitCapble   :1;
+  UINT32  ProcessorMultiCore :1;
+  UINT32  ProcessorHardwareThread:1;
+  UINT32  ProcessorExecuteProtection :1;
+  UINT32  ProcessorEnhancedVirtulization :1;
+  UINT32  ProcessorPowerPerformanceCtrl  :1;
+  UINT32  Processor128bitCapble  :1;
+  UINT32  ProcessorReserved2 :7;
+} PROCESSOR_CHARACTERISTIC_FLAGS;
+
+typedef struct {
   PROCESSOR_SIGNATURE Signature;
   PROCESSOR_FEATURE_FLAGS FeatureFlags;
 } PROCESSOR_ID_DATA;
@@ -2508,6 +2526,57 @@ typedef struct {
   UINT8 InterfaceTypeSpecificData[4];   ///< This 
field has a minimum of four bytes
 } SMBIOS_TABLE_TYPE42;
 
+
+///
+/// Processor Specific Block - Processor Architecture Type
+///
+typedef enum{
+  ProcessorSpecificBlockArchTypeReserved   = 0x00,
+  ProcessorSpecificBlockArchTypeIa32   = 0x01,
+  ProcessorSpecificBlockArchTypeX64= 0x02,
+  ProcessorSpecificBlockArchTypeItanium= 0x03,
+  ProcessorSpecificBlockArchTypeAarch32= 0x04,
+  ProcessorSpecificBlockArchTypeAarch64= 0x05,
+  ProcessorSpecificBlockArchTypeRiscVRV32  = 0x06,
+  ProcessorSpecificBlockArchTypeRiscVRV64  = 0x07,
+  ProcessorSpecificBlockArchTypeRiscVRV128 = 0x08
+} PROCESSOR_SPECIFIC_BLOCK_ARCH_TYPE;
+
+///
+/// Processor Specific Block is the standard container of processor-specific 
data.
+///
+typedef struct {
+  UINT8  Length;
+  UINT8  ProcessorArchType;
+  ///
+  /// Below followed by Processor-specific data
+  ///
+  ///
+} PROCESSOR_SPECIFIC_BLOCK;
+
+///
+/// Processor Additional Information(Type 44).
+///
+/// The information in this structure defines the processor additional 
information in case
+/// SMBIOS type 4 is not sufficient to describe processor characteristics.
+/// The SMBIOS type 44 structure has a reference handle field to link back to 
the related
+/// SMBIOS type 4 structure. There may be multiple SMBIOS type 44 structures 
linked to the
+/// same SMBIOS type 4 structure. For example, when cores are not identical in 
a processor,
+/// SMBIOS type 44 structures describe different core-specific information.
+///
+/// SMBIOS type 44 defines the standard header for the processor-specific 
block, while the
+/// contents of processor-specific data are maintained by processor
+/// architecture workgroups or vendors in separate documents.
+///
+typedef struct {
+  SMBIOS_STRUCTURE  Hdr;
+  SMBIOS_HANDLE RefHandle; ///< 

[edk2-devel] [PATCH v5 1/3] MdeModulePkg: Update to support SmBios 3.3.0

2019-10-08 Thread Abner Chang
This commit update the revision of SMBIOS spec reported in PCDs.
Bugzilla link,
https://bugzilla.tianocore.org/show_bug.cgi?id=2202

Signed-off-by: Abner Chang 

Cc: Hao A Wu 
Cc: Jian J Wang 
Cc: Leif Lindholm 
Cc: Gilbert Chen 
---
 MdeModulePkg/MdeModulePkg.dec | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 19935c8..6b40021 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -5,7 +5,7 @@
 #
 # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
 # Copyright (c) 2016, Linaro Ltd. All rights reserved.
-# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+# (C) Copyright 2016 - 2019 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.
 # Copyright (c) 2016, Microsoft Corporation
 # SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -1792,7 +1792,7 @@
 
   ## SMBIOS version.
   # @Prompt SMBIOS version.
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0302|UINT16|0x00010055
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0303|UINT16|0x00010055
 
   ## SMBIOS Docrev field in SMBIOS 3.0 (64-bit) Entry Point Structure.
   # @Prompt SMBIOS Docrev field in SMBIOS 3.0 (64-bit) Entry Point Structure.
-- 
2.7.4


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48556): https://edk2.groups.io/g/devel/message/48556
Mute This Topic: https://groups.io/mt/34440301/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH v5 3/3] ShellPkg/UefiShellDebug1CommandsLib: Update to support SmBios 3.3.0

2019-10-08 Thread Abner Chang
Shell command smbiosview updates for SMBIOS 3.3.0 spec.

Bugzilla link,
https://bugzilla.tianocore.org/show_bug.cgi?id=2202

Signed-off-by: Abner Chang 

Cc: Jaben Carsey 
Cc: Ray Ni 
Cc: Zhichao Gao 
Cc: Leif Lindholm 
Cc: Gilbert Chen 
---
 .../SmbiosView/PrintInfo.c | 23 +++-
 .../SmbiosView/PrintInfo.h | 13 -
 .../SmbiosView/QueryTable.c| 63 +-
 .../UefiShellDebug1CommandsLib.uni |  3 +-
 4 files changed, 98 insertions(+), 4 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index cfd7a2b..ff0c1db 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -3,7 +3,7 @@
 
   Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
-  (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
+  (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -1169,6 +1169,15 @@ SmbiosPrintStructure (
 break;
 
   //
+  // Processor Additional Information (Type 44)
+  //
+  case 44:
+PRINT_STRUCT_VALUE_H (Struct, Type44, RefHandle);
+PRINT_STRUCT_VALUE_H (Struct, Type44, 
ProcessorSpecificBlock.ProcessorArchType);
+ProcessorArchitectureType 
(Struct->Type44->ProcessorSpecificBlock.ProcessorArchType, Option);
+break;
+
+  //
   // Inactive (Type 126)
   //
   case 126:
@@ -2350,6 +2359,18 @@ DisplayProcessorFamily2 (
   Print (L"Video Processor\n");
   break;
 
+case 0x200:
+  Print (L"RISC-V RV32\n");
+  break;
+
+case 0x201:
+  Print (L"RISC-V RV64\n");
+  break;
+
+case 0x202:
+  Print (L"RISC-V RV128\n");
+  break;
+
 default:
  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN 
(STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY), gShellDebug1HiiHandle);
   }
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
index a8c32ab..22f59d6 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
@@ -2,7 +2,7 @@
   Module to clarify the element info of the smbios structure.
 
   Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
-  (C) Copyright 2017 Hewlett Packard Enterprise Development LP
+  (C) Copyright 2017 - 2019 Hewlett Packard Enterprise Development LP
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -427,4 +427,15 @@ DisplayTpmDeviceCharacteristics (
   IN UINT8   Option
   );
 
+/**
+  Display Processor Architecture Type (Type 44).
+
+  @param[in] Type   The key of the structure.
+  @param[in] Option The optional information.
+**/
+VOID
+ProcessorArchitectureType (
+  IN UINT8 Type,
+  IN UINT8 Option
+  );
 #endif
diff --git 
a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index bfb7c3b..54e9a52 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
@@ -3,7 +3,7 @@
   And give a interface of query a string out of a table.
 
   Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
-  (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
+  (C) Copyright 2016-2019 Hewlett Packard Enterprise Development LP
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -620,6 +620,10 @@ TABLE_ITEM  ProcessorCharacteristicsTable[] = {
   {
 7,
 L" Power/Performance Control"
+  },
+  {
+8,
+L" 128-bit Capable"
   }
 };
 
@@ -3268,6 +3272,44 @@ TABLE_ITEM  MCHostInterfaceTypeTable[] = {
   },
 };
 
+TABLE_ITEM  ProcessorArchitectureTypesTable[] = {
+  {
+0,
+L" Reserved "
+  },
+  {
+1,
+L" IA32 (x86) "
+  },
+  {
+2,
+L" x64 (x86-64, intel64, AMD64, EM64T) "
+  },
+  {
+3,
+L" Intel Itanium architecture "
+  },
+  {
+4,
+L" 32-bit ARM (Aarch32) "
+  },
+  {
+5,
+L" 64-bit ARM (Aarch64) "
+  },
+  {
+6,
+L" 32-bit RISC-V (RV32) "
+  },
+  {
+7,
+L" 64-bit RISC-V (RV64) "
+  },
+  {
+8,
+L" 128-bit RISC-V (RV128) "
+  }
+};
 
 TABLE_ITEM  StructureTypeInfoTable[] = {
   {
@@ -3447,6 +3489,10 @@ TABLE_ITEM  StructureTypeInfoTable[] = {
 L" TPM Device"
   },
   {
+44,
+L" Processor Additional Information"
+  },
+  {
 0x7E,
 L" Inactive"
   },
@@ -4697,6 +4743,21 @@ DisplayMCHostInterfaceType (
 }
 
 /**
+  Display Processor Architecture Type (Type 44).
+
+  @param[in] Type   The key of the structure.
+  @param[in] Option The 

[edk2-devel] [PATCH 3/3] ShellPkg/UefiShellDebug1CommandsLib: Update to support SmBios 3.3.0

2019-10-08 Thread Abner Chang
Shell command smbiosview updates for SMBIOS 3.3.0 spec.

Bugzilla link,
https://bugzilla.tianocore.org/show_bug.cgi?id=2202

Signed-off-by: Abner Chang 

Cc: Jaben Carsey 
Cc: Ray Ni 
Cc: Zhichao Gao 
Cc: Leif Lindholm 
Cc: Gilbert Chen 
---
 .../SmbiosView/PrintInfo.c | 23 +++-
 .../SmbiosView/PrintInfo.h | 13 -
 .../SmbiosView/QueryTable.c| 63 +-
 .../UefiShellDebug1CommandsLib.uni |  3 +-
 4 files changed, 98 insertions(+), 4 deletions(-)

diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index cfd7a2b..ff0c1db 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -3,7 +3,7 @@
 
   Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
   (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
-  (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
+  (C) Copyright 2015-2019 Hewlett Packard Enterprise Development LP
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -1169,6 +1169,15 @@ SmbiosPrintStructure (
 break;
 
   //
+  // Processor Additional Information (Type 44)
+  //
+  case 44:
+PRINT_STRUCT_VALUE_H (Struct, Type44, RefHandle);
+PRINT_STRUCT_VALUE_H (Struct, Type44, 
ProcessorSpecificBlock.ProcessorArchType);
+ProcessorArchitectureType 
(Struct->Type44->ProcessorSpecificBlock.ProcessorArchType, Option);
+break;
+
+  //
   // Inactive (Type 126)
   //
   case 126:
@@ -2350,6 +2359,18 @@ DisplayProcessorFamily2 (
   Print (L"Video Processor\n");
   break;
 
+case 0x200:
+  Print (L"RISC-V RV32\n");
+  break;
+
+case 0x201:
+  Print (L"RISC-V RV64\n");
+  break;
+
+case 0x202:
+  Print (L"RISC-V RV128\n");
+  break;
+
 default:
  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN 
(STR_SMBIOSVIEW_PRINTINFO_UNDEFINED_PROC_FAMILY), gShellDebug1HiiHandle);
   }
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
index a8c32ab..22f59d6 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
@@ -2,7 +2,7 @@
   Module to clarify the element info of the smbios structure.
 
   Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
-  (C) Copyright 2017 Hewlett Packard Enterprise Development LP
+  (C) Copyright 2017 - 2019 Hewlett Packard Enterprise Development LP
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -427,4 +427,15 @@ DisplayTpmDeviceCharacteristics (
   IN UINT8   Option
   );
 
+/**
+  Display Processor Architecture Type (Type 44).
+
+  @param[in] Type   The key of the structure.
+  @param[in] Option The optional information.
+**/
+VOID
+ProcessorArchitectureType (
+  IN UINT8 Type,
+  IN UINT8 Option
+  );
 #endif
diff --git 
a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c 
b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index bfb7c3b..54e9a52 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
@@ -3,7 +3,7 @@
   And give a interface of query a string out of a table.
 
   Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
-  (C) Copyright 2016-2017 Hewlett Packard Enterprise Development LP
+  (C) Copyright 2016-2019 Hewlett Packard Enterprise Development LP
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -620,6 +620,10 @@ TABLE_ITEM  ProcessorCharacteristicsTable[] = {
   {
 7,
 L" Power/Performance Control"
+  },
+  {
+8,
+L" 128-bit Capable"
   }
 };
 
@@ -3268,6 +3272,44 @@ TABLE_ITEM  MCHostInterfaceTypeTable[] = {
   },
 };
 
+TABLE_ITEM  ProcessorArchitectureTypesTable[] = {
+  {
+0,
+L" Reserved "
+  },
+  {
+1,
+L" IA32 (x86) "
+  },
+  {
+2,
+L" x64 (x86-64, intel64, AMD64, EM64T) "
+  },
+  {
+3,
+L" Intel Itanium architecture "
+  },
+  {
+4,
+L" 32-bit ARM (Aarch32) "
+  },
+  {
+5,
+L" 64-bit ARM (Aarch64) "
+  },
+  {
+6,
+L" 32-bit RISC-V (RV32) "
+  },
+  {
+7,
+L" 64-bit RISC-V (RV64) "
+  },
+  {
+8,
+L" 128-bit RISC-V (RV128) "
+  }
+};
 
 TABLE_ITEM  StructureTypeInfoTable[] = {
   {
@@ -3447,6 +3489,10 @@ TABLE_ITEM  StructureTypeInfoTable[] = {
 L" TPM Device"
   },
   {
+44,
+L" Processor Additional Information"
+  },
+  {
 0x7E,
 L" Inactive"
   },
@@ -4697,6 +4743,21 @@ DisplayMCHostInterfaceType (
 }
 
 /**
+  Display Processor Architecture Type (Type 44).
+
+  @param[in] Type   The key of the structure.
+  @param[in] Option The 

[edk2-devel] [PATCH 1/3] MdeModulePkg: Update to support SmBios 3.3.0

2019-10-08 Thread Abner Chang
This commit update the revision of SMBIOS spec reported in PCDs.
Bugzilla link,
https://bugzilla.tianocore.org/show_bug.cgi?id=2202

Signed-off-by: Abner Chang 

Cc: Hao A Wu 
Cc: Jian J Wang 
Cc: Leif Lindholm 
Cc: Gilbert Chen 
---
 MdeModulePkg/MdeModulePkg.dec | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 19935c8..6b40021 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -5,7 +5,7 @@
 #
 # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.
 # Copyright (c) 2016, Linaro Ltd. All rights reserved.
-# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+# (C) Copyright 2016 - 2019 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.
 # Copyright (c) 2016, Microsoft Corporation
 # SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -1792,7 +1792,7 @@
 
   ## SMBIOS version.
   # @Prompt SMBIOS version.
-  gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0302|UINT16|0x00010055
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0303|UINT16|0x00010055
 
   ## SMBIOS Docrev field in SMBIOS 3.0 (64-bit) Entry Point Structure.
   # @Prompt SMBIOS Docrev field in SMBIOS 3.0 (64-bit) Entry Point Structure.
-- 
2.7.4


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48552): https://edk2.groups.io/g/devel/message/48552
Mute This Topic: https://groups.io/mt/34440286/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 0/3] Update to support SmBios 3.3.0

2019-10-08 Thread Abner Chang
Codes changes for SMBIOS spec 3.3.0 (Already public on DMTF).

Bugzilla link,
https://bugzilla.tianocore.org/show_bug.cgi?id=2202

Abner Chang (3):
  MdeModulePkg: Update to support SmBios 3.3.0
  MdePkg/Include: Update to support SmBios 3.3.0
  ShellPkg/UefiShellDebug1CommandsLib: Update to support SmBios 3.3.0

 MdeModulePkg/MdeModulePkg.dec  |  4 +-
 MdePkg/Include/IndustryStandard/SmBios.h   | 76 +-
 .../SmbiosView/PrintInfo.c | 23 ++-
 .../SmbiosView/PrintInfo.h | 13 +++-
 .../SmbiosView/QueryTable.c| 63 +-
 .../UefiShellDebug1CommandsLib.uni |  3 +-
 6 files changed, 173 insertions(+), 9 deletions(-)

-- 
2.7.4


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48551): https://edk2.groups.io/g/devel/message/48551
Mute This Topic: https://groups.io/mt/34440285/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



[edk2-devel] [PATCH 2/3] MdePkg/Include: Update to support SmBios 3.3.0

2019-10-08 Thread Abner Chang
Update SmBios.h to support SMBIOS 3.3.0 spec.

Bugzilla link,
https://bugzilla.tianocore.org/show_bug.cgi?id=2202

Signed-off-by: Abner Chang 

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Leif Lindholm 
Cc: Gilbert Chen 
---
 MdePkg/Include/IndustryStandard/SmBios.h | 76 ++--
 1 file changed, 73 insertions(+), 3 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/SmBios.h 
b/MdePkg/Include/IndustryStandard/SmBios.h
index f3b6f18..f504cc8 100644
--- a/MdePkg/Include/IndustryStandard/SmBios.h
+++ b/MdePkg/Include/IndustryStandard/SmBios.h
@@ -1,8 +1,9 @@
 /** @file
-  Industry Standard Definitions of SMBIOS Table Specification v3.2.0.
+  Industry Standard Definitions of SMBIOS Table Specification v3.3.0.
 
 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
 (C) Copyright 2015-2017 Hewlett Packard Enterprise Development LP
+(C) Copyright 2015 - 2019 Hewlett Packard Enterprise Development LP
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -46,7 +47,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define SMBIOS_3_0_TABLE_MAX_LENGTH 0x
 
 //
-// SMBIOS type macros which is according to SMBIOS 2.7 specification.
+// SMBIOS type macros which is according to SMBIOS 3.3.0 specification.
 //
 #define SMBIOS_TYPE_BIOS_INFORMATION 0
 #define SMBIOS_TYPE_SYSTEM_INFORMATION   1
@@ -92,6 +93,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION 41
 #define SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE 42
 #define SMBIOS_TYPE_TPM_DEVICE   43
+#define SMBIOS_TYPE_PROCESSOR_ADDITIONAL_INFORMATION 44
 
 ///
 /// Inactive type is added from SMBIOS 2.2. Reference SMBIOS 2.6, chapter 
3.3.43.
@@ -727,7 +729,10 @@ typedef enum {
   ProcessorFamilyMII   = 0x012E,
   ProcessorFamilyWinChip   = 0x0140,
   ProcessorFamilyDSP   = 0x015E,
-  ProcessorFamilyVideoProcessor= 0x01F4
+  ProcessorFamilyVideoProcessor= 0x01F4,
+  ProcessorFamilyRiscvRV32 = 0x0200,
+  ProcessorFamilyRiscVRV64 = 0x0201,
+  ProcessorFamilyRiscVRV128= 0x0202
 } PROCESSOR_FAMILY2_DATA;
 
 ///
@@ -857,6 +862,19 @@ typedef struct {
 } PROCESSOR_FEATURE_FLAGS;
 
 typedef struct {
+  UINT32  ProcessorReserved1 :1;
+  UINT32  ProcessorUnknown   :1;
+  UINT32  Processor64BitCapble   :1;
+  UINT32  ProcessorMultiCore :1;
+  UINT32  ProcessorHardwareThread:1;
+  UINT32  ProcessorExecuteProtection :1;
+  UINT32  ProcessorEnhancedVirtulization :1;
+  UINT32  ProcessorPowerPerformanceCtrl  :1;
+  UINT32  Processor128bitCapble  :1;
+  UINT32  ProcessorReserved2 :7;
+} PROCESSOR_CHARACTERISTIC_FLAGS;
+
+typedef struct {
   PROCESSOR_SIGNATURE Signature;
   PROCESSOR_FEATURE_FLAGS FeatureFlags;
 } PROCESSOR_ID_DATA;
@@ -2508,6 +2526,57 @@ typedef struct {
   UINT8 InterfaceTypeSpecificData[4];   ///< This 
field has a minimum of four bytes
 } SMBIOS_TABLE_TYPE42;
 
+
+///
+/// Processor Specific Block - Processor Architecture Type
+///
+typedef enum{
+  ProcessorSpecificBlockArchTypeReserved   = 0x00,
+  ProcessorSpecificBlockArchTypeIa32   = 0x01,
+  ProcessorSpecificBlockArchTypeX64= 0x02,
+  ProcessorSpecificBlockArchTypeItanium= 0x03,
+  ProcessorSpecificBlockArchTypeAarch32= 0x04,
+  ProcessorSpecificBlockArchTypeAarch64= 0x05,
+  ProcessorSpecificBlockArchTypeRiscVRV32  = 0x06,
+  ProcessorSpecificBlockArchTypeRiscVRV64  = 0x07,
+  ProcessorSpecificBlockArchTypeRiscVRV128 = 0x08
+} PROCESSOR_SPECIFIC_BLOCK_ARCH_TYPE;
+
+///
+/// Processor Specific Block is the standard container of processor-specific 
data.
+///
+typedef struct {
+  UINT8  Length;
+  UINT8  ProcessorArchType;
+  ///
+  /// Below followed by Processor-specific data
+  ///
+  ///
+} PROCESSOR_SPECIFIC_BLOCK;
+
+///
+/// Processor Additional Information(Type 44).
+///
+/// The information in this structure defines the processor additional 
information in case
+/// SMBIOS type 4 is not sufficient to describe processor characteristics.
+/// The SMBIOS type 44 structure has a reference handle field to link back to 
the related
+/// SMBIOS type 4 structure. There may be multiple SMBIOS type 44 structures 
linked to the
+/// same SMBIOS type 4 structure. For example, when cores are not identical in 
a processor,
+/// SMBIOS type 44 structures describe different core-specific information.
+///
+/// SMBIOS type 44 defines the standard header for the processor-specific 
block, while the
+/// contents of processor-specific data are maintained by processor
+/// architecture workgroups or vendors in separate documents.
+///
+typedef struct {
+  SMBIOS_STRUCTURE  Hdr;
+  SMBIOS_HANDLE RefHandle; ///< 

Re: [edk2-devel] [edk2-platforms][PATCH V2 3/3] BoardModulePkg/FirmwareBootMediaInfoPei: Add module

2019-10-08 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: Kubacki, Michael A
> Sent: Saturday, October 5, 2019 1:29 AM
> To: devel@edk2.groups.io
> Cc: Dong, Eric ; Gao, Liming 
> Subject: [edk2-platforms][PATCH V2 3/3]
> BoardModulePkg/FirmwareBootMediaInfoPei: Add module
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2229
> 
> Adds a new module that is responsible for publishing the boot
> media device information that will be used in the boot flow for
> system initialization decisions dependent upon firmware boot
> media.
> 
> The module depends on a library class to implement the board-
> specific details to get the firmware boot media device. This
> allows the module to remain consistent in its responsibility
> across implementations and the details to be easily substituted.
> 
> Cc: Eric Dong 
> Cc: Liming Gao 
> Signed-off-by: Michael Kubacki 
> ---
>  Platform/Intel/BoardModulePkg/BoardModulePkg.dsc 
> |  3 +
> 
> Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMedi
> aInfoPei.inf | 46 
> 
> Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMedi
> aInfoPei.c   | 76 
>  3 files changed, 125 insertions(+)
> 
> diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> index 3d605cf876..5ec68ceebf 100644
> --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> @@ -31,9 +31,11 @@
>DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
>PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> +  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
> 
>  [LibraryClasses.common.PEIM]
> 
> FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFi
> rmwareBootMediaLib.inf
> +
> FirmwareBootMediaInfoLib|BoardModulePkg/Library/PeiFirmwareBootMediaI
> nfoLib/PeiFirmwareBootMediaInfoLib.inf
>HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
> 
> MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAll
> ocationLib.inf
> 
> @@ -73,6 +75,7 @@
> 
> ###
> 
> 
>  [Components]
> +  BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMediaInfoPei.inf
>BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf
> 
> BoardModulePkg/Library/PlatformCmosAccessLibNull/PlatformCmosAccessLib
> Null.inf
> 
> diff --git
> a/Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe
> diaInfoPei.inf
> b/Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe
> diaInfoPei.inf
> new file mode 100644
> index 00..a81932f2a1
> --- /dev/null
> +++
> b/Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe
> diaInfoPei.inf
> @@ -0,0 +1,46 @@
> +## @file
> +# Firmware Boot Media Info Module
> +#
> +# This module publishes firmware boot media device information used in the
> boot flow for system initialization
> +# decisions dependent upon the firmware boot media.
> +#
> +# This module depends upon a library instance to actually perform firmware
> boot media device detection since the
> +# detection mechanism will vary across systems. In many cases, the media
> type may simply be set to a single firmware
> +# boot media device with no run-time logic required. In any case, this module
> should dispatch as early as possible in
> +# the system boot flow so the firmware boot media information is available
> for other modules. If any dependencies are
> +# required to dynamically determine the firmware boot media device, those
> should be in the DEPEX section of the active
> +# FirmwareBootMediaInfoLib such that this module will dispatch once those
> dependencies are satisfied.
> +#
> +# Copyright (c) 2019, Intel Corporation. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION   = 0x00010017
> +  BASE_NAME = FirmwareBootMediaInfoPei
> +  FILE_GUID = A8F14FA9-FC88-45F4-A622-F06E6C56E632
> +  VERSION_STRING= 1.0
> +  MODULE_TYPE   = PEIM
> +  ENTRY_POINT   = FirmwareBootMediaInfoPeiEntry
> +
> +[LibraryClasses]
> +  BaseLib
> +  DebugLib
> +  FirmwareBootMediaLib
> +  FirmwareBootMediaInfoLib
> +  HobLib
> +  PeimEntryPoint
> +  PeiServicesLib
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  IntelSiliconPkg/IntelSiliconPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> +
> +[Sources]
> +  FirmwareBootMediaInfoPei.c
> +
> +[Depex]
> +  TRUE
> diff --git
> a/Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe
> diaInfoPei.c
> b/Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe
> diaInfoPei.c
> new file mode 100644
> index 00..7a71071053
> --- /dev/null
> +++
> b/Platform/Intel/BoardModulePkg/FirmwareBootMediaInfo/FirmwareBootMe
> 

Re: [edk2-devel] [edk2-platforms][PATCH V2 2/3] BoardModulePkg/FirmwareBootMediaInfoLib: Add library

2019-10-08 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: Kubacki, Michael A
> Sent: Saturday, October 5, 2019 1:29 AM
> To: devel@edk2.groups.io
> Cc: Dong, Eric ; Gao, Liming 
> Subject: [edk2-platforms][PATCH V2 2/3]
> BoardModulePkg/FirmwareBootMediaInfoLib: Add library
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2229
> 
> Introduces a new library class FirmwareBootMediaInfoLib that is
> used to report the firmware boot media device. A default library
> instance is provided that always returns the firmware boot media
> is SPI flash. For platforms with other firmware boot media
> options, a board-specific instance of this library should be
> used instead to provide the correct firmware boot media device
> information.
> 
> Cc: Eric Dong 
> Cc: Liming Gao 
> Signed-off-by: Michael Kubacki 
> ---
>  Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> |  3 ++
>  Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> |  3 ++
> 
> Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFir
> mwareBootMediaInfoLib.inf | 35 
>  Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLib.h
> | 26 +++
> 
> Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFir
> mwareBootMediaInfoLib.c   | 24 ++
>  5 files changed, 91 insertions(+)
> 
> diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> index 6f13945ca8..f96fb09aa1 100644
> --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> @@ -33,6 +33,9 @@
>##  @libraryclassProvide services to get BIOS ID information.
>BiosIdLib|Include/Library/BiosIdLib.h
> 
> +  ## @libraryclass Provides a service to determine the firmware boot 
> media
> device.
> +  FirmwareBootMediaInfoLib|Include/Library/FirmwareBootMediaInfoLib.h
> +
>  [Guids]
>## Include Include/Guid/BiosId.h
>gBiosIdGuid = { 0xC3E36D09, 0x8294, 0x4b97, { 0xA8, 0x57, 0xD5, 0x28, 0x8F,
> 0xE3, 0x3E, 0x28 } }
> diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> index 734ead9be8..3d605cf876 100644
> --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> @@ -33,6 +33,7 @@
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> 
>  [LibraryClasses.common.PEIM]
> +
> FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/PeiFi
> rmwareBootMediaLib.inf
>HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
> 
> MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAll
> ocationLib.inf
> 
> @@ -40,6 +41,7 @@
> 
> PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/Pei
> ServicesTablePointerLibIdt.inf
> 
>  [LibraryClasses.common.DXE_DRIVER]
> +
> FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Dxe
> SmmFirmwareBootMediaLib.inf
>HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> 
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory
> AllocationLib.inf
> 
> @@ -77,3 +79,4 @@
>BoardModulePkg/Library/BiosIdLib/DxeBiosIdLib.inf
>BoardModulePkg/Library/BiosIdLib/PeiBiosIdLib.inf
> 
> +
> BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFirmwareBootMe
> diaInfoLib.inf
> diff --git
> a/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi
> rmwareBootMediaInfoLib.inf
> b/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi
> rmwareBootMediaInfoLib.inf
> new file mode 100644
> index 00..637aeca2af
> --- /dev/null
> +++
> b/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi
> rmwareBootMediaInfoLib.inf
> @@ -0,0 +1,35 @@
> +## @file
> +# Firmware Boot Media Info Library
> +#
> +# This library identifies firmware boot media device information used in the
> boot flow for system initialization
> +# decisions dependent upon the firmware boot media.
> +#
> +# This library instance provides a default implementation of the
> FirmwareBootMediaInfoLib library class that always
> +# returns SPI flash as the boot media device. For any system firmware in
> which this is not the case, an instance
> +# of this library class should be provided that returns the correct boot 
> media
> for the platform.
> +#
> +# Copyright (c) 2019, Intel Corporation. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION  = 0x00010005
> +  BASE_NAME= PeiFirmwareBootMediaInfoLib
> +  FILE_GUID= 91CC29F5-AEAD-4108-9E91-C8DECDC1C654
> +  MODULE_TYPE  = PEIM
> +  VERSION_STRING   = 1.0
> +  LIBRARY_CLASS= FirmwareBootMediaInfoLib
> +
> +[Sources]
> +  PeiFirmwareBootMediaInfoLib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  IntelSiliconPkg/IntelSiliconPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> +
> 

Re: [edk2-devel] [edk2-platforms][PATCH V1 2/3] BoardModulePkg/FirmwareBootMediaInfoLib: Add library

2019-10-08 Thread Dong, Eric
Reviewed-by: Eric Dong 

> -Original Message-
> From: Kubacki, Michael A
> Sent: Tuesday, October 1, 2019 9:16 AM
> To: devel@edk2.groups.io
> Cc: Dong, Eric ; Gao, Liming 
> Subject: [edk2-platforms][PATCH V1 2/3]
> BoardModulePkg/FirmwareBootMediaInfoLib: Add library
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2229
> 
> Introduces a new library class FirmwareBootMediaInfoLib that is used to
> report the firmware boot media device. A default library instance is provided
> that always returns the firmware boot media is SPI flash. For platforms with
> other firmware boot media options, a board-specific instance of this library
> should be used instead to provide the correct firmware boot media device
> information.
> 
> Cc: Eric Dong 
> Cc: Liming Gao 
> Signed-off-by: Michael Kubacki 
> ---
>  Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> |  3 ++
>  Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> |  3 ++
> 
> Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFir
> mwareBootMediaInfoLib.inf | 35 
>  Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLib.h
> | 26 +++
> 
> Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFir
> mwareBootMediaInfoLib.c   | 24 ++
>  5 files changed, 91 insertions(+)
> 
> diff --git a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> index 6f13945ca8..c42f38c32a 100644
> --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dec
> @@ -33,6 +33,9 @@
>##  @libraryclassProvide services to get BIOS ID information.
>BiosIdLib|Include/Library/BiosIdLib.h
> 
> +  ## @libraryclass Provide a service to determine the firmware boot media
> device.
> +  FirmwareBootMediaInfoLib|Include/Library/FirmwareBootMediaInfoLib.h
> +
>  [Guids]
>## Include Include/Guid/BiosId.h
>gBiosIdGuid = { 0xC3E36D09, 0x8294, 0x4b97, { 0xA8, 0x57, 0xD5, 0x28, 0x8F,
> 0xE3, 0x3E, 0x28 } } diff --git
> a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> index 734ead9be8..78c09fbf82 100644
> --- a/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> +++ b/Platform/Intel/BoardModulePkg/BoardModulePkg.dsc
> @@ -33,6 +33,8 @@
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> 
>  [LibraryClasses.common.PEIM]
> +
> +
> FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Pei
> + FirmwareBootMediaLib.inf
> +
> FirmwareBootMediaInfoLib|BoardModulePkg/Library/PeiFirmwareBootMediaI
> n
> + foLib/PeiFirmwareBootMediaInfoLib.inf
>HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
> 
> MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAll
> ocationLib.inf
> 
> @@ -42,6 +44,7 @@
>  [LibraryClasses.common.DXE_DRIVER]
>HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> 
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemory
> AllocationLib.inf
> +
> +
> FirmwareBootMediaLib|IntelSiliconPkg/Library/PeiDxeSmmBootMediaLib/Dxe
> + SmmFirmwareBootMediaLib.inf
> 
>  [LibraryClasses.common.UEFI_DRIVER]
>HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
> diff --git
> a/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi
> rmwareBootMediaInfoLib.inf
> b/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/PeiFi
> rmwareBootMediaInfoLib.inf
> new file mode 100644
> index 00..637aeca2af
> --- /dev/null
> +++ b/Platform/Intel/BoardModulePkg/Library/PeiFirmwareBootMediaInfoLib/
> +++ PeiFirmwareBootMediaInfoLib.inf
> @@ -0,0 +1,35 @@
> +## @file
> +# Firmware Boot Media Info Library
> +#
> +# This library identifies firmware boot media device information used
> +in the boot flow for system initialization # decisions dependent upon the
> firmware boot media.
> +#
> +# This library instance provides a default implementation of the
> +FirmwareBootMediaInfoLib library class that always # returns SPI flash
> +as the boot media device. For any system firmware in which this is not the
> case, an instance # of this library class should be provided that returns the
> correct boot media for the platform.
> +#
> +# Copyright (c) 2019, Intel Corporation. All rights reserved. # #
> +SPDX-License-Identifier: BSD-2-Clause-Patent # ##
> +
> +[Defines]
> +  INF_VERSION  = 0x00010005
> +  BASE_NAME= PeiFirmwareBootMediaInfoLib
> +  FILE_GUID= 91CC29F5-AEAD-4108-9E91-C8DECDC1C654
> +  MODULE_TYPE  = PEIM
> +  VERSION_STRING   = 1.0
> +  LIBRARY_CLASS= FirmwareBootMediaInfoLib
> +
> +[Sources]
> +  PeiFirmwareBootMediaInfoLib.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  IntelSiliconPkg/IntelSiliconPkg.dec
> +  BoardModulePkg/BoardModulePkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> +  FirmwareBootMediaLib
> diff --git
> a/Platform/Intel/BoardModulePkg/Include/Library/FirmwareBootMediaInfoLib
> .h

Re: [edk2-devel] [PATCH v1 0/4] Support HTTPS HostName validation feature(CVE-2019-14553)

2019-10-08 Thread Wu, Jiaxin
Hi David,

I just realized you have the comments on Bugzilla 960: 

>"...given that testing is failing and code inspection shows it would never 
>have been expected to work."

Do you mean you didn't pass the verification if URLs with IPv6 literals 
(https://[2001:8b0:10b:1236::1]/)?  Can you also show me where the code 
inspection indicated it would never have been expected to work? We do pass the 
testing for the URLs with IPv6 if the CN or SAN in certificate has the 
corresponding IPv6 address (at least working with openssl 1.1.0). 

For the series patches here, we are intending to support the host name 
validation, I think we can commit the series patches since we pass the 
verification of IPV6 URL, what do you think?

Thanks,
Jiaxin

> -Original Message-
> From: David Woodhouse 
> Sent: Tuesday, October 1, 2019 5:02 PM
> To: Laszlo Ersek ; devel@edk2.groups.io; Wang, Jian J
> ; Wu, Jiaxin ; Bret Barkelew
> 
> Subject: Re: [edk2-devel] [PATCH v1 0/4] Support HTTPS HostName
> validation feature(CVE-2019-14553)
> 
> On Tue, 2019-10-01 at 01:21 +0200, Laszlo Ersek wrote:
> > On 09/29/19 08:09, Wang, Jian J wrote:
> > > For this patch series,
> > > 1. " Contributed-under: TianoCore Contribution Agreement 1.1" is not
> needed any more.
> > >   Remove it at push time and no need to send a v2.
> > > 2. Since it's security patch which had been reviewed separately, I see no
> reason for new r-b
> > >   required. Please raise it asap if any objections.
> > > 3. Acked-by: Jian J Wang 
> >
> >
> > * Can you please confirm that these patches match those that we
> > discussed here:
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=960#c18
> > https://bugzilla.tianocore.org/show_bug.cgi?id=960#c19
> >
> >
> > * In the BZ, David and Bret raised some questions:
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=960#c31
> > https://bugzilla.tianocore.org/show_bug.cgi?id=960#c32
> > https://bugzilla.tianocore.org/show_bug.cgi?id=960#c35
> > https://bugzilla.tianocore.org/show_bug.cgi?id=960#c36
> >
> > and
> >
> > https://bugzilla.tianocore.org/show_bug.cgi?id=960#c40
> >
> > The latest comment in the bug is c#41. I'm not under the impression that
> > all concerns raised by David and Bret have been addressed (or
> > abandoned). I'd like David and Bret to ACK the patches.
> 
> I do not believe my comment #35 has been addressed, nor the requested
> testing performed.

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48547): https://edk2.groups.io/g/devel/message/48547
Mute This Topic: https://groups.io/mt/34307578/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-



Re: [edk2-devel] [PATCH V2 1/9] MdeModulePkg/Variable: Consolidate common parsing functions

2019-10-08 Thread Wang, Jian J
Michael,

One comment below.

> -Original Message-
> From: Kubacki, Michael A 
> Sent: Saturday, September 28, 2019 9:47 AM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan ; Ard Biesheuvel
> ; Dong, Eric ; Laszlo Ersek
> ; Gao, Liming ; Kinney, Michael D
> ; Ni, Ray ; Wang, Jian J
> ; Wu, Hao A ; Yao, Jiewen
> 
> Subject: [PATCH V2 1/9] MdeModulePkg/Variable: Consolidate common parsing
> functions
> 
> This change moves the following functions into a dedicated file
> so they may be used in other variable files as needed. Furthermore,
> it reduces the overall size of the common Variable.c file.
> 
>  * DataSizeOfVariable ()
>  * FindVariableEx ()
>  * GetEndPointer ()
>  * GetNextVariablePtr ()
>  * GetStartPointer ()
>  * GetVariableDataOffset ()
>  * GetVariableDataPtr ()
>  * GetVariableHeaderSize ()
>  * GetVariableNamePtr ()
>  * GetVariableStoreStatus ()
>  * GetVendorGuidPtr ()
>  * IsValidVariableHeader ()
>  * NameSizeOfVariable ()
>  * SetDataSizeOfVariable ()
>  * SetNameSizeOfVariable ()
>  * UpdateVariableInfo ()
>  * VariableCompareTimeStampInternal ()
>  * VariableServiceGetNextVariableInternal ()
> 
> Cc: Dandan Bi 
> Cc: Ard Biesheuvel 
> Cc: Eric Dong 
> Cc: Laszlo Ersek 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Cc: Ray Ni 
> Cc: Jian J Wang 
> Cc: Hao A Wu 
> Cc: Jiewen Yao 
> Signed-off-by: Michael Kubacki 
> ---
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf   |   2
> +
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf  |   2 +
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf |
> 7 +
>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h   | 119 
> 
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h| 306
> 
>  MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c   | 726 
> +--
> 
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c  |   3 +-
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c| 731
> 
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c|   1 +
>  9 files changed, 1052 insertions(+), 845 deletions(-)
> 
> diff --git
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> index 641376c9c5..c35e5fe787 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> @@ -36,6 +36,8 @@
>Variable.c
>VariableDxe.c
>Variable.h
> +  VariableParsing.c
> +  VariableParsing.h
>PrivilegePolymorphic.h
>Measurement.c
>TcgMorLockDxe.c
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> index 0a160d269d..626738b9c7 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf
> @@ -45,6 +45,8 @@
>Variable.c
>VariableTraditionalMm.c
>VariableSmm.c
> +  VariableParsing.c
> +  VariableParsing.h
>VarCheck.c
>Variable.h
>PrivilegePolymorphic.h
> diff --git
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> index 21bc81163b..1ba8f9ebfb 100644
> ---
> a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> +++
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf
> @@ -45,6 +45,8 @@
>Variable.c
>VariableSmm.c
>VariableStandaloneMm.c
> +  VariableParsing.c
> +  VariableParsing.h
>VarCheck.c
>Variable.h
>PrivilegePolymorphic.h
> @@ -99,6 +101,11 @@
>## SOMETIMES_PRODUCES   ## Variable:L"Lang"
>gEfiGlobalVariableGuid
> 
> +  ## SOMETIMES_CONSUMES   ## Variable:L"db"
> +  ## SOMETIMES_CONSUMES   ## Variable:L"dbx"
> +  ## SOMETIMES_CONSUMES   ## Variable:L"dbt"
> +  gEfiImageSecurityDatabaseGuid

Why add the guid here? It's only consumed by Measurement.c, which is not 
included
in this inf file.

> +
>gEfiMemoryOverwriteControlDataGuid## SOMETIMES_CONSUMES   ##
> Variable:L"MemoryOverwriteRequestControl"
>gEfiMemoryOverwriteRequestControlLockGuid ## SOMETIMES_PRODUCES
> ## Variable:L"MemoryOverwriteRequestControlLock"
> 
> diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
> b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
> index 9eac43759f..fb574b2e32 100644
> --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
> +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.h
> @@ -179,89 +179,6 @@ FindVariable (
>IN  BOOLEAN IgnoreRtCheck
>);
> 
> -/**
> -
> -  Gets the pointer to the end of the variable storage area.
> -
> -  This function gets pointer to the end of the variable storage
> -  area, according to the input variable store header.
> -
> -  @param