On Fri, 12 Jan 2024 at 12:38, Gerd Hoffmann <kra...@redhat.com> wrote: > > Raise the limit for writes without block erase from two to four > P30_MAX_BUFFER_SIZE_IN_BYTES blocks. With this in place almost > all efi variable updates are handled without block erase. With > the old limit some variable updates (with device paths) took the > block erase code path. > > Signed-off-by: Gerd Hoffmann <kra...@redhat.com> > --- > OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c > b/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c > index 90db12716a4c..c631ffd3a62d 100644 > --- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c > +++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c > @@ -555,7 +555,7 @@ NorFlashWriteSingleBlock ( > // To avoid pathological cases were a 2 byte write is disregarded because > it > // occurs right at a 128 byte buffered write alignment boundary, permit up > to > // twice the max buffer size, and perform two writes if needed.
Please update the comment > - if ((*NumBytes + (Offset & BOUNDARY_OF_32_WORDS)) <= (2 * > P30_MAX_BUFFER_SIZE_IN_BYTES)) { > + if ((*NumBytes + (Offset & BOUNDARY_OF_32_WORDS)) <= (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 in the block is set to 1. Reviewed-by: Ard Biesheuvel <a...@kernel.org> -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113728): https://edk2.groups.io/g/devel/message/113728 Mute This Topic: https://groups.io/mt/103680934/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-