Re: [edk2-devel] [PATCH v3 3/5] MdeModulePkg: Do nothing on NestedInterruptRestoreTPL(TPL_HIGH_LEVEL)

2024-01-24 Thread Laszlo Ersek
On 1/23/24 17:59, Michael Brown wrote: > On 23/01/2024 16:32, Laszlo Ersek wrote: >> On 1/23/24 16:31, Michael Brown wrote: >>> At TPL_HIGH_LEVEL, CPU interrupts are disabled (as per the UEFI >>> specification) and so we should never encounter a situation in wh

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-24 Thread Laszlo Ersek
On 1/23/24 17:11, Gerd Hoffmann wrote: > Hi, > > Well, it's OVMF in a virtual machine. No boot guard involved. > So we could probably go for a OVMF-specific patch here. > > But I'd prefer to figure what exactly is happening here before going > down that route. An extreme

Re: [edk2-devel] [PATCH v3 5/5] MdeModulePkg: Extend NestedInterruptTplLib to support Arm CPUs

2024-01-23 Thread Laszlo Ersek
the declarations of variables and functions for exactly those libraries that we link against. There are two exceptions (that I can think of at once): when we only want macros from a lib class header, or when we include a lib class header because we are implementing an instance for that lib class (i.e., we're p

Re: [edk2-devel] [PATCH v3 4/5] MdeModulePkg: Add self-tests for NestedInterruptTplLib

2024-01-23 Thread Laszlo Ersek
SERT (FALSE); > + } > + > + // > + // If no timer interrupt occurred then this indicates that the timer > + // interrupt handler failed to rearm the timer before calling > + // NestedInterruptRestoreTPL(). This would prevent nested > + // interrupts from occurring at a

Re: [edk2-devel] [PATCH v3 3/5] MdeModulePkg: Do nothing on NestedInterruptRestoreTPL(TPL_HIGH_LEVEL)

2024-01-23 Thread Laszlo Ersek
logic might as well be "panic" here (except edk2 does not have a central panic API that's suitable for all platforms). I probably missed the previous discussion that led to this patch. Either way, it seems reasonable. Acked-by: Laszlo Ersek -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You r

Re: [edk2-devel] [edk2-discuss] Multi-ISA Driver Compatibility Survey

2024-01-23 Thread Laszlo Ersek
On 1/22/24 20:04, Rebecca Cran wrote: > Originally posted at > https://twitter.com/UEFIForum/status/1745518769232077208 > > The Multi-ISA Driver Compatibility Survey is at > https://docs.google.com/forms/d/e/1FAIpQLScXjwaSBgLeqB1coEDxCPxho5JWF3AMqshOTJ2wd6Tf0He4LA/viewform > > From that page: >

Re: [edk2-devel] [PATCH V1 1/1] UefiCpuPkg/ResetVector: Cache Disable should not be set by default in CR0

2024-01-23 Thread Laszlo Ersek
On 1/23/24 11:52, Gerd Hoffmann wrote: > On Mon, Jan 22, 2024 at 01:11:52PM -0600, Brian J. Johnson wrote: >> On 1/18/24 09:46, Gerd Hoffmann wrote: >>> On Wed, Jan 10, 2024 at 04:43:47PM +, West, Catharine wrote: Disabling cache by default results in violation of BTG protections (if BTG

Re: [edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance

2024-01-23 Thread Laszlo Ersek
On 1/23/24 12:36, Huang, Qing wrote: > CpuLib.h exposes StandardSignatureIsAuthenticAMD() API and we require stub > function in its BaseCpuLibNull library > instance to avoid potential link issue. > > Signed-off-by: Qing Huang > --- > MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c | 17

Re: [edk2-devel] [PATCH v3] UefiCpuPkg: Fix issue that IsModified is wrongly set in PageTableMap

2024-01-23 Thread Laszlo Ersek
age table. > Also, add more comment to explain this behavior. > > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Cc: Gerd Hoffmann > Cc: Crystal Lee > Cc: Pedro Falcato > Signed-off-by: Zhiguang Liu > --- > .../Library/CpuPageTableLib/CpuPageTableMap.c |

Re: [edk2-devel] [PATCH v2 2/2] MdeModulePkg: Add missing Iret.h to NestedInterruptTplLib sources list

2024-01-22 Thread Laszlo Ersek
st don't like it when a commit message only consists of a subject line.) Thanks for considering! Reviewed-by: Laszlo Ersek -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114141): https://edk2.groups.io/g/devel/message/114141 Mute

Re: [edk2-devel] [PATCH v2 1/2] MdeModulePkg: Move NestedInterruptTplLib to MdeModulePkg

2024-01-22 Thread Laszlo Ersek
med by drivers outside of OvmfPkg. > > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Gerd Hoffmann > Cc: Michael D Kinney > Signed-off-by: Michael Brown > --- > MdeModulePkg/MdeModulePkg.dec | 4 > OvmfPkg/OvmfPkg.dec

Re: [edk2-devel] Memory Attribute for depex section

2024-01-19 Thread Laszlo Ersek
On 1/19/24 05:43, Nhi Pham wrote: > On 1/18/2024 9:49 PM, Laszlo Ersek wrote: >>>>> but I'd prefer to just remove this >>>>> optimization from standalone MM, given that not only a) it shouldn't >>>>> have to deal with a large number of protocol GUID

Re: [edk2-devel] [PATCH 1/1] StandaloneMmPkg/Core: Remove optimization for depex evaluation

2024-01-19 Thread Laszlo Ersek
On 1/19/24 05:56, Nhi Pham wrote: > From: Laszlo Ersek > > The current dependency evaluator violates the memory access permission > when patching depex grammar directly in the read-only depex memory area. > > Laszlo pointed out the optimization issue in the thread (1) &

Re: [edk2-devel] RFC: Folder layout change in UefiCpuPkg

2024-01-19 Thread Laszlo Ersek
for review. > >   > > Mike, Laszlo, Gerd, Abner, any comments? I'm also OK with plan A. Thanks Laszlo > >   > >   > > Thanks, > > Ray > > *From:* Chao Li > *Sent:* Thursday, January 18, 2024 4:27 PM > *To:* Ni, Ray ; Sunil V L > *Cc:* devel@e

Re: [edk2-devel] [PATCH 0/3] DxeTpm and DxeTpm2MeasureBootLib symbol rename

2024-01-18 Thread Laszlo Ersek
On 1/17/24 23:47, Doug Flick via groups.io wrote: > OVMF is failing because it includes both DxeTpm2MeasureBootLib and > DxeTpm2MeasureBootLib which makes the symbols collide. This patch > renames the function names to be unique to avoid symbol collision. > > Cc: Jiewen Yao > Cc: Rahul Kumar >

Re: [edk2-devel] [PATCH v3 0/6] OvmfPkg/VirtNorFlashDxe: fix corruption + misc small improvements

2024-01-18 Thread Laszlo Ersek
On 1/16/24 18:10, Gerd Hoffmann wrote: > This is a little series containing the flash corruption fix sent > yesterday with an slightly improved commit message and some small > improvements on top of this. > > v3: > - fix diagram > - fix DoErase control flow > - pick up reviewed-by tags > v2: >

Re: [edk2-devel] [PATCH 2/2] OvmfPkg/Tcg2Config: remove unused TPM 1.2 support

2024-01-18 Thread Laszlo Ersek
On 1/17/24 15:12, Gerd Hoffmann wrote: >> This patch is good: >> >> Reviewed-by: Laszlo Ersek >> >> but the series shouldn't stop here. In "OvmfPkg/Tcg/Tcg2Config", we're >> left with an INF file (Tcg2ConfigPei.inf) that still references >

Re: [edk2-devel] Memory Attribute for depex section

2024-01-18 Thread Laszlo Ersek
On 1/18/24 07:00, Nhi Pham wrote: > Hi Laszlo, > > On 1/16/2024 2:00 AM, Laszlo Ersek wrote: >> On 1/15/24 15:04, Ard Biesheuvel wrote: >>> On Mon, 15 Jan 2024 at 14:07, Nhi Pham >>> wrote: >>>> >>>> On 1/12/2024 4:45 PM, Laszlo Ersek

Re: [edk2-devel] [PATCH v1 1/1] MdePkg/BaseCacheMaintenanceLib: RV64 replace asserts with logs

2024-01-18 Thread Laszlo Ersek
ly platform/drivers need to have > better guard for such functionality. > > Signed-off-by: Dhaval Sharma > Cc: Liming Gao > Cc: Michael D Kinney > Cc: Zhiguang Liu > Cc: Sunil V L > Cc: Andrei Warkentin > Cc: Laszlo Ersek > Cc: Pedro Falcato > Cc: Yang Cheng >

Re: [edk2-devel] [PATCH v2] UefiCpuPkg: Fix issue that IsModified is wrongly set in PageTableMap

2024-01-17 Thread Laszlo Ersek
leLibMapInLevel, the function assume page > table is not changed, and add ASSERT to check. But hardware may change > the page table, which cause the ASSERT happens. > Fix the issue by considering the hardware may also change page table, > and document the detail in function header. > > Cc:

Re: [edk2-devel] [PATCH v2 2/2] UefiCpuPkg/CpuMpPei: Don't write CR3 in ConvertMemoryPageToNotPresent

2024-01-17 Thread Laszlo Ersek
. Also, because ConvertMemoryPageToNotPresent in called in a > loop, to improve performance, there is no need to flush TLB > inside ConvertMemoryPageToNotPresent. Just flushing TLB after the loop > is enough. > > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Cc: Gerd

Re: [edk2-devel] [PATCH v2 1/2] UefiCpuPkg/CpuPageTableLib: Enhance function header for PageTableMap()

2024-01-17 Thread Laszlo Ersek
On 1/17/24 07:21, Zhiguang Liu wrote: > PageTableMap() only modifies the PageTable root pointer when creating from > zero. > Explicitly explain it in function header. > > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Cc: Gerd Hoffmann > Signed-off-by: Zhigua

Re: [edk2-devel] [PATCH v3 6/6] OvmfPkg/VirtNorFlashDxe: move DoErase code block into new function

2024-01-17 Thread Laszlo Ersek
device back into Read Array mode > + SEND_NOR_COMMAND (Instance->DeviceBaseAddress, 0, P30_CMD_READ_ARRAY); > > - // Put the data at the appropriate location inside the buffer area > - CopyMem ((VOID *)((UINTN)Instance->ShadowBuffer + Offset), Buffer, > *NumBytes); > - &

Re: [edk2-devel] [PATCH 2/2] OvmfPkg/Tcg2Config: remove unused TPM 1.2 support

2024-01-17 Thread Laszlo Ersek
> - > - @retval EFI_SUCCESS TPM-1.2 available. The Tpm12RequestUseTpm() and > - Tpm12SubmitCommand(TPM_ORD_GetTicks) operations > - (from the Tpm12DeviceLib class) have succeeded. > - > - @return Error codes propagated fr

Re: [edk2-devel] [PATCH 1/2] OvmfPkg: remove TPM1_ENABLE build option

2024-01-17 Thread Laszlo Ersek
> | X64 | X64| OvmfPkgIa64.dsc | None > | > | IA32 X64| PEI-IA32 DXE-X64 | OvmfPkgIa32X64.dsc | None > | > -| IA32 X64 Full | PEI-IA32 DXE-X64 | OvmfPkgIa32X64.dsc | > SECURE_BOO

Re: [edk2-devel] [PATCH 1/6] UefiCpuPkg/LocalApicTimerDxe: Duplicate OvmfPkg/LocalApicTimerDxe driver

2024-01-16 Thread Laszlo Ersek
On 1/16/24 16:16, Michael Brown wrote: > On 16/01/2024 14:34, Laszlo Ersek wrote: >> On 1/16/24 10:48, Michael Brown wrote: >> IOW, my impression is that NestedInterruptTplLib can certainly handle >> all scenarios thrown at it, but where it really matters is in the face >

Re: [edk2-devel] [PATCH v2 6/6] OvmfPkg/VirtNorFlashDxe: move DoErase code block into new function

2024-01-16 Thread Laszlo Ersek
On 1/16/24 14:44, Laszlo Ersek wrote: > On 1/15/24 16:59, Gerd Hoffmann wrote: >> Move the DoErase code block into a separate function, call the function >> instead of jumping around with goto. >> >> Signed-off-by: Gerd Hoffmann >> --- >> Ovmf

Re: [edk2-devel] [PATCH v7 25/37] ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg

2024-01-16 Thread Laszlo Ersek
On 1/16/24 12:54, Chao Li wrote: > On 2024/1/15 16:46, Laszlo Ersek wrote: >> On 1/12/24 09:25, Chao Li wrote: >>> @@ -29,7 +29,6 @@ >>>QemuKernel.c >>> >>> [Packages] >>> - ArmVirtPkg/ArmVirtPkg.dec >>>MdeModulePkg/MdeMo

Re: [edk2-devel] [PATCH 1/6] UefiCpuPkg/LocalApicTimerDxe: Duplicate OvmfPkg/LocalApicTimerDxe driver

2024-01-16 Thread Laszlo Ersek
On 1/16/24 10:48, Michael Brown wrote: > On 16/01/2024 08:47, Gerd Hoffmann wrote: >> I think the reason is that the next timer interrupt arriving while the >> handler is running still is *much* more likely in virtual machines >> because the vCPU does not get 100% of the of the physical CPU time

Re: [edk2-devel] [PATCH v2 6/6] OvmfPkg/VirtNorFlashDxe: move DoErase code block into new function

2024-01-16 Thread Laszlo Ersek
On 1/15/24 16:59, Gerd Hoffmann wrote: > Move the DoErase code block into a separate function, call the function > instead of jumping around with goto. > > Signed-off-by: Gerd Hoffmann > --- > OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c | 76 +- > 1 file changed, 51

Re: [edk2-devel] [PATCH v2 5/6] OvmfPkg/VirtNorFlashDxe: ValidateFvHeader: unwritten state is EOL too

2024-01-16 Thread Laszlo Ersek
shFvb.c > @@ -302,6 +302,11 @@ ValidateFvHeader ( >break; > } > > +if (VarHeader->State == 0xff) { > + DEBUG ((DEBUG_INFO, "%a: end of var list (unwritten state)\n", > __func__)); > + break; > +} > + > VarName = NULL;

Re: [edk2-devel] [PATCH v2 4/6] OvmfPkg/VirtNorFlashDxe: allow larger writes without block erase

2024-01-16 Thread Laszlo Ersek
TES)) { > + if ((End - Start) <= (4 * P30_MAX_BUFFER_SIZE_IN_BYTES)) { > // Check to see if we need to erase before programming the data into NOR. > // If the destination bits are only changing from 1s to 0s we can just > write. > // After a block is erased all bits

Re: [edk2-devel] [PATCH v2 3/6] OvmfPkg/VirtNorFlashDxe: add a loop for NorFlashWriteBuffer calls.

2024-01-16 Thread Laszlo Ersek
er + P30_MAX_BUFFER_SIZE_IN_BYTES > + Instance->ShadowBuffer + Index * > P30_MAX_BUFFER_SIZE_IN_BYTES > ); > + if (EFI_ERROR (Status)) { > +goto Exit; > + } > } > > Exit: Reviewed-by: Laszlo Ersek -=-=-=-=-=-=

Re: [edk2-devel] [PATCH v2 2/6] OvmfPkg/VirtNorFlashDxe: clarify block write logic & fix shadowbuffer reads

2024-01-16 Thread Laszlo Ersek
i.e., the relative offset inside (or just past) //| | the *double-word* such that it is the //| | *exclusive* end of the (logical) update. With that comment update: Reviewed-by: Laszlo Ersek Thanks! Laszlo > + //| | > + //| Of

Re: [edk2-devel] When TPM is enabled, Ubuntu doesn't boot

2024-01-16 Thread Laszlo Ersek
On 1/15/24 13:34, Hamit Can Karaca wrote: > Hi Yao, Jiewen, > I actually tried to get help from the ubuntu people but they really > don't understand what is going in the UEFI side. I am trying to fix > this problem for 3 weeks now and I am about the give up. I hope > somebody can help me :( The

Re: [edk2-devel] [PATCH 1/6] UefiCpuPkg/LocalApicTimerDxe: Duplicate OvmfPkg/LocalApicTimerDxe driver

2024-01-16 Thread Laszlo Ersek
On 1/15/24 19:10, Kinney, Michael D wrote: > Hi Ray, > > I think nesting may be possible in physical platforms, but very hard > to induce. > > One option is to consolidate to a single LocalApicTimerDxe > implementation in the UefiCpuPkg, but allow the platform DSC to either > specify a Null

Re: [edk2-devel] [PATCH 0/4] OvmfPkg/VirtNorFlashDxe: fix corruption + misc small improvements

2024-01-16 Thread Laszlo Ersek
On 1/15/24 18:56, Ard Biesheuvel wrote: > On Mon, 15 Jan 2024 at 11:21, Laszlo Ersek wrote: >> >> On 1/12/24 12:37, Gerd Hoffmann wrote: >>> This is a little series containing the flash corruption fix sent >>> yesterday with an slightly improved commit messag

Re: [edk2-devel] [PATCH 1/6] UefiCpuPkg/LocalApicTimerDxe: Duplicate OvmfPkg/LocalApicTimerDxe driver

2024-01-15 Thread Laszlo Ersek
On 1/15/24 09:59, Pedro Falcato wrote: > On Mon, Jan 15, 2024 at 8:04 AM Ni, Ray wrote: >> >> This commit only duplicates the OvmfPkg/LocalApicTimerDxe. >> Following commits will enhance the driver. > > Hi, > > Please describe why you're doing this change. i.e what's your use case > for

Re: [edk2-devel] [PATCH v2 1/6] OvmfPkg/VirtNorFlashDxe: add casts to UINTN and UINT32

2024-01-15 Thread Laszlo Ersek
mp; (UINT32)Buffer[CurOffset]) { > goto DoErase; >} > The explicit cast for the RHS is not strictly necessary (the same would happen as a consequence of the cast being added to the LHS, through the usual arithmetic conversions), *but* it definitely doesn't hurt, and argua

Re: [edk2-devel] [PATCH v3 0/3] Support CloudHv guests with >1TB of RAM

2024-01-15 Thread Laszlo Ersek
tility is not currently supported for CloudHv. >>>> >>>> My working branch for these changes can be found here: >>>> https://github.com/thomasbarrett/edk2/tree/cloud-hv-1tb-ram >>>> >>>> Cc: Anatol Belski >>>> Cc: Ard Bieshe

Re: [edk2-devel] Memory Attribute for depex section

2024-01-15 Thread Laszlo Ersek
On 1/15/24 15:04, Ard Biesheuvel wrote: > On Mon, 15 Jan 2024 at 14:07, Nhi Pham wrote: >> >> On 1/12/2024 4:45 PM, Laszlo Ersek wrote: >>> (Independently: I think that's a valid thing to do for *SMM* drivers, >>> because the entry point functions of those driv

Re: [edk2-devel] [PATCH] UefiCpuPkg: Fix issue that IsModified is wrongly set in PageTableMap

2024-01-15 Thread Laszlo Ersek
On 1/15/24 10:43, Pedro Falcato wrote: > On Thu, Jan 11, 2024 at 8:56 AM Laszlo Ersek wrote: >> >> On 1/11/24 03:03, Ni, Ray wrote: >>>> This function is incredibly complicated, so reviewing this patch is >>>> hard, even after reading the bugzilla ticket.

Re: [edk2-devel] [PATCH] UefiCpuPkg: Fix issue that IsModified is wrongly set in PageTableMap

2024-01-15 Thread Laszlo Ersek
On 1/15/24 03:59, Liu, Zhiguang wrote: > Hi Laszlo, > > I don't think it is a good idea to explicitly mask out the Accessed/Dirty > bit. We can't assume Accessed/Dirty bit are only changed by hardware, because > the caller also can change the Accessed/Dirty bit. > > For API PageTableMap, the

Re: [edk2-devel] [PATCH v3 0/3] Support CloudHv guests with >1TB of RAM

2024-01-15 Thread Laszlo Ersek
latformScanE820 > utility is not currently supported for CloudHv. > > My working branch for these changes can be found here: > https://github.com/thomasbarrett/edk2/tree/cloud-hv-1tb-ram > > Cc: Anatol Belski > Cc: Ard Biesheuvel > Cc: Gerd Hoffmann > Cc: Jianyong Wu

Re: [edk2-devel] [PATCH 0/4] OvmfPkg/VirtNorFlashDxe: fix corruption + misc small improvements

2024-01-15 Thread Laszlo Ersek
On 1/15/24 11:21, Laszlo Ersek wrote: > - please only ever apply the bit-neg operator on values that are UINT32, > UINTN, or UINT64. Otherwise we get sign bit flipping, and that's > terrible. (Most people are not even aware of it happening.) Doing this is BTW not as obvious as it m

Re: [edk2-devel] [PATCH 0/4] OvmfPkg/VirtNorFlashDxe: fix corruption + misc small improvements

2024-01-15 Thread Laszlo Ersek
On 1/12/24 12:37, Gerd Hoffmann wrote: > This is a little series containing the flash corruption fix sent > yesterday with an slightly improved commit message and some small > improvements on top of this. > > Gerd Hoffmann (4): > OvmfPkg/VirtNorFlashDxe: fix shadowbuffer reads >

Re: [edk2-devel] RFC: Folder layout change in UefiCpuPkg

2024-01-15 Thread Laszlo Ersek
On 1/12/24 11:19, Sunil V L wrote: > Hi Ray, > > On Fri, Jan 12, 2024 at 09:12:34AM +, Ni, Ray wrote: >> Sunil, >> I would like to hear your feedback regarding locations of following RiscV64 >> components in UefiCpuPkg: >> * UefiCpuPkg/Library/BaseRiscV64CpuExceptionHandlerLib/ >> *

Re: [edk2-devel] [PATCH v7 25/37] ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg

2024-01-15 Thread Laszlo Ersek
On 1/12/24 09:25, Chao Li wrote: > Moved the PlatformBootManagerLib to OvmfPkg and renamed to > PlatformBootManagerLibLight for easy use by other ARCH. > > Build-tested only (with "ArmVirtQemu.dsc"). > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 > > Cc: Ard Biesheuvel > Cc: Leif

Re: [edk2-devel] [PATCH v7 00/37] Enable LoongArch virtual machine in edk2

2024-01-15 Thread Laszlo Ersek
On 1/12/24 09:21, Chao Li wrote: > **Changes from V6 to V7:** > [...] > For the review opinions: > 1. Moved the changes to OvmfPkg.dec from old patch 24 to new patch 23. > Questioner: Laszlo. IIUC, you may have inteded to do this, but didn't actually do it. Laszlo -=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v7 23/37] ArmVirtPkg: Move the FdtSerialPortAddressLib to OvmfPkg

2024-01-15 Thread Laszlo Ersek
Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Gerd Hoffmann > Cc: Jiewen Yao > Cc: Laszlo Ersek > Signed-off-by: Chao Li > --- > ArmVirtPkg/ArmVirt.dsc.inc| 2 +- > .../Include/Library/FdtSerialPortAddressLib.h | 0 > .

Re: [edk2-devel] [PATCH 1/1] OvmfPkg/VirtNorFlashDxe: fix shadowbuffer reads

2024-01-12 Thread Laszlo Ersek
On 1/11/24 14:36, Gerd Hoffmann wrote: > In some cases (specifically when the flash update region is > small but crosses a multiple of P30_MAX_BUFFER_SIZE_IN_BYTES) > NorFlashWriteSingleBlock reads only one instead of two > P30_MAX_BUFFER_SIZE_IN_BYTES blocks into the shadow buffer. > > That

Re: [edk2-devel] Memory Attribute for depex section

2024-01-12 Thread Laszlo Ersek
On 1/12/24 03:44, Andrew (EFI) Fish wrote: > Sorry need some more time to digest this…. First thoughts. > > 1) The actual performance issue we hit was the explosion > of CoreValidateHandle() calls as the number of protocols got large for > some diags. The newer handles tended to be at the end of

Re: [edk2-devel] Memory Attribute for depex section

2024-01-12 Thread Laszlo Ersek
On 1/12/24 03:10, Pedro Falcato wrote: > On Thu, Jan 11, 2024 at 8:46 AM Laszlo Ersek wrote: >> >> On 1/10/24 22:50, Pedro Falcato wrote: >>> FWIW, can we do better than an RB tree? They're notoriously cache >>> unfriendly... >> >> Sure, if s

Re: [edk2-devel] Memory Attribute for depex section

2024-01-11 Thread Laszlo Ersek
On 1/11/24 09:46, Laszlo Ersek wrote: > On 1/10/24 22:50, Pedro Falcato wrote: >> For the protocol database, you'd replace the linked list with a simple >> hashtable, hashed by protocol. Something as simple as LIST_ENTRY >> mProtocolHashtable[64]; would probably be e

Re: [edk2-devel] [PATCH] UefiCpuPkg: change name of gMpInformationHobGuid2

2024-01-11 Thread Laszlo Ersek
On 1/11/24 10:00, Dun Tan wrote: > Change name of gMpInformationHobGuid2 to > gMpInformation2HobGuid. It's to align with > the file name MpInformation2.h and the > structure name MP_INFORMATION2_HOB_DATA. > > Signed-off-by: Dun Tan > Cc: Ray Ni > Cc: Laszlo Ersek >

Re: [edk2-devel] [PATCH 1/2] CloudHv: Add CloudHv support to PlatformScanE820 utility function.

2024-01-11 Thread Laszlo Ersek
Hello Thomas, (+ Jianyong, Anatol, Gerd) On 1/10/24 23:21, Thomas Barrett wrote: > Signed-off-by: Thomas Barrett > --- > OvmfPkg/Library/PlatformInitLib/MemDetect.c | 95 ++--- > 1 file changed, 65 insertions(+), 30 deletions(-) please don't paste patches in email bodies; they

Re: [edk2-devel] [PATCH] UefiCpuPkg: Fix issue that IsModified is wrongly set in PageTableMap

2024-01-11 Thread Laszlo Ersek
On 1/11/24 03:03, Ni, Ray wrote: >> This function is incredibly complicated, so reviewing this patch is >> hard, even after reading the bugzilla ticket. >> >> The commit message is useless. It should contain a brief description of >> the problem, and how the fix resolves the problem. >> >> The

Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuMpPei: Don't write CR3 in ConvertMemoryPageToNotPresent

2024-01-11 Thread Laszlo Ersek
On 1/11/24 03:08, Ni, Ray wrote: > > > Thanks, > Ray >> -Original Message----- >> From: Laszlo Ersek >> Sent: Wednesday, January 10, 2024 7:57 PM >> To: Liu, Zhiguang ; devel@edk2.groups.io >> Cc: Ni, Ray ; Kumar, Rahul R ; >> Gerd Hoffm

Re: [edk2-devel] [Patch V2] UefiCpuPkg:Limit PhysicalAddressBits in speicial case

2024-01-11 Thread Laszlo Ersek
CPU HOB or > CpuId is bigger than 47, and since virtual > addresses are sign-extended, only [0, 2^47-1] > range in 52-bit physical address is mapped > in page table. > > Signed-off-by: Dun Tan > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Cc: Gerd Hoffmann

Re: [edk2-devel] Memory Attribute for depex section

2024-01-11 Thread Laszlo Ersek
On 1/10/24 22:50, Pedro Falcato wrote: > On Wed, Jan 10, 2024 at 1:45 PM Laszlo Ersek > wrote: >> >> (+ Andrew) >> >> On 1/10/24 14:09, Laszlo Ersek wrote: >> >>> I think that keeping the depex section read-only is valuable, so I'd >>> rul

Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg: Initialise serial port early in StandaloneMmEntryPoint

2024-01-10 Thread Laszlo Ersek
On 1/10/24 17:13, levi.yun wrote: >> My personal conclusion in that thread was [1], and correspondingly, >> commit 5087a0773645 ("ArmVirtPkg/FdtPL011SerialPortLib: initialize >> implicitly", 2023-10-07). In the end, the only tractable solution was to >> initialize the serial port (hardware, and

Re: [edk2-devel] Memory Attribute for depex section

2024-01-10 Thread Laszlo Ersek
(+ Andrew) On 1/10/24 14:09, Laszlo Ersek wrote: > I think that keeping the depex section read-only is valuable, so I'd > rule out #2. I'd also not start with option #1 -- copying the depex to > heap memory, just so this optimization can succeed. I'd simply start by > removing the

Re: [edk2-devel] Memory Attribute for depex section

2024-01-10 Thread Laszlo Ersek
Hi, On 1/8/24 11:11, Nhi Pham via groups.io wrote: > Hi Ard, all, > > Could you please help explain how the depex section in an image is > mapped in terms of memory attribute? > > As my observation, dispatcher locates[1] the depex section inside the > module image and write[2] an evaluated data

Re: [edk2-devel] [PATCH] UefiCpuPkg:Limit PhysicalAddressBits in speicial case

2024-01-10 Thread Laszlo Ersek
On 1/10/24 11:54, Gerd Hoffmann wrote: > On Wed, Jan 10, 2024 at 04:05:44PM +0800, Dun Tan wrote: >> When creating smm page table, limit maximum >> supported physical address bits returned by >> CalculateMaximumSupportAddress() to 48 if >> 5-Level Paging is disabled. >> When 5-Level Paging is

Re: [edk2-devel] [PATCH] UefiCpuPkg: Fix issue that IsModified is wrongly set in PageTableMap

2024-01-10 Thread Laszlo Ersek
On 1/10/24 06:38, Zhiguang Liu wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4614 > > Fix issue that IsModified is wrongly set in PageTableMap. > > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Cc: Gerd Hoffmann > Cc: Crystal Lee &g

Re: [edk2-devel] [PATCH] UefiCpuPkg/CpuMpPei: Don't write CR3 in ConvertMemoryPageToNotPresent

2024-01-10 Thread Laszlo Ersek
On 1/10/24 06:43, Zhiguang Liu wrote: > After ConvertMemoryPageToNotPresent, there is always a flush TLB > function. So, to improve performance, there is no need to write CR3 > inside ConvertMemoryPageToNotPresent > > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar

Re: [edk2-devel] [PATCH v5 3/3] OvmfPkg/VirtNorFlashDxe: sanity-check variables

2024-01-09 Thread Laszlo Ersek
On 1/9/24 15:11, Gerd Hoffmann wrote: > Hi, > >> Nit: to my knowledge, the coding style forbids initialization of "auto" >> storage class variables (more commonly put, "non-static local >> variables"). IOW, we should spell the above as: >> >> | diff --git

Re: [edk2-devel] [Patch V3 0/2] Change the usage of input parameter ProcessorNumber in MpInitLibGetProcessorInfo() of MpInitLibUp

2024-01-09 Thread Laszlo Ersek
On 1/8/24 06:08, duntan wrote: > Please ignore the V2 PATCH set. No other change except adding BaseMemoryLib > headfile and lib instance in .inf to pass build since ZeroMem() is used. > > Comparing to the V1 patch set: > In "set EXTENDED_PROCESSOR_INFORMATION to 0", set >

Re: [edk2-devel] Updates to .mailmap needed for Jeff Brasen, Jake Garver, Joey Vagades and Michael Roth?

2024-01-09 Thread Laszlo Ersek
On 1/9/24 13:28, Michael Brown wrote: > On 09/01/2024 12:13, Laszlo Ersek wrote: >> On 1/9/24 11:45, Ard Biesheuvel wrote: >>> Note that git am does support a 'From: ' header as the first line of >>> the commit log, and will use it correctly to supersede the From: >

Re: [edk2-devel] [PATCH v5 3/3] OvmfPkg/VirtNorFlashDxe: sanity-check variables

2024-01-09 Thread Laszlo Ersek
rbage, unless the tail starts with 0x55aa, which indicates that it's indeed either a truncated variable header, or one that's not truncated, but just fits (and has no room for subsequent name/data). Furthermore, we consider "VariableStoreHeader->Size" trusted & valid here, th

Re: [edk2-devel] Updates to .mailmap needed for Jeff Brasen, Jake Garver, Joey Vagades and Michael Roth?

2024-01-09 Thread Laszlo Ersek
On 1/9/24 11:45, Ard Biesheuvel wrote: > On Tue, 9 Jan 2024 at 10:17, Laszlo Ersek wrote: >> >> On 1/5/24 01:05, Rebecca Cran via groups.io wrote: >>> I noticed recent commits by Jeff Brasen, Jake Garver, Joey Vagades and >>> Michael Roth have funky Author li

Re: [edk2-devel] Updates to .mailmap needed for Jeff Brasen, Jake Garver, Joey Vagades and Michael Roth?

2024-01-09 Thread Laszlo Ersek
On 1/5/24 01:05, Rebecca Cran via groups.io wrote: > I noticed recent commits by Jeff Brasen, Jake Garver, Joey Vagades and > Michael Roth have funky Author lines, which I think means .mailmap needs > updated? > > Author: Jeff Brasen via groups.io > Author: Joey Vagedes via groups.io > Author:

Re: [edk2-devel] [PATCH v4 3/3] OvmfPkg/VirtNorFlashDxe: sanity-check variables

2024-01-09 Thread Laszlo Ersek
On 1/8/24 20:21, Gerd Hoffmann wrote: > Extend the ValidateFvHeader function, additionally to the header checks > walk over the list of variables and sanity check them. > > In case we find inconsistencies indicating variable store corruption > return EFI_NOT_FOUND so the variable store will be

Re: [edk2-devel] [PATCH v4 2/3] OvmfPkg/VirtNorFlashDxe: stop accepting gEfiVariableGuid

2024-01-09 Thread Laszlo Ersek
_HEADER *)((UINTN)FwVolHeader + > FwVolHeader->HeaderLength); > >// Check the Variable Store Guid > - if (!CompareGuid (>Signature, ) && > - !CompareGuid (>Signature, > )) > - { > + if (!CompareGuid (>Signature, > )) { >

Re: [edk2-devel] [PATCH v4 1/3] OvmfPkg/RiscVVirt: use gEfiAuthenticatedVariableGuid unconditionally

2024-01-09 Thread Laszlo Ersek
ePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - ># 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0x3FFB8 ># This can speed up the Variable Dispatch a bit. Reviewed-by: Laszlo Ersek -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply

Re: [edk2-devel] [PATCH v6 24/36] ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg

2024-01-09 Thread Laszlo Ersek
On 1/9/24 07:40, Chao Li wrote: > Hi Laszlo, > > > Thanks, > Chao > On 2024/1/8 22:02, Laszlo Ersek wrote: >> On 1/5/24 10:45, Chao Li wrote: >>> Moved the PlatformBootManagerLib to OvmfPkg and renamed to >>> PlatformBootManagerLibLight for easy us

Re: [edk2-devel] [PATCH v6 24/36] ArmVirtPkg: Move PlatformBootManagerLib to OvmfPkg

2024-01-08 Thread Laszlo Ersek
On 1/5/24 10:45, Chao Li wrote: > Moved the PlatformBootManagerLib to OvmfPkg and renamed to > PlatformBootManagerLibLight for easy use by other ARCH. > > Build-tested only (with "ArmVirtQemu.dsc"). > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 > > Cc: Ard Biesheuvel > Cc: Leif

Re: [edk2-devel] [PATCH v10 4/5] MdePkg: Utilize Cache Management Operations Implementation For RISC-V

2024-01-08 Thread Laszlo Ersek
Hi Dhaval, On 12/13/23 15:59, Dhaval Sharma wrote: > Use newly defined cache management operations for RISC-V where possible > It builds up on the support added for RISC-V cache management > instructions in BaseLib. > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu

Re: [edk2-devel] [PATCH v2 3/4] UefiCpuPkg/CpuTimerDxeRiscV64: Add support for Sstc

2024-01-08 Thread Laszlo Ersek
y to program the timer interrupt. > > Cc: Gerd Hoffmann > Cc: Rahul Kumar > Cc: Laszlo Ersek > Cc: Ray Ni > Cc: Andrei Warkentin > Signed-off-by: Sunil V L > --- > .../CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf | 1 + > UefiCpuPkg/CpuTimerDxeRiscV64/Timer.h

Re: [edk2-devel] [Patch V3 0/2] Change the usage of input parameter ProcessorNumber in MpInitLibGetProcessorInfo() of MpInitLibUp

2024-01-08 Thread Laszlo Ersek
On 1/8/24 06:08, duntan wrote: > Please ignore the V2 PATCH set. No other change except adding BaseMemoryLib > headfile and lib instance in .inf to pass build since ZeroMem() is used. Reviewed-by: Laszlo Ersek > > Comparing to the V1 patch set: > In "set EXTENDED_PROCES

Re: [edk2-devel] [Patch V2 0/2] Change the usage of input parameter ProcessorNumber in MpInitLibGetProcessorInfo() of MpInitLibUp

2024-01-08 Thread Laszlo Ersek
XTENDED_PROCESSOR_INFORMATION to 0 > UefiCpuPkg: Check lower 24 bits of ProcessorNumber > > UefiCpuPkg/Include/Library/MpInitLib.h | 2 ++ > UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 ++ > UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.c | 19 +++ > 3 fil

Re: [edk2-devel] [PATCH v1 1/1] StandaloneMmPkg: Initialise serial port early in StandaloneMmEntryPoint

2024-01-08 Thread Laszlo Ersek
On 1/5/24 19:38, Oliver Smith-Denny wrote: > On 1/5/2024 9:22 AM, levi.yun wrote: >> >> Hi Ard :) >> >>> So now we will always initialize the serial port in the entrypoint >>> only because DebugLib might use it later with doing the >>> initialization. >>> >>> That doesn't sound quite correct to

Re: [edk2-devel] [PATCH 1/2] UefiCpuPkg: Retrive EXTENDED_PROCESSOR_INFORMATION

2024-01-05 Thread Laszlo Ersek
asteful. Right now the ZeroMem() looks much more frugal, and a bit more future-proof too. Thanks! Laszlo > > Thanks, > Ray >> -Original Message- >> From: Tan, Dun >> Sent: Friday, January 5, 2024 5:25 PM >> To: Laszlo Ersek ; devel@edk2.groups.io >> Cc

Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg: Check lower 24 bits of ProcessorNumber

2024-01-05 Thread Laszlo Ersek
icitly use BIT24 instead of CPU_V2_EXTENDED_TOPOLOGY. > Using BIT24 clearly tells that processor number only occupies the lower 24 > bits. Yes, I've noticed this discrepancy too; I agree BIT24 is clearer here! > > >>> return EFI_NOT_FOUND; >>>} >>> >

Re: [edk2-devel] [PATCH v2 1/1] UefiCpuPkg/PiSmmCpuDxeSmm: Optimize PatchSmmSaveStateMap and FlushTlbForAll

2024-01-05 Thread Laszlo Ersek
On 1/5/24 13:52, Ni, Ray wrote: > Reviewed-by: Ray Ni Thanks, please feel free to merge this! Laszlo > > > Thanks, > Ray >> -Original Message- >> From: Jin, Zhi >> Sent: Friday, January 5, 2024 10:54 AM >> To: devel@edk2.groups.io >> Cc:

Re: [edk2-devel] [PATCH 3/4] UefiCpuPkg/CpuTimerDxeRiscV64: Add support for Sstc

2024-01-05 Thread Laszlo Ersek
On 1/4/24 16:46, Sunil V L wrote: > On Thu, Jan 04, 2024 at 03:38:17PM +0100, Laszlo Ersek wrote: >> On 1/3/24 14:58, Sunil V L wrote: >>> Sstc extension allows to program the timer and receive the interrupt >>> without using an SBI call. This reduces the la

Re: [edk2-devel] [PATCH 3/4] UefiCpuPkg/CpuTimerDxeRiscV64: Add support for Sstc

2024-01-05 Thread Laszlo Ersek
On 1/4/24 16:01, Sunil V L wrote: > Hi Laszlo, > > Thank you very much for the review!. > > On Thu, Jan 04, 2024 at 03:38:17PM +0100, Laszlo Ersek wrote: >> On 1/3/24 14:58, Sunil V L wrote: >>> Sstc extension allows to program the timer and receive the interrupt

Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/VirtNorFlashDxe: sanity-check variables

2024-01-05 Thread Laszlo Ersek
On 1/4/24 16:06, Gerd Hoffmann wrote: > Hi, > - if the StartId is 0x55aa, then we need to look further, beause we can't decide yet. For example, if State is VAR_HEADER_VALID_ONLY (0x7f), then it might be fine for the variable header (at the very end of the varstore) *not* to

Re: [edk2-devel] [PATCH 1/2] UefiCpuPkg: Retrive EXTENDED_PROCESSOR_INFORMATION

2024-01-04 Thread Laszlo Ersek
On 1/4/24 08:32, duntan wrote: > Retrive EXTENDED_PROCESSOR_INFORMATION in the API > MpInitLibGetProcessorInfo() of MpInitLibUp instance > when the BIT24 of input ProcessorNumber is set. > It's to align with the behavior in PEI/DXE MpInitLib > > Signed-off-by: Dun Tan > Cc:

Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg: Check lower 24 bits of ProcessorNumber

2024-01-04 Thread Laszlo Ersek
cessorNumber might be set to > indicate if the EXTENDED_PROCESSOR_INFORMATION will > be retrived. > > Signed-off-by: Dun Tan > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Rahul Kumar > Cc: Gerd Hoffmann > Cc: Min Xu > --- > UefiCpuPkg/Library/MpInitLibUp/MpInitLibU

Re: [edk2-devel] [PATCH 4/4] OvmfPkg/RiscVVirt: Override Sstc extension

2024-01-04 Thread Laszlo Ersek
On 1/3/24 14:58, Sunil V L wrote: > Override Sstc extension and use SBI calls itself by default for RISC-V > qemu virt platform. > > Cc: Andrei Warkentin > Cc: Ard Biesheuvel > Cc: Gerd Hoffmann > Cc: Jiewen Yao > Cc: Laszlo Ersek > Signed-off-by: Sunil V L

Re: [edk2-devel] [PATCH 3/4] UefiCpuPkg/CpuTimerDxeRiscV64: Add support for Sstc

2024-01-04 Thread Laszlo Ersek
y to program the timer interrupt. > > Cc: Gerd Hoffmann > Cc: Rahul Kumar > Cc: Laszlo Ersek > Cc: Ray Ni > Cc: Andrei Warkentin > Signed-off-by: Sunil V L > --- > .../CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf | 1 + > UefiCpuPkg/CpuTimerDxeRiscV64/Timer.h

Re: [edk2-devel] [PATCH 4/4] OvmfPkg/RiscVVirt: Override Sstc extension

2024-01-04 Thread Laszlo Ersek
On 1/3/24 14:58, Sunil V L wrote: > Override Sstc extension and use SBI calls itself by default for RISC-V > qemu virt platform. > > Cc: Andrei Warkentin > Cc: Ard Biesheuvel > Cc: Gerd Hoffmann > Cc: Jiewen Yao > Cc: Laszlo Ersek > Signed-off-by: Sunil V L

Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/VirtNorFlashDxe: sanity-check variables

2024-01-04 Thread Laszlo Ersek
On 1/3/24 16:11, Gerd Hoffmann wrote: > Hi, > >> Second (and worse): the bug. In "OvmfPkg/RiscVVirt/VarStore.fdf.inc", it >> turns out that we *still* generate the gEfiVariableGuid varstore header >> signature, in case SECURE_BOOT_ENABLE is FALSE. For some reason, commit >> 92b27c2e6ada

Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/VirtNorFlashDxe: sanity-check variables

2024-01-03 Thread Laszlo Ersek
On 1/3/24 14:09, Laszlo Ersek wrote: > On 1/3/24 13:56, Laszlo Ersek wrote: > >> (8) Apologies if it was me who suggested ALIGN_VALUE() previously, but >> this is, in effect, an unchecked addition. I can't off-hand see evidence >> that it can never overflow (the pr

Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/VirtNorFlashDxe: sanity-check variables

2024-01-03 Thread Laszlo Ersek
On 1/3/24 13:56, Laszlo Ersek wrote: > (8) Apologies if it was me who suggested ALIGN_VALUE() previously, but > this is, in effect, an unchecked addition. I can't off-hand see evidence > that it can never overflow (the previous checks don't seem to prevent an > overflow here),

Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/VirtNorFlashDxe: sanity-check variables

2024-01-03 Thread Laszlo Ersek
On 12/14/23 16:31, Gerd Hoffmann wrote: > Extend the ValidateFvHeader function, additionally to the header checks > walk over the list of variables and sanity check them. > > In case we find inconsistencies indicating variable store corruption > return EFI_NOT_FOUND so the variable store will be

Re: [edk2-devel] [PATCH v2 1/1] OvmfPkg/VirtNorFlashDxe: sanity-check variables

2023-12-14 Thread Laszlo Ersek
On 12/14/23 16:31, Gerd Hoffmann wrote: > Hi, > >> The general idea is, once we don't trust the varstore, there cannot be >> a *single* unchecked addition in the code. (Unless we can *prove* that >> overflow is impossible.) > > There are some cases where we add a small, constant number to a

Re: [edk2-devel] [PATCH v3 3/6] UefiCpuPkg: Implements SmmCpuSyncLib library instance

2023-12-14 Thread Laszlo Ersek
On 12/14/23 12:11, Wu, Jiaxin wrote: > Hi Laszlo, > > Really appreciate your comments! I checked one by one and feedback as below, > thank you & Ray again & again for patch refinement > > >> >> (1) If / when you update the documentation in patch#2, please update >> this one as well. >> >

Re: [edk2-devel] [PATCH V6] DebugLib: Update DEBUG macro used when MDEPKG_NDEBUG is defined

2023-12-14 Thread Laszlo Ersek
On 12/14/23 10:33, Mike Beaton wrote: >> Please stop sending patches. > > I believe this version is a clear improvement, with motivation. > (Certainly, it was meant as such!) > > How am I meant to send improvements or updates in this email-based workflow? By pacing yourself. Posting two

<    1   2   3   4   5   6   7   8   9   10   >