From: "Ard Biesheuvel" <ardb@kernel.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: devel@edk2.groups.io, Laszlo Ersek <lersek@redhat.com>,
Jiewen Yao <jiewen.yao@intel.com>,
oliver@redhat.com
Subject: Re: [edk2-devel] [PATCH 3/4] OvmfPkg/VirtNorFlashDxe: allow larger writes without block erase
Date: Fri, 12 Jan 2024 13:15:52 +0100 [thread overview]
Message-ID: <CAMj1kXEsB7rNLyrp7mCZ3R7uMaEEXD85E5rLxzsNhND40PJ8Yg@mail.gmail.com> (raw)
In-Reply-To: <20240112113754.14710-4-kraxel@redhat.com>
On Fri, 12 Jan 2024 at 12:38, Gerd Hoffmann <kraxel@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 <kraxel@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 <ardb@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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-01-12 12:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-12 11:37 [edk2-devel] [PATCH 0/4] OvmfPkg/VirtNorFlashDxe: fix corruption + misc small improvements Gerd Hoffmann
2024-01-12 11:37 ` [edk2-devel] [PATCH 1/4] OvmfPkg/VirtNorFlashDxe: fix shadowbuffer reads Gerd Hoffmann
2024-01-12 12:11 ` Ard Biesheuvel
2024-01-12 11:37 ` [edk2-devel] [PATCH 2/4] OvmfPkg/VirtNorFlashDxe: clarify block write logic Gerd Hoffmann
2024-01-12 12:14 ` Ard Biesheuvel
2024-01-12 11:37 ` [edk2-devel] [PATCH 3/4] OvmfPkg/VirtNorFlashDxe: allow larger writes without block erase Gerd Hoffmann
2024-01-12 12:15 ` Ard Biesheuvel [this message]
2024-01-12 11:37 ` [edk2-devel] [PATCH 4/4] OvmfPkg/VirtNorFlashDxe: ValidateFvHeader: unwritten state is EOL too Gerd Hoffmann
2024-01-12 12:16 ` Ard Biesheuvel
2024-01-12 12:41 ` Gerd Hoffmann
2024-01-15 10:21 ` [edk2-devel] [PATCH 0/4] OvmfPkg/VirtNorFlashDxe: fix corruption + misc small improvements Laszlo Ersek
2024-01-15 12:38 ` Laszlo Ersek
2024-01-15 17:56 ` Ard Biesheuvel
2024-01-16 9:37 ` Laszlo Ersek
2024-01-16 10:21 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMj1kXEsB7rNLyrp7mCZ3R7uMaEEXD85E5rLxzsNhND40PJ8Yg@mail.gmail.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox