Re: [edk2-devel] edk2/basetools python package build is failing.

2023-03-07 Thread Jain, Vikas
Hi All,

Did any one faced same issue earlier?
Can you please suggest a way to build python package for edk2 basetolls. I am 
working a small application which I can use to read the capsule file data using 
python package.
Below is the sample code which I want to use:

import efilib
import struct

def dump_hii_knobs(capsule_path):
with open(capsule_path, 'rb') as f:
data = f.read()

image = efilib.FirmwareVolume(data)

hii_handles = []
for section in image.get_sections():
if section.type == efilib.SECTION_GUID_DEFINED:
if section.guid == efilib.HII_DATABASE_GUID:
hii_handles.append(struct.unpack("https://github.com/tianocore/edk2-basetools
Steps to build:

  1.  Run pip install -e . (you might need do this from an admin prompt in 
windows)
  2.  Run edk2_build to make sure it works
Error Log:

[root@master-node edk2basetools]# edk2_build
Build environment: Linux-4.18.0-408.el8.x86_64-x86_64-with-glibc2.28
Build start time: 15:08:33, Mar.07 2023



edk2_build...
: error C0DE: Unknown fatal error when processing []

(Please send email to devel@edk2.groups.io for 
help, attaching following call stack trace!)

(Python 3.9.16 on linux) Traceback (most recent call last):
  File "/root/edk2-basetools/edk2-basetools/edk2basetools/build/build.py", line 
2648, in Main
CheckEnvVariable()
  File "/root/edk2-basetools/edk2-basetools/edk2basetools/build/build.py", line 
127, in CheckEnvVariable
os.environ["EDK_TOOLS_PATH"] = 
os.path.normcase(os.environ["EDK_TOOLS_PATH"])
  File "/usr/lib64/python3.9/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'EDK_TOOLS_PATH'


- Failed -
Build end time: 15:08:33, Mar.07 2023
Build total time: 00:00:00

[root@master-node edk2basetools]#

Thanks for looking into it.

Regards,
Vikas


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100831): https://edk2.groups.io/g/devel/message/100831
Mute This Topic: https://groups.io/mt/97455016/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] RedfishPkg/RedfishPlatformCredentialIpmiLib: IPMI implementation

2023-03-07 Thread Nickle Wang via groups.io
This library follows Redfish Host Interface specification and use IPMI
command to get bootstrap account credential(NetFn 2Ch, Command 02h)
from BMC. RedfishHostInterfaceDxe will use this credential for the
following communication between BIOS and BMC.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 .../RedfishPlatformCredentialIpmiLib.c| 443 ++
 .../RedfishPlatformCredentialIpmiLib.h|  86 
 .../RedfishPlatformCredentialIpmiLib.inf  |  42 ++
 RedfishPkg/RedfishPkg.dec |   7 +
 RedfishPkg/RedfishPkg.dsc |   2 +
 5 files changed, 580 insertions(+)
 create mode 100644 
RedfishPkg/Library/RedfishPlatformCredentialIpmi/RedfishPlatformCredentialIpmiLib.c
 create mode 100644 
RedfishPkg/Library/RedfishPlatformCredentialIpmi/RedfishPlatformCredentialIpmiLib.h
 create mode 100644 
RedfishPkg/Library/RedfishPlatformCredentialIpmi/RedfishPlatformCredentialIpmiLib.inf

diff --git 
a/RedfishPkg/Library/RedfishPlatformCredentialIpmi/RedfishPlatformCredentialIpmiLib.c
 
b/RedfishPkg/Library/RedfishPlatformCredentialIpmi/RedfishPlatformCredentialIpmiLib.c
new file mode 100644
index 00..2706b8508b
--- /dev/null
+++ 
b/RedfishPkg/Library/RedfishPlatformCredentialIpmi/RedfishPlatformCredentialIpmiLib.c
@@ -0,0 +1,443 @@
+/** @file
+  Implementation of getting bootstrap credential via IPMI.
+
+  Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Specification Reference:
+  - Redfish Host Interface Specification
+  
(https://www.dmtf.org/sites/default/files/standards/documents/DSP0270_1.3.0.pdf)
+**/
+
+#include "RedfishPlatformCredentialIpmiLib.h"
+
+//
+// Global flag of controlling credential service
+//
+BOOLEAN  mRedfishServiceStopped = FALSE;
+
+/**
+  Notify the Redfish service provide to stop provide configuration service to 
this platform.
+
+  This function should be called when the platform is about to leave the safe 
environment.
+  It will notify the Redfish service provider to abort all login session, and 
prohibit
+  further login with original auth info. GetAuthInfo() will return 
EFI_UNSUPPORTED once this
+  function is returned.
+
+  @param[in]   ThisPointer to 
EDKII_REDFISH_CREDENTIAL_PROTOCOL instance.
+  @param[in]   ServiceStopType Reason of stopping Redfish service.
+
+  @retval EFI_SUCCESS  Service has been stoped successfully.
+  @retval EFI_INVALID_PARAMETERThis is NULL.
+  @retval Others   Some error happened.
+
+**/
+EFI_STATUS
+EFIAPI
+LibStopRedfishService (
+  IN EDKII_REDFISH_CREDENTIAL_PROTOCOL   *This,
+  IN EDKII_REDFISH_CREDENTIAL_STOP_SERVICE_TYPE  ServiceStopType
+  )
+{
+  EFI_STATUS  Status;
+
+  if ((ServiceStopType <= ServiceStopTypeNone) || (ServiceStopType >= 
ServiceStopTypeMax)) {
+return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // Only stop credential service after leaving BIOS
+  //
+  if (ServiceStopType != ServiceStopTypeExitBootService) {
+return EFI_UNSUPPORTED;
+  }
+
+  //
+  // Raise flag first
+  //
+  mRedfishServiceStopped = TRUE;
+
+  //
+  // Notify BMC to disable credential bootstrapping support.
+  //
+  if (PcdGetBool (PcdRedfishDisableBootstrapCredentialService)) {
+Status = GetBootstrapAccountCredentials (TRUE, NULL, NULL);
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "%a: fail to disable bootstrap credential: %r\n", 
__FUNCTION__, Status));
+  return Status;
+}
+  }
+
+  //
+  // Delete cached variable
+  //
+  Status = SetBootstrapAccountCredentialsToVariable (NULL, NULL, TRUE);
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: fail to remove bootstrap credential: %r\n", 
__FUNCTION__, Status));
+  }
+
+  DEBUG ((DEBUG_INFO, "%a: bootstrap credential service stopped\n", 
__FUNCTION__));
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Notification of Exit Boot Service.
+
+  @param[in]  ThisPointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL.
+**/
+VOID
+EFIAPI
+LibCredentialExitBootServicesNotify (
+  IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This
+  )
+{
+  //
+  // Stop the credential support when system is about to enter OS.
+  //
+  LibStopRedfishService (This, ServiceStopTypeExitBootService);
+}
+
+/**
+  Notification of End of DXe.
+
+  @param[in]  ThisPointer to EDKII_REDFISH_CREDENTIAL_PROTOCOL.
+**/
+VOID
+EFIAPI
+LibCredentialEndOfDxeNotify (
+  IN  EDKII_REDFISH_CREDENTIAL_PROTOCOL  *This
+  )
+{
+  //
+  // Do nothing now.
+  // We can stop credential support when system reach end-of-dxe for security 
reason.
+  //
+}
+
+/**
+  Function to retrieve temporary user credentials for the UEFI redfish client. 
This function can
+  also disable bootstrap credential service in BMC.
+
+  @param[in]  DisableBootstrapControl
+  TRUE - Tell the BMC to disable the 
bootstrap credential
+  

Re: [edk2-devel] [PATCH] Platform/Loongson: Allow building with stack protector support

2023-03-07 Thread xianglai

Reviewed-by: Xianglai Li 

On 2023/3/5 下午12:40, WANG Xuerui wrote:

Some toolchains have stack protection enabled by default, so without the
appropriate library included the build will fail with missing symbols
during link.

Cc: Bibo Mao 
Cc: Xianglai li 
Cc: Chao Li 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Signed-off-by: WANG Xuerui 
---
  Platform/Loongson/LoongArchQemuPkg/Loongson.dsc | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc 
b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
index d1162519cd..465e9229a2 100644
--- a/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
+++ b/Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
@@ -95,6 +95,9 @@
TlsLib|CryptoPkg/Library/TlsLib/TlsLib.inf
  !endif
  
+  # For stack protector support

+  NULL | 
MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+
BaseLib  | MdePkg/Library/BaseLib/BaseLib.inf
SafeIntLib   | 
MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
TimeBaseLib  | 
EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100829): https://edk2.groups.io/g/devel/message/100829
Mute This Topic: https://groups.io/mt/97430342/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1] MinPlatformPkg: Update MinDsdt device name from PCI0 to MinDsdt_PC00

2023-03-07 Thread Isaac Oram
Pushed as 65e001a7f2..90ea518edf

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Tuesday, March 7, 2023 4:28 PM
To: Chiu, Chasel ; Chen, Aryeh ; 
devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Gao, Liming 
; Dong, Eric 
Subject: Re: [edk2-devel] [PATCH v1] MinPlatformPkg: Update MinDsdt device name 
from PCI0 to MinDsdt_PC00

Reviewed-by: Isaac Oram 

-Original Message-
From: Chiu, Chasel  
Sent: Wednesday, March 1, 2023 8:03 AM
To: Chen, Aryeh ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Oram, Isaac W 
; Gao, Liming ; Dong, Eric 

Subject: RE: [PATCH v1] MinPlatformPkg: Update MinDsdt device name from PCI0 to 
MinDsdt_PC00


Reviewed-by: Chasel Chiu 

Thanks,
Chasel


> -Original Message-
> From: Chen, Aryeh 
> Sent: Tuesday, February 28, 2023 10:37 PM
> To: devel@edk2.groups.io
> Cc: Chen, Aryeh ; Chiu, Chasel 
> ; Desimone, Nathaniel L 
> ; Oram, Isaac W 
> ; Gao, Liming ; 
> Dong, Eric 
> Subject: [PATCH v1] MinPlatformPkg: Update MinDsdt device name from 
> PCI0 to
> MinDsdt_PC00
> 
> From: Aryeh Chen 
> 
> Since AlderLake platform client project align Server project to use PC00.
> 
> Signed-off-by: Aryeh Chen 
> Cc: Chasel Chiu ,
> Cc: Nate DeSimone ,
> Cc: Isaac Oram ,
> Cc: Liming Gao ,
> Cc: Eric Dong 
> ---
>  Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> index 4efb8709ac..d84393d465 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> @@ -23,7 +23,7 @@ DefinitionBlock (
>
> //--- 
>   // Begin PCI
> tree object scope   
> //
> Device(PCI0) { // PCI Bridge "Host Bridge"+Device(PC00) { // PCI 
> Bridge
> "Host Bridge"   Name(_HID, EISAID("PNP0A08")) // Indicates PCI 
> Express/PCI-X
> Mode2 host hierarchy   Name(_CID, EISAID("PNP0A03")) // To support legacy
> OS that doesn't understand the new HID   Name(_SEG, 0)--
> 2.26.2.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100828): https://edk2.groups.io/g/devel/message/100828
Mute This Topic: https://groups.io/mt/97309232/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1] MinPlatformPkg: Update MinDsdt device name from PCI0 to MinDsdt_PC00

2023-03-07 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Chiu, Chasel  
Sent: Wednesday, March 1, 2023 8:03 AM
To: Chen, Aryeh ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Oram, Isaac W 
; Gao, Liming ; Dong, Eric 

Subject: RE: [PATCH v1] MinPlatformPkg: Update MinDsdt device name from PCI0 to 
MinDsdt_PC00


Reviewed-by: Chasel Chiu 

Thanks,
Chasel


> -Original Message-
> From: Chen, Aryeh 
> Sent: Tuesday, February 28, 2023 10:37 PM
> To: devel@edk2.groups.io
> Cc: Chen, Aryeh ; Chiu, Chasel 
> ; Desimone, Nathaniel L 
> ; Oram, Isaac W 
> ; Gao, Liming ; 
> Dong, Eric 
> Subject: [PATCH v1] MinPlatformPkg: Update MinDsdt device name from 
> PCI0 to
> MinDsdt_PC00
> 
> From: Aryeh Chen 
> 
> Since AlderLake platform client project align Server project to use PC00.
> 
> Signed-off-by: Aryeh Chen 
> Cc: Chasel Chiu ,
> Cc: Nate DeSimone ,
> Cc: Isaac Oram ,
> Cc: Liming Gao ,
> Cc: Eric Dong 
> ---
>  Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> index 4efb8709ac..d84393d465 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> @@ -23,7 +23,7 @@ DefinitionBlock (
>
> //--- 
>   // Begin PCI
> tree object scope   
> //
> Device(PCI0) { // PCI Bridge "Host Bridge"+Device(PC00) { // PCI 
> Bridge
> "Host Bridge"   Name(_HID, EISAID("PNP0A08")) // Indicates PCI 
> Express/PCI-X
> Mode2 host hierarchy   Name(_CID, EISAID("PNP0A03")) // To support legacy
> OS that doesn't understand the new HID   Name(_SEG, 0)--
> 2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100827): https://edk2.groups.io/g/devel/message/100827
Mute This Topic: https://groups.io/mt/97309232/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 V1 1/1] WhitleyOpenBoardPkg/DSC: Restore AdvancedFeatures

2023-03-07 Thread Isaac Oram
Include for building Advanced Features was mistakenly removed
in an earlier commit.

Cc: Nate DeSimone 
Cc: Chasel Chiu 
Signed-off-by: Isaac Oram 
---
 Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc 
b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
index c784df0144..9452867edb 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
@@ -59,6 +59,11 @@
 [PcdsFixedAtBuild]
   gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|1
 
+#
+# Include AdvancedFeatures
+#
+!include AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
+
   #
   # Platform On/Off features are defined here
   #
-- 
2.39.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100826): https://edk2.groups.io/g/devel/message/100826
Mute This Topic: https://groups.io/mt/97462761/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: Add IPMI KCS definitions

2023-03-07 Thread Isaac Oram
Acked-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Thursday, March 2, 2023 7:17 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D ; Gao, Liming 
; Liu, Zhiguang ; Nickle Wang 
; Igor Kulchytskyy ; Oram, Isaac W 
; Abdul Lateef Attar 
Subject: [edk2-devel] [PATCH V2] MdePkg/Include: Add IPMI KCS definitions

From: Abner Chang 

BZ #4354
This change adds definitions for IPMI KCS.

Spec ref:
https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
---
 MdePkg/MdePkg.dec |  5 ++
 MdePkg/Include/IndustryStandard/IpmiKcs.h | 77 +++
 2 files changed, 82 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 
3d08f20d15b..0ed033983bf 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -9,6 +9,7 @@
 # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP  # 
Copyright (c) 2022, Loongson Technology Corporation Limited. All rights 
reserved.  # Copyright (c) 2021 - 2022, Arm Limited. All rights 
reserved.
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2332,6 +2333,10 @@
   # @Prompt Memory Address of GuidedExtractHandler Table.
   
gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x100|UINT64|0x30001015
 
+  ## This value is the IPMI KCS Interface I/O base address used to transmit 
IPMI commands.
+  # @Prompt IPMI KCS Interface I/O Base Address
+  
+ gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress|0xca2|UINT16|0x0031
+
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## This value is used to set the base address of PCI express hierarchy.
   # @Prompt PCI Express Base Address.
diff --git a/MdePkg/Include/IndustryStandard/IpmiKcs.h 
b/MdePkg/Include/IndustryStandard/IpmiKcs.h
new file mode 100644
index 000..6533135dcde
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
@@ -0,0 +1,77 @@
+/** @file
+  IPMI KCS Register Definitions
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+ reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+  IPMI Specification
+  Version 2.0, Rev. 1.1
+  
+https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi
+-second-gen-interface-spec-v2-rev1-1.html
+**/
+
+#ifndef IPMI_KCS_H_
+#define IPMI_KCS_H_
+
+#define IPMI_KCS_STATUS_REGISTER_OFFSET1
+#define IPMI_KCS_COMMAND_REGISTER_OFFSET   1
+#define IPMI_KCS_DATA_OUT_REGISTER_OFFSET  0
+#define IPMI_KCS_DATA_IN_REGISTER_OFFSET   0
+
+///
+/// IPMI KCS Interface Status Bits
+///
+#define IPMI_KCS_OBF   BIT0
+#define IPMI_KCS_IBF   BIT1
+#define IPMI_KCS_SMS_ATN   BIT2
+#define IPMI_KCS_COMMAND_DATA  BIT3
+#define IPMI_KCS_OEM1  BIT4
+#define IPMI_KCS_OEM2  BIT5
+#define IPMI_KCS_S0BIT6
+#define IPMI_KCS_S1BIT7
+
+///
+/// IPMI KCS Interface Control Codes
+///
+#define IPMI_KCS_CONTROL_CODE_GET_STATUS_ABORT  0x60
+#define IPMI_KCS_CONTROL_CODE_WRITE_START   0x61
+#define IPMI_KCS_CONTROL_CODE_WRITE_END 0x62
+#define IPMI_KCS_CONTROL_CODE_READ  0x68
+
+///
+/// Status Codes
+///
+#define IPMI_KCS_STATUS_NO_ERROR  0x00
+#define IPMI_KCS_STATUS_ABORT 0x01
+#define IPMI_KCS_STATUS_ILLEGAL   0x02
+#define IPMI_KCS_STATUS_LENGTH_ERROR  0x06
+#define IPMI_KCS_STATUS_UNSPECIFIED   0xFF
+
+///
+/// KCS Interface State Bit
+///
+typedef enum {
+  IPMI_KCS_IDLE_STATE = 0,
+  IPMI_KCS_READ_STATE,
+  IPMI_KCS_WRITE_STATE,
+  IPMI_KCS_ERROR_STATE
+} IPMI_KCS_STATE;
+
+///
+/// IPMI KCS Interface Request Format
+///
+typedef struct {
+  UINT8NetFunc;
+  UINT8Command;
+  UINT8Data[0];
+} IPMI_KCS_RESQUEST_HEADER;
+
+///
+/// IPMI KCS Interface Response Format
+///
+typedef struct {
+  UINT8NetFunc;
+  UINT8Command;
+  UINT8CompletionCode;
+} IPMI_KCS_RESPONSE_HEADER;
+#endif
--
2.37.1.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100825): https://edk2.groups.io/g/devel/message/100825
Mute This Topic: https://groups.io/mt/97355098/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

2023-03-07 Thread Ni, Ray
Sure. I will.

> -Original Message-
> From: Kinney, Michael D 
> Sent: Wednesday, March 8, 2023 7:53 AM
> To: devel@edk2.groups.io; Ni, Ray ; Reyes, Darbin
> 
> Cc: Narey, Jacob ; Kinney, Michael D
> 
> Subject: RE: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe:
> Fix exception
> 
> Hi Ray,
> 
> It is in an error path.  My guess is that this error path has not been used
> since this bug was introduced.
> 
> Can you please merge this fix?
> 
> Mike
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Ni,
> Ray
> > Sent: Tuesday, March 7, 2023 3:24 PM
> > To: devel@edk2.groups.io; Reyes, Darbin 
> > Cc: Narey, Jacob 
> > Subject: Re: [edk2-devel] [PATCH]
> UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception
> >
> > Great fix.
> > I am wondering why this bug was not found earlier.
> > If Status is 0 (Success), #PF exception would occur when NULL pointer
> protection is turned on.
> > If Status is 0x8000_x (Error), #GP exception would occur because an
> address with only the BIT63 set is an
> > invalid address.
> >
> > Thanks,
> > Ray
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of
> Darbin
> > > Reyes
> > > Sent: Wednesday, March 8, 2023 7:04 AM
> > > To: devel@edk2.groups.io
> > > Cc: Reyes, Darbin ; Narey, Jacob
> > > 
> > > Subject: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe:
> Fix
> > > exception
> > >
> > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4360
> > >
> > > An incorrect format specifier is being used in a DEBUG print,
> > > specifically, a variable of type EFI_STATUS was being printed with
> > > the %a format specifier (pointer to an ASCII string), thus the value of
> > > the Status variable was being treated as the address of a string,
> > > leading to a CPU exception, when encountered this bug manifests itself
> > > as a hang near "Ready to Boot Event", with the last DEBUG print being
> > > "INFO: Got MicrocodePatchHob with microcode patches starting address"
> > > followed by a CPU Exception dump.
> > >
> > > Signed-off-by: Darbin Reyes 
> > > Reviewed-by: Jacob Narey 
> > > ---
> > >
> UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c |
> > > 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git
> > >
> a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> > >
> b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> > > index 762ca159ff..5fd3b3365c 100644
> > > ---
> > >
> a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> > > +++
> > >
> b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> > > @@ -238,7 +238,7 @@ MeasureMicrocodePatches (
> > > TotalMicrocodeSize)
> > >
> > >);
> > >
> > >} else {
> > >
> > > -DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed
> with
> > > status %a!\n", Status));
> > >
> > > +DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed
> with
> > > status %r!\n", Status));
> > >
> > >}
> > >
> > >
> > >
> > >FreePool (Offsets);
> > >
> > > --
> > > 2.38.1.windows.1
> > >
> > >
> > >
> > > -=-=-=-=-=-=
> > > Groups.io Links: You receive all messages sent to this group.
> > > View/Reply Online (#100818):
> > > https://edk2.groups.io/g/devel/message/100818
> > > Mute This Topic: https://groups.io/mt/97461560/1712937
> > > Group Owner: devel+ow...@edk2.groups.io
> > > Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray...@intel.com]
> > > -=-=-=-=-=-=
> > >
> >
> >
> >
> > 
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100824): https://edk2.groups.io/g/devel/message/100824
Mute This Topic: https://groups.io/mt/97461560/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH V2] MdePkg/Include: Add DMTF MCTP definitions

2023-03-07 Thread Isaac Oram
Acked-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Thursday, March 2, 2023 7:25 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D ; Gao, Liming 
; Liu, Zhiguang ; Nickle Wang 
; Igor Kulchytskyy ; Oram, Isaac W 
; Abdul Lateef Attar 
Subject: [edk2-devel] [PATCH V2] MdePkg/Include: Add DMTF MCTP definitions

From: Abner Chang 

BZ #4355
This change adds definitions for DMTF MCTP base specification.

Spec ref:
https://www.dmtf.org/sites/default/files/standards/documents/DSP0236_1.3.1.pdf

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
---
 MdePkg/Include/IndustryStandard/Mctp.h | 114 +
 1 file changed, 114 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/Mctp.h

diff --git a/MdePkg/Include/IndustryStandard/Mctp.h 
b/MdePkg/Include/IndustryStandard/Mctp.h
new file mode 100644
index 000..b71063a6502
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/Mctp.h
@@ -0,0 +1,114 @@
+/** @file
+
+  The definitions of DMTF Management Component Transport Protocol 
+ (MCTP)  Base Specification.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+ reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+  DMTF Management Component Transport Protocol (MCTP) Base 
+Specification
+  Version 1.3.1
+  
+https://www.dmtf.org/sites/default/files/standards/documents/DSP0236_1.
+3.1.pdf
+**/
+
+#ifndef MCTP_H_
+#define MCTP_H_
+
+///
+/// Definitions of endpoint ID
+///
+#define MCTP_NULL_DESTINATION_ENDPOINT_ID  0
+#define MCTP_NULL_SOURCE_ENDPOINT_ID   0
+#define MCTP_RESERVED_ENDPOINT_START_ID1
+#define MCTP_RESERVED_ENDPOINT_END_ID  7
+#define MCTP_BROADCAST_ENDPOINT_ID 0xFF
+
+// Minimum transmission size is 64 bytes.
+#define MCTP_BASELINE_MINIMUM_UNIT_TRANSMISSION_SIZE  0x40
+
+///
+/// The 32-bit Header of MCTP packet.
+///
+typedef union {
+  struct {
+UINT8Reserved  : 4; ///< Reserved for future definitions.
+UINT8HeaderVersion : 4; ///< The version of header.
+UINT8DestinationEndpointId : 8; ///< Destination endpoint Id (EID).
+UINT8SourceEndpointId  : 8; ///< Source endpoint Id (EID)
+UINT8StartOfMessage: 1; ///< Indicates the first packet of 
message.
+UINT8EndOfMessage  : 1; ///< Indicates the last packet of 
message.
+UINT8PacketSequence: 2; ///< Sequence number increments modulo 
4 on
+///< each packet.
+UINT8TagOwner  : 1; ///< Tag owner identifies the message 
was
+///< originated by the source EID or
+///< destination EID.
+UINT8MessageTag: 3; ///< Check the MCTP Base specification 
for the
+///< usages.
+  } Bits;
+  UINT32Header;
+} MCTP_HEADER;
+
+///
+/// MCTP Control Commands
+///
+#define   MCTP_CONTROL_RESERVED0x00
+#define   MCTP_CONTROL_SET_ENDPOINT_ID 0x01
+#define   MCTP_CONTROL_GET_ENDPOINT_ID 0x02
+#define   MCTP_CONTROL_GET_ENDPOINT_UUID   0x03
+#define   MCTP_CONTROL_GET_MCTP_VERSION_SUPPORT0x04
+#define   MCTP_CONTROL_GET_MESSAGE_TYPE_SUPPORT0x05
+#define   MCTP_CONTROL_GET_VENDOR_DEFINED_MESSAGE_SUPPORT  0x06
+#define   MCTP_CONTROL_RESOLVE_ENDPOINT_ID 0x07
+#define   MCTP_CONTROL_ALLOCATE_ENDPOINT_IDS   0x08
+#define   MCTP_CONTROL_ROUTING_INFORMATION_UPDATE  0x09
+#define   MCTP_CONTROL_GET_ROUTINE_TABLE_ENTRIES   0x0A
+#define   MCTP_CONTROL_PREPARE_FOR_ENDPOINT_DISCOVERY  0x0B
+#define   MCTP_CONTROL_ENDPOINT_DISCOVERY  0x0C
+#define   MCTP_CONTROL_DISCOVERY_NOTIFY0x0D
+#define   MCTP_CONTROL_GET_NETWORK_ID  0x0E
+#define   MCTP_CONTROL_QUERY_HOP   0x0F
+#define   MCTP_CONTROL_RESOLVE_UUID0x10
+#define   MCTP_CONTROL_QUERY_RATE_LIMIT0x11
+#define   MCTP_CONTROL_REQUEST_TX_RATE_LIMIT   0x12
+#define   MCTP_CONTROL_UPDATE_RATE_LIMIT   0x13
+#define   MCTP_CONTROL_QUERY_SUPPORTED_INTERFACES  0x14
+#define   MCTP_CONTROL_TRANSPORT_SPECIFIC_START0xF0
+#define   MCTP_CONTROL_TRANSPORT_SPECIFIC_END  0xFF
+
+///
+/// MCTP Control Message Completion Codes ///
+#define   MCTP_CONTROL_COMPLETION_CODES_SUCCESS 0x00
+#define   MCTP_CONTROL_COMPLETION_CODES_ERROR   0x01
+#define   MCTP_CONTROL_COMPLETION_CODES_ERROR_INVALID_DATA  0x02
+#define   MCTP_CONTROL_COMPLETION_CODES_ERROR_INVALID_LENGTH0x03
+#define   MCTP_CONTROL_COMPLET

Re: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

2023-03-07 Thread Michael D Kinney
Hi Ray,

It is in an error path.  My guess is that this error path has not been used
since this bug was introduced.

Can you please merge this fix?

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ni, Ray
> Sent: Tuesday, March 7, 2023 3:24 PM
> To: devel@edk2.groups.io; Reyes, Darbin 
> Cc: Narey, Jacob 
> Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix 
> exception
> 
> Great fix.
> I am wondering why this bug was not found earlier.
> If Status is 0 (Success), #PF exception would occur when NULL pointer 
> protection is turned on.
> If Status is 0x8000_x (Error), #GP exception would occur because an 
> address with only the BIT63 set is an
> invalid address.
> 
> Thanks,
> Ray
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Darbin
> > Reyes
> > Sent: Wednesday, March 8, 2023 7:04 AM
> > To: devel@edk2.groups.io
> > Cc: Reyes, Darbin ; Narey, Jacob
> > 
> > Subject: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix
> > exception
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4360
> >
> > An incorrect format specifier is being used in a DEBUG print,
> > specifically, a variable of type EFI_STATUS was being printed with
> > the %a format specifier (pointer to an ASCII string), thus the value of
> > the Status variable was being treated as the address of a string,
> > leading to a CPU exception, when encountered this bug manifests itself
> > as a hang near "Ready to Boot Event", with the last DEBUG print being
> > "INFO: Got MicrocodePatchHob with microcode patches starting address"
> > followed by a CPU Exception dump.
> >
> > Signed-off-by: Darbin Reyes 
> > Reviewed-by: Jacob Narey 
> > ---
> >  UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c |
> > 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git
> > a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> > b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> > index 762ca159ff..5fd3b3365c 100644
> > ---
> > a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> > +++
> > b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> > @@ -238,7 +238,7 @@ MeasureMicrocodePatches (
> > TotalMicrocodeSize)
> >
> >);
> >
> >} else {
> >
> > -DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with
> > status %a!\n", Status));
> >
> > +DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with
> > status %r!\n", Status));
> >
> >}
> >
> >
> >
> >FreePool (Offsets);
> >
> > --
> > 2.38.1.windows.1
> >
> >
> >
> > -=-=-=-=-=-=
> > Groups.io Links: You receive all messages sent to this group.
> > View/Reply Online (#100818):
> > https://edk2.groups.io/g/devel/message/100818
> > Mute This Topic: https://groups.io/mt/97461560/1712937
> > Group Owner: devel+ow...@edk2.groups.io
> > Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray...@intel.com]
> > -=-=-=-=-=-=
> >
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100822): https://edk2.groups.io/g/devel/message/100822
Mute This Topic: https://groups.io/mt/97461560/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel][edk2-platforms][PATCH V1 1/1] IpmiFeaturePkg/Build: Fix DSC organization issues

2023-03-07 Thread Isaac Oram
Move libraries from [Components] to [LibraryClasses]
Match build to library supported build types
Add missing SmmGenericIpmi.inf driver
Move common library include to package build as this feature
should not choose common libraries for board use

Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Isaac Oram 
---
 .../IpmiFeaturePkg/Include/IpmiFeature.dsc| 24 +++
 .../IpmiFeaturePkg/IpmiFeaturePkg.dsc |  1 +
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
index 237a4fc006..958ed1420d 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
@@ -31,20 +31,23 @@
 #
 

 
-!include MdePkg/MdeLibs.dsc.inc
-
 [LibraryClasses]
   IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 
   IpmiCommandLib|IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf
   
IpmiPlatformHookLib|IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf
 
-[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM]
+[LibraryClasses.common.PEI_CORE, LibraryClasses.common.PEIM]
   IpmiBaseLib|IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf
 
-[LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.UEFI_DRIVER]
+[LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.DXE_RUNTIME_DRIVER, 
LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION]
   IpmiBaseLib|IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf
 
+[LibraryClasses.common.SMM_CORE, LibraryClasses.common.DXE_SMM_DRIVER]
+  IpmiBaseLib|IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf
+
+
+
 

 #
 # Component section - list of all components that need built for this feature.
@@ -70,11 +73,6 @@
   # IPMI Feature Package
   #
 
-  # Add library instances here that are not included in package components and 
should be tested
-  # in the package build.
-
-  IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf
-
   #
   # Add components here that should be included in the package build.
   #
@@ -93,16 +91,10 @@
   # IPMI Feature Package
   #
 
-  # Add library instances here that are not included in package components and 
should be tested
-  # in the package build.
-
-  IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf
-
   #
   # Add components here that should be included in the package build.
   #
   IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf
-  IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf
   IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf
   IpmiFeaturePkg/BmcElog/BmcElog.inf
   IpmiFeaturePkg/Frb/FrbDxe.inf
@@ -110,3 +102,5 @@
   IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf
   IpmiFeaturePkg/OsWdt/OsWdt.inf
   IpmiFeaturePkg/SolStatus/SolStatus.inf
+
+  IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf
diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc
index 76d2c45a73..cee7c7e065 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc
@@ -38,6 +38,7 @@
 #
 # Include common libraries
 #
+!include MdePkg/MdeLibs.dsc.inc
 !include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
 !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
 !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
-- 
2.39.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100821): https://edk2.groups.io/g/devel/message/100821
Mute This Topic: https://groups.io/mt/97462248/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

2023-03-07 Thread Ni, Ray
Great fix.
I am wondering why this bug was not found earlier.
If Status is 0 (Success), #PF exception would occur when NULL pointer 
protection is turned on.
If Status is 0x8000_x (Error), #GP exception would occur because an address 
with only the BIT63 set is an invalid address.

Thanks,
Ray

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Darbin
> Reyes
> Sent: Wednesday, March 8, 2023 7:04 AM
> To: devel@edk2.groups.io
> Cc: Reyes, Darbin ; Narey, Jacob
> 
> Subject: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix
> exception
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4360
> 
> An incorrect format specifier is being used in a DEBUG print,
> specifically, a variable of type EFI_STATUS was being printed with
> the %a format specifier (pointer to an ASCII string), thus the value of
> the Status variable was being treated as the address of a string,
> leading to a CPU exception, when encountered this bug manifests itself
> as a hang near "Ready to Boot Event", with the last DEBUG print being
> "INFO: Got MicrocodePatchHob with microcode patches starting address"
> followed by a CPU Exception dump.
> 
> Signed-off-by: Darbin Reyes 
> Reviewed-by: Jacob Narey 
> ---
>  UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c |
> 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> index 762ca159ff..5fd3b3365c 100644
> ---
> a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> +++
> b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> @@ -238,7 +238,7 @@ MeasureMicrocodePatches (
> TotalMicrocodeSize)
> 
>);
> 
>} else {
> 
> -DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with
> status %a!\n", Status));
> 
> +DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with
> status %r!\n", Status));
> 
>}
> 
> 
> 
>FreePool (Offsets);
> 
> --
> 2.38.1.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#100818):
> https://edk2.groups.io/g/devel/message/100818
> Mute This Topic: https://groups.io/mt/97461560/1712937
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [ray...@intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100820): https://edk2.groups.io/g/devel/message/100820
Mute This Topic: https://groups.io/mt/97461560/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

2023-03-07 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 



> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Darbin Reyes
> Sent: Tuesday, March 7, 2023 3:04 PM
> To: devel@edk2.groups.io
> Cc: Reyes, Darbin ; Narey, Jacob 
> 
> Subject: [edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix 
> exception
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4360
> 
> An incorrect format specifier is being used in a DEBUG print,
> specifically, a variable of type EFI_STATUS was being printed with
> the %a format specifier (pointer to an ASCII string), thus the value of
> the Status variable was being treated as the address of a string,
> leading to a CPU exception, when encountered this bug manifests itself
> as a hang near "Ready to Boot Event", with the last DEBUG print being
> "INFO: Got MicrocodePatchHob with microcode patches starting address"
> followed by a CPU Exception dump.
> 
> Signed-off-by: Darbin Reyes 
> Reviewed-by: Jacob Narey 
> ---
>  UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> index 762ca159ff..5fd3b3365c 100644
> --- a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> +++ b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
> @@ -238,7 +238,7 @@ MeasureMicrocodePatches (
> TotalMicrocodeSize)
> 
>);
> 
>} else {
> 
> -DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with status 
> %a!\n", Status));
> 
> +DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with status 
> %r!\n", Status));
> 
>}
> 
> 
> 
>FreePool (Offsets);
> 
> --
> 2.38.1.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#100818): https://edk2.groups.io/g/devel/message/100818
> Mute This Topic: https://groups.io/mt/97461560/1643496
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [michael.d.kin...@intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100819): https://edk2.groups.io/g/devel/message/100819
Mute This Topic: https://groups.io/mt/97461560/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] UefiCpuPkg/MicrocodeMeasurementDxe: Fix exception

2023-03-07 Thread Darbin Reyes
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4360

An incorrect format specifier is being used in a DEBUG print,
specifically, a variable of type EFI_STATUS was being printed with
the %a format specifier (pointer to an ASCII string), thus the value of
the Status variable was being treated as the address of a string,
leading to a CPU exception, when encountered this bug manifests itself
as a hang near "Ready to Boot Event", with the last DEBUG print being
"INFO: Got MicrocodePatchHob with microcode patches starting address"
followed by a CPU Exception dump.

Signed-off-by: Darbin Reyes 
Reviewed-by: Jacob Narey 
---
 UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c 
b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
index 762ca159ff..5fd3b3365c 100644
--- a/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
+++ b/UefiCpuPkg/MicrocodeMeasurementDxe/MicrocodeMeasurementDxe.c
@@ -238,7 +238,7 @@ MeasureMicrocodePatches (
TotalMicrocodeSize)
   );
   } else {
-DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with status 
%a!\n", Status));
+DEBUG ((DEBUG_ERROR, "ERROR: TpmMeasureAndLogData failed with status 
%r!\n", Status));
   }
 
   FreePool (Offsets);
-- 
2.38.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100818): https://edk2.groups.io/g/devel/message/100818
Mute This Topic: https://groups.io/mt/97461560/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH edk2-platforms 3/3] IpmiFeaturePkg: refine GetSelfTest function

2023-03-07 Thread Isaac Oram
Coding convention does not allow Hungarian notation, 
https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/v/release-2.20/4_naming_conventions/43_identifiers#4.3.3-hungarian-prefixes
Please change pSelfTestResult to SelfTestResult.

Thanks,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Mike Maslenkin
Sent: Monday, February 27, 2023 3:28 PM
To: devel@edk2.groups.io
Cc: Mike Maslenkin ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: [edk2-devel] [PATCH edk2-platforms 3/3] IpmiFeaturePkg: refine 
GetSelfTest function

Use predefined type while accessing IPMI command returned data instead of raw 
byte array.

Signed-off-by: Mike Maslenkin 
---
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
index 8a0c596a6434..1db47e28c54e 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/
+++ IpmiInit.c
@@ -86,6 +86,8 @@ Returns:
   BOOLEAN bResultFlag = FALSE;   UINT8   TempData[MAX_TEMP_DATA]; +  
IPMI_SELF_TEST_RESULT_RESPONSE *pSelfTestResult;+   //   // Get the SELF TEST 
Results.   //@@ -100,7 +102,8 @@ Returns:
DataSize = sizeof (TempData); -  TempData[1] = 0;+  pSelfTestResult = 
(IPMI_SELF_TEST_RESULT_RESPONSE*)&TempData[0];+  
pSelfTestResult->CompletionCode = 0;do { Status = IpmiSendCommand (@@ 
-114,7 +117,7 @@ Returns:
&DataSize); if (Status == EFI_SUCCESS) {-   
   switch (TempData[1]) {+  switch (pSelfTestResult->Result) { case 
IPMI_APP_SELFTEST_NO_ERROR: case IPMI_APP_SELFTEST_NOT_IMPLEMENTED: 
case IPMI_APP_SELFTEST_ERROR:@@ -147,7 +150,7 @@ Returns:
 IpmiInstance->BmcStatus = BMC_HARDFAIL; return Status;   } else {-
DEBUG ((DEBUG_INFO, "[IPMI] BMC self-test result: %02X-%02X\n", TempData[1], 
TempData[2]));+DEBUG ((DEBUG_INFO, "[IPMI] BMC self-test result: 
%02X-%02X\n", pSelfTestResult->Result, pSelfTestResult->Param)); // // 
Copy the Self test results to Error Status.  Data will be copied as long as it  
   // does not exceed the size of the ErrorStatus variable.@@ -162,7 +165,7 @@ 
Returns:
 // Check the IPMI defined self test results. // Additional Cases are 
device specific test results. //-switch (TempData[1]) {+switch 
(pSelfTestResult->Result) {   case IPMI_APP_SELFTEST_NO_ERROR:   case 
IPMI_APP_SELFTEST_NOT_IMPLEMENTED: IpmiInstance->BmcStatus = BMC_OK;@@ 
-174,7 +177,7 @@ Returns:
 // BootBlock Firmware corruption, and Operational Firmware Corruption. 
 All // other errors are BMC soft failures. //-if 
((TempData[2] & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) 
{+if ((pSelfTestResult->Param & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) { 
  IpmiInstance->BmcStatus = BMC_HARDFAIL; } else {   
IpmiInstance->BmcStatus = BMC_SOFTFAIL;@@ -182,7 +185,7 @@ Returns:
 // // Check if SDR repository is empty and report it if it is. 
//-if ((TempData[2] & IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) 
!= 0) {+if ((pSelfTestResult->Param & 
IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) != 0) {   if (*ErrorCount < 
MAX_SOFT_COUNT) { StatusCodeValue[*ErrorCount] = 
EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | CU_FP_EC_SDR_EMPTY; 
(*ErrorCount)++;-- 
2.35.3



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100527): https://edk2.groups.io/g/devel/message/100527
Mute This Topic: https://groups.io/mt/97279450/1492418
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [isaac.w.o...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100817): https://edk2.groups.io/g/devel/message/100817
Mute This Topic: https://groups.io/mt/97279450/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH edk2-platforms 2/3] IpmiFeaturePkg: remove buffer temporary buffer from BMC instance structure

2023-03-07 Thread Isaac Oram
Mike,

Thanks for the fixes.  There is one more instance using TempData in 
SmmGenericIpmi.c.  Could you please fix that as well?  I noted that it isn't 
currently built/included by the IpmiFeaturePkg.dsc.  I will fix that.

Also, please add maintainers and reviewers for the package to commit messages, 
e.g.:
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 

Regards,
Isaac

-Original Message-
From: Mike Maslenkin  
Sent: Monday, February 27, 2023 3:28 PM
To: devel@edk2.groups.io
Cc: Mike Maslenkin ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: [PATCH edk2-platforms 2/3] IpmiFeaturePkg: remove buffer temporary 
buffer from BMC instance structure

There is no point to have temporary buffer in BMC instance data used only for 
synchronous IPMI command as a transfer buffer.
Using local variables make things much simpler.

Signed-off-by: Mike Maslenkin 
---
 .../GenericIpmi/Common/IpmiBmc.c  |  5 ++-
 .../GenericIpmi/Common/IpmiBmcCommon.h|  1 -
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 39 ++-
 .../GenericIpmi/Pei/PeiGenericIpmi.c  | 11 +++---
 .../GenericIpmi/Pei/PeiIpmiBmc.c  |  5 ++-
 .../GenericIpmi/Pei/PeiIpmiBmcDef.h   |  1 -
 6 files changed, 33 insertions(+), 29 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.c
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.c
index 03b8174e3786..a6be2f46e84e 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Comm
+++ on/IpmiBmc.c
@@ -101,6 +101,7 @@ Returns:
   IPMI_RESPONSE   *IpmiResponse;   UINT8   RetryCnt = 
IPMI_SEND_COMMAND_MAX_RETRY;   UINT8   Index;+  UINT8   
TempData[MAX_TEMP_DATA];IpmiInstance = 
INSTANCE_FROM_SM_IPMI_BMC_THIS (This); @@ -110,8 +111,8 @@ Returns:
 // response data.  Since the command format is different from the response 
// format, the buffer is cast to both structure definitions. //-
IpmiCommand  = (IPMI_COMMAND*)  IpmiInstance->TempData;-IpmiResponse = 
(IPMI_RESPONSE*) IpmiInstance->TempData;+IpmiCommand  = (IPMI_COMMAND*)  
TempData;+IpmiResponse = (IPMI_RESPONSE*) TempData;  // // Send 
IPMI command to BMCdiff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
index 1e5dfd81f1fb..06eab62aaec9 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Comm
+++ on/IpmiBmcCommon.h
@@ -50,7 +50,6 @@ typedef struct {
   UINTN   Signature;   UINT64  KcsTimeoutPeriod;   
UINT8   SlaveAddress;-  UINT8   
TempData[MAX_TEMP_DATA];   BMC_STATUS  BmcStatus;   UINT64  
ErrorStatus;   UINT8   SoftErrorCount;diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
index aeaefaad642e..8a0c596a6434 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/
+++ IpmiInit.c
@@ -84,6 +84,7 @@ Returns:
   UINT8   *TempPtr;   UINT32  Retries;   BOOLEAN bResultFlag = 
FALSE;+  UINT8   TempData[MAX_TEMP_DATA];//   // Get the SELF TEST 
Results.@@ -97,9 +98,9 @@ Returns:
 Retries = PcdGet8 (PcdIpmiBmcReadyDelayTimer);   } -  DataSize = sizeof 
(IpmiInstance->TempData);+  DataSize = sizeof (TempData); -  
IpmiInstance->TempData[1] = 0;+  TempData[1] = 0;do { Status = 
IpmiSendCommand (@@ -109,11 +110,11 @@ Returns:
IPMI_APP_GET_SELFTEST_RESULTS,NULL, 
   0,-   IpmiInstance->TempData,+   TempData,   
 &DataSize); if (Status == EFI_SUCCESS) {-  switch 
(IpmiInstance->TempData[1]) {+  switch (TempData[1]) { case 
IPMI_APP_SELFTEST_NO_ERROR: case IPMI_APP_SELFTEST_NOT_IMPLEMENTED: 
case IPMI_APP_SELFTEST_ERROR:@@ -146,7 +147,7 @@ Returns:
 IpmiInstance->BmcStatus = BMC_HARDFAIL; return Status;   } else {-
DEBUG ((EFI_D_INFO, "[IPMI] BMC self-test result: %02X-%02X\n", 
IpmiInstance->TempData[1], IpmiInstance->TempData[2]));+DEBUG ((DEBUG_INFO, 
"[IPMI] BMC self-test result: %02X-%02X\n", TempData[1], TempData[2])); //  
   // Copy the Self test results to Error Status.  Data will be copied as long 
as it // does not exceed the size of the ErrorStatus variable.@@ -155,13 
+156,13 @@ Returns:
  (Index < DataSize) && (Index < sizeof (IpmiInstance->ErrorStatus)

Re: [edk2-devel] PATCH v1 1/1 MdePkg: Remove Itanium leftover data structure

2023-03-07 Thread Michael D Kinney
Hi Pawel,

Can you please also reference the following BZ and commit in the commit message

https://bugzilla.tianocore.org/show_bug.cgi?id=1560
https://github.com/tianocore/edk2/commit/4e1daa60f5372c22a11503961061ffa569eaf873

If you post a branch with these small updates and my Rb and send it
through EDK II CI, I can do the push from there.

Thanks,

Mike

> -Original Message-
> From: Kinney, Michael D 
> Sent: Tuesday, March 7, 2023 1:59 PM
> To: Paweł Poławski ; devel@edk2.groups.io
> Cc: Gao, Liming ; Liu, Zhiguang 
> ; Zimmer, Vincent
> ; Kinney, Michael D 
> Subject: RE: [edk2-devel] PATCH v1 1/1 MdePkg: Remove Itanium leftover data 
> structure
> 
> Hi Pawel,
> 
> With suggestion from Vincent, let's remove ItaniumHealthFlags.
> 
> https://edk2.groups.io/g/devel/message/100812
> 
> I recommend adding a note in the comment block for the
> EFI_SEC_PLATFORM_INFORMATION_RECORD that with the removal of the
> ItaniumHealthFlags, this union has diverged from the PI
> Specification definition.
> 
> With that one comment addition:
> 
> Reviewed-by: Michael D Kinney 
> 
> Mike
> 
> 
> > -Original Message-
> > From: Paweł Poławski 
> > Sent: Thursday, December 1, 2022 7:36 AM
> > To: devel@edk2.groups.io
> > Cc: Kinney, Michael D ; Gao, Liming 
> > ; Liu, Zhiguang
> > 
> > Subject: [edk2-devel] PATCH v1 1/1 MdePkg: Remove Itanium leftover data 
> > structure
> >
> > Itanium support has been removed from EDK2 aroun 2019.
> > ITANIUM_HANDOFF_STATUS data structure looks to be
> > some leftover from that process.
> >
> > There is also positive sidefect of this data structure removal.
> > Due to HOB allocation type used in PEI stage there is a limit
> > how much data about virtual CPU can be hold. This limit result
> > in only 1024 vCPU can be used by VM.
> > With Itanium related data structure removed more allocated space
> > can be used for vCPU data and with current allocation limit
> > will change from 1024 to around 8k vCPUs.
> >
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> > Cc: Zhiguang Liu 
> >
> > Signed-off-by: Paweł Poławski 
> > ---
> >  MdePkg/Include/Ppi/SecPlatformInformation.h | 44 
> >  1 file changed, 44 deletions(-)
> >
> > diff --git a/MdePkg/Include/Ppi/SecPlatformInformation.h 
> > b/MdePkg/Include/Ppi/SecPlatformInformation.h
> > index 02b0711f189e..fbcd205acd96 100644
> > --- a/MdePkg/Include/Ppi/SecPlatformInformation.h
> > +++ b/MdePkg/Include/Ppi/SecPlatformInformation.h
> > @@ -84,49 +84,6 @@ typedef union {
> >
> >  typedef EFI_HEALTH_FLAGS X64_HANDOFF_STATUS;
> >  typedef EFI_HEALTH_FLAGS IA32_HANDOFF_STATUS;
> > -///
> > -/// The hand-off status structure for Itanium architecture.
> > -///
> > -typedef struct {
> > -  ///
> > -  /// SALE_ENTRY state : 3 = Recovery_Check
> > -  /// and 0 = RESET or Normal_Boot phase.
> > -  ///
> > -  UINT8 BootPhase;
> > -  ///
> > -  /// Firmware status on entry to SALE.
> > -  ///
> > -  UINT8 FWStatus;
> > -  UINT16Reserved1;
> > -  UINT32Reserved2;
> > -  ///
> > -  /// Geographically significant unique processor ID assigned by PAL.
> > -  ///
> > -  UINT16ProcId;
> > -  UINT16Reserved3;
> > -  UINT8 IdMask;
> > -  UINT8 EidMask;
> > -  UINT16Reserved4;
> > -  ///
> > -  /// Address to make PAL calls.
> > -  ///
> > -  UINT64PalCallAddress;
> > -  ///
> > -  /// If the entry state is RECOVERY_CHECK, this contains the PAL_RESET
> > -  /// return address, and if entry state is RESET, this contains
> > -  /// address for PAL_authentication call.
> > -  ///
> > -  UINT64PalSpecialAddress;
> > -  ///
> > -  /// GR35 from PALE_EXIT state.
> > -  ///
> > -  UINT64SelfTestStatus;
> > -  ///
> > -  /// GR37 from PALE_EXIT state.
> > -  ///
> > -  UINT64SelfTestControl;
> > -  UINT64MemoryBufferRequired;
> > -} ITANIUM_HANDOFF_STATUS;
> >
> >  ///
> >  /// EFI_SEC_PLATFORM_INFORMATION_RECORD.
> > @@ -134,7 +91,6 @@ typedef struct {
> >  typedef union {
> >IA32_HANDOFF_STATUS   IA32HealthFlags;
> >X64_HANDOFF_STATUSx64HealthFlags;
> > -  ITANIUM_HANDOFF_STATUSItaniumHealthFlags;
> >  } EFI_SEC_PLATFORM_INFORMATION_RECORD;
> >
> >  /**
> > --
> > 2.38.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100815): https://edk2.groups.io/g/devel/message/100815
Mute This Topic: https://groups.io/mt/95384808/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH edk2-platforms 1/3] IpmiFeaturePkg: fix IPMI GetSelfTest command response parsing

2023-03-07 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Mike Maslenkin  
Sent: Monday, February 27, 2023 3:28 PM
To: devel@edk2.groups.io
Cc: Mike Maslenkin ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: [PATCH edk2-platforms 1/3] IpmiFeaturePkg: fix IPMI GetSelfTest 
command response parsing

Byte 0 of a response contains completion code for the command.
So, the examined data starts from byte 1. It's easy to make a mistake here 
since specification counts response data from 1.

For the "Get Self Test Results" command Intelligent Platform Management 
Interface Specification v2.0 rev 1.1 paragraph 20.4 defines response as:
+-+---+
|byte | data field|
+-+---+
| 1   | Completion Code   |
| |   |
| 2   | 55h =  No error. All Self Tests Passed.   |
| | 56h = Self Test function not implemented in this controller.  |
| | 57h = Corrupted or inaccessible data or devices   |
| | 58h = Fatal hardware error|
| |   |
| 3   | For byte 2 = 55h, 56h, FFh: 00h   |
| | For byte 2 = 58h, all other: Device-specific  |
| | For byte 2 = 57h: self-test error bitfield.   |
+-+---+

Signed-off-by: Mike Maslenkin 
---
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
index d788b4886723..aeaefaad642e 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/
+++ IpmiInit.c
@@ -161,7 +161,7 @@ Returns:
 // Check the IPMI defined self test results. // Additional Cases are 
device specific test results. //-switch (IpmiInstance->TempData[0]) {+  
  switch (IpmiInstance->TempData[1]) {   case IPMI_APP_SELFTEST_NO_ERROR:   
case IPMI_APP_SELFTEST_NOT_IMPLEMENTED: IpmiInstance->BmcStatus = 
BMC_OK;@@ -173,7 +173,7 @@ Returns:
 // BootBlock Firmware corruption, and Operational Firmware Corruption. 
 All // other errors are BMC soft failures. //-if 
((IpmiInstance->TempData[1] & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) 
{+if ((IpmiInstance->TempData[2] & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) { 
  IpmiInstance->BmcStatus = BMC_HARDFAIL; } else {   
IpmiInstance->BmcStatus = BMC_SOFTFAIL;@@ -181,7 +181,7 @@ Returns:
 // // Check if SDR repository is empty and report it if it is. 
//-if ((IpmiInstance->TempData[1] & 
IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) != 0) {+if 
((IpmiInstance->TempData[2] & IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) != 0) {   
if (*ErrorCount < MAX_SOFT_COUNT) { 
StatusCodeValue[*ErrorCount] = EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | 
CU_FP_EC_SDR_EMPTY; (*ErrorCount)++;-- 
2.35.3



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100814): https://edk2.groups.io/g/devel/message/100814
Mute This Topic: https://groups.io/mt/97279448/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] PATCH v1 1/1 MdePkg: Remove Itanium leftover data structure

2023-03-07 Thread Michael D Kinney
Hi Pawel,

With suggestion from Vincent, let's remove ItaniumHealthFlags.

https://edk2.groups.io/g/devel/message/100812

I recommend adding a note in the comment block for the 
EFI_SEC_PLATFORM_INFORMATION_RECORD that with the removal of the 
ItaniumHealthFlags, this union has diverged from the PI
Specification definition.

With that one comment addition:

Reviewed-by: Michael D Kinney 

Mike


> -Original Message-
> From: Paweł Poławski 
> Sent: Thursday, December 1, 2022 7:36 AM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D ; Gao, Liming 
> ; Liu, Zhiguang
> 
> Subject: [edk2-devel] PATCH v1 1/1 MdePkg: Remove Itanium leftover data 
> structure
> 
> Itanium support has been removed from EDK2 aroun 2019.
> ITANIUM_HANDOFF_STATUS data structure looks to be
> some leftover from that process.
> 
> There is also positive sidefect of this data structure removal.
> Due to HOB allocation type used in PEI stage there is a limit
> how much data about virtual CPU can be hold. This limit result
> in only 1024 vCPU can be used by VM.
> With Itanium related data structure removed more allocated space
> can be used for vCPU data and with current allocation limit
> will change from 1024 to around 8k vCPUs.
> 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> 
> Signed-off-by: Paweł Poławski 
> ---
>  MdePkg/Include/Ppi/SecPlatformInformation.h | 44 
>  1 file changed, 44 deletions(-)
> 
> diff --git a/MdePkg/Include/Ppi/SecPlatformInformation.h 
> b/MdePkg/Include/Ppi/SecPlatformInformation.h
> index 02b0711f189e..fbcd205acd96 100644
> --- a/MdePkg/Include/Ppi/SecPlatformInformation.h
> +++ b/MdePkg/Include/Ppi/SecPlatformInformation.h
> @@ -84,49 +84,6 @@ typedef union {
> 
>  typedef EFI_HEALTH_FLAGS X64_HANDOFF_STATUS;
>  typedef EFI_HEALTH_FLAGS IA32_HANDOFF_STATUS;
> -///
> -/// The hand-off status structure for Itanium architecture.
> -///
> -typedef struct {
> -  ///
> -  /// SALE_ENTRY state : 3 = Recovery_Check
> -  /// and 0 = RESET or Normal_Boot phase.
> -  ///
> -  UINT8 BootPhase;
> -  ///
> -  /// Firmware status on entry to SALE.
> -  ///
> -  UINT8 FWStatus;
> -  UINT16Reserved1;
> -  UINT32Reserved2;
> -  ///
> -  /// Geographically significant unique processor ID assigned by PAL.
> -  ///
> -  UINT16ProcId;
> -  UINT16Reserved3;
> -  UINT8 IdMask;
> -  UINT8 EidMask;
> -  UINT16Reserved4;
> -  ///
> -  /// Address to make PAL calls.
> -  ///
> -  UINT64PalCallAddress;
> -  ///
> -  /// If the entry state is RECOVERY_CHECK, this contains the PAL_RESET
> -  /// return address, and if entry state is RESET, this contains
> -  /// address for PAL_authentication call.
> -  ///
> -  UINT64PalSpecialAddress;
> -  ///
> -  /// GR35 from PALE_EXIT state.
> -  ///
> -  UINT64SelfTestStatus;
> -  ///
> -  /// GR37 from PALE_EXIT state.
> -  ///
> -  UINT64SelfTestControl;
> -  UINT64MemoryBufferRequired;
> -} ITANIUM_HANDOFF_STATUS;
> 
>  ///
>  /// EFI_SEC_PLATFORM_INFORMATION_RECORD.
> @@ -134,7 +91,6 @@ typedef struct {
>  typedef union {
>IA32_HANDOFF_STATUS   IA32HealthFlags;
>X64_HANDOFF_STATUSx64HealthFlags;
> -  ITANIUM_HANDOFF_STATUSItaniumHealthFlags;
>  } EFI_SEC_PLATFORM_INFORMATION_RECORD;
> 
>  /**
> --
> 2.38.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100813): https://edk2.groups.io/g/devel/message/100813
Mute This Topic: https://groups.io/mt/95384808/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] PATCH v1 1/1 MdePkg: Remove Itanium leftover data structure

2023-03-07 Thread Zimmer, Vincent
I would suggest going forward to remove itanium hand-off information.  Now that 
the stable table has been dropped the community can assess the impact of this 
change over the next few months.

I can also follow-up on some of the more formal PI spec clean-up for elision of 
this info targeting a post PI1.8 document, too.


Vincent

From: Pawel Polawski 
Sent: Tuesday, March 7, 2023 4:43 AM
To: devel@edk2.groups.io; thomas.lenda...@amd.com; Ni, Ray ; 
Kinney, Michael D ; Zimmer, Vincent 
; Kirkendall, Garrett 
Cc: Gao, Liming ; Liu, Zhiguang 

Subject: Re: [edk2-devel] PATCH v1 1/1 MdePkg: Remove Itanium leftover data 
structure

Hi all,

I would like to kindly remind that the final decision on this topic has not 
been made yet.
If I understand correctly we need some more expertise from Intel about 
potential issues
caused by this change on binary based images (which assumes fixed size for this 
data structure and
cannot be changed)?

Best regards,
Pawel

On Tue, Jan 17, 2023 at 1:46 PM Paweł Poławski 
mailto:ppola...@redhat.com>> wrote:
Hi all,

Just to let you know: I performed a test with this modified version
of EDK2 and 1500 vCPU set in Qemu config. The test ended up with
success. I can confirm that space saved by removing Itanium data
structure allows to allocate more than 1024 vCPU using KVM accelerator.

On thing to note - to test this KVM needs to be modified, the same with
Qemu. Both - by default has vCPU limits so low that they will be
bottleneck for vCPU now.

Best regards,
Pawel

W dniu 10.01.2023 o 16:32, Lendacky, Thomas via groups.io 
pisze:
> + Garret
>
> On 1/10/23 03:36, Ni, Ray via groups.io wrote:
>> The challenge is that the non-Itanium CPU archs that may depend on
>> the
>> current binary layout of these structures.  This could be a binary
>> PEI CPU module, DXE CPU module, SMM CPU module, MM CPU modules,
>> UEFI App/Shell App that use the PPI or HOB.
>>
>> The CPU health record is stored in PPI first by SecCore, then saved to
>> HOB by CpuMpPei module.
>> Then CpuDxe gets the record from HOB.
>>
>> If SecCore, CpuMpPei, CpuDxe are built with different structure
>> definition,
>> the compatibility issue appears.
>>
>> The very well know binary separation module today for x86 is Intel's FSP.
>> I am not sure if today customer might use a pre-built FSP binary which
>> is built from
>> version #1 of edk2 while the SecCore and CpuDxe in platform binary are
>> built from
>> a different version of edk2.
>> I don't know how AMD distributes the binary module. + Tom
>>
>> If binary distribution is not adopted yet by industry, I prefer we
>> just update the
>> structure definition.
>>
>>
>> Even if we define a new HOB format, we have to decide when it is
>> used to support compatibility.  Perhaps always keep the current
>> logic if < 1024 CPUs.  If number of CPUs >= 1024, then produce
>> the new format of CPU information and update all consumers to
>> look for new format and use that with higher priority than the
>> old format.
>>
>> I don't like this approach because it still breaks the case when CPU
>> >=1024 and binary
>> distribution is used.
>>
>>
>> Another option is to keep the current format and allow multiple
>> HOBs to be produced if the CPU information does not fit in the
>> single HOB size limit of 64KB.  Then update all consumers to
>> look for 1 or more HOBs to collect all the information.  This
>> approach removes the CPU number limit as long as there is enough
>> temp RAM for the multiple HOBs.
>>
>> CpuDxe driver is one of the consumers.
>> 1. Old CpuMpPei (in FSP binary) + new CpuDxe (In Platform binary)
>>   This doesn't work because CpuMpPei still cannot produce the
>> huge-size HOB.
>> 2. New CpuMpPei (in FSP binary) + old CpuDxe (In Platform binary)
>>   This doesn't work because old CpuDxe doesn't look for multiple
>> HOBs.
>>
>>
>>
>>> -Original Message-
>>> From: devel@edk2.groups.io 
>>> mailto:devel@edk2.groups.io>> On Behalf Of Pawel
>>> Polawski
>>> Sent: Tuesday, January 10, 2023 4:19 PM
>>> To: devel@edk2.groups.io; Ni, Ray 
>>> mailto:ray...@intel.com>>; Kinney, Michael
>>> D mailto:michael.d.kin...@intel.com>>; Zimmer, 
>>> Vincent
>>> mailto:vincent.zim...@intel.com>>
>>> Cc: Gao, Liming 
>>> mailto:gaolim...@byosoft.com.cn>>; Liu, Zhiguang
>>> mailto:zhiguang@intel.com>>
>>> Subject: Re: [edk2-devel] PATCH v1 1/1 MdePkg: Remove Itanium
>>> leftover data structure
>>>
>>> Hi everyone,
>>>
>>> If there is a chance you have some evaluation about this problem
>>> already?
>>>
>>> Best regards,
>>> Pawel
>>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>







--

Paweł Poławski

Red Hat Virtualization

ppola...@redhat.com
@RedHat   Red 
Hat  Red 
Hat

Re: [edk2-devel] [edk2-platforms][PATCH 0/8] Introduce ManageabilityPkg

2023-03-07 Thread Tinh Nguyen via groups.io

Hi,

I'm not sure if I understand this module completely.

This module is another IPMI solution?! we will utilize either 
ManageabilityPkg or IpmiFeaturePkg. And the IPMI protocol specified in 
the EDK2 repo is used by ManageabilityPkg.


Can we make the IpmiCommandLib more generic so that we don't have to 
create it again when we use ManageabilityPkg?


Second, because edk2 does not define a protocol for KCS, you don't use 
"Transport Protocol" and "Protocol Driver" in the KCS 
ManageabilityTransportLib you implement for reference. But, for other 
interfaces, we should use the protocol provided by the PI or UEFI 
specifications.


Please let me know if i was wrong

Thanks,

- Tinh


On 3/3/2023 2:40 PM, Chang, Abner via groups.io wrote:

From: Abner Chang 

edk2 ManageabilityPkg is introduced to provide edk2 drivers
and libraries for industry platform management standards,
such as PLDM (Platform Level Data Model), MCTP (Management
Component Transfer Protocol),
IPMI (Intelligent Platform Management Interface) and others.
The framework of ManageabilityPkg is designed to flexibly
support the transport interfaces for above industry
standards, the transport interfaces such as KCS or I2C for
IPMI, PCI VDM (Vendor Defined Message),
I2C or KCS for MCTP, or the OEM proprietary transports.
Please check the Readme file for the design guidance:
https://github.com/changab/edk2-platforms/blob/Manageability_IPMI_upstream/Features/ManageabilityPkg/Readme.md

In this version we had implemented,
- KCS manageability transport library
- Manageability library helper library
- IPMI PEI/DXE/SMM protocol implementations

Next upstream would be edk2 MCTP_PROTOCOL
implementation that also consumes the manageability
transport libraries.

Abner Chang (8):
   ManageabilityPkg: Add Readme file
   ManageabilityPkg: Initial package
   ManageabilityPkg: Add NULL ManageabilityTransportLib
   ManageabilityPkg: Add ManageabilityTransportHelperLib
   ManageabilityPkg/ManageabilityTransportKcsLib
   ManageabilityPkg: Implement Ipmi Protocol/Ppi
   ManageabilityPkg: Add IpmiProtocol to Manageability Package
   edk2-platforms: Maintainers.txt

  .../ManageabilityPkg/ManageabilityPkg.dec |  48 ++
  .../Include/Dsc/Manageability.dsc |  25 +
  .../ManageabilityPkg/ManageabilityPkg.dsc |  45 ++
  .../BaseManageabilityTransportHelper.inf  |  40 +
  .../BaseManageabilityTransportNull.inf|  28 +
  .../Dxe/DxeManageabilityTransportKcs.inf  |  44 +
  .../IpmiProtocol/Dxe/IpmiProtocolDxe.inf  |  50 ++
  .../Universal/IpmiProtocol/Pei/IpmiPpiPei.inf |  51 ++
  .../IpmiProtocol/Smm/IpmiProtocolSmm.inf  |  52 ++
  .../Library/ManageabilityTransportHelperLib.h |  93 +++
  .../Library/ManageabilityTransportIpmiLib.h   |  24 +
  .../Library/ManageabilityTransportLib.h   | 335 
  .../Common/ManageabilityTransportKcs.h| 106 +++
  .../IpmiProtocol/Common/IpmiProtocolCommon.h  | 108 +++
  .../BaseManageabilityTransportHelper.c| 242 ++
  .../BaseManageabilityTransportNull.c  |  64 ++
  .../Common/KcsCommon.c| 480 +++
  .../Dxe/ManageabilityTransportKcs.c   | 375 +
  .../IpmiProtocol/Common/IpmiProtocolCommon.c  | 245 ++
  .../Universal/IpmiProtocol/Dxe/IpmiProtocol.c | 177 +
  .../Universal/IpmiProtocol/Pei/IpmiPpi.c  | 151 
  .../Universal/IpmiProtocol/Smm/IpmiProtocol.c | 147 
  Features/ManageabilityPkg/Readme.md   | 177 +
  .../Media/ManageabilityDriverStack.svg| 752 ++
  .../BaseManageabilityTransportHelper.uni  |  13 +
  .../BaseManageabilityTransportNull.uni|  13 +
  .../Dxe/ManageabilityTransportKcs.uni |  13 +
  Maintainers.txt   |  11 +-
  .../Library/RiscVOpensbiLib/opensbi   |   2 +-
  29 files changed, 3908 insertions(+), 3 deletions(-)
  create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dec
  create mode 100644 Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
  create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dsc
  create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
  create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
  create mode 100644 
Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
  create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
  create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
  create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf
  create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
  create mode 100644 
Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
  create mode 100644 
Features/Ma

[edk2-devel] [PATCH edk2-platforms v1] Add build docs for Arm plats FVP and Juno

2023-03-07 Thread Jose Marinho
Signed-off-by: Jose Marinho 

Cc: Sami Mujawar 
Cc: Samer El-Haj-Mahmoud 
---
 Platform/ARM/Readme.md | 315 +
 1 file changed, 315 insertions(+)
 create mode 100644 Platform/ARM/Readme.md

diff --git a/Platform/ARM/Readme.md b/Platform/ARM/Readme.md
new file mode 100644
index 00..8c48bd0d7b
--- /dev/null
+++ b/Platform/ARM/Readme.md
@@ -0,0 +1,315 @@
+# Introduction
+
+These instructions explain how to get an edk2/edk2-platforms build running
+on the Arm Base FVP and a Juno. The Arm Base FVP is a software model provided 
by ARM (for free)
+, which models a Cortex A core with various peripherals. More information
+can be found 
[here](https://developer.arm.com/products/system-design/fixed-virtual-platforms).
+
+## Build environment setup on Linux or Windows
+
+### Initial steps
+
+The first step towards building an EDKII firmware image is to create a working 
directory.
+
+1. Launch a terminal window.
+2. Create a directory on your development machine (we willl name it 'source' 
in this example).
+3. Set the WORKSPACE environment variable to point to this directory.
+
+ Example:
+In a Linux bash shell:
+```
+cd 
+mkdir source
+cd source
+export WORKSPACE=$PWD
+```
+
+OR
+
+In a Windows command prompt:
+
+```
+cd 
+mkdir source
+cd source
+set WORKSPACE=%CD%
+```
+
+### Cloning the source code repositories
+
+Note: To clone the repositories you need 'git' to be installed on your 
development PC (see Development Tools).
+
+In the terminal window, change directory to your workspace ('source') folder 
and run the following commands. Install Git if necessary.
+
+```
+git clone https://github.com/tianocore/edk2.git
+git clone https://github.com/tianocore/edk2-platforms.git
+git clone https://github.com/acpica/acpica.git
+```
+
+Then go to the edk2 folder and update the submodules.
+
+```
+cd edk2
+git submodule update --init
+cd ..
+```
+
+# Building firmware on a Linux host
+
+## Prerequisites
+
+- A 64-bit development machine.
+- Ubuntu 20.04 desktop.
+- At least 10GB of free disk space.
+
+Check the Ubuntu version by typing the following in the terminal window.
+
+```
+$ uname -srvmpio
+Linux 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64 
x86_64 x86_64 GNU/Linux
+```
+
+### Development Tools
+
+The following tools must be installed on the development PC.
+
+
+| Sr. No.   | Tool| Description
  | Install instructions |
+|---|-|--|--|
+| 1 | Python 3| Python interpreter 
  | $ sudo apt install python3 python3-distutils |
+| 2 | Git | Git source control tool
  | $ sudo apt install git   |
+| 3 | uuid-dev| Required for including uuid/uuid.h 
  | $ sudo apt install uuid-dev  |
+| 4 | build-essential | Installs make, gcc, g++, etc   
  | $ sudo apt install build-essential  $ make -v  GNU 
Make 4.2.1  gcc --version  gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 
 $ g++ --version  g++ (Ubuntu 9.4.0-1ubuntu1\~20.04.1) 9.4.0 |
+| 5 | bison   | A parser generator required by acpica 
tools. | $ sudo apt install bison   
  |
+| 6 | flex| A fast lexical analyzer generator required 
by acpica tools   | $ sudp apt get install flex  |
+
+### Setting up the development tools
+
+Install the required development tools by running the following commands in 
the terminal window.
+
+```
+$ sudo apt install bison build-essential flex git uuid-dev
+ ```
+
+```
+$ sudo apt install python3 python3-distutils
+ ```
+
+### Arm cross compiler toolchain
+
+The Arm toolchain to cross compile from x86_64-linux to aarch64-elf is 
available 
[here](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads).
+
+Select the latest toolchain to match the development PC architecture. Select 
the little-endian 'AArch64 ELF bare-metal target (aarch64-elf)' GCC cross 
compiler.
+
+Example: For a x86_64 development PC, download 
arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf.tar.xz
+
+Create a directory called 'toolchain' under the workspace folder. For example 
source\toolchain and extract the toolchain to this directory.
+
+```
+$ mkdir $WORKSPACE/toolchain
+$ cd $WORKSPACE/toolchain
+$ wget 
https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf.tar.xz
+$ tar xf arm-gnu-toolchain-12.2.rel1-x86_64-aarch64-none-elf.tar.xz
+$ cd $WORKSPACE
+```
+
+### Build the acpica 

[edk2-devel] edk2/basetools python package build is failing.

2023-03-07 Thread Jain, Vikas
Hi All,

I am trying to build edk2/basetools python package but it is failing with the 
below error, looks like there is some problem with environment setup.
Can some one please suggest a way to build it?

Repo Link: https://github.com/tianocore/edk2-basetools
Steps to build:

  1.  Run pip install -e . (you might need do this from an admin prompt in 
windows)
  2.  Run edk2_build to make sure it works
Error Log:

[root@master-node edk2basetools]# edk2_build
Build environment: Linux-4.18.0-408.el8.x86_64-x86_64-with-glibc2.28
Build start time: 15:08:33, Mar.07 2023



edk2_build...
: error C0DE: Unknown fatal error when processing []

(Please send email to devel@edk2.groups.io for 
help, attaching following call stack trace!)

(Python 3.9.16 on linux) Traceback (most recent call last):
  File "/root/edk2-basetools/edk2-basetools/edk2basetools/build/build.py", line 
2648, in Main
CheckEnvVariable()
  File "/root/edk2-basetools/edk2-basetools/edk2basetools/build/build.py", line 
127, in CheckEnvVariable
os.environ["EDK_TOOLS_PATH"] = 
os.path.normcase(os.environ["EDK_TOOLS_PATH"])
  File "/usr/lib64/python3.9/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'EDK_TOOLS_PATH'


- Failed -
Build end time: 15:08:33, Mar.07 2023
Build total time: 00:00:00

[root@master-node edk2basetools]#

Thanks for looking into it.

Regards,
Vikas


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100809): https://edk2.groups.io/g/devel/message/100809
Mute This Topic: https://groups.io/mt/97455016/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v4 0/2] SecurityPkg: Fixes for RngDxe

2023-03-07 Thread PierreGondois
From: Pierre Gondois 

v1:
- https://edk2.groups.io/g/devel/message/96356
v2:
- https://edk2.groups.io/g/devel/message/96434
- Reformulate commit message.
- Do not warn if no algorithm is found as the message
  would be printed on non-Arm platforms.
v3:
- https://edk2.groups.io/g/devel/topic/95240503
- Add the following patches:
  1. ArmPkg/ArmTrngLib: Remove ASSERTs in ArmTrngLibConstructor()
 Requested by Ard.
 Cf https://edk2.groups.io/g/devel/message/96495
  2. SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL
 Do not install EFI_RNG_PROTOCOL if no RNG algorithm is available.
 Cf. https://edk2.groups.io/g/devel/message/96494
  3. SecurityPkg/RngDxe: Fix Rng algo selection for Arm
 Coming from v2 patch being split.
v4:
- Change description of:
   'SecurityPkg/RngDxe: Fix Rng algo selection for Arm'
  to:
   'SecurityPkg/RngDxe: Simplify Rng algorithm selection for Arm'
- Add patch:
'SecurityPkg/RngDxe: Check for NULL PcdCpuRngSupportedAlgorithm'
- Remove as merged:
SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL
SecurityPkg/RngDxe: Correctly update mAvailableAlgoArrayCount

When adding support for the Firmware Trng interface, it was made
available through in the RngDxe module. In RngDxe, the algorithm
associated with PcdCpuRngSupportedAlgorithm (implemented by the
RngLib) was always advertised by default.

It was assumed that support for RngLib and RNDR instructions
should be kept in ArmVirtPkg. However this support did not exist
as all ArmVirtPkg use the BaseRngLibTimerLib.inf implementation
of the RngLib.

Do not advertise the RngLib and PcdCpuRngSupportedAlgorithm
if PcdCpuRngSupportedAlgorithm is NULL.

Also simplify the selection of the default algorithm.

Pierre Gondois (2):
  SecurityPkg/RngDxe: Simplify Rng algorithm selection for Arm
  SecurityPkg/RngDxe: Check for NULL PcdCpuRngSupportedAlgorithm

 .../RngDxe/AArch64/AArch64Algo.c| 14 +++---
 .../RandomNumberGenerator/RngDxe/ArmRngDxe.c| 17 -
 2 files changed, 7 insertions(+), 24 deletions(-)

-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100806): https://edk2.groups.io/g/devel/message/100806
Mute This Topic: https://groups.io/mt/97454014/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v4 2/2] SecurityPkg/RngDxe: Check for NULL PcdCpuRngSupportedAlgorithm

2023-03-07 Thread PierreGondois
From: Pierre Gondois 

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4151

The EFI_RNG_PROTOCOL can advertise multiple algorithms through
Guids. The PcdCpuRngSupportedAlgorithm contains a Guid that
can be configured. It represents the algorithm used in RngLib
and using CPU instructions.

When adding support for the Firmware Trng interface, it was made
available through in the RngDxe module. In RngDxe, the algorithm
associated with PcdCpuRngSupportedAlgorithm (implemented by the
RngLib) was always advertised by default.

It was assumed that support for RngLib and RNDR instructions
should be kept in ArmVirtPkg. However this support did not exist
as all ArmVirtPkg use the BaseRngLibTimerLib.inf implementation
of the RngLib.

Do not advertise the RngLib and PcdCpuRngSupportedAlgorithm
if PcdCpuRngSupportedAlgorithm is NULL.

Reported-by: Sami Mujawar 
Signed-off-by: Pierre Gondois 
---
 .../RngDxe/AArch64/AArch64Algo.c   | 14 +++---
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/AArch64Algo.c 
b/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/AArch64Algo.c
index e8be217f8a8c..c98e09363e25 100644
--- a/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/AArch64Algo.c
+++ b/SecurityPkg/RandomNumberGenerator/RngDxe/AArch64/AArch64Algo.c
@@ -39,23 +39,15 @@ GetAvailableAlgorithms (
   }
 
   // Check RngGetBytes() before advertising PcdCpuRngSupportedAlgorithm.
-  if (!EFI_ERROR (RngGetBytes (sizeof (DummyRand), (UINT8 *)&DummyRand))) {
+  if (!IsZeroGuid (PcdGetPtr (PcdCpuRngSupportedAlgorithm)) &&
+  !EFI_ERROR (RngGetBytes (sizeof (DummyRand), (UINT8 *)&DummyRand)))
+  {
 CopyMem (
   &mAvailableAlgoArray[mAvailableAlgoArrayCount],
   PcdGetPtr (PcdCpuRngSupportedAlgorithm),
   sizeof (EFI_RNG_ALGORITHM)
   );
 mAvailableAlgoArrayCount++;
-
-DEBUG_CODE_BEGIN ();
-if (IsZeroGuid (PcdGetPtr (PcdCpuRngSupportedAlgorithm))) {
-  DEBUG ((
-DEBUG_WARN,
-"PcdCpuRngSupportedAlgorithm should be a non-zero GUID\n"
-));
-}
-
-DEBUG_CODE_END ();
   }
 
   // Raw algorithm (Trng)
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100808): https://edk2.groups.io/g/devel/message/100808
Mute This Topic: https://groups.io/mt/97454018/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v4 1/2] SecurityPkg/RngDxe: Simplify Rng algorithm selection for Arm

2023-03-07 Thread PierreGondois
From: Pierre Gondois 

The default algorithm to use is the first element of
mAvailableAlgoArray. There is no need to iterate through the
array to find a valid algorithm.

Simplify the Rng algorithm selection by returning the first
element of mAvailableAlgoArray.

Signed-off-by: Pierre Gondois 
---
 .../RandomNumberGenerator/RngDxe/ArmRngDxe.c| 17 -
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/ArmRngDxe.c 
b/SecurityPkg/RandomNumberGenerator/RngDxe/ArmRngDxe.c
index ce49ff7ae661..b8a343e3d397 100644
--- a/SecurityPkg/RandomNumberGenerator/RngDxe/ArmRngDxe.c
+++ b/SecurityPkg/RandomNumberGenerator/RngDxe/ArmRngDxe.c
@@ -77,7 +77,6 @@ RngGetRNG (
   )
 {
   EFI_STATUS  Status;
-  UINTN   Index;
 
   if ((This == NULL) || (RNGValueLength == 0) || (RNGValue == NULL)) {
 return EFI_INVALID_PARAMETER;
@@ -87,21 +86,13 @@ RngGetRNG (
 //
 // Use the default RNG algorithm if RNGAlgorithm is NULL.
 //
-for (Index = 0; Index < mAvailableAlgoArrayCount; Index++) {
-  if (!IsZeroGuid (&mAvailableAlgoArray[Index])) {
-RNGAlgorithm = &mAvailableAlgoArray[Index];
-goto FoundAlgo;
-  }
-}
-
-if (Index == mAvailableAlgoArrayCount) {
-  // No algorithm available.
-  ASSERT (Index != mAvailableAlgoArrayCount);
-  return EFI_DEVICE_ERROR;
+if (mAvailableAlgoArrayCount != 0) {
+  RNGAlgorithm = &mAvailableAlgoArray[0];
+} else {
+  return EFI_UNSUPPORTED;
 }
   }
 
-FoundAlgo:
   if (CompareGuid (RNGAlgorithm, PcdGetPtr (PcdCpuRngSupportedAlgorithm))) {
 Status = RngGetBytes (RNGValueLength, RNGValue);
 return Status;
-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100807): https://edk2.groups.io/g/devel/message/100807
Mute This Topic: https://groups.io/mt/97454017/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-libc Patch 2/2] Incorporated review comments

2023-03-07 Thread Rebecca Cran

Sorry, could you send out a v2 patch series with the fixes included please?


Thanks.

Rebecca Cran


On 3/6/23 10:11 PM, Ajay Kadapathri wrote:

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Jayaprakash N 
Signed-off-by: Ajay Kadapathri 
---
  .../PyMod-3.6.8/Modules/edk2module.c  | 26 +--
  1 file changed, 12 insertions(+), 14 deletions(-)

diff --git 
a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c 
b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
index a0e6273..4c400b9 100644
--- a/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
+++ b/AppPkg/Applications/Python/Python-3.6.8/PyMod-3.6.8/Modules/edk2module.c
@@ -4257,26 +4257,24 @@ MiscRT_SetVariable(PyObject *self, PyObject *args)
  }
  
  
+/**

+  This function prints a GUID to a buffer
+
+  @param guidPointer to a GUID
+
+  @param str_buffer  Pointer to a str buffer
+
+
+  @retval EFI_SUCCESSGUID was printed
+
+  @retval EFI_INVALID_PARAMETER  GUID was NULL
  
+**/

  EFI_STATUS
  GuidToStr (
IN EFI_GUID  *guid,
IN OUT UINT8 *str_buffer
)
-/*++
-
-Routine Description:
-  This function prints a GUID to a buffer
-
-Arguments:
-  guid   - Pointer to a GUID
-  str_buffer - Pointer to a str buffer
-
-Returns:
-  EFI_SUCCESSGUID was printed
-  EFI_INVALID_PARAMETER  GUID was NULL
-
---*/
  {
if (guid == NULL) {
  return EFI_INVALID_PARAMETER;



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100805): https://edk2.groups.io/g/devel/message/100805
Mute This Topic: https://groups.io/mt/97443897/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3 0/4] ArmPkg/SecurityPkg: Fixes for ArmTrngLib/RngDxe

2023-03-07 Thread Ard Biesheuvel
On Tue, 7 Mar 2023 at 08:53, Yao, Jiewen  wrote:
>
> I don’t mind, please go ahead.
>

Thanks. Merged as #4109

Note that I replaced the 'return EFI_UNSUPPORTED' with 'return
EFI_REQUEST_UNLOAD_IMAGE' so that RngDxe is simply unloaded again
without an error if no RNG sources are available to it.


> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Ard
> > Biesheuvel
> > Sent: Tuesday, March 7, 2023 12:22 AM
> > To: Yao, Jiewen 
> > Cc: Pierre Gondois ; devel@edk2.groups.io; Leif
> > Lindholm ; Sami Mujawar ;
> > Wang, Jian J 
> > Subject: Re: [edk2-devel] [PATCH v3 0/4] ArmPkg/SecurityPkg: Fixes for
> > ArmTrngLib/RngDxe
> >
> > On Mon, 6 Mar 2023 at 16:42, Yao, Jiewen  wrote:
> > >
> > > Hi Pierre
> > > I don’t have strong opinion.
> > >
> > > For ARM specific patch, would you please get R-B from ARM expert?
> > >
> > > I think we need to wait for the response from Ard to confirm.
> > >
> >
> > These patches
> >
> >   SecurityPkg/RngDxe: Correctly update mAvailableAlgoArrayCount
> >   SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL
> >
> > Reviewed-by: Ard Biesheuvel 
> >
> > Jiewen, if you don't mind, I will merge those right away.
> >
> > For the remaining patch, I am not sure I understand why the behavior
> > regarding the zero GUID is correct. Perhaps we could
> > revisit/resend/review that patch in isolation?
> >
> > Thanks,
> > Ard.
> >
> >
> >
> >
> > >
> > > > -Original Message-
> > > > From: Pierre Gondois 
> > > > Sent: Monday, March 6, 2023 11:38 PM
> > > > To: devel@edk2.groups.io
> > > > Cc: Leif Lindholm ; Sami Mujawar
> > > > ; Yao, Jiewen ;
> > Wang,
> > > > Jian J ; Ard Biesheuvel 
> > > > Subject: Re: [edk2-devel] [PATCH v3 0/4] ArmPkg/SecurityPkg: Fixes for
> > > > ArmTrngLib/RngDxe
> > > >
> > > > Hello Jiewen, Jian,
> > > > Do these patches in this set look ok to you ?
> > > > - SecurityPkg/RngDxe: Correctly update mAvailableAlgoArrayCount
> > > > - SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL
> > > > - SecurityPkg/RngDxe: Fix Rng algo selection for Arm
> > > >
> > > > Regards,
> > > > Pierre
> > > >
> > > > On 2/10/23 10:26, PierreGondois via groups.io wrote:
> > > > > Hello Jiewen, Jian,
> > > > > Just a reminder in case this was forgotten,
> > > > > Regards,
> > > > > Pierre
> > > > >
> > > > > On 1/9/23 13:26, Pierre Gondois wrote:
> > > > >> Hello,
> > > > >> I was wondering if I should re-arrange the patch in any way/there was
> > any
> > > > >> concern with the patch set. The first patch of serie was taken, but 
> > > > >> the
> > > > other
> > > > >> ones are pending,
> > > > >>
> > > > >> Regards,
> > > > >> Pierre
> > > > >>
> > > > >> On 11/28/22 14:34, PierreGondois via groups.io wrote:
> > > > >>> Hello Ard,
> > > > >>>
> > > > >>> On 11/26/22 15:33, Ard Biesheuvel wrote:
> > > >  On Thu, 24 Nov 2022 at 17:18,  wrote:
> > > > >
> > > > > From: Pierre Gondois 
> > > > >
> > > > > v1:
> > > > > - https://edk2.groups.io/g/devel/message/96356
> > > > > v2:
> > > > > - https://edk2.groups.io/g/devel/message/96434
> > > > > - Reformulate commit message.
> > > > > - Do not warn if no algorithm is found as the message
> > > > >   would be printed on non-Arm platforms.
> > > > > v3:
> > > > > - Add the following patches:
> > > > >   1. ArmPkg/ArmTrngLib: Remove ASSERTs in
> > > > ArmTrngLibConstructor()
> > > > >  Requested by Ard.
> > > > >  Cf https://edk2.groups.io/g/devel/message/96495
> > > > >   2. SecurityPkg/RngDxe: Conditionally install
> > EFI_RNG_PROTOCOL
> > > > >  Do not install EFI_RNG_PROTOCOL if no RNG algorithm is
> > > > available.
> > > > >  Cf. https://edk2.groups.io/g/devel/message/96494
> > > > >   3. SecurityPkg/RngDxe: Fix Rng algo selection for Arm
> > > > >  Coming from v2 patch being split.
> > > > >
> > > > > Some issues were found by Ard/Sami on the RngDxe/ArmTrngLib
> > after
> > > > > recent patches were merged. This patch serie intends to fix them.
> > > > >
> > > > > Pierre Gondois (4):
> > > > >   ArmPkg/ArmTrngLib: Remove ASSERTs in
> > ArmTrngLibConstructor()
> > > > 
> > > >  Thanks for the fixed
> > > > 
> > > >  Reviewed-by: Ard Biesheuvel 
> > > > 
> > > >  I pushed this one as #3663 (pending CI verification atm)
> > > > 
> > > > >   SecurityPkg/RngDxe: Correctly update
> > mAvailableAlgoArrayCount
> > > > >   SecurityPkg/RngDxe: Conditionally install EFI_RNG_PROTOCOL
> > > > >   SecurityPkg/RngDxe: Fix Rng algo selection for Arm
> > > > >
> > > > 
> > > >  The remaining code still looks a bit clunky to me. Can't we just
> > > >  return an error from the library constructor of the library cannot
> > > >  initialize due to a missing prerequisite?
> > > > >>>
> > > > >>> In RngDriverEntry(), GetAvailableAlgorithms() probe the available
> > > > >>> RNG

Re: [edk2-devel] PATCH v3 1/3 MdeModulePkg: TerminalDxe: set xterm resolution on mode change

2023-03-07 Thread Paweł Poławski
Hi all,

As a new stable version has been released recently and the freeze is over,
if there is a chance for review of this set of patches?

They have been already reviewed in the past and the last request was to
make commit
messages more meaningful for the end user.

Best regards,
Pawel

On Fri, Feb 17, 2023 at 2:02 PM Paweł Poławski  wrote:

> From: Laszlo Ersek 
>
> TerminalDxe driver can send xterm control sequences.
> Reference: 
>
> This way it can trigger client window resize (xterm,
> gnome-terminal etc.) accordingly, to a specified number
> of rows and columns. It improves user experience
> when handling text mode based operations.
>
> New PcdResizeXterm config switch has been added to enable
> or disable this behaviour.
>
> Signed-off-by: Laszlo Ersek 
>
> Pawel Polawski: Updated commit message for re-submission
>
> Cc: Jian J Wang 
> Cc: Liming Gao 
>
> Signed-off-by: Paweł Poławski 
> ---
>  MdeModulePkg/MdeModulePkg.dec   |  4 +++
>  MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf  |  2 ++
>  MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 29
> 
>  3 files changed, 35 insertions(+)
>
> diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
> index 9605c617b7a8..76007e0af42a 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -2107,6 +2107,10 @@ [PcdsFixedAtBuild, PcdsPatchableInModule,
> PcdsDynamic, PcdsDynamicEx]
># @Prompt The shared bit mask when Intel Tdx is enabled.
>gEfiMdeModulePkgTokenSpaceGuid.PcdTdxSharedBitMask|0x0|UINT64|0x1025
>
> +  ## Controls whether TerminalDxe outputs an XTerm resize sequence on
> terminal
> +  #  mode change.
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm|FALSE|BOOLEAN|0x00010080
> +
>  [PcdsPatchableInModule]
>## Specify memory size with page number for PEI code when
>#  Loading Module at Fixed Address feature is enabled.
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> index b2a8aeba8510..eff625346539 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
> @@ -55,6 +55,7 @@ [LibraryClasses]
>DebugLib
>PcdLib
>BaseLib
> +  PrintLib
>
>  [Guids]
>## SOMETIMES_PRODUCES ## Variable:L"ConInDev"
> @@ -87,6 +88,7 @@ [Protocols]
>  [Pcd]
>gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType   ##
> SOMETIMES_CONSUMES
>gEfiMdeModulePkgTokenSpaceGuid.PcdErrorCodeSetVariable## CONSUMES
> +  gEfiMdeModulePkgTokenSpaceGuid.PcdResizeXterm ## CONSUMES
>
>  # [Event]
>  # # Relative timer event set by UnicodeToEfiKey(), used to be one 2
> seconds input timeout.
> diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> index 7809869e7d49..496849458db4 100644
> --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
> @@ -7,6 +7,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>
>  **/
>
> +#include 
> +
>  #include "Terminal.h"
>
>  //
> @@ -80,6 +82,15 @@ CHAR16  mSetCursorPositionString[] = { ESC, '[', '0',
> '0', ';', '0', '0', 'H', 0
>  CHAR16  mCursorForwardString[] = { ESC, '[', '0', '0', 'C', 0 };
>  CHAR16  mCursorBackwardString[]= { ESC, '[', '0', '0', 'D', 0 };
>
> +//
> +// Note that this is an ASCII format string, taking two INT32 arguments:
> +// rows, columns.
> +//
> +// A %d (INT32) format specification can expand to at most 11 characters.
> +//
> +CHAR8  mResizeTextAreaFormatString[] = "\x1B[8;%d;%dt";
> +#define RESIZE_SEQ_SIZE  (sizeof mResizeTextAreaFormatString + 2 * (11 -
> 2))
> +
>  //
>  // Body of the ConOut functions
>  //
> @@ -498,6 +509,24 @@ TerminalConOutSetMode (
>  return EFI_DEVICE_ERROR;
>}
>
> +  if (PcdGetBool (PcdResizeXterm)) {
> +CHAR16  ResizeSequence[RESIZE_SEQ_SIZE];
> +
> +UnicodeSPrintAsciiFormat (
> +  ResizeSequence,
> +  sizeof ResizeSequence,
> +  mResizeTextAreaFormatString,
> +  (INT32)TerminalDevice->TerminalConsoleModeData[ModeNumber].Rows,
> +  (INT32)TerminalDevice->TerminalConsoleModeData[ModeNumber].Columns
> +  );
> +TerminalDevice->OutputEscChar = TRUE;
> +Status= This->OutputString (This,
> ResizeSequence);
> +TerminalDevice->OutputEscChar = FALSE;
> +if (EFI_ERROR (Status)) {
> +  return EFI_DEVICE_ERROR;
> +}
> +  }
> +
>This->Mode->Mode = (INT32)ModeNumber;
>
>Status = This->ClearScreen (This);
> --
> 2.39.1
>
>
>
> 
>
>
>

-- 

Paweł Poławski

Red Hat  Virtualization

ppola...@redhat.com
@RedHat    Red Hat
  Red Hat


Re: [edk2-devel] PATCH v1 1/1 MdePkg: Remove Itanium leftover data structure

2023-03-07 Thread Paweł Poławski
Hi all,

I would like to kindly remind that the final decision on this topic has not
been made yet.
If I understand correctly we need some more expertise from Intel about
potential issues
caused by this change on binary based images (which assumes fixed size for
this data structure and
cannot be changed)?

Best regards,
Pawel

On Tue, Jan 17, 2023 at 1:46 PM Paweł Poławski  wrote:

> Hi all,
>
> Just to let you know: I performed a test with this modified version
> of EDK2 and 1500 vCPU set in Qemu config. The test ended up with
> success. I can confirm that space saved by removing Itanium data
> structure allows to allocate more than 1024 vCPU using KVM accelerator.
>
> On thing to note - to test this KVM needs to be modified, the same with
> Qemu. Both - by default has vCPU limits so low that they will be
> bottleneck for vCPU now.
>
> Best regards,
> Pawel
>
> W dniu 10.01.2023 o 16:32, Lendacky, Thomas via groups.io pisze:
> > + Garret
> >
> > On 1/10/23 03:36, Ni, Ray via groups.io wrote:
> >> The challenge is that the non-Itanium CPU archs that may depend on
> >> the
> >> current binary layout of these structures.  This could be a binary
> >> PEI CPU module, DXE CPU module, SMM CPU module, MM CPU modules,
> >> UEFI App/Shell App that use the PPI or HOB.
> >>
> >> The CPU health record is stored in PPI first by SecCore, then saved to
> >> HOB by CpuMpPei module.
> >> Then CpuDxe gets the record from HOB.
> >>
> >> If SecCore, CpuMpPei, CpuDxe are built with different structure
> >> definition,
> >> the compatibility issue appears.
> >>
> >> The very well know binary separation module today for x86 is Intel's
> FSP.
> >> I am not sure if today customer might use a pre-built FSP binary which
> >> is built from
> >> version #1 of edk2 while the SecCore and CpuDxe in platform binary are
> >> built from
> >> a different version of edk2.
> >> I don't know how AMD distributes the binary module. + Tom
> >>
> >> If binary distribution is not adopted yet by industry, I prefer we
> >> just update the
> >> structure definition.
> >>
> >>
> >> Even if we define a new HOB format, we have to decide when it is
> >> used to support compatibility.  Perhaps always keep the current
> >> logic if < 1024 CPUs.  If number of CPUs >= 1024, then produce
> >> the new format of CPU information and update all consumers to
> >> look for new format and use that with higher priority than the
> >> old format.
> >>
> >> I don't like this approach because it still breaks the case when CPU
> >> >=1024 and binary
> >> distribution is used.
> >>
> >>
> >> Another option is to keep the current format and allow multiple
> >> HOBs to be produced if the CPU information does not fit in the
> >> single HOB size limit of 64KB.  Then update all consumers to
> >> look for 1 or more HOBs to collect all the information.  This
> >> approach removes the CPU number limit as long as there is enough
> >> temp RAM for the multiple HOBs.
> >>
> >> CpuDxe driver is one of the consumers.
> >> 1. Old CpuMpPei (in FSP binary) + new CpuDxe (In Platform binary)
> >>   This doesn't work because CpuMpPei still cannot produce the
> >> huge-size HOB.
> >> 2. New CpuMpPei (in FSP binary) + old CpuDxe (In Platform binary)
> >>   This doesn't work because old CpuDxe doesn't look for multiple
> >> HOBs.
> >>
> >>
> >>
> >>> -Original Message-
> >>> From: devel@edk2.groups.io  On Behalf Of Pawel
> >>> Polawski
> >>> Sent: Tuesday, January 10, 2023 4:19 PM
> >>> To: devel@edk2.groups.io; Ni, Ray ; Kinney, Michael
> >>> D ; Zimmer, Vincent
> >>> 
> >>> Cc: Gao, Liming ; Liu, Zhiguang
> >>> 
> >>> Subject: Re: [edk2-devel] PATCH v1 1/1 MdePkg: Remove Itanium
> >>> leftover data structure
> >>>
> >>> Hi everyone,
> >>>
> >>> If there is a chance you have some evaluation about this problem
> >>> already?
> >>>
> >>> Best regards,
> >>> Pawel
> >>>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
>
>
>
> 
>
>
>

-- 

Paweł Poławski

Red Hat  Virtualization

ppola...@redhat.com
@RedHat    Red Hat
  Red Hat




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100802): https://edk2.groups.io/g/devel/message/100802
Mute This Topic: https://groups.io/mt/95384808/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/1] UefiCpuPkg/MpInitLib: fix apic mode for cpu hotplug

2023-03-07 Thread Gerd Hoffmann
In case the number of CPUs can in increase beyond 255
due to CPU hotplug choose x2apic mode.

Signed-off-by: Gerd Hoffmann 
---
 UefiCpuPkg/Library/MpInitLib/MpLib.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c 
b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index e5dc852ed95f..d73b95001263 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -526,7 +526,9 @@ CollectProcessorCount (
   //
   // Enable x2APIC mode if
   //  1. Number of CPU is greater than 255; or
-  //  2. There are any logical processors reporting an Initial APIC ID of 255 
or greater.
+  //  2. The platform exposed the exact *boot* CPU count to us in advance, and
+  // more than 255 logical processors are possible later, with hotplug; or
+  //  3. There are any logical processors reporting an Initial APIC ID of 255 
or greater.
   //
   X2Apic = FALSE;
   if (CpuMpData->CpuCount > 255) {
@@ -534,6 +536,10 @@ CollectProcessorCount (
 // If there are more than 255 processor found, force to enable X2APIC
 //
 X2Apic = TRUE;
+  } else if ((PcdGet32 (PcdCpuBootLogicalProcessorNumber) > 0) &&
+ (PcdGet32 (PcdCpuMaxLogicalProcessorNumber) > 255))
+  {
+X2Apic = TRUE;
   } else {
 CpuInfoInHob = (CPU_INFO_IN_HOB *)(UINTN)CpuMpData->CpuInfoInHob;
 for (Index = 0; Index < CpuMpData->CpuCount; Index++) {
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100801): https://edk2.groups.io/g/devel/message/100801
Mute This Topic: https://groups.io/mt/97447597/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] MdeModulePkg/Logo: Add a PCD to control the position of the Logo

2023-03-07 Thread Sheng Lean Tan
Another kind reminder, thanks.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100800): https://edk2.groups.io/g/devel/message/100800
Mute This Topic: https://groups.io/mt/95802829/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/3] MdeModulePkg/BmBoot: Skip removable media if it is not present

2023-03-07 Thread Sheng Lean Tan
Another kind reminder, thanks.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100799): https://edk2.groups.io/g/devel/message/100799
Mute This Topic: https://groups.io/mt/95706437/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/2] NetworkPkg/HttpDxe: provide function to disable TLS host verify

2023-03-07 Thread Michael Brown

On 07/03/2023 08:21, Nickle Wang via groups.io wrote:

I got an idea to handle this issue.

EFI_HTTP_SERVICE_BINDING_PROTOCOL is defined in UEFI specification for 
caller to create HTTP protocol on child instance. How about I propose a 
new service binding protocol called 
EFI_HTTP_*NO_TLS_HOST_VERIFY*_SERVICE_BINDING_PROTOCOL, and the 
EFI_HTTP_PROTOCOL created by this service binding protocol will not do 
TLS host verify during HTTPS communication.


When caller like to disable host verify on HTTPS communication, caller 
use this service binding protocol to create special HTTP instance. For 
other case, caller use regular EFI_HTTP_SERVICE_BINDING_PROTOCOL to get 
normal EFI_HTTP_PROTOCOL instance.


That seems very hacky, and does not help to address the general problem 
of being able to more flexibly configure HTTP connections.


From a quick look through the UEFI spec, it looks as though 
EFI_TLS_PROTOCOL.SetSessionData() should already allow you to set 
EfiTlsVerifyMethod with a value of EFI_TLS_VERIFY_NONE.


The implementation of HttpDxe makes it very messy to gain access to the 
EFI_TLS_PROTOCOL instance, since it will be created only when 
EFI_HTTP_PROTOCOL.Request() is called.  I think you may have to use 
gBS->RegisterProtocolNotify() in order to intercept the point at which 
EFI_TLS_PROTOCOL is installed.  In your notification event callback, you 
would then check to see if the handle is a child of the 
EFI_HTTP_PROTOCOL handle and, if so, call 
EFI_TLS_PROTOCOL.SetSessionData() to disable host verification.


You would need to be using a newly created EFI_HTTP_PROTOCOL instance, 
so that you could be sure that there was no existing EFI_TLS_PROTOCOL 
instance already in place.


I haven't tested any of the above, but it looks as though it should work 
and allow you to disable host verification for a single 
EFI_HTTP_PROTOCOL instance, without any specification changes.


Michael



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100798): https://edk2.groups.io/g/devel/message/100798
Mute This Topic: https://groups.io/mt/96669380/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] MdePkg/Include: Add IPMI KCS definitions

2023-03-07 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Tinh,
That depends on if AMD platform enables SSIF as host-bmc transport interface, 
otherwise I may not work on that because I have no platform to test.
Thanks
Abner

> -Original Message-
> From: Tinh Nguyen 
> Sent: Tuesday, March 7, 2023 3:51 PM
> To: devel@edk2.groups.io; Chang, Abner 
> Subject: Re: [edk2-devel] [PATCH] MdePkg/Include: Add IPMI KCS
> definitions
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> Hi Abner,
> 
> Any plan to support SMBUS system interface (ssif)?
> 
> - Tinh
> 
> On 03/03/2023 09:31, Chang, Abner via groups.io wrote:
> > From: Abner Chang 
> >
> > BZ #4354
> > This change adds definitions for IPMI KCS.
> >
> > Signed-off-by: Abner Chang 
> > Cc: Michael D Kinney 
> > Cc: Liming Gao 
> > Cc: Zhiguang Liu 
> > Cc: Nickle Wang 
> > Cc: Igor Kulchytskyy 
> > Cc: Isaac Oram 
> > Cc: Abdul Lateef Attar 
> > ---
> >   MdePkg/MdePkg.dec |  5 ++
> >   MdePkg/Include/IndustryStandard/IpmiKcs.h | 72
> +++
> >   2 files changed, 77 insertions(+)
> >   create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h
> >
> > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index
> > 3d08f20d15b..0ed033983bf 100644
> > --- a/MdePkg/MdePkg.dec
> > +++ b/MdePkg/MdePkg.dec
> > @@ -9,6 +9,7 @@
> >   # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development
> LP
> >   # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights
> reserved.
> >   # Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
> > +# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> > +reserved.
> >   #
> >   # SPDX-License-Identifier: BSD-2-Clause-Patent
> >   #
> > @@ -2332,6 +2333,10 @@
> > # @Prompt Memory Address of GuidedExtractHandler Table.
> >
> >
> gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x1000
> 000
> > |UINT64|0x30001015
> >
> > +  ## This value is the IPMI KCS Interface I/O base address used to transmit
> IPMI commands.
> > +  # @Prompt IPMI KCS Interface I/O Base Address
> > +
> > +
> gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress|0xca2|UINT16|0x
> 00
> > + 31
> > +
> >   [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
> > ## This value is used to set the base address of PCI express hierarchy.
> > # @Prompt PCI Express Base Address.
> > diff --git a/MdePkg/Include/IndustryStandard/IpmiKcs.h
> > b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> > new file mode 100644
> > index 000..2a51698b126
> > --- /dev/null
> > +++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
> > @@ -0,0 +1,72 @@
> > +/** @file
> > +  IPMI KCS Register Definitions
> > +
> > +  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> > +reserved.
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> > +
> > +#ifndef IPMI_KCS_H_
> > +#define IPMI_KCS_H_
> > +
> > +#define IPMI_KCS_STATUS_REGISTER_OFFSET1
> > +#define IPMI_KCS_COMMAND_REGISTER_OFFSET   1
> > +#define IPMI_KCS_DATA_OUT_REGISTER_OFFSET  0
> > +#define IPMI_KCS_DATA_IN_REGISTER_OFFSET   0
> > +
> > +///
> > +/// IPMI KCS Interface Status Bits
> > +///
> > +#define IPMI_KCS_OBF   BIT0
> > +#define IPMI_KCS_IBF   BIT1
> > +#define IPMI_KCS_SMS_ATN   BIT2
> > +#define IPMI_KCS_COMMAND_DATA  BIT3
> > +#define IPMI_KCS_OEM1  BIT4
> > +#define IPMI_KCS_OEM2  BIT5
> > +#define IPMI_KCS_S0BIT6
> > +#define IPMI_KCS_S1BIT7
> > +
> > +///
> > +/// IPMI KCS Interface Control Codes
> > +///
> > +#define IPMI_KCS_CONTROL_CODE_GET_STATUS_ABORT  0x60
> > +#define IPMI_KCS_CONTROL_CODE_WRITE_START   0x61
> > +#define IPMI_KCS_CONTROL_CODE_WRITE_END 0x62
> > +#define IPMI_KCS_CONTROL_CODE_READ  0x68
> > +
> > +///
> > +/// Status Codes
> > +///
> > +#define IPMI_KCS_STATUS_NO_ERROR  0x00
> > +#define IPMI_KCS_STATUS_ABORT 0x01
> > +#define IPMI_KCS_STATUS_ILLEGAL   0x02
> > +#define IPMI_KCS_STATUS_LENGTH_ERROR  0x06
> > +#define IPMI_KCS_STATUS_UNSPECIFIED   0xFF
> > +
> > +///
> > +/// KCS Interface State Bit
> > +///
> > +typedef enum {
> > +  IPMI_KCS_IDLE_STATE = 0,
> > +  IPMI_KCS_READ_STATE,
> > +  IPMI_KCS_WRITE_STATE,
> > +  IPMI_KCS_ERROR_STATE
> > +} IPMI_KCS_STATE;
> > +
> > +///
> > +/// IPMI KCS Interface Request Format /// typedef struct {
> > +  UINT8NetFunc;
> > +  UINT8Command;
> > +  UINT8Data[0];
> > +} IPMI_KCS_RESQUEST_HEADER;
> > +
> > +///
> > +/// IPMI KCS Interface Response Format /// typedef struct {
> > +  UINT8NetFunc;
> > +  UINT8Command;
> > +  UINT8CompletionCode;
> > +} IPMI_KCS_RESPONSE_HEADER;
> > +#endif


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100797): https://edk2.groups.io/g/devel/message/100797
Mute This Topic: https://groups.io/mt/97354433/21656
Group Owner: devel+ow.

[edk2-devel] [PATCH v2 2/2] OvmfPkg: move OvmfTpmDxe.fdf.inc to Include/Fdf

2023-03-07 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/AmdSev/AmdSevX64.fdf | 2 +-
 OvmfPkg/CloudHv/CloudHvX64.fdf   | 2 +-
 OvmfPkg/OvmfPkgIa32.fdf  | 2 +-
 OvmfPkg/OvmfPkgIa32X64.fdf   | 2 +-
 OvmfPkg/OvmfPkgX64.fdf   | 2 +-
 OvmfPkg/{ => Include/Fdf}/OvmfTpmDxe.fdf.inc | 0
 6 files changed, 5 insertions(+), 5 deletions(-)
 rename OvmfPkg/{ => Include/Fdf}/OvmfTpmDxe.fdf.inc (100%)

diff --git a/OvmfPkg/AmdSev/AmdSevX64.fdf b/OvmfPkg/AmdSev/AmdSevX64.fdf
index 25e446013cd4..fec08468d3e0 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.fdf
+++ b/OvmfPkg/AmdSev/AmdSevX64.fdf
@@ -316,7 +316,7 @@ [FV.DXEFV]
 #
 # TPM support
 #
-!include OvmfPkg/OvmfTpmDxe.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
 
 

 
diff --git a/OvmfPkg/CloudHv/CloudHvX64.fdf b/OvmfPkg/CloudHv/CloudHvX64.fdf
index 62d048bce181..72de7bcdad66 100644
--- a/OvmfPkg/CloudHv/CloudHvX64.fdf
+++ b/OvmfPkg/CloudHv/CloudHvX64.fdf
@@ -343,7 +343,7 @@ [FV.DXEFV]
 #
 # TPM support
 #
-!include OvmfPkg/OvmfTpmDxe.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
 
 

 
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 09d5965803b1..d92fff1ef3cc 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -371,7 +371,7 @@ [FV.DXEFV]
 #
 # TPM support
 #
-!include OvmfPkg/OvmfTpmDxe.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
 
 !if $(LOAD_X64_ON_IA32_ENABLE) == TRUE
 INF  OvmfPkg/CompatImageLoaderDxe/CompatImageLoaderDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index 633e91f48403..9f3d4ff39dc0 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -378,7 +378,7 @@ [FV.DXEFV]
 #
 # TPM support
 #
-!include OvmfPkg/OvmfTpmDxe.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
 
 

 
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index fc58c7af1f82..a65b01130d6a 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -412,7 +412,7 @@ [FV.DXEFV]
 #
 # TPM support
 #
-!include OvmfPkg/OvmfTpmDxe.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
 
 

 
diff --git a/OvmfPkg/OvmfTpmDxe.fdf.inc b/OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
similarity index 100%
rename from OvmfPkg/OvmfTpmDxe.fdf.inc
rename to OvmfPkg/Include/Fdf/OvmfTpmDxe.fdf.inc
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100796): https://edk2.groups.io/g/devel/message/100796
Mute This Topic: https://groups.io/mt/97445873/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 0/2] OvmfPkg: move two include files to Include/Fdf

2023-03-07 Thread Gerd Hoffmann
v2:
 - rebase to latest master

Gerd Hoffmann (2):
  OvmfPkg: move OvmfTpmPei.fdf.inc to Include/Fdf
  OvmfPkg: move OvmfTpmDxe.fdf.inc to Include/Fdf

 OvmfPkg/AmdSev/AmdSevX64.fdf | 4 ++--
 OvmfPkg/CloudHv/CloudHvX64.fdf   | 4 ++--
 OvmfPkg/OvmfPkgIa32.fdf  | 4 ++--
 OvmfPkg/OvmfPkgIa32X64.fdf   | 4 ++--
 OvmfPkg/OvmfPkgX64.fdf   | 4 ++--
 OvmfPkg/{ => Include/Fdf}/OvmfTpmDxe.fdf.inc | 0
 OvmfPkg/{ => Include/Fdf}/OvmfTpmPei.fdf.inc | 0
 7 files changed, 10 insertions(+), 10 deletions(-)
 rename OvmfPkg/{ => Include/Fdf}/OvmfTpmDxe.fdf.inc (100%)
 rename OvmfPkg/{ => Include/Fdf}/OvmfTpmPei.fdf.inc (100%)

-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100794): https://edk2.groups.io/g/devel/message/100794
Mute This Topic: https://groups.io/mt/97445870/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v2 1/2] OvmfPkg: move OvmfTpmPei.fdf.inc to Include/Fdf

2023-03-07 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann 
---
 OvmfPkg/AmdSev/AmdSevX64.fdf | 2 +-
 OvmfPkg/CloudHv/CloudHvX64.fdf   | 2 +-
 OvmfPkg/OvmfPkgIa32.fdf  | 2 +-
 OvmfPkg/OvmfPkgIa32X64.fdf   | 2 +-
 OvmfPkg/OvmfPkgX64.fdf   | 2 +-
 OvmfPkg/{ => Include/Fdf}/OvmfTpmPei.fdf.inc | 0
 6 files changed, 5 insertions(+), 5 deletions(-)
 rename OvmfPkg/{ => Include/Fdf}/OvmfTpmPei.fdf.inc (100%)

diff --git a/OvmfPkg/AmdSev/AmdSevX64.fdf b/OvmfPkg/AmdSev/AmdSevX64.fdf
index 5fb3b5d27632..25e446013cd4 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.fdf
+++ b/OvmfPkg/AmdSev/AmdSevX64.fdf
@@ -162,7 +162,7 @@ [FV.PEIFV]
 INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 INF  OvmfPkg/AmdSev/SecretPei/SecretPei.inf
 
-!include OvmfPkg/OvmfTpmPei.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
 
 

 
diff --git a/OvmfPkg/CloudHv/CloudHvX64.fdf b/OvmfPkg/CloudHv/CloudHvX64.fdf
index 0d13d4066d27..62d048bce181 100644
--- a/OvmfPkg/CloudHv/CloudHvX64.fdf
+++ b/OvmfPkg/CloudHv/CloudHvX64.fdf
@@ -168,7 +168,7 @@ [FV.PEIFV]
 !endif
 INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
-!include OvmfPkg/OvmfTpmPei.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
 
 

 
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index 5451bfb84525..09d5965803b1 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -172,7 +172,7 @@ [FV.PEIFV]
 !endif
 INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
-!include OvmfPkg/OvmfTpmPei.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
 
 

 
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index 4c5bd0dbc3b0..633e91f48403 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -172,7 +172,7 @@ [FV.PEIFV]
 !endif
 INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
-!include OvmfPkg/OvmfTpmPei.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
 
 

 
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index 1ba24440..fc58c7af1f82 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -188,7 +188,7 @@ [FV.PEIFV]
 INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 INF  FILE_GUID = $(UP_CPU_PEI_GUID) UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
-!include OvmfPkg/OvmfTpmPei.fdf.inc
+!include OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
 
 

 
diff --git a/OvmfPkg/OvmfTpmPei.fdf.inc b/OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
similarity index 100%
rename from OvmfPkg/OvmfTpmPei.fdf.inc
rename to OvmfPkg/Include/Fdf/OvmfTpmPei.fdf.inc
-- 
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100795): https://edk2.groups.io/g/devel/message/100795
Mute This Topic: https://groups.io/mt/97445872/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/1] MdeModulePkg: Improve formatting of DEBUG messages in UsbBusDxe

2023-03-07 Thread Wu, Hao A
Merged via:
PR - https://github.com/tianocore/edk2/pull/4102
Commit - 
https://github.com/tianocore/edk2/commit/46f51898ff716e53921b93e8d78af0fc7d06a2f9

Best Regards,
Hao Wu

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Wu, Hao A
> Sent: Monday, February 27, 2023 1:16 PM
> To: Rebecca Cran ; devel@edk2.groups.io; Wang, Jian J
> ; Gao, Liming ; Ni, Ray
> 
> Subject: Re: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: Improve formatting
> of DEBUG messages in UsbBusDxe
> 
> Reviewed-by: Hao A Wu .
> Will merge it after the upcoming stable tag announcement.
> 
> Best Regards,
> Hao Wu
> 
> > -Original Message-
> > From: Rebecca Cran 
> > Sent: Friday, February 24, 2023 8:18 AM
> > To: devel@edk2.groups.io; Wang, Jian J ; Gao,
> > Liming ; Wu, Hao A ; Ni,
> > Ray 
> > Cc: Rebecca Cran 
> > Subject: [PATCH v2 1/1] MdeModulePkg: Improve formatting of DEBUG
> > messages in UsbBusDxe
> >
> > Improve the formatting of DEBUG messages in UsbBusDxe by adding a
> > hyphen to separate the EFI_STATUS code.
> >
> > Signed-off-by: Rebecca Cran 
> > ---
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c| 12 ++--
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c   |  6 +++---
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c |  2 +-
> >  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbHub.c|  2 +-
> >  4 files changed, 11 insertions(+), 11 deletions(-)
> >
> > diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> > b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> > index 6a3ac63c3aa0..c25f3cc2f279 100644
> > --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> > +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
> > @@ -838,7 +838,7 @@ UsbIoPortReset (
> >if (EFI_ERROR (Status)) {
> >  DEBUG ((
> >DEBUG_ERROR,
> > -  "UsbIoPortReset: failed to reset hub port %d@hub  %d, %r \n",
> > +  "UsbIoPortReset: failed to reset hub port %d@hub  %d - %r\n",
> >Dev->ParentPort,
> >Dev->ParentAddr,
> >Status
> > @@ -945,7 +945,7 @@ UsbBusBuildProtocol (
> >);
> >
> >if (EFI_ERROR (Status)) {
> > -DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to open device path %r\n",
> > Status));
> > +DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to open device path -
> > + %r\n",
> > Status));
> >
> >  FreePool (UsbBus);
> >  return Status;
> > @@ -978,7 +978,7 @@ UsbBusBuildProtocol (
> > );
> >
> >if (EFI_ERROR (Status) && EFI_ERROR (Status2)) {
> > -DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to open
> > USB_HC/USB2_HC %r\n", Status));
> > +DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to open USB_HC/USB2_HC
> > + -
> >  %r\n", Status));
> >
> >  Status = EFI_DEVICE_ERROR;
> >  goto CLOSE_HC;
> > @@ -1006,7 +1006,7 @@ UsbBusBuildProtocol (
> >);
> >
> >if (EFI_ERROR (Status)) {
> > -DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to install bus protocol 
> > %r\n",
> > Status));
> > +DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to install bus protocol
> > + - %r\n",
> > Status));
> >  goto CLOSE_HC;
> >}
> >
> > @@ -1054,7 +1054,7 @@ UsbBusBuildProtocol (
> >Status = mUsbRootHubApi.Init (RootIf);
> >
> >if (EFI_ERROR (Status)) {
> > -DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to init root hub %r\n",
> > Status));
> > +DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to init root hub -
> > + %r\n",
> > Status));
> >  goto FREE_ROOTHUB;
> >}
> >
> > @@ -1102,7 +1102,7 @@ UsbBusBuildProtocol (
> >   );
> >FreePool (UsbBus);
> >
> > -  DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to start bus driver
> > %r\n", Status));
> > +  DEBUG ((DEBUG_ERROR, "UsbBusStart: Failed to start bus driver -
> > + %r\n",
> > Status));
> >return Status;
> >  }
> >
> > diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
> > b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
> > index a620a670748c..8b078e7e4936 100644
> > --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
> > +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.c
> > @@ -761,7 +761,7 @@ UsbGetOneConfig (
> >if (EFI_ERROR (Status)) {
> >  DEBUG ((
> >DEBUG_ERROR,
> > -  "UsbGetOneConfig: failed to get descript length(%d) %r\n",
> > +  "UsbGetOneConfig: failed to get descript length(%d) - %r\n",
> >Desc.TotalLength,
> >Status
> >));
> > @@ -787,7 +787,7 @@ UsbGetOneConfig (
> >Status = UsbCtrlGetDesc (UsbDev, USB_DESC_TYPE_CONFIG, Index, 0,
> > Buf, Desc.TotalLength);
> >
> >if (EFI_ERROR (Status)) {
> > -DEBUG ((DEBUG_ERROR, "UsbGetOneConfig: failed to get full
> > descript %r\n", Status));
> > +DEBUG ((DEBUG_ERROR, "UsbGetOneConfig: failed to get full
> > + descript -
> >  %r\n", Status));
> >
> >  FreePool (Buf);
> >  return NULL;
> > @@ -891,7 +891,7 @@ UsbBuildDescTable (
> >Status = UsbBuildLangTable (UsbDev);
> >
> >if (EFI_ERROR (Status)) {
> > -DEBUG ((DEBUG_INFO, "UsbBuildDescTable: get language ID table %r\n",
> > Status));
> > +DEBUG ((DEBUG_INFO, "UsbB

Re: [edk2-devel] [PATCH 1/2] NetworkPkg/HttpDxe: provide function to disable TLS host verify

2023-03-07 Thread Nickle Wang via groups.io
Hi @Michael Brown, @Maciej 
Rabeda, @Siyuan 
Fu,

I got an idea to handle this issue.

EFI_HTTP_SERVICE_BINDING_PROTOCOL is defined in UEFI specification for caller 
to create HTTP protocol on child instance. How about I propose a new service 
binding protocol called EFI_HTTP_NO_TLS_HOST_VERIFY_SERVICE_BINDING_PROTOCOL, 
and the EFI_HTTP_PROTOCOL created by this service binding protocol will not do 
TLS host verify during HTTPS communication.

When caller like to disable host verify on HTTPS communication, caller use this 
service binding protocol to create special HTTP instance. For other case, 
caller use regular EFI_HTTP_SERVICE_BINDING_PROTOCOL to get normal 
EFI_HTTP_PROTOCOL instance.

What do you think about this idea?

Thanks,
Nickle

From: devel@edk2.groups.io  On Behalf Of Nickle Wang via 
groups.io
Sent: Thursday, February 2, 2023 2:35 PM
To: Michael Brown ; devel@edk2.groups.io; Maciej Rabeda 
; Siyuan Fu 
Cc: Abner Chang ; Igor Kulchytskyy ; Nick 
Ramirez 
Subject: Re: [edk2-devel] [PATCH 1/2] NetworkPkg/HttpDxe: provide function to 
disable TLS host verify

External email: Use caution opening links or attachments


Hi Michael,



Thank you very much for your feedback. PCD was my idea too, but this may have 
impact to other HTTPS connection. I like to only disable TLS host verify on 
Redfish connection between BIOS and BMC.



Hi @Maciej Rabeda, @Siyuan 
Fu,



May I have your comments about this challenge? I am looking for a way of 
passing a flag to HTTP instance and this flag will disable TLS host 
verification.



Thanks,

Nickle



-Original Message-
From: Michael Brown mailto:mc...@ipxe.org>>
Sent: Wednesday, February 1, 2023 7:28 PM
To: devel@edk2.groups.io; Nickle Wang 
mailto:nick...@nvidia.com>>
Cc: Maciej Rabeda 
mailto:maciej.rab...@linux.intel.com>>; Siyuan 
Fu mailto:siyuan...@intel.com>>; Abner Chang 
mailto:abner.ch...@amd.com>>; Igor Kulchytskyy 
mailto:ig...@ami.com>>; Nick Ramirez 
mailto:nrami...@nvidia.com>>
Subject: Re: [edk2-devel] [PATCH 1/2] NetworkPkg/HttpDxe: provide function to 
disable TLS host verify



External email: Use caution opening links or attachments





On 01/02/2023 11:06, Nickle Wang via groups.io wrote:

> Thanks for catching this. To prevent the change to data structure,

> would you suggest me to create new interface in EFI_HTTP_PROTOCOL and

> disable TLS host verify?



Adding an interface to EFI_HTTP_PROTOCOL would also break the ABI by changing 
the layout of a data structure defined in the UEFI specification, and so can't 
be done.



I took a quick look through Http.h and I can't immediately see any way you can 
convey the information you want without making a breaking change.  There are no 
flags fields (that could be extended with extra flags in the same memory slot), 
no structure version number fields (that could allow structures to be extended, 
subject to a version number check), and no general-purpose "additional 
information" extension mechanism besides the one for passing arbitrary HTTP 
headers.



I suspect you'll need to either make a new protocol (lots of work, very

ugly) or find some sideband mechanism you can use to work around the problem, 
like a PCD to globally enable/disable host verification.



It may be worth waiting for one of the HttpDxe maintainers to offer an opinion 
on this, since I am totally unfamiliar with this part of the codebase.



Sorry,



Michael





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100792): https://edk2.groups.io/g/devel/message/100792
Mute This Topic: https://groups.io/mt/96669380/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] CryptoPkg/BaseCryptLib: avoid certain openssl library calls

2023-03-07 Thread Yao, Jiewen
Sure.
Thanks to remind me.
https://github.com/tianocore/edk2/pull/4104.

Thank you
Yao, Jiewen

> -Original Message-
> From: kra...@redhat.com 
> Sent: Tuesday, March 7, 2023 2:54 PM
> To: Yao, Jiewen 
> Cc: devel@edk2.groups.io; Oliver Steffen ; Pawel
> Polawski 
> Subject: Re: [edk2-devel] [PATCH 0/4] CryptoPkg/BaseCryptLib: avoid certain
> openssl library calls
> 
>   Hi,
> 
> Ping.  Code freeze is over, can we merge this now?
> 
> thanks,
>   Gerd
> 
> On Wed, Feb 15, 2023 at 08:15:32AM +, Yao, Jiewen wrote:
> > Reviewed-by: Jiewen Yao 
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of Gerd
> > > Hoffmann
> > > Sent: Tuesday, February 14, 2023 3:20 AM
> > > To: devel@edk2.groups.io
> > > Cc: Oliver Steffen ; Pawel Polawski
> > > ; Gerd Hoffmann 
> > > Subject: [edk2-devel] [PATCH 0/4] CryptoPkg/BaseCryptLib: avoid certain
> > > openssl library calls
> > >
> > > In preparation for the openssl 3.0 switch ...
> > >
> > > openssl 3.0 sneak preview (WIP still, does not yet pass CI) is at
> > > https://github.com/kraxel/edk2/commits/openssl3
> > >
> > > Gerd Hoffmann (4):
> > >   CryptoPkg/BaseCryptLib: avoid using SHA1()
> > >   CryptoPkg/BaseCryptLib: avoid using SHA256()
> > >   CryptoPkg/BaseCryptLib: avoid using SHA384()
> > >   CryptoPkg/BaseCryptLib: avoid using SHA512()
> > >
> > >  .../Library/BaseCryptLib/Hash/CryptSha1.c | 16 --
> > >  .../Library/BaseCryptLib/Hash/CryptSha256.c   | 16 --
> > >  .../Library/BaseCryptLib/Hash/CryptSha512.c   | 32 +++---
> -
> > >  3 files changed, 52 insertions(+), 12 deletions(-)
> > >
> > > --
> > > 2.39.1
> > >
> > >
> > >
> > > 
> > >
> >
> 
> --



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100791): https://edk2.groups.io/g/devel/message/100791
Mute This Topic: https://groups.io/mt/96943599/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-