[edk2-devel] [PATCH v4 1/1] MdePkg:Add NVME Sanitize command support to Nvme.h

2023-11-08 Thread Tina Chen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4591 1. Refer NVME spec 2.0c chapter 5.24, add Sanitize Command related definition. 2. Refer NVME spec 2.0c chapter 5.16, add Get Log Page Command related definition for Sanitize status support. Cc: Ray Ni Cc: Xiao X Chen Cc: Arthur Chen Cc:

Re: [edk2-devel] [PATCH v2 1/3] UefiCpuPkg/PiSmmCpuDxeSmm: Clear CR4.CET before restoring MSR IA32_S_CET

2023-11-08 Thread Sheng Wei
Hi Laszlo, Please ignore the patch V3. I will refine the patches and raise patch V4. Thank you. BR Sheng Wei > -Original Message- > From: Laszlo Ersek > Sent: Thursday, November 9, 2023 5:16 AM > To: devel@edk2.groups.io; Sheng, W > Cc: Dong, Eric ; Ni, Ray ; Wu, Jiaxin > ; Tan, Dun >

Re: [edk2-devel] Use dynamic pcd in smm mode

2023-11-08 Thread Yoshinoya
Hi, Laszlo: Got it. Thanks a lot! I study the udk code, and find there are no smm pcd drivers, so can't use dynamic pcd in smm code. At 2023-11-07 20:45:16, "Laszlo Ersek" wrote: >On 11/7/23 12:31, Yoshinoya wrote: >> Hi, All: >> Could dynamic PCD be used in smm driver code?

Re: [edk2-devel] [PATCH 0/2] Remove string IO instruction in BaseIoLibIntrinsic.inf

2023-11-08 Thread Ni, Ray
Reviewed-by: Ray Ni Thanks for providing the alternative solution that avoids impacting OVMF boot performance. Thanks, Ray From: devel@edk2.groups.io on behalf of duntan Sent: Thursday, November 9, 2023 10:49 AM To: devel@edk2.groups.io Subject: [edk2-devel]

Re: [edk2-devel] [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-08 Thread Dong, Eric
Reviewed-by: Eric Dong -Original Message- From: Wu, Jiaxin Sent: Tuesday, November 7, 2023 9:25 AM To: devel@edk2.groups.io Cc: Dong, Eric ; Ni, Ray ; Zeng, Star ; Gerd Hoffmann ; Kumar, Rahul R ; Laszlo Ersek Subject: [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET e

Re: [edk2-devel] [PATCH] IntelFsp2Pkg\Tools\ConfigEditor: Added new USF config workstream support Config Edit utility addition/changes.

2023-11-08 Thread Arun Sura
Hi Chasel, Sure, will work on the feedbacks. Thanks Arun Sura S -Original Message- From: Chiu, Chasel Sent: Thursday, November 9, 2023 3:40 AM To: Soundara Pandian, Arun SuraX ; devel@edk2.groups.io Cc: Duggapu, Chinni B ; Desimone, Nathaniel L ; Ng, Ray Han Lim ; Zeng, Star ; Kuo,

Re: [edk2-devel] [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Exception when CET enable

2023-11-08 Thread Ni, Ray
Reviewed-by: Ray Ni Thanks, Ray From: Wu, Jiaxin Sent: Tuesday, November 7, 2023 9:24 AM To: devel@edk2.groups.io Cc: Dong, Eric ; Ni, Ray ; Zeng, Star ; Gerd Hoffmann ; Kumar, Rahul R ; Laszlo Ersek Subject: [PATCH v4] UefiCpuPkg/PiSmmCpuDxeSmm: Fix CP Excep

[edk2-devel] [PATCH 1/1] MdeModulePkg: Optimize CoreInstallMultipleProtocolInterfaces

2023-11-08 Thread Zhi Jin
CoreLocateDevicePath is used in CoreInstallMultipleProtocolInterfaces to check if a Device Path Protocol instance with the same device path is alreay installed. CoreLocateDevicePath is a generic API, and would introduce some unnecessary overhead for such usage. The optimization is: 1. Implement Is

[edk2-devel] [PATCH 3/3] StandaloneMmPkg:Remove MpInformation.h

2023-11-08 Thread duntan
Remove MpInformation.h in StandaloneMmPkg since it has been moved to UefiCpuPkg Signed-off-by: Dun Tan Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Ray Ni --- StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf | 1 + StandaloneMmPkg/Include/Guid/MpInformation.h

[edk2-devel] [PATCH 2/3] StandaloneMmPkg:Add UefiCpuPkg.dec in DependencyCheck

2023-11-08 Thread duntan
Add UefiCpuPkg.dec in DependencyCheck section of StandaloneMmPkg.ci.yaml to allow StandaloneMmPkg depend on UefiCpuPkg. Signed-off-by: Dun Tan Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Ray Ni --- StandaloneMmPkg/StandaloneMmPkg.ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) di

[edk2-devel] [PATCH 1/3] UefiCpuPkg: Create MpInformation.h in UefiCpuPkg

2023-11-08 Thread duntan
Copy MpInformation.h and gMpInformationHobGuid to UefiCpuPkg. Previously, the HOB is defined, created and consumed only in StandaloneMmPkg. The HOB contains the number of processors and EFI_PROCESSOR_INFORMATION structure. This is the same as the information that PiSmmCpuDxeSmm uses EfiMpServicePro

[edk2-devel] [PATCH 0/3] Move gMpInformationHobGuid from StandaloneMmPkg to UefiCpuPkg.

2023-11-08 Thread duntan
Move gMpInformationHobGuid from StandaloneMmPkg to UefiCpuPkg. Previously, the HOB is defined, created and consumed only in StandaloneMmPkg. The HOB contains the number of processors and EFI_PROCESSOR_INFORMATION structure. This is the same as the information that PiSmmCpuDxeSmm uses EfiMpServic

[edk2-devel] [PATCH 2/2] MdePkg:simplify Fifo API in BaseIoLibIntrinsic

2023-11-08 Thread duntan
Simplify IoRead/WriteFifo implement by repeatedly calling IoRead/Write in the C code. This can avoid calling assembly code to use string I/O instructions. With this change Ia32/IoFifo.nasm and X64/IoFifo.nasm can be removed. Then the source files for IA32 and X64 are the same. Signed-off-by: Dun T

[edk2-devel] [PATCH 1/2] MdePkg: Change IoLibFifo.c to IoLibFifoCc.c

2023-11-08 Thread duntan
Change IoLibFifo.c to IoLibFifoCc.c since the file is for Tdx and SEV in BaseIoLibIntrinsicSev. It's also to distinguish with a new incoming IoLibFifo.c for BaseIoLibIntrinsic. Signed-off-by: Dun Tan Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Ray Ni --- MdePkg/Library/BaseIoLib

[edk2-devel] [PATCH 0/2] Remove string IO instruction in BaseIoLibIntrinsic.inf

2023-11-08 Thread duntan
Simplify IoRead/WriteFifo implement in BaseIoLibIntrinsic by repeatedly calling IoRead/Write in C code. This can avoid calling assembly code to use string I/O instructions. With this change, Ia32/IoFifo.nasm and X64/IoFifo.nasm can be removed. Also source files for IA32 and X64 are the same. Dun

Re: [edk2-devel] [PATCH 1/1] MdeModulePkg: Optimize CoreInstallMultipleProtocolInterfaces

2023-11-08 Thread Ni, Ray
Reviewed-by: Ray Ni Thanks, Ray From: Jin, Zhi Sent: Thursday, November 9, 2023 9:46 AM To: devel@edk2.groups.io Cc: Jin, Zhi ; Wang, Jian J ; Gao, Liming ; Bi, Dandan ; Ni, Ray Subject: [PATCH 1/1] MdeModulePkg: Optimize CoreInstallMultipleProtocolInterface

Re: [edk2-devel] [PATCH v2 11/30] UefiCpuPkg: Add CpuMmuLib.h to UefiCpuPkg

2023-11-08 Thread Andrei Warkentin
Hi Chao, I see that you're adding a header, CpuMmuLib.h, but this header is not generic - it includes a bunch of Loongson arch-specific "stuff". I agree in principle that there's room for a generic CpuMmuLib, and I don't think you ought to be on the hook to refactor ArmMmuLib, but I suggest mo

Re: [edk2-devel] [PATCH v2 17/30] OvmfPkg/LoongArchVirt: Add PciCpuIo2Dxe module

2023-11-08 Thread Sunil V L
On Tue, Nov 07, 2023 at 06:03:43PM +0800, Chao Li wrote: > Hi Gerd, > > Yes, you are right, this driver could probably be located somewhere else > where other ARCH can easily use it, but I can not find the right place, > maybe MdeModulePkg or MdePkg? I also feel that something is not quite right >

Re: [edk2-devel] [PATCH v2 24/30] OvmfPkg/LoongArchVirt: Add platform boot manager library

2023-11-08 Thread Laszlo Ersek
On 11/6/23 04:30, Chao Li wrote: > This library is provides boot mananger interfaces, and it is referenced > from ArmVirtPkg. > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 > > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > Signed-off-by: Chao Li >

Re: [edk2-devel] [PATCH v2 23/30] OvmfPkg/LoongArchVirt: Add PeiServiceTablePointerLib

2023-11-08 Thread Laszlo Ersek
On 11/6/23 04:30, Chao Li wrote: > Use a register to save PeiServiceTable pointer. This Library provides > PeiServiceTable pointer saveing and retrieval serivces. > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 > > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd

Re: [edk2-devel] [PATCH v2 20/30] OvmfPkg/LoongArchVirt: Add serial port library

2023-11-08 Thread Laszlo Ersek
On 11/7/23 11:12, Chao Li wrote: > Hi Gerd, > > These two libraries is not only copy code, the way of obtain the serial > base address is different from ARM, and the early serial port output > also different from ARM, so these two libraries are LoongArch specific. I think we're going to have to g

Re: [edk2-devel] [PATCH] IntelFsp2Pkg\Tools\ConfigEditor: Added new USF config workstream support Config Edit utility addition/changes.

2023-11-08 Thread Chiu, Chasel
Hi Arun, I gave it a try and with test_vfr_yaml.yml there are just some label, numbers, string_index and empty blocks which look to me not very helpful for users to understand and track the configuration data. Do we need to include certain string table file so the string_index can be more rea

Re: [edk2-devel] [PATCH v4 11/14] UefiCpuPkg: Use Attribute From SMM MemoryAttributesTable if Nonzero

2023-11-08 Thread Laszlo Ersek
On 11/3/23 18:17, Taylor Beebe wrote: > The function EnforceMemoryMapAttribute() in the SMM MAT logic will > ensure that the CODE and DATA memory types have the desired attributes. EnforceMemoryMapAttribute() leaves those descriptors alone where Attribute is already nonzero ("PE image") [1]. For

Re: [edk2-devel] [PATCH v2 3/3] UefiCpuPkg/PiSmmCpuDxeSmm: Set mSmmInterruptSspTables initial value

2023-11-08 Thread Laszlo Ersek
On 11/6/23 10:07, Sheng Wei wrote: > Initial the value of mSmmInterruptSspTables to 0. > > Signed-off-by: Sheng Wei > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Wu Jiaxin > Cc: Tan Dun > --- > UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmmFuncsArch.c | 2 +- > 1 file changed, 1 insertion(+), 1

Re: [edk2-devel] [PATCH v2 2/3] UefiCpuPkg/PiSmmCpuDxeSmm: Change CR4.CET bit only

2023-11-08 Thread Laszlo Ersek
On 11/6/23 10:07, Sheng Wei wrote: > Do not use fixed CR4 value 0x668, change CR4.CET bit only. > > Signed-off-by: Sheng Wei > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Wu Jiaxin > Cc: Tan Dun > --- > UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 9 ++--- > UefiCpuPkg/PiSmmCp

Re: [edk2-devel] [PATCH v2 1/3] UefiCpuPkg/PiSmmCpuDxeSmm: Clear CR4.CET before restoring MSR IA32_S_CET

2023-11-08 Thread Laszlo Ersek
On 11/6/23 10:07, Sheng Wei wrote: > Clear CR4.CET bit before restoring MSR IA32_S_CET. > Backup/restore MSR IA32_U_CET in SMI. (1) As far as I understand, these are still two separate fixes. And I think this patch has issues due to trying to fix both issues at the same time. (I could be wrong of

[edk2-devel] [edk2-stable202311][Patch 1/1] BaseTools/Scripts: Handle reviewer only case in GetMaintainer.py

2023-11-08 Thread Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4593 If a package only has reviewers and no maintainers, then also return the maintainers. Update get_maintainers() to return maintainers, reviews, and lists separately instead of a single merged list to allow this module to be used by other sc

Re: [edk2-devel] [PATCH v4 4/4] StandaloneMmPkg/Core: Fix the failure to find uncompressed inner FV

2023-11-08 Thread Laszlo Ersek
On 11/6/23 08:52, Xu, Wei6 wrote: > The MmCoreFfsFindMmDriver only checks for encapsulated compressed FVs. > When an inner FV is uncompressed, StandaloneMmCore will miss the FV and > all the MM drivers in the FV will not be dispatched. > Add checks for uncompressed inner FV to fix this issue. > >

Re: [edk2-devel] [PATCH v4 3/4] StandaloneMmPkg/Core: Fix issue that offset calculation might be wrong

2023-11-08 Thread Laszlo Ersek
On 11/6/23 08:52, Xu, Wei6 wrote: > MmCoreFfsFindMmDriver() assumes FileHeader is EFI_FFS_FILE_HEADER. > If FileHeader is an EFI_FFS_FILE_HEADER2, 'FileHeader + 1' will get a > wrong section address. Use FfsFindSection to get the section directly, > instead of 'FileHeader + 1' to avoid this issue.

Re: [edk2-devel] [PATCH v4 2/4] StandaloneMmPkg/Core: Fix potential memory leak issue

2023-11-08 Thread Laszlo Ersek
On 11/6/23 08:52, Xu, Wei6 wrote: > In MmCoreFfsFindMmDriver(), > - ScratchBuffer is not freed in the error return path that DstBuffer page > allocation fails. Free ScratchBuffer before return with error. > - If the decoded buffer is identical to the data in InputSection, > ExtractGuidedSectionDeco

Re: [edk2-devel] [PATCH v4 1/4] StandaloneMmPkg/Core: Limit FwVol encapsulation section recursion

2023-11-08 Thread Laszlo Ersek
On 11/6/23 08:52, Xu, Wei6 wrote: > MmCoreFfsFindMmDriver() is called recursively for encapsulation sections. > Currently this recursion is not limited. Introduce a new PCD > (fixed-at-build, or patchable-in-module), and make MmCoreFfsFindMmDriver() > track the section nesting depth against that PC

Re: [edk2-devel] [PATCH] MdeModulePkg/PciHostBridgeDxe: Add readback after final Cfg-Write

2023-11-08 Thread Laszlo Ersek
On 11/6/23 07:55, Joe L wrote: > (1) I'd like (a) the problem report, and the full reasoning by Ard and > Michael to be captured in the commit message, and (b) *minimally* a hint > at the possible reordering, and at the PCI spec-based workaround, to be > placed in the code comment a

Re: [edk2-devel] [PATCH v1 0/7] CryptoPkg: Enable Openssl native instruction support for AARCH64

2023-11-08 Thread PierreGondois
Hello Ard, On 11/8/23 16:03, Ard Biesheuvel wrote: Hello Pierre, Thanks for working on this. On Wed, 8 Nov 2023 at 15:39, Pierre Gondois wrote: Hello Yi, The tests run are based on the TestBaseCryptLibShell module. Each test is run 100 times, then the first 5 values (considered as warmup)

Re: [edk2-devel] [PATCH v1 0/7] CryptoPkg: Enable Openssl native instruction support for AARCH64

2023-11-08 Thread Ard Biesheuvel
Hello Pierre, Thanks for working on this. On Wed, 8 Nov 2023 at 15:39, Pierre Gondois wrote: > > Hello Yi, > > The tests run are based on the TestBaseCryptLibShell module. > Each test is run 100 times, then the first 5 values > (considered as warmup) are removed. > > The NoAccel column relies on

Re: [edk2-devel] [PATCH v1 6/7] CryptoPkg/OpensslLib: Add AArch64Cap for arch specific hooks

2023-11-08 Thread PierreGondois
Hello Gerd, On 11/7/23 10:21, Gerd Hoffmann wrote: [Sources.AARCH64] + OpensslStub/AArch64Cap.c # Autogenerated files list starts here $(OPENSSL_PATH)/crypto/aes/aes_cbc.c $(OPENSSL_PATH)/crypto/aes/aes_cfb.c @@ -1598,7 +1599,7 @@ [Sources.AARCH64] $(OPENSSL_PATH)/crypto/kdf/kdf

Re: [edk2-devel] [PATCH v1 0/7] CryptoPkg: Enable Openssl native instruction support for AARCH64

2023-11-08 Thread PierreGondois
Hello Yi, The tests run are based on the TestBaseCryptLibShell module. Each test is run 100 times, then the first 5 values (considered as warmup) are removed. The NoAccel column relies on the OpensslLibFull implementation, the Accel column relies on the OpensslLibFullAccel implementation. The 'I

Re: [edk2-devel] [PATCH V4 0/3] OvmfPkg: Update TdVmCall to handle the retry for MapGPA

2023-11-08 Thread Yao, Jiewen
Hi Liming and Mike Would you please review the MdePkg update? This patch was sent before soft freeze. I request that it be in 202311 release because this patch is required by the latest KVM/QEMU. This patch only impacts Intel TDX, and has no impact to other CC (AMD SEV) or non-CC module. Thank

Re: [edk2-devel] [PATCH V4 0/3] OvmfPkg: Update TdVmCall to handle the retry for MapGPA

2023-11-08 Thread Yao, Jiewen
All: Reviewed-by: Jiewen Yao > -Original Message- > From: Sun, CepingX > Sent: Wednesday, November 8, 2023 7:38 PM > To: devel@edk2.groups.io > Cc: Sun, CepingX ; Gao, Liming > ; Kinney, Michael D ; > Aktas, Erdem ; James Bottomley > ; Xu, Min M ; Tom Lendacky > ; Michael Roth ; Yao, >

[edk2-devel] [PATCH V4 3/3] OvmfPkg/BaseMemEncryptTdxLib: Handle retry result of MapGPA

2023-11-08 Thread sunceping
From: Ceping Sun REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4572 According to section 3.2 of the [GHCI] document, if the return status of MapGPA is "TDG.VP.VMCALL_RETRY", TD must retry this operation for the pages in the region starting at the GPA specified in R11. In this patch, when

[edk2-devel] [PATCH V4 2/3] MdePkg/Tdx.h: Add TDVMCALL_STATUS_RETRY

2023-11-08 Thread sunceping
From: Ceping Sun REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4572 TDVMCALL_STATUS_RETRY is defined in GHCI spec section 2.4.1. Reference: [GHCI]: TDX Guest-Host-Communication Interface v1.0 https://cdrdv2.intel.com/v1/dl/getContent/726790 Cc: Liming Gao Cc: Michael D Kinney Cc: Erdem

[edk2-devel] [PATCH V4 1/3] MdePkg/BaseLib: Update TdVmcall to always output the value in R11

2023-11-08 Thread sunceping
From: Ceping Sun REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4572 According to section 3.2 of the [GHCI] spec, if the return status of MapGPA is "TDG.VP.VMCALL_RETRY", TD must retry this operation for the pages in the region starting at the GPA specified in R11. Currently, TDVF has not

[edk2-devel] [PATCH V4 0/3] OvmfPkg: Update TdVmCall to handle the retry for MapGPA

2023-11-08 Thread sunceping
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4572 According to section 3.2 of the [GHCI] spec, if the result is "TDG.VP.VMCALL_RETRY" for TDG.VP.VMCALL.MapGPA, TD must retry the mapping for the pages in the region starting at the GPA specified in r11. Currently, TDVF does not properly han

Re: [edk2-devel] [PATCH V3 2/2] OvmfPkg/BaseMemEncryptTdxLib: Handle retry result of MapGPA

2023-11-08 Thread Yao, Jiewen
Hey Ceping Please don't change two packages in one patch, because it is hard to let the corresponding maintainer to review and give R-B, if he/she only reviews part of them. The patch should be split to MdePkg update and OvmfPkg update. Thank you Yao, Jiewen > -Original Message- > Fro

Re: [edk2-devel] [PATCH V3 1/2] MdePkg/BaseLib: Update TdVmcall to always output the value in R11

2023-11-08 Thread Min Xu
Hi, Liming & Miachel Can you help to review this patch (because it is changed in MdePkg)? Thanks! Min > -Original Message- > From: Sun, CepingX > Sent: Wednesday, November 8, 2023 4:32 PM > To: devel@edk2.groups.io > Cc: Sun, CepingX ; Gao, Liming > ; Kinney, Michael D > ; Aktas, Erdem ;

[edk2-devel] [PATCH V3 2/2] OvmfPkg/BaseMemEncryptTdxLib: Handle retry result of MapGPA

2023-11-08 Thread sunceping
From: Ceping Sun REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4572 According to section 3.2 of the [GHCI] document, if the return status of MapGPA is "TDG.VP.VMCALL_RETRY", TD must retry this operation for the pages in the region starting at the GPA specified in R11. In this patch, when

[edk2-devel] [PATCH V3 1/2] MdePkg/BaseLib: Update TdVmcall to always output the value in R11

2023-11-08 Thread sunceping
From: Ceping Sun REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4572 According to section 3.2 of the [GHCI] spec, if the return status of MapGPA is "TDG.VP.VMCALL_RETRY", TD must retry this operation for the pages in the region starting at the GPA specified in R11. Currently, TDVF has not

[edk2-devel] [PATCH V3 0/2] OvmfPkg: Update TdVmCall to handle the retry for MapGPA

2023-11-08 Thread sunceping
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4572 According to section 3.2 of the [GHCI] spec, if the result is "TDG.VP.VMCALL_RETRY" for TDG.VP.VMCALL.MapGPA, TD must retry the mapping for the pages in the region starting at the GPA specified in r11. Currently, TDVF does not properly han