Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-18 Thread Michael D Kinney
Have you looked to see what OS code does to access CSR registers? Mike From: 李超 Sent: Friday, August 18, 2023 7:18 PM To: devel@edk2.groups.io; af...@apple.com Cc: Kinney, Michael D ; pedro.falc...@gmail.com; Gao, Liming ; Feng, Bob C ; Chen, Christine Subject: Re: Re: [edk2-devel] About

回复: 回复: edk2-stable202308 Re: [edk2-devel][PATCH v1 1/1] MdeModulePkg: HeapGuard: Don't Assume Pool Head Allocated In First Page

2023-08-18 Thread gaoliming via groups.io
Oliver: https://github.com/tianocore/edk2/pull/4751 is created to merge this patch. Thanks Liming > -邮件原件- > 发件人: devel@edk2.groups.io 代表 gaoliming via > groups.io > 发送时间: 2023年8月19日 10:45 > 收件人: 'Oliver Smith-Denny' ; > devel@edk2.groups.io; quic_llind...@quicinc.com; 'Ard

回复: 回复: edk2-stable202308 Re: [edk2-devel][PATCH v1 1/1] MdeModulePkg: HeapGuard: Don't Assume Pool Head Allocated In First Page

2023-08-18 Thread gaoliming via groups.io
Oliver: This patch is not required to be updated. You can send another for this clean up in Allocate after the stable tag. Thanks Liming > -邮件原件- > 发件人: Oliver Smith-Denny > 发送时间: 2023年8月18日 1:05 > 收件人: gaoliming ; devel@edk2.groups.io; > quic_llind...@quicinc.com; 'Ard Biesheuvel' >

Re: [edk2-devel] About EDK2 supports Self Modifying Code

2023-08-18 Thread Chao Li
Hi Mike and Andrew, The CSR instructions integer value width is 14 bits, use for to access the CSR registers (Control And Status Registers). Just like Andrew saying, the CSR registers include status registers, exception registers, TLB registers, performance conters etc. Now, there are a few

[edk2-devel] [PATCH v2 24/25] ArmVirtPkg: Delete Memory Protection PCDs

2023-08-18 Thread Taylor Beebe
Now that the transition to use SetMemoryProtectionsLib and GetMemoryProtectionsLib is complete, delete the memory protection PCDs to avoid confusing the interface. All memory protection settings will now be set and consumed via the libraries. Signed-off-by: Taylor Beebe Cc: Ard Biesheuvel Cc:

[edk2-devel] [PATCH v2 25/25] MdeModulePkg: Delete Memory Protection PCDs

2023-08-18 Thread Taylor Beebe
Now that the transition to use SetMemoryProtectionsLib and GetMemoryProtectionsLib is complete, delete the memory protection PCDs to avoid confusing the interface. All memory protection settings will now be set and consumed via the libraries. Signed-off-by: Taylor Beebe Cc: Jian J Wang Cc:

[edk2-devel] [PATCH v2 23/25] OvmfPkg: Delete Memory Protection PCDs

2023-08-18 Thread Taylor Beebe
Now that the transition to use SetMemoryProtectionsLib and GetMemoryProtectionsLib is complete, delete the memory protection PCDs to avoid confusing the interface. All memory protection settings will now be set and consumed via the libraries. Signed-off-by: Taylor Beebe Cc: Ard Biesheuvel Cc:

[edk2-devel] [PATCH v2 22/25] MdeModulePkg: Delete PCD Profile from SetMemoryProtectionsLib

2023-08-18 Thread Taylor Beebe
Now that the transition to use SetMemoryProtectionsLib and GetMemoryProtectionsLib is complete, delete the PCD profile to avoid confusing the interface. All memory protection settings will now be set and consumed via the libraries. Signed-off-by: Taylor Beebe Cc: Jian J Wang Cc: Liming Gao ---

[edk2-devel] [PATCH v2 21/25] ArmVirtPkg: Apply Memory Protections via SetMemoryProtectionsLib

2023-08-18 Thread Taylor Beebe
Set the memory protections on Arm virtual platforms. Because the QemuFg parser is not currently available in ArmVirtPkg, use the RELEASE profile by default. Signed-off-by: Taylor Beebe Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Sami Mujawar Cc: Gerd Hoffmann ---

[edk2-devel] [PATCH v2 20/25] OvmfPkg: Enable Choosing Memory Protection Profile via QemuCfg

2023-08-18 Thread Taylor Beebe
Now that the EDK2 tree uses GetMemoryProtectionsLib to query the platform memory protection settings, OvmfPkg can be updated to use QemuCfg to set the entire memory protection profile instead of just SetNxForStack. For example, the following will set the DXE memory protection to the RELEASE

[edk2-devel] [PATCH v2 17/25] UefiCpuPkg: Use GetMemoryProtectionsLib instead of Memory Protection PCDs

2023-08-18 Thread Taylor Beebe
Replace references to the memory protection PCDs to instead check the platform protections via GetMemoryProtectionsLib. Because the protection profile is equivalent to the PCD settings, this updated does not cause a torn state. Signed-off-by: Taylor Beebe Cc: Eric Dong Cc: Ray Ni Cc: Rahul

[edk2-devel] [PATCH v2 18/25] MdeModulePkg: Use GetMemoryProtectionsLib instead of Memory Protection PCDs

2023-08-18 Thread Taylor Beebe
Replace references to the memory protection PCDs to instead check the platform protections via GetMemoryProtectionsLib. Because the protection profile is equivalent to the PCD settings, this updated does not cause a torn state. Signed-off-by: Taylor Beebe Cc: Jian J Wang Cc: Liming Gao Cc:

[edk2-devel] [PATCH v2 13/25] MdeModulePkg: Update DXE Handoff to use SetMemoryProtectionsLib

2023-08-18 Thread Taylor Beebe
Update the DXE handoff logic in MdeModulePkg to use SetMemoryProtectionsLib to fetch the platform memory protection settings and reference them when creating the page tables. Because the protection profile is equivalent to the PCD settings even when the platform does not explicitly set a profile,

[edk2-devel] [PATCH v2 12/25] UefiPayloadPkg: Update DXE Handoff to use SetMemoryProtectionsLib

2023-08-18 Thread Taylor Beebe
Update the DXE handoff logic in UefiPayloadPkg to use SetMemoryProtectionsLib to fetch the platform memory protection settings and reference them when creating the page tables. Because the protection profile is equivalent to the PCD settings even when the platform does not explicitly set a

[edk2-devel] [PATCH v2 19/25] MdeModulePkg: Add Additional Profiles to SetMemoryProtectionsLib

2023-08-18 Thread Taylor Beebe
Now that the EDK2 tree uses GetMemoryProtectionsLib to query the platform memory protection settings, we can add additional profiles to SetMemoryProtectionsLib to give plaforms more options for setting memory protections. Signed-off-by: Taylor Beebe Cc: Jian J Wang Cc: Liming Gao ---

[edk2-devel] [PATCH v2 15/25] EmulatorPkg: Use GetMemoryProtectionsLib instead of Memory Protection PCDs

2023-08-18 Thread Taylor Beebe
Replace references to the memory protection PCDs to instead check the platform protections via GetMemoryProtectionsLib. Because the protection profile is equivalent to the PCD settings, this updated does not cause a torn state. Signed-off-by: Taylor Beebe Cc: Andrew Fish Cc: Ray Ni ---

[edk2-devel] [PATCH v2 14/25] ArmPkg: Use GetMemoryProtectionsLib instead of Memory Protection PCDs

2023-08-18 Thread Taylor Beebe
Replace references to the memory protection PCDs to instead check the platform protections via GetMemoryProtectionsLib. Signed-off-by: Taylor Beebe Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar --- ArmPkg/Drivers/CpuDxe/CpuDxe.c | 5 ++--- ArmPkg/ArmPkg.dsc| 1 +

[edk2-devel] [PATCH v2 10/25] OvmfPkg: Apply Memory Protections via SetMemoryProtectionsLib

2023-08-18 Thread Taylor Beebe
Use SetMemoryProtectionsLib to set the memory protections for the platform in both normal and PEI-less boot. The protections set are equivalent to the PCD settings and the ability to set NxForStack via QemuCfg is preserved. Once the transition to use SetMemoryProtectionsLib and

[edk2-devel] [PATCH v2 16/25] OvmfPkg: Use GetMemoryProtectionsLib instead of Memory Protection PCDs

2023-08-18 Thread Taylor Beebe
Replace references to the memory protection PCDs to instead check the platform protections via GetMemoryProtectionsLib. Because the protection profile is equivalent to the PCD settings, this updated does not cause a torn state. Signed-off-by: Taylor Beebe Cc: Ard Biesheuvel Cc: Jiewen Yao Cc:

[edk2-devel] [PATCH v2 11/25] OvmfPkg: Update PeilessStartupLib to use SetMemoryProtectionsLib

2023-08-18 Thread Taylor Beebe
This patch updates the DXE Handoff in PEI-less Startup to use SetMemoryProtectionsLib to get the platform memory protection settings and build the page tables based on the applied protections. Signed-off-by: Taylor Beebe Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann

[edk2-devel] [PATCH v2 07/25] UefiCpuPkg: Always Set Stack Guard in MpPei Init

2023-08-18 Thread Taylor Beebe
Memory protection is not set in PEI and ingested during and after DXE handoff. This paradigm means that the platform cannot reliably query the stack guard setting during MpInit. Because the execution path of PEI consistent and no third party code is executed, setting the stack guard in MpInit on

[edk2-devel] [PATCH v2 08/25] ArmVirtPkg: Add Memory Protection Library Definitions to Platforms

2023-08-18 Thread Taylor Beebe
Add library classes for SetMemoryProtectionsLib and GetMemoryProtectionsLib to ArmVirtPkg. Signed-off-by: Taylor Beebe Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Sami Mujawar Cc: Gerd Hoffmann Cc: Julien Grall --- ArmVirtPkg/ArmVirt.dsc.inc | 6 ++ 1 file changed, 6 insertions(+) diff

[edk2-devel] [PATCH v2 09/25] OvmfPkg: Add Memory Protection Library Definitions to Platforms

2023-08-18 Thread Taylor Beebe
Add library classes for SetMemoryProtectionsLib and GetMemoryProtectionsLib to OvmfPkg platfomrs. Signed-off-by: Taylor Beebe Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Rebecca Cran Cc: Peter Grehan Cc: Corvin Köhne Cc: Jianyong Wu Cc: Anatol Belski Cc:

[edk2-devel] [PATCH v2 03/25] MdeModulePkg: Add NULL Instances for Get/SetMemoryProtectionsLib

2023-08-18 Thread Taylor Beebe
The NULL instances for GetMemoryProtectionsLib and SetMemoryProtectionsLib just zero out the memory protections structure effectively disabling memory protections. Signed-off-by: Taylor Beebe Cc: Jian J Wang Cc: Liming Gao ---

[edk2-devel] [PATCH v2 04/25] MdeModulePkg: Implement SetMemoryProtectionsLib and GetMemoryProtectionsLib

2023-08-18 Thread Taylor Beebe
The SetMemoryProtectionsLib implementation has functionality for setting protections based on a preset profile or a custom DXE/MM profile passed in by the caller. The implementation also supports locking the protections (tracked via an extra boolean stored in the HOB entry) which prevents the

[edk2-devel] [PATCH v2 02/25] MdeModulePkg: Define SetMemoryProtectionsLib and GetMemoryProtectionsLib

2023-08-18 Thread Taylor Beebe
SetMemoryProtectionsLib is a PEIM which allows platforms to apply memory protection settings to the current boot. GetMemoryProtectionsLib has DXE and MM implementations to allow platforms to query the current memory protection settings via a global variable populated by the library

[edk2-devel] [PATCH v2 05/25] MdeModulePkg: Apply Protections to the HOB List

2023-08-18 Thread Taylor Beebe
Because the platform memory protection settings will be stored in the HOB, the HOB list should be marked read-only and non-executable as soon as possible in boot. This patch page-aligns the allocated HOB list in DXE and marks it RO/NX during memory protection initialization. Signed-off-by:

[edk2-devel] [PATCH v2 06/25] MdeModulePkg: Check Print Level Before Dumping GCD Memory Map

2023-08-18 Thread Taylor Beebe
When page/pool protections are active, the GCD sync process takes quite a bit longer than normal. This behavior is primarily due to a function which dumps the GCD memory map to the console. This dump function runs only on DEBUG builds but will iterate through the GCD memory map dozens of times

[edk2-devel] [PATCH v2 01/25] MdeModulePkg: Add DXE and MM Memory Protection Settings Definitions

2023-08-18 Thread Taylor Beebe
These headers provide settings definitions for memory protections, settings profiles for easily enabling memory protections, and the GUIDs used for producing the memory protection HOB entry. The settings options are functionally 1:1 with the existing PCD bitfield definitions. Instead of setting a

[edk2-devel] [PATCH v2 00/25] Implement Dynamic Memory Protections

2023-08-18 Thread Taylor Beebe
In the past, memory protection settings were configured via FixedAtBuild PCDs, which resulted in a build-time configuration of memory mitigations. This approach limited the flexibility of applying mitigations to the system and made it difficult to update or adjust the settings post-build. In a

Re: [edk2-devel][PATCH v1 1/1] ArmVirtPkg: ArmVirtQemu: Add Graphics and Input

2023-08-18 Thread Ard Biesheuvel
On Fri, 18 Aug 2023 at 20:17, Oliver Smith-Denny wrote: > > Currently, unlike OVMF, ArmVirtQemu does not display any graphics, > only the QEMU monitor. Graphics are helpful to confirm booting into > an OS is successful, interacting with the EFI shell while getting > separate logging messages,

Re: [edk2-devel] [PATCH v3 1/1] MdePkg: Add Cxl20.h into IndustryStandard

2023-08-18 Thread Michael D Kinney
Is RegisterBlock a flexible array member? If so, then [] is the compatible syntax. Mike > -Original Message- > From: Chris Li OS > Sent: Friday, August 18, 2023 2:29 AM > To: devel@edk2.groups.io; Nong, Foster ; Gao, > Liming > Cc: Yao, Jiewen ; Ni, Ray ; > Kinney, Michael D ; Open

Re: [edk2-devel] [PATCH v1 1/1] OvmfPkg/Bhyve: build platform info HOB

2023-08-18 Thread Ard Biesheuvel
On Tue, 15 Aug 2023 at 10:10, Ard Biesheuvel wrote: > > On Mon, 14 Aug 2023 at 10:15, Corvin Köhne wrote: > > > > On Thu, 2023-08-10 at 15:54 -0400, Michael Kubacki wrote: > > > I'm not sure why test results are not being reported that may be a > > > larger issue. > > > > > > I pulled the branch

[edk2-devel] [PATCH V4 3/3] ShellPkg/AcpiView: Add MPAM Parser

2023-08-18 Thread Rohit Mathew
Add a parser for the MPAM (Memory system resource partitioning and monitoring) ACPI table. This parser would parse all MPAM related structures embedded as part of the ACPI table. Necessary validations are also performed where and when required. Signed-off-by: Rohit Mathew Cc: James Morese Cc:

[edk2-devel] [PATCH v4 2/3] ShellPkg: acpiview: Add routine to print 16 chars

2023-08-18 Thread Rohit Mathew
Certain ACPI tables like MPAM has fields which are 16 bytes long. Routines similar to Dump12Chars but for 16 characters are required to print such fields. Add Dump16Chars routine to satisfy this requirement. Signed-off-by: Rohit Mathew Cc: James Morese Cc: Sami Mujawar Cc: Thomas Abraham Cc:

[edk2-devel] [PATCH V4 1/3] MdePkg/IndustryStandard: Add definitions for MPAM ACPI specification

2023-08-18 Thread Rohit Mathew
From: Rohit Mathew Add definitions, macros and types for elements associated with MPAM ACPI 2.0 specification. Signed-off-by: Rohit Mathew Cc: James Morese Cc: Liming Gao Cc: Michael D Kinney Cc: Sami Mujawar Cc: Thomas Abraham Cc: Zhiguang Liu Acked-by: Liming Gao Reviewed-by: Pierre

[edk2-devel] [PATCH V4 0/3] MPAM ACPI definitions and parser

2023-08-18 Thread Rohit Mathew
This series adds the following - definitions corresponding to MPAM ACPI 2.0 specification. - MPAM parser An MPAM ACPI table formulated using the newly added MPAM ACPI definitions were validated on the linux kernel tree at [1]. The same table was parsed via acpiview using the newly added

Re: [edk2-devel] [PATCH V2 0/2] Add ProcessorUpgradeSocket definitions from SMBIOS 3.7.0

2023-08-18 Thread Zeng, Star
Got it, thanks Liming. So we need wait until 2023-08-25, then you can help merge the patches.  -Original Message- From: gaoliming Sent: Friday, August 18, 2023 3:03 PM To: devel@edk2.groups.io; Zeng, Star ; Cuevas Farfan, Eduardo Cc: Kinney, Michael D ; Liu, Zhiguang ; Gao, Zhichao

[edk2-devel] [PATCH v3 1/1] MdePkg: Add Cxl20.h into IndustryStandard

2023-08-18 Thread Chris Li OS via groups.io
Absorbed Foster's input with minor delta. @Nong, Foster @Liming and all kindly help review/vote again. One change compared with Intel's proposal is the below line, we prefer [1] style to be safer to work across all compilers. Let us know if you folks have different suggestions here. -

回复: [edk2-devel] [PATCH V2 0/2] Add ProcessorUpgradeSocket definitions from SMBIOS 3.7.0

2023-08-18 Thread gaoliming via groups.io
This patch seems a new feature to add new definition from SMBIOS 3.7.0. It is sent and reviewed after soft feature freeze. Based on the release rule, it will not be merged for this stable tag 202308. It can be merged after the stable tag is created. Thanks Liming > -邮件原件- > 发件人:

[edk2-devel] [PATCH 1/1] ShellPkg/SmbiosView: Update display of PCIe system slot ID

2023-08-18 Thread Nhi Pham via groups.io
This updates the system slot ID up to SlotTypePCIExpressGen6andBeyond (0xC4) to cover modern PCIe Gen. Cc: Zhichao Gao Signed-off-by: Nhi Pham --- ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git