Re: [edk2-devel] [PATCH 0/6] Fine tune SimicsOpenBoardPkg

2023-05-25 Thread Zhiguang Liu
Reviewed-by: Zhiguang Liu > -Original Message- > From: devel@edk2.groups.io On Behalf Of Ni, Ray > Sent: Wednesday, May 24, 2023 8:29 PM > To: devel@edk2.groups.io > Subject: [edk2-devel] [PATCH 0/6] Fine tune SimicsOpenBoardPkg > > > Ray Ni (6): > SimicsOpenBoardPkg: Remove un-used

Re: [edk2-devel] [Patch V4 07/15] UefiCpuPkg/PiSmmCpuDxeSmm: Add 2 function to disable/enable CR0.WP

2023-05-25 Thread Kun Qin
Thanks, Ray. Looking forward to seeing the ideas on this feature! Regards, Kun On 5/24/2023 5:46 PM, Ni, Ray wrote: Kun, Thanks for raising that up😊 We have some ideas. Will post them later. Looking forward to work with community together. Thanks, Ray -Original Message- From: Kun Qi

Re: [edk2-devel] [PATCH v2 1/2] AMD/AmdMinBoardPkg: Implements PCI hotplug init protocol

2023-05-25 Thread Chang, Abner via groups.io
[AMD Official Use Only - General] Hi Abdul, Is this a duplicate patch? There was a patch you sent: [edk2-devel] [PATCH 1/1] AMD/AmdMinBoardPkg: Implements PCI hotplug init protocol, they both create PciHotPlug.c and PciHotPlug.inf. Thanks Abner > -Original Message- > From: Abdul Latee

Re: [edk2-devel] [PATCH 1/1] AMD/AmdMinBoardPkg: Implements PCI hotplug init protocol

2023-05-25 Thread Chang, Abner via groups.io
[AMD Official Use Only - General] Hi Abdul, Is this change just a initial patch that clone PciHotPlugInit.c to under AmdMIniBordPkg? Do we have AMD modification on this file? Because I don't see AMD license in the file header. Just curious about why do we change the GUID of DSC file? Thanks Abn

[edk2-devel] [PATCH v1] BaseTools: toolsetup.bat always execute PYTHON_HOME

2023-05-25 Thread Guo, Gua
From: Gua Guo Ideally behavior is like below order that can support one local build machine, clone multiple Edk2, some of edk2 repo use old tag and some of edk2 repo use new tag, they can both support on one machine. 1. if defined PYTHON_COMMAND only - use PYTHON_COMMAND = user assigned 2. if

Re: [edk2-devel] [RFC PATCH 00/10] Add PPI to manage PEI phase memory attributes

2023-05-25 Thread Ard Biesheuvel
On Thu, 25 May 2023 at 19:21, Oliver Smith-Denny wrote: > > On 5/25/2023 7:30 AM, Ard Biesheuvel wrote: > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4468 > > > > > > > > This is a proof-of-concept RFC that implements a PEI phase PPI to manage > > > > memory permission attributes, and wi

Re: [edk2-devel] [RFC PATCH 07/10] MdeModulePkg/PeiCore: Apply restricted permissions in image loader

2023-05-25 Thread Ard Biesheuvel
On Thu, 25 May 2023 at 19:21, Oliver Smith-Denny wrote: > > On 5/25/2023 7:30 AM, Ard Biesheuvel wrote: > > Add a notification callback to the PEI core to grab a reference to the > > memory attributes PPI as soon as it is registered, and use it in the > > image loader to set restricted memory perm

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-25 Thread Michael D Kinney
Pedro and Oliver, Yes. Renaming the struct members is my preferred solution. This is why I did not send this as a code review as an official change request. It was just to complete the set of options to consider * No code changes. Figure out compiler flags to address. STATUS: No complete so

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-25 Thread Pedro Falcato
On Thu, May 25, 2023 at 6:43 PM Oliver Smith-Denny wrote: > > Hi Mike, > > Thanks for looking for solutions here. This one feels like > quite a back bend, I'm imagining reading code and coming > across TpmStruct.CPLUSPLUS_OPERATOR_KEYWORD and having to > dig around quite a lot to see what goodness

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-25 Thread Oliver Smith-Denny
Hi Mike, Thanks for looking for solutions here. This one feels like quite a back bend, I'm imagining reading code and coming across TpmStruct.CPLUSPLUS_OPERATOR_KEYWORD and having to dig around quite a lot to see what goodness is going on. Because we would have to update the C files, too, right,

Re: [edk2-devel] [RFC PATCH 07/10] MdeModulePkg/PeiCore: Apply restricted permissions in image loader

2023-05-25 Thread Oliver Smith-Denny
On 5/25/2023 7:30 AM, Ard Biesheuvel wrote: Add a notification callback to the PEI core to grab a reference to the memory attributes PPI as soon as it is registered, and use it in the image loader to set restricted memory permissions after loading the image if the image was loaded into memory. T

Re: [edk2-devel] [RFC PATCH 00/10] Add PPI to manage PEI phase memory attributes

2023-05-25 Thread Oliver Smith-Denny
On 5/25/2023 7:30 AM, Ard Biesheuvel wrote: REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4468 This is a proof-of-concept RFC that implements a PEI phase PPI to manage memory permission attributes, and wires it up to the PEI image loader so that shadowed PEIMs as well as the DXE core a

Re: [edk2-devel] GoogleTest Compatibility with MdePkg's IndustyStandard header files

2023-05-25 Thread Michael D Kinney
Hi Pedro, Thanks for the feedback! Applying your pattern to edk2, we find all the usage of c++ reserved keywords and replace with a macro. We then define that macro to either be the actual c++ reserved keyword if build with a C compiler and rename the keyword if building with a c++ compiler. Th

Re: [edk2-devel] [edk2-non-osi][PATCH 1/1] Platform/RaspberryPi: Update TF-A to v2.9 to fix rainbow screen on reboot

2023-05-25 Thread Ard Biesheuvel
On Thu, 25 May 2023 at 18:49, Pete Batard wrote: > > The newly released TF-A v2.9 contains a fix for an issue that has been > affecting some Raspberry Pi 3 users, when trying to issue a reboot with > some types of SD cards (See: pftf/RPi3#17, pftf/RPi3#24). > > This fix is documented at: > https:/

[edk2-devel] [edk2-non-osi][PATCH 1/1] Platform/RaspberryPi: Update TF-A to v2.9 to fix rainbow screen on reboot

2023-05-25 Thread Pete Batard via groups.io
The newly released TF-A v2.9 contains a fix for an issue that has been affecting some Raspberry Pi 3 users, when trying to issue a reboot with some types of SD cards (See: pftf/RPi3#17, pftf/RPi3#24). This fix is documented at: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/20297

Re: [edk2-devel] [PATCH 1/1] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: refine flash detection

2023-05-25 Thread Ard Biesheuvel
On Tue, 2 May 2023 at 07:59, Gerd Hoffmann wrote: > > Check whenever flash is actually writable. > This is a bit too terse. Could you explain why this is needed, and why this approach is suitable? > Signed-off-by: Gerd Hoffmann > --- > OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c | 14 ++

Re: [edk2-devel] [PATCH v2 0/5] ArmVirtPkg: Add dynamic CFI flash detection for Kvmtool guests

2023-05-25 Thread Ard Biesheuvel
On Fri, 19 May 2023 at 16:56, Sami Mujawar wrote: > > Kvmtool allows guest VMs to be launched with or without > a CFI flash device. The guest hardware configuration can > be seen in the device tree that Kvmtool hands off to the > guest firmware. > > Therefore, add support to dynamically detect if

Re: [edk2-devel] [PATCH 0/3] OvmfPkg: gigabyte page tweaks

2023-05-25 Thread Ard Biesheuvel
On Wed, 17 May 2023 at 12:24, Gerd Hoffmann wrote: > > > > Gerd Hoffmann (3): > OvmfPkg/PlatformInitLib: check PcdUse1GPageTable > OvmfPkg/OvmfPkgIa32X64: enable 1G pages > OvmfPkg/MicrovmX64: enable 1G pages > Acked-by: Ard Biesheuvel > OvmfPkg/Microvm/MicrovmX64.dsc

Re: [edk2-devel] [PATCH 1/1] OvmfPkg/PciHotPlugInitDxe: Do not reserve IO ports by default.

2023-05-25 Thread Ard Biesheuvel
On Tue, 16 May 2023 at 11:48, Gerd Hoffmann wrote: > > Flip the default for IO address space reservations for PCI(e) bridges > and root ports with hotplug support from TRUE to FALSE. > > PCI(e) bridges will still get IO address space assigned in case: > > (a) Downstream devices actually need IO

Re: [edk2-devel] [PATCH 5/7] OvmfPkg/VirtNorFlashDxe: Not add memory space if it exists

2023-05-25 Thread Tuan Phan
On Thu, May 25, 2023 at 7:27 AM Ard Biesheuvel wrote: > On Wed, 24 May 2023 at 20:13, Tuan Phan wrote: > > > > > > > > On Mon, Mar 6, 2023 at 9:53 AM Ard Biesheuvel wrote: > >> > >> On Mon, 6 Mar 2023 at 18:33, Tuan Phan wrote: > >> > > >> > The flash base address can be added to GCD before th

[edk2-devel] [RFC PATCH 09/10] MdeModulePkg/DxeIpl: Use memory attribute PPI to remap the stack NX

2023-05-25 Thread Ard Biesheuvel
If the associated PCD is set to TRUE, use the memory attribute PPI to remap the stack non-executable. This provides a generic method for doing so, which will be used by ARM and AArch64 as well once they move to the generic DxeIpl handoff implementation. Signed-off-by: Ard Biesheuvel --- MdeModul

[edk2-devel] [RFC PATCH 10/10] MdeModulePkg/DxeIpl ARM AARCH64: Switch to generic handoff code

2023-05-25 Thread Ard Biesheuvel
Now that we have a generic method to manage memory permissions using a PPI, we can switch to the generic version of the DXE handoff code in DxeIpl, and drop the ARM specific version. Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Core/DxeIplPeim/Arm/DxeLoadFunc.c | 71 MdeMo

[edk2-devel] [RFC PATCH 08/10] MdeModulePkg/DxeIpl: Merge EBC, RISCV64 and LOONGARCH code

2023-05-25 Thread Ard Biesheuvel
The Risc-V and LoongArch specific versions of the DXE core handoff code in DxeIpl are essentially copies of the EBC version (modulo the copyright in the header and some debug prints in the code). In preparation for introducing a generic PPI based method to implement the non-executable stack, let's

[edk2-devel] [RFC PATCH 07/10] MdeModulePkg/PeiCore: Apply restricted permissions in image loader

2023-05-25 Thread Ard Biesheuvel
Add a notification callback to the PEI core to grab a reference to the memory attributes PPI as soon as it is registered, and use it in the image loader to set restricted memory permissions after loading the image if the image was loaded into memory. There are two use cases for this: - when the DX

[edk2-devel] [RFC PATCH 06/10] ArmPkg/CpuPei: Implement the memory attributes PPI

2023-05-25 Thread Ard Biesheuvel
Implement the newly defined PPI that permits the PEI core and DXE IPL to manage memory permissions on ranges of DRAM, for doing things like mapping the stack non-executable, or granting executable permissions to shadowed PEIMs. Signed-off-by: Ard Biesheuvel --- ArmPkg/Drivers/CpuPei/CpuPei.c |

[edk2-devel] [RFC PATCH 05/10] MdeModulePkg: Define memory attribute PPI

2023-05-25 Thread Ard Biesheuvel
Define a PPI interface that may be used by the PEI core or other PEIMs to manage permissions on memory ranges. This is primarily intended for restricting permissions to what is actually needed for correct execution by the code in question, and for limiting the use of memory mappings that are both w

[edk2-devel] [RFC PATCH 04/10] OvmfPkg/RiscVVirt: Remove unimplemented NxForStack configuration

2023-05-25 Thread Ard Biesheuvel
The RISC-V version of the DXE IPL does not implement setting the stack NX, so before switching to an implementation that will ASSERT() on the missing support, drop the PCD setting that enables it. Signed-off-by: Ard Biesheuvel --- OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 6 -- 1 file changed, 6

[edk2-devel] [RFC PATCH 03/10] ArmPkg/CpuPei: Drop bogus DEPEX on PEI permanent memory

2023-05-25 Thread Ard Biesheuvel
Currently, ARM's CPU PEIM depexes on PEI permanent memory being installed, but functionally, it does not actually depend on that at all. So let's drop the DEPEX. Signed-off-by: Ard Biesheuvel --- ArmPkg/Drivers/CpuPei/CpuPei.inf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[edk2-devel] [RFC PATCH 02/10] ArmPkg/CpuDxe: Simplify memory attributes protocol implementation

2023-05-25 Thread Ard Biesheuvel
Now that ArmSetMemoryAttributes() permits a mask to be provided, we can simplify the implementation the UEFI memory attribute protocol substantially, and just pass on the requested mask to be set or cleared directly. Signed-off-by: Ard Biesheuvel --- ArmPkg/Drivers/CpuDxe/MemoryAttribute.c | 50

[edk2-devel] [RFC PATCH 01/10] ArmPkg/ArmMmuLib: Extend API to manage memory permissions better

2023-05-25 Thread Ard Biesheuvel
Currently, ArmSetMemoryAttributes () takes a combination of EFI_MEMORY_xx constants describing the memory type and permission attributes that should be set on a region of memory. In cases where the memory type is omitted, we assume that the memory permissions being set are final, and that existing

[edk2-devel] [RFC PATCH 00/10] Add PPI to manage PEI phase memory attributes

2023-05-25 Thread Ard Biesheuvel
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4468 This is a proof-of-concept RFC that implements a PEI phase PPI to manage memory permission attributes, and wires it up to the PEI image loader so that shadowed PEIMs as well as the DXE core are remapped with the appropriate, restricted memor

Re: [edk2-devel] [PATCH 5/7] OvmfPkg/VirtNorFlashDxe: Not add memory space if it exists

2023-05-25 Thread Ard Biesheuvel
On Wed, 24 May 2023 at 20:13, Tuan Phan wrote: > > > > On Mon, Mar 6, 2023 at 9:53 AM Ard Biesheuvel wrote: >> >> On Mon, 6 Mar 2023 at 18:33, Tuan Phan wrote: >> > >> > The flash base address can be added to GCD before this driver run. >> > So only add it if it has not been done. >> > >> >> How