Re: [edk2-devel] [PATCH] SimicsOpenBoardPkg: BoardX58Ich10 set PcdSmrrEnable as False

2023-04-25 Thread Ni, Ray
Reviewed-by: Ray Ni > -Original Message- > From: Liu, Zhiguang > Sent: Tuesday, April 25, 2023 2:37 PM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Desimone, Nathaniel L > ; Ni, Ray > Subject: [PATCH] SimicsOpenBoardPkg: BoardX58Ich10 set PcdSmrrEnable as > False > > In BoardX58Ich

Re: [edk2-devel] [PATCH 1/3] SimicsOpenBoardPkg: Support 64-bit Pei BoardX58Ich10

2023-04-25 Thread Ni, Ray
Reviewed-by: Ray Ni > -Original Message- > From: Liu, Zhiguang > Sent: Tuesday, April 25, 2023 2:40 PM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Desimone, Nathaniel L > ; Ni, Ray > Subject: [PATCH 1/3] SimicsOpenBoardPkg: Support 64-bit Pei BoardX58Ich10 > > Create a new platfor

[edk2-devel] [PATCH 0/5] refine Smm range code in BoardX58Ich10

2023-04-25 Thread Zhiguang Liu
In BoardX58Ich10 platform, two modules has hard-code about how SMM range should be, and this causes a issue since PEI phase may change SMM ranges now. This patch set refine Smm range related code. Zhiguang Liu (5): SimicsOpenBoardPkg: Build gEfiSmmSmramMemoryGuid Hob in S3 path SimicsOpenBoard

[edk2-devel] [PATCH 1/5] SimicsOpenBoardPkg: Build gEfiSmmSmramMemoryGuid Hob in S3 path

2023-04-25 Thread Zhiguang Liu
gEfiSmmSmramMemoryGuid Hob is needed for SmmRelocation feature even for S3 path. So in MemDetect.c, remove specical code path for S3 about creating gEfiSmmSmramMemoryGuid Hob and adding some memory descriptor, which does no harm in S3 path. Cc: Nate DeSimone Cc: Ray Ni Signed-off-by: Zhiguang Li

[edk2-devel] [PATCH 2/5] SimicsOpenBoardPkg: Move AcpiVariableGuid hob to MemDetect

2023-04-25 Thread Zhiguang Liu
Currently, MemDetect create gEfiSmmSmramMemoryGuid Hob containing one descriptor, which should be updated later, when AcpiVariableGuid hob use some buffer from SmRam. However, the Hob doesn't get updated, and this is a bug. Move the logic creating AcpiVariableGuid hob from PEIM SmmAccessPei.inf to

[edk2-devel] [PATCH 3/5] SimicsOpenBoardPkg: Use SmmAccessLib instead of SmmAccessPei.inf

2023-04-25 Thread Zhiguang Liu
SmmAccessPei.inf is a PEIM we should deleted, here is the reason: 1. It programs registers MCH_TOLUD to set the Low Usable DRAM, but reading LMCH_TOLUD always return zere in QSP platforms 2. It programs/reads MCH_TSEGMB to implemte some Smm Access service such as open/close/lock. However, this read

[edk2-devel] [PATCH 4/5] SimicsOpenBoardPkg: Use another SmmAccess Driver

2023-04-25 Thread Zhiguang Liu
Because of the similiar reason I mentioned in last commit, the SmmAccess2Dxe.inf driver should be deleted and the replacement will avoid hard-code and use gEfiSmmSmramMemoryGuid Hob to get Smm Range information. This can fix an exsiting bug, when gSmmBaseHobGuid may allocate buffer from smm range,

[edk2-devel] [PATCH 5/5] SimicsX58SktPkg: Remove unused Smm related modules

2023-04-25 Thread Zhiguang Liu
In last two commit, I replace the two SMM related modules, and now no platform will use these two moduels. Remove them Cc: Nate DeSimone Cc: Ray Ni Signed-off-by: Zhiguang Liu --- .../Smm/Access/SmmAccess2Dxe.c| 148 .../Smm/Access/SmmAccess2Dxe.inf | 54

Re: [edk2-devel] [PATCH 3/3] SimicsOpenBoardPkg: Remove unused PCD PcdSimicsSecPageTablesBase

2023-04-25 Thread Ni, Ray
Reviewed-by: Ray Ni > -Original Message- > From: Liu, Zhiguang > Sent: Tuesday, April 25, 2023 2:40 PM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Desimone, Nathaniel L > ; Ni, Ray > Subject: [PATCH 3/3] SimicsOpenBoardPkg: Remove unused PCD > PcdSimicsSecPageTablesBase > > Curren

[edk2-devel] [Patch V2 0/2] Update ProcTrace feature code for new requirements.

2023-04-25 Thread duntan
In V2 patch set: 1.Remove the patch to set MTC to 0. 2.Updated 'Update code to support enable ProcTrace only on BSP' based on Ray's comments. PCD name is updated to PcdCpuProcTraceBspOnly and cache the value in ConfigData. Use MemRegionBaseAddr and TopaTableBaseAddr instead of the unused loca

[edk2-devel] [Patch V2 1/2] UefiCpuPkg: Update code to support enable ProcTrace only on BSP

2023-04-25 Thread duntan
Update code to support enable ProcTrace only on BSP. Add a new dynamic PCD to indicate if enable ProcTrace only on BSP. In ProcTrace.c code, if this new PCD is true, only allocate buffer and set CtrlReg.Bits.TraceEn to 1 for BSP. Bugzila: https://bugzilla.tianocore.org/show_bug.cgi?id=4423 Signed-

[edk2-devel] [Patch V2 2/2] UefiCpuPkg: Update PT code to support enable collect performance

2023-04-25 Thread duntan
Update ProcTrace feature code to support enable collect performance data by generating CYC and TSC packets. Add a new dynamic PCD to indicate if enable performance collecting. In ProcTrace.c code, if this new PCD is true, after check cpuid, CYC and TSC packets will be generated by setting the corre

Re: [edk2-devel] [PATCH 1/1] DynamicTablesPkg/SsdtCpuTopology: Allow multi-packages topologies

2023-04-25 Thread Sami Mujawar
Hi Pierre, Thank you for this patch. These changes look good to me, other than the change-id in the commit message (which I will drop before merging the change). Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 09/03/2023 03:32 pm, pierre.gond...@arm.com wrote: From: Pierre Gondois The

[edk2-devel] [PATCH v2 1/1] ArmPkg/PlatformBootManagerLib: Add path to boot UEFI Shell over UiApp

2023-04-25 Thread PierreGondois
From: Pierre Gondois The UEFI Shell is a non-active boot option, at the opposite of UiApp. If no valid boot option is found, UiApp is selected. UiApp requires a human interaction. When installing a new EDKII image in CIs or when scripting is required, this is problematic. If no valid boot option

Re: [edk2-devel] [PATCH v5 00/13] BaseTools,CryptoPkg,EmulatorPkg,MdePkg,others: Delete CLANG35,CLANG38,VS2008-2013,EBC, deprecate GCC48,GCC49,GCC5, add GCC and GCCNOLTO, update CLANGDWARF

2023-04-25 Thread Rebecca Cran
I've merged the OBJCOPY fix. My understanding is that you're seeing a problem on Windows with an internal build: if you could share part of the log file with filenames etc. changed to protect proprietary information that could be useful so we can try and find where the program is trying to be r

Re: [edk2-devel] [PATCH 1/5] SimicsOpenBoardPkg: Build gEfiSmmSmramMemoryGuid Hob in S3 path

2023-04-25 Thread Ni, Ray
Zhiguang, Can you please keep the comments that explain why below 1MB memory resource should be added for QSP platform? Another question not related to your changes: why "AddMemoryRangeHob (BASE_1MB, LowerMemorySize);" is only called when PcdSmmSmramRequire is FALSE? Thanks, Ray > -Origi

Re: [edk2-devel] [PATCH 1/5] SimicsOpenBoardPkg: Build gEfiSmmSmramMemoryGuid Hob in S3 path

2023-04-25 Thread Ni, Ray
Please ignore my 2nd question. I saw " AddMemoryRangeHob (BASE_1MB, LowerMemorySize - TsegSize);" when PcdSmmSmramRequire is TRUE. > -Original Message- > From: devel@edk2.groups.io On Behalf Of Ni, Ray > Sent: Tuesday, April 25, 2023 9:49 PM > To: Liu, Zhiguang ; devel@edk2.groups.io > Cc

Re: [edk2-devel] [PATCH 2/5] SimicsOpenBoardPkg: Move AcpiVariableGuid hob to MemDetect

2023-04-25 Thread Ni, Ray
Reviewed-by: Ray Ni > -Original Message- > From: devel@edk2.groups.io On Behalf Of > Zhiguang Liu > Sent: Tuesday, April 25, 2023 3:03 PM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Desimone, Nathaniel L > ; Ni, Ray > Subject: [edk2-devel] [PATCH 2/5] SimicsOpenBoardPkg: Move > Acp

Re: [edk2-devel] [PATCH 3/5] SimicsOpenBoardPkg: Use SmmAccessLib instead of SmmAccessPei.inf

2023-04-25 Thread Ni, Ray
Can you fix some typos in the commit message? With that, Reviewed-by: Ray Ni > -Original Message- > From: Liu, Zhiguang > Sent: Tuesday, April 25, 2023 3:03 PM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Desimone, Nathaniel L > ; Ni, Ray > Subject: [PATCH 3/5] SimicsOpenBoardPkg: U

Re: [edk2-devel] [PATCH 4/5] SimicsOpenBoardPkg: Use another SmmAccess Driver

2023-04-25 Thread Ni, Ray
The code change looks good to me. Can you refine your commit message a bit to explain what the bug is? Thanks, Ray > -Original Message- > From: Liu, Zhiguang > Sent: Tuesday, April 25, 2023 3:03 PM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Desimone, Nathaniel L > ; Ni, Ray > Sub

Re: [edk2-devel] [PATCH 5/5] SimicsX58SktPkg: Remove unused Smm related modules

2023-04-25 Thread Ni, Ray
Reviewed-by: Ray Ni > -Original Message- > From: Liu, Zhiguang > Sent: Tuesday, April 25, 2023 3:03 PM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang ; Desimone, Nathaniel L > ; Ni, Ray > Subject: [PATCH 5/5] SimicsX58SktPkg: Remove unused Smm related > modules > > In last two commit,

Re: [edk2-devel] [Patch V2 1/2] UefiCpuPkg: Update code to support enable ProcTrace only on BSP

2023-04-25 Thread Ni, Ray
> +if (ProcTraceData->EnableOnBspOnly) { 1. can you please add comments here to remind reader that this is also the first and only time ProcTraceInitialize() runs? Similar comments in the next chunk code. > + MemRegionBaseAddr = (UINTN)AllocateAlignedReservedPages (Pages, > Align

Re: [edk2-devel] [Patch V2 2/2] UefiCpuPkg: Update PT code to support enable collect performance

2023-04-25 Thread Ni, Ray
> @@ -112,6 +115,7 @@ ProcTraceSupport ( >PROC_TRACE_DATA *ProcTraceData; >CPUID_STRUCTURED_EXTENDED_FEATURE_FLAGS_EBX Ebx; >CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_ECXEcx; > + CPUID_INTEL_PROCESSOR_TRACE_MAIN_LEAF_EBXMainLeafEbx; 1. can you update

Re: [edk2-devel] [PATCH v5 00/13] BaseTools,CryptoPkg,EmulatorPkg,MdePkg,others: Delete CLANG35,CLANG38,VS2008-2013,EBC, deprecate GCC48,GCC49,GCC5, add GCC and GCCNOLTO, update CLANGDWARF

2023-04-25 Thread Michael D Kinney
Made some progress on root cause. Related to rename of CLANG38 to CLANGDWARF definitions for IA32. Wil give an update in a few hours after some more testing. Mike > -Original Message- > From: devel@edk2.groups.io On Behalf Of Rebecca Cran > Sent: Tuesday, April 25, 2023 6:10 AM > To:

[edk2-devel] [RFC PATCH v1 05/30] ArmPkg & ArmVirtPkg: Make PcdMonitorConduitHvc a dynamic PCD

2023-04-25 Thread Sami Mujawar
The monitor call conduit is fixed for a platform firmware in most scenarios. For a normal virtual machine guest firmware, the default conduit is HVC. However, for Arm CCA the Realm code must use SMC as the conduit. To have a common code base for Guest/Virtual firmware to be used by both normal VMs

[edk2-devel] [RFC PATCH v1 01/30] ArmVirtPkg: kvmtool: Add Emulated Runtime variable support

2023-04-25 Thread Sami Mujawar
Although Kvmtool supports a CFI flash interface, it is currently implemented using file backed support on the Host. This scenario requires the VMM to be within the trust boundary. In Confidential Compute Architecture the VMM is outside the trust boundary. For such architectures Emulated Runtime va

[edk2-devel] [RFC PATCH v1 06/30] ArmVirtPkg: Add Arm CCA Realm Service Interface Library

2023-04-25 Thread Sami Mujawar
The Realm Management Monitor (RMM) is a software component which forms part of a system which implements the Arm Confidential Compute Architecture (CCA) and is responsible for management of Realms. The RMM specification defines a Realm Service Interface (RSI) that the Guest can use to request servi

[edk2-devel] [RFC PATCH v1 08/30] ArmVirtPkg: ArmCcaRsiLib: Add an interface to get an attestation token

2023-04-25 Thread Sami Mujawar
A CCA attestation token is a collection of claims about the state of a Realm and of the CCA platform on which the Realm is running. A CCA attestation token consists of two parts: * Realm token - Contains attributes of the Realm, including: # Realm Initial Measurement # Realm Extensible Me

[edk2-devel] [RFC PATCH v1 07/30] ArmVirtPkg: ArmCcaRsiLib: Add interfaces to manage the Realm IPA state

2023-04-25 Thread Sami Mujawar
The IPA space of a Realm is divided into two halves: Protected IPA space and Unprotected IPA space. Software in a Realm should treat the most significant bit of an IPA as a protection attribute. A Protected IPA is an address in the lower half of a Realm's IPA space. An Unprotected IPA is an address

[edk2-devel] [RFC PATCH v1 11/30] ArmVirtPkg: Define a GUID HOB for IPA width of a Realm

2023-04-25 Thread Sami Mujawar
The IPA width of a Realm is read from the Realm Config by invoking the RSI call RSI_REALM_CONFIG to read the Realm Config. The IPA width is then stored in a GUID HOB gArmCcaIpaWidthGuid for subsequent use. This GUID HOB is also useful to pass the IPA width of the Realm to the DXE phase. Signed-of

[edk2-devel] [RFC PATCH v1 09/30] ArmVirtPkg: ArmCcaRsiLib: Add interfaces to get/extend REMs

2023-04-25 Thread Sami Mujawar
The Section A2.1.3 Realm attributes, RMM Specification, version A-bet0 introduces the concept of REMs as described below: DGRFCS - A Realm Extensible Measurement (REM) is a measurement value which can be extended during the lifetime of a Realm. IFMPYL - Attributes of a Realm include

[edk2-devel] [RFC PATCH v1 16/30] ArmVirtPkg: Define an interface to configure MMIO regions for Arm CCA

2023-04-25 Thread Sami Mujawar
The IPA space of a Realm is divided into two halves: - Protected IPA space and - Unprotected IPA space. Software in a Realm should treat the most significant bit of an IPA as a protection attribute. The Unprotected IPA space is used for sharing memory and for performing MMIO accesses with the

[edk2-devel] [RFC PATCH v1 17/30] ArmVirtPkg: CloudHv: Add a NULL implementation of ArmCcaConfigureMmio

2023-04-25 Thread Sami Mujawar
To support Arm CCA, a hook function ArmCcaConfigureMmio () has been added to the ArmVirtMemInfoLib library. Since, Arm CCA has not been enabled for the Cloud Hypervisor guest firmware, update the CloudHvVirtMemInfoLib library to add a NULL implementation for ArmCcaConfigureMmio () that returns RET

[edk2-devel] [RFC PATCH v1 19/30] ArmVirtPkg: Xen: Add a NULL implementation of ArmCcaConfigureMmio

2023-04-25 Thread Sami Mujawar
To support Arm CCA, a hook function ArmCcaConfigureMmio () has been added to the ArmVirtMemInfoLib library. Since, Arm CCA has not been enabled for the Xen guest firmware, update the XenVirtMemInfoLib library to add a NULL implementation for ArmCcaConfigureMmio () that returns RETURN_UNSUPPORTED.

[edk2-devel] [RFC PATCH v1 10/30] ArmVirtPkg: ArmCcaRsiLib: Add an interface to make a RSI Host Call

2023-04-25 Thread Sami Mujawar
The Section A4.5 Host call, RMM Specification, version A-bet0 describes the programming model for Realm communication with the Host and specifies the following: DYDJWT - A Host call is a call made by the Realm to the Host, by execution of the RSI_HOST_CALL command. IXNFKZ - A Host ca

[edk2-devel] [RFC PATCH v1 13/30] ArmVirtPkg: Add NULL instance of ArmCcaInitPeiLib

2023-04-25 Thread Sami Mujawar
Add a NULL instance of ArmCcaInitPeiLib library that guest firmware for VMMs that do not implement Arm CCA Realms can use. Signed-off-by: Sami Mujawar --- ArmVirtPkg/ArmVirt.dsc.inc | 2 + ArmVirtPkg/Library/ArmCcaInitPeiLibNull/ArmCcaInitPeiLibNull.c | 5

[edk2-devel] [RFC PATCH v1 18/30] ArmVirtPkg: Qemu: Add a NULL implementation of ArmCcaConfigureMmio

2023-04-25 Thread Sami Mujawar
To support Arm CCA, a hook function ArmCcaConfigureMmio () has been added to the ArmVirtMemInfoLib library. Since, Arm CCA has not been enabled for the Qemu guest firmware, update the QemuVirtMemInfoLib library to add a NULL implementation for ArmCcaConfigureMmio () that returns RETURN_UNSUPPORTED

[edk2-devel] [RFC PATCH v1 15/30] ArmVirtPkg: Add Null instance of ArmCcaLib

2023-04-25 Thread Sami Mujawar
Add a Null instance of ArmCcaLib so that guest firmware that does not support Arm CCA can link to this Null version of the library. Also include it in ArmVirt.dsc.inc so that it is linked for the non-Arm CCA firmware builds. Signed-off-by: Sami Mujawar --- ArmVirtPkg/ArmVirt.dsc.inc

[edk2-devel] [RFC PATCH v1 20/30] ArmVirtPkg: Configure the MMIO regions for Arm CCA

2023-04-25 Thread Sami Mujawar
The IPA space of a Realm is divided into two halves: - Protected IPA space and - Unprotected IPA space. Software in a Realm should treat the most significant bit of an IPA as a protection attribute. The Unprotected IPA space is used for sharing memory and for performing MMIO accesses with the

[edk2-devel] [RFC PATCH v1 14/30] ArmVirtPkg: Add library for Arm CCA helper functions

2023-04-25 Thread Sami Mujawar
Introduce ArmCcaLib library that implements helper functions to: - probe if the code is executing in a Realm context - configure the protection attribute in page tables for the memory regions shared with the host - get the IPA width of the Realm which was stored in the GUID HOB gArmCcaIpaWidthG

[edk2-devel] [RFC PATCH v1 23/30] ArmVirtPkg: Arm CCA configure system memory in early Pei

2023-04-25 Thread Sami Mujawar
When a VMM creates a Realm, a small amount of DRAM (which contains the firmware image) and the initial content is configured as Protected RAM. The remaining System Memory is in the Protected Empty state. The firmware must then initialise the remaining System Memory as Protected RAM before it can be

[edk2-devel] [RFC PATCH v1 21/30] ArmVirtPkg: Kvmtool: Use Null version of DebugLib in PrePi

2023-04-25 Thread Sami Mujawar
The patch at "6c8a08bd8a680 ArmVirtPkg/PrePi: Ensure timely execution of library constructors" moved the processing of library constructors before the MMU is initialised. This resulted in the BaseDebugLibSerialPort library constructor BaseDebugLibSerialPortConstructor () which initialises the ser

[edk2-devel] [RFC PATCH v1 24/30] ArmVirtPkg: Perform Arm CCA initialisation in the Pei phase

2023-04-25 Thread Sami Mujawar
Add ArmCcaInitialize () to perform Arm CCA specific initialisation like: - Reading the Realm Config by calling the RSI interface. - Storing the IPA width of the Realm in PcdArmCcaEarlyIpaWidth. - Configuring the MMIO regions to update the page tables to set the protection attribute as Unprote

[edk2-devel] [RFC PATCH v1 12/30] ArmVirtPkg: Add library for Arm CCA initialisation in PEI

2023-04-25 Thread Sami Mujawar
Add ArmCcaInitPeiLib library that performs the Arm CCA specific initialisation in the PEI phase like: - Configuring the system memory as Protected RAM. - Reading the Realm Config and storing the IPA width in a GUID HOB i.e., gArmCcaIpaWidthGuid for subsequent use. - Calling ArmCcaConfigureMmi

[edk2-devel] [RFC PATCH v1 22/30] ArmVirtPkg: Add Arm CCA libraries for Kvmtool guest firmware

2023-04-25 Thread Sami Mujawar
The following libraries have been introduced for Arm CCA: * ArmCcaInitPeiLib - provides functions for ARM CCA initialisations in early PEI phase. * ArmCcaLib- provides the necessary helper functions for Arm CCA * ArmCcaRsiLib - implements f

[edk2-devel] [RFC PATCH v1 28/30] ArmVirtPkg: Enable Virtio communication for Arm CCA

2023-04-25 Thread Sami Mujawar
Arm CCA Realms protect the access to memory from outside the Realm. For Virtio to work the Realm Guest and the Host should be able to share buffers. Realm Aperture Management protocol (RAMP) manages the sharing of buffers between the Realm Guest and the Host, while the ArmCcaIoMmuDxe implements th

[edk2-devel] [RFC PATCH v1 26/30] ArmVirtPkg: Introduce Realm Aperture Management Protocol

2023-04-25 Thread Sami Mujawar
The Realm Aperture Management Protocol (RAMP) is used to manage the sharing of buffers between the Guest and Host. It configures the memory regions as Protected EMPTY or Protected RAM by calling RSI_IPA_STATE_SET command. The RAMP provides interfaces that device drivers can use to open/close apertu

[edk2-devel] [RFC PATCH v1 30/30] ArmVirtPkg: Kvmtool: Switch to use BaseRng for AArch64

2023-04-25 Thread Sami Mujawar
The kvmtool guest firmware is using the default RNG library defined in ArmVirtPkg.dsc.inc which is BaseRngLibTimerLib. BaseRngLibTimerLib is only present to use for test purposes on platforms that do not have a suitable RNG source and must not be used for production purposes. Armv8.5 introduces r

[edk2-devel] [RFC PATCH v1 29/30] MdePkg: Warn if AArch64 RNDR instruction is not supported

2023-04-25 Thread Sami Mujawar
The BaseRngLib library constructor for AArch64 asserts if the RNDR instruction is not supported by the CPU. This approach to warn about the unsupported instruction may be suitable for the host platform firmware. However, for a guest firmware the only mechanism to discover the supported RNG interfac

[edk2-devel] [RFC PATCH v1 25/30] ArmVirtPkg: Add ArmCcaDxe for early DXE phase initialisation

2023-04-25 Thread Sami Mujawar
Add ArmCcaDxe for early DXE phase initialisation like setting up the monitor call conduit for Realm code The Realm code should use SMC as the conduit for monitor calls. Therefore, set the PcdMonitorConduitHvc to FALSE if the code is running in a Realm. Note: ArmCcaDxe is configured as an APRIORI

[edk2-devel] [RFC PATCH v1 27/30] ArmVirtPkg: IoMMU driver to DMA from Realms

2023-04-25 Thread Sami Mujawar
On Arm CCA systems the access to pages inside the Realm is protected. However, software executing in a Realm needs to interact with the external world. This may be done using para virtualisation of the disk, network interfaces, etc. For this to work the buffers in the Realm need to be shared with

[edk2-devel] [RFC PATCH v1 02/30] ArmPkg: Add helper function to detect RME

2023-04-25 Thread Sami Mujawar
Add helper function to check if the Realm Management Extension (RME) is implemented by the hardware. Signed-off-by: Sami Mujawar --- ArmPkg/Include/Chipset/AArch64.h | 3 ++- ArmPkg/Include/Library/ArmLib.h| 15 ++- ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c |

[edk2-devel] [RFC PATCH v1 03/30] ArmPkg: Export SetMemoryRegionAttribute in ArmMmuLib

2023-04-25 Thread Sami Mujawar
Arm CCA requires the software in a Realm to treat the most significant bit of an IPA as a protection attribute. To enable/disable sharing of memory regions with the host, the protection attribute needs to be set/cleared accordingly. Instead of implementing the functionality to Set/Clear the protec

[edk2-devel] [RFC PATCH v1 04/30] ArmPkg: Extend number of parameter registers in SMC call

2023-04-25 Thread Sami Mujawar
The Realm Service Interface (RSI) commands use registers between X1-X10 as parameters and between X0-X8 as return values for SMC calls. According to the SMCCC Section 2.6 SMC32/HVC32 argument passing When an SMC32/HVC32 call is made from AArch32: - Arguments are passed in registers R1-R7.

[edk2-devel] [RFC PATCH v1 00/30] Support for Arm CCA guest firmware

2023-04-25 Thread Sami Mujawar
We are happy to announce an early RFC version of the Arm Confidential Compute Architecture (CCA) support for the Kvmtool guest firmware. The intention is to seek early feedback in the following areas: * Integration of the Arm CCA in ArmVirtPkg * Generalise the operations wherever possible with ot

[edk2-devel][PATCH v1 1/2] UefiPayloadPkg: Define RngLibTimerLib for systems without RDRAND

2023-04-25 Thread Benjamin Doron
From: Benjamin Doron Presently, `ArchIsRngSupported()` always returns TRUE, per https://github.com/tianocore/edk2/blob/1eeca0750af5af2f0e78437bf791ac2de74bde74/MdePkg/Library/BaseRngLib/Rand/RdRand.c#L124-L125. Therefore, `BaseRngLibConstructor()` should continue to assert RDRAND support. Howeve

[edk2-devel][PATCH v1 2/2] UefiPayloadPkg: Enable RNG support

2023-04-25 Thread Benjamin Doron
From: Benjamin Doron Uses CPU RDRAND support and installs the EfiRngProtocol. The protocol may be used by iPXE or the Linux kernel to gather entropy. Cc: Guo Dong Cc: Ray Ni Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Signed-off-by: Benjamin Doron --- UefiPayloadPkg/UefiPayloadPkg.dsc | 3 ++

Re: [edk2-devel] [Patch V3 0/8] Create page table by CpuPageTableLib in DxeIpl

2023-04-25 Thread Ard Biesheuvel
On Tue, 25 Apr 2023 at 03:45, Ni, Ray wrote: > > > > > -Original Message- > > From: devel@edk2.groups.io On Behalf Of Ard > > Biesheuvel > > Sent: Tuesday, April 25, 2023 2:07 AM > > To: Kinney, Michael D > > Cc: devel@edk2.groups.io; Tan, Dun > > Subject: Re: [edk2-devel] [Patch V3 0/8

Re: [edk2-devel] [PATCH 1/2] SecurityPkg: Add RNG support

2023-04-25 Thread Benjamin Doron
Please see https://edk2.groups.io/g/devel/message/103583 and https://edk2.groups.io/g/devel/message/103584. Thanks. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103585): https://edk2.groups.io/g/devel/message/103585 Mute This Topic: ht

[edk2-devel] [PATCH 0/6] edksetup.bat, BaseTools: Improve Windows environment setup and BaseTools C compilation

2023-04-25 Thread Rebecca Cran
There are remnants of Python 2 support in BaseTools/toolsetup.bat that it's probably time to remove since we only support Python 3.9 and newer these days. So, remove the variables that enable Python3 support and simplify the batch script. I've also seen errors where after running edksetup.bat the b

[edk2-devel] [PATCH 1/6] BaseTools: Remove Python2/Python3 detection from toolset.bat

2023-04-25 Thread Rebecca Cran
Since Python3 is now required, we can remove the checks for PYTHON3_ENABLE and PYTHON3 and simplify the code in toolsetup.bat. Also, remove the leftover from when we supported freezing Python code. While here, fix a couple of typos and improve error messages. Signed-off-by: Rebecca Cran --- Bas

[edk2-devel] [PATCH 2/6] BaseTools: use threading.current_thread in NmakeSubdirs.py

2023-04-25 Thread Rebecca Cran
threading.currentThread is a deprecated alias for threading.current_thread, and causes a warning to be displayed when it's called. Update NmakeSubdirs.py to use the latter method instead. Signed-off-by: Rebecca Cran --- BaseTools/Source/C/Makefiles/NmakeSubdirs.py | 2 +- 1 file changed, 1 inser

[edk2-devel] [PATCH 3/6] edksetup.bat: if toolsetup.bat fails, just exit

2023-04-25 Thread Rebecca Cran
If toolsetup.bat fails (i.e. exits with a non-zero %ERRORLEVEL%), don't try and carry on but just quit. Signed-off-by: Rebecca Cran --- edksetup.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/edksetup.bat b/edksetup.bat index 7ad137bb3e9b..b63b57fc873e 100755 --- a/edksetup.bat +++ b/ed

[edk2-devel] [PATCH 4/6] BaseTools: Update toolsetup.bat and Tests/PythonTest.py to check ver

2023-04-25 Thread Rebecca Cran
Update toolsetup.bat and Tests/PythonTest.py to check if we're running a version of Python that's compatible with BaseTools and the Pip BaseTools. Since edk2-pytool-extensions (https://pypi.org/project/edk2-pytool-extensions/) requires Python 3.9 or newer, set that as the minimum version EDK2 requ

[edk2-devel] [PATCH 5/6] BaseTools: Update toolsetup.bat to not use BASETOOLS_PYTHON_SOURCE

2023-04-25 Thread Rebecca Cran
The BASETOOLS_PYTHON_SOURCE environment variable is only used temporarily to set PYTHONPATH. Since it doesn't help improve clarity, remove it. While here, make sure we set PYTHONPATH when we're using Pip BaseTools so that build etc. can be found. Signed-off-by: Rebecca Cran --- BaseTools/toolse

[edk2-devel] [PATCH 6/6] BaseTools: only print the environment once in toolsetup.bat

2023-04-25 Thread Rebecca Cran
Avoid printing %PATH% twice: move the printing of the environment down to print_python_info. Signed-off-by: Rebecca Cran --- BaseTools/toolsetup.bat | 35 +--- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/BaseTools/toolsetup.bat b/BaseTools/toolsetup.bat index

Re: [edk2-devel] [V1 PATCH 1/1] MdePkg: TDX: Correct TDCALL_INFO_RETURN_DATA layout

2023-04-25 Thread Vishal Annapurve via groups.io
On Wed, Feb 15, 2023 at 4:10 PM Xu, Min M wrote: > > On February 16, 2023 3:51 AM, Vishal Annapurve wrote: > > > > TDCALL_INFO should return num_vcpus as lower 4 bytes of r8 register > > according to the tdx spec, so reorder num_vcpus and max_vcpus fields to > > match the spec. > > > > Reference:

Re: [edk2-devel] [PATCH v7 0/3] RISC-V SBI-backed SerialLib

2023-04-25 Thread Andrei Warkentin
Thanks for the review. I believe this patch set is ready for merging. Sunil had one comment on the contents of the UNI file, which I clarified. Sunil, anything else you wanted from this patch set or is it good to go? A > -Original Message- > From: Kinney, Michael D > Sent: Friday, Apri

[edk2-devel] [PATCH v2 0/4] Fixes for SEV-SNP CC blob and CPUID table handling

2023-04-25 Thread Roth, Michael via groups.io
(Mainly a resend of v1, but rolled in Gerd's Acked-by's, addressed new coding style check in the CI, and updated Cc list) Here are a number of fixes related to OVMF handling of the SEV-SNP Confidential Computing blob and CPUID table. Patch #1 is a fix for recently-reported issue that can cause si

[edk2-devel] [PATCH v2 1/4] OvmfPkg/AmdSevDxe: Allocate SEV-SNP CC blob as EfiACPIReclaimMemory

2023-04-25 Thread Roth, Michael via groups.io
The SEV-SNP Confidential Computing blob contains metadata that should remain accessible for the life of the guest. Allocate it as EfiACPIReclaimMemory to ensure the memory isn't overwritten by the guest operating system later. Reported-by: Dov Murik Suggested-by: Dov Murik Reviewed-by: Dov Murik

[edk2-devel] [PATCH v2 2/4] OvmfPkg/AmdSevDxe: Update ConfidentialComputing blob struct definition

2023-04-25 Thread Roth, Michael via groups.io
The Confidential Computing blob defined here is intended to match the definition defined by linux guest kernel. Previously, both definitions relied on natural alignment, but that relies on both OVMF and kernel being compiled as 64-bit. While there aren't currently any plans to enable SNP support fo

[edk2-devel] [PATCH v2 3/4] OvmfPkg/CcExitLib: Fix SEV-SNP XSave area size calculation

2023-04-25 Thread Roth, Michael via groups.io
CPUID leaf 0xD sub-leafs 0x0 and 0x1 contain cumulative sizes for the enabled XSave areas. Those sizes are calculated by tallying up all the other sub-leafs that contain per-area size information for XSave areas that are currently enabled in XCr0/XSS. The current check has the logic inverted. Fix t

[edk2-devel] [PATCH v2 4/4] OvmfPkg/CcExitLib: Use documented XSave area base size for SEV-SNP

2023-04-25 Thread Roth, Michael via groups.io
Currently OVMF tries to rely on the base size advertised via the CPUID table entries corresponding to leaf 0xD, sub-leafs 0x0/0x1. This will generally work for KVM guests, but might not for other SEV-SNP hypervisor implementations. Make the handling more robust by simply using the base area size do

[edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, April 25, 2023 #cal-reminder

2023-04-25 Thread Group Notification
*Reminder: TianoCore Bug Triage - APAC / NAMO* *When:* Tuesday, April 25, 2023 6:30pm to 7:30pm (UTC-07:00) America/Los Angeles *Where:* https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTk1YzJhN2UtOGQwNi00NjY4LWEwMTktY2JiODRlYTY1NmY0%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4e

Re: [edk2-devel] [Patch V2 2/2] UefiCpuPkg: Update PT code to support enable collect performance

2023-04-25 Thread duntan
Thanks for the comments. I'll update the code in next version patch. Thanks, Dun -Original Message- From: Ni, Ray Sent: Tuesday, April 25, 2023 10:14 PM To: Tan, Dun ; devel@edk2.groups.io Cc: Dong, Eric ; Kumar, Rahul R ; Gerd Hoffmann ; Chen, Xiao X Subject: RE: [Patch V2 2/2] UefiC

Re: [edk2-devel] [Patch V2 1/2] UefiCpuPkg: Update code to support enable ProcTrace only on BSP

2023-04-25 Thread duntan
Thanks for the comments. I'll add comments to explain it. Thanks, Dun -Original Message- From: Ni, Ray Sent: Tuesday, April 25, 2023 10:10 PM To: devel@edk2.groups.io; Tan, Dun Cc: Dong, Eric ; Kumar, Rahul R ; Gerd Hoffmann ; Chen, Xiao X Subject: RE: [edk2-devel] [Patch V2 1/2] Uef

[edk2-devel] [Patch V3 0/2] Update ProcTrace feature code for new requirements.

2023-04-25 Thread duntan
In V3 patch set: 1. Add more comments in 'Update code to support enable ProcTrace only on BSP' 2. Rename some local varibles and remove a uneeded if check in 'Update PT code to support enable collect performance' Dun Tan (2): UefiCpuPkg: Update code to support enable ProcTrace only on BSP Uef

[edk2-devel] [Patch V3 1/2] UefiCpuPkg: Update code to support enable ProcTrace only on BSP

2023-04-25 Thread duntan
Update code to support enable ProcTrace only on BSP. Add a new dynamic PCD to indicate if enable ProcTrace only on BSP. In ProcTrace.c code, if this new PCD is true, only allocate buffer and set CtrlReg.Bits.TraceEn to 1 for BSP. Bugzila: https://bugzilla.tianocore.org/show_bug.cgi?id=4423 Signed-

[edk2-devel] [Patch V3 2/2] UefiCpuPkg: Update PT code to support enable collect performance

2023-04-25 Thread duntan
Update ProcTrace feature code to support enable collect performance data by generating CYC and TSC packets. Add a new dynamic PCD to indicate if enable performance collecting. In ProcTrace.c code, if this new PCD is true, after check cpuid, CYC and TSC packets will be generated by setting the corre

Re: [edk2-devel] [Patch V3 0/2] Update ProcTrace feature code for new requirements.

2023-04-25 Thread Ni, Ray
Reviewed-by: Ray Ni > -Original Message- > From: devel@edk2.groups.io On Behalf Of duntan > Sent: Wednesday, April 26, 2023 9:54 AM > To: devel@edk2.groups.io > Subject: [edk2-devel] [Patch V3 0/2] Update ProcTrace feature code for new > requirements. > > In V3 patch set: > 1. Add more

Re: [edk2-devel] [PATCH v3 2/3] MdePkg: Support FDT library.

2023-04-25 Thread Chiu, Chasel
Hello, Since platform may also define other FDT structures, this EDK2 library may not be able to convert all the FDT structures to little endian. We might define a generic MACRO in library like CONVERT_FDT_DATA_TO_LITTLE_ENDIAN which can be used for all structure data, but it will be almost li

Re: [edk2-devel] [Patch V3 0/8] Create page table by CpuPageTableLib in DxeIpl

2023-04-25 Thread Ni, Ray
I can think of 3 options: 1. Create MdeModulePkg/HandOffToDxeCoreLib lib class. UefiCpuPkg implements the two instances supporting 32/64bit PEI. 2. Create MdeModulePkg/Ppi/EdkiiMemoryAttribute.h. UefiCpuPkg/CpuMpPei implements the X86 version of MemoryAttribute PPI. (As what Ard did in ArmCp

[edk2-devel] [PATCH v2 0/5] refine Smm range code in BoardX58Ich10

2023-04-25 Thread Zhiguang Liu
In BoardX58Ich10 platform, two modules has hard-code about how SMM range should be, and this causes a issue since PEI phase may change SMM ranges now. This patch set refine Smm range related code. v2 refine comments and commit message Zhiguang Liu (5): SimicsOpenBoardPkg: Build gEfiSmmSmramMemor

[edk2-devel] [PATCH v2 1/5] SimicsOpenBoardPkg: Build gEfiSmmSmramMemoryGuid Hob in S3 path

2023-04-25 Thread Zhiguang Liu
gEfiSmmSmramMemoryGuid Hob is needed for SmmRelocation feature even for S3 path. So in MemDetect.c, remove specical code path for S3 about creating gEfiSmmSmramMemoryGuid Hob and adding some memory descriptor, which does no harm in S3 path. Cc: Nate DeSimone Cc: Ray Ni Signed-off-by: Zhiguang Li

[edk2-devel] [PATCH v2 2/5] SimicsOpenBoardPkg: Move AcpiVariableGuid hob to MemDetect

2023-04-25 Thread Zhiguang Liu
Currently, MemDetect create gEfiSmmSmramMemoryGuid Hob containing one descriptor, which should be updated later, when AcpiVariableGuid hob use some buffer from SmRam. However, the Hob doesn't get updated, and this is a bug. Move the logic creating AcpiVariableGuid hob from PEIM SmmAccessPei.inf to

[edk2-devel] [PATCH v2 3/5] SimicsOpenBoardPkg: Use SmmAccessLib instead of SmmAccessPei.inf

2023-04-25 Thread Zhiguang Liu
SmmAccessPei.inf is a PEIM we should delete, here is the reason: 1. It programs registers MCH_TOLUD to set the Low Usable DRAM, but reading LMCH_TOLUD always return zero in QSP platforms 2. It programs/reads MCH_TSEGMB to implement some Smm Access service such as open/close/lock. However, this read

[edk2-devel] [PATCH v2 4/5] SimicsOpenBoardPkg: Use another SmmAccess Driver

2023-04-25 Thread Zhiguang Liu
Because of the similar reason I mentioned in last commit, the SmmAccess2Dxe.inf driver should be deleted and the replacement will avoid hard-code and use gEfiSmmSmramMemoryGuid Hob to get Smm Range information. This can fix an existing bug. In pei phase, some module may use some SMM range, and mar

[edk2-devel] [PATCH v2 5/5] SimicsX58SktPkg: Remove unused Smm related modules

2023-04-25 Thread Zhiguang Liu
In last two commit, I replace the two SMM related modules, and now no platform will use these two moduels. Remove them Cc: Nate DeSimone Cc: Ray Ni Reviewed-by: Ray Ni Signed-off-by: Zhiguang Liu --- .../Smm/Access/SmmAccess2Dxe.c| 148 .../Smm/Access/SmmAccess2Dxe.in

Re: [edk2-devel] [PATCH v1 1/2] Add the volatile keyword to NvmExpressDxe's Passthru CQs and SQs.

2023-04-25 Thread Wu, Hao A
Thanks Oliver, For the Submission Queue pointer "Sq", I think it is being used to format the command that will be sent to the NVME controller. NvmExpressPassThru() does not read back its content for checking after the command gets submitted. My opinion is that it might be not necessary to add vo

Re: [edk2-devel] [PATCH v7 0/3] RISC-V SBI-backed SerialLib

2023-04-25 Thread Sunil V L
On Tue, Apr 25, 2023 at 07:26:41PM +, Andrei Warkentin wrote: > Thanks for the review. I believe this patch set is ready for merging. Sunil > had one comment on the contents of the UNI file, which I clarified. Sunil, > anything else you wanted from this patch set or is it good to go? > Hi An