d6671b1ccc
- edk2-OvmfPkg-VirtNorFlashDxe-clone-ArmPlatformPkg-s-NOR-f.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-remove-CheckBlockLocked-feat.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-remove-disk-I-O-protocol-imp.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-drop-block-I-O-protocol-impl.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-avoid-array-mode-switch-afte.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-avoid-switching-between-mode.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-use-EFI_MEMORY_WC-and-drop-A.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-map-flash-memory-as-uncachea.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-stop-accepting-gEfiVariable2.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-sanity-check-variable2.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-add-casts-to-UINTN-and-UINT3.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-clarify-block-write-logic-fi.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-add-a-loop-for-NorFlashWrite.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-allow-larger-writes-without-.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-ValidateFvHeader-unwritten-s.patch [RHEL-17587] - edk2-OvmfPkg-VirtNorFlashDxe-move-DoErase-code-block-into.patch [RHEL-17587] - edk2-ArmVirtPkg-ArmVirtQemu-migrate-to-OVMF-s-VirtNorFlas.patch [RHEL-17587] - edk2-OvmfPkg-clone-NorFlashPlatformLib-into-VirtNorFlashP.patch [RHEL-17587] - Resolves: RHEL-17587 ([rhel8] guest fails to boot due to ASSERT error)
56 lines
2.2 KiB
Diff
56 lines
2.2 KiB
Diff
From e8150ee7fdf1421d2e2801c901e0196496ef599e Mon Sep 17 00:00:00 2001
|
|
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
Date: Tue, 16 Jan 2024 18:11:00 +0100
|
|
Subject: [PATCH 11/18] OvmfPkg/VirtNorFlashDxe: add casts to UINTN and UINT32
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
RH-Author: Gerd Hoffmann <None>
|
|
RH-MergeRequest: 43: OvmfPkg/VirtNorFlashDxe backport
|
|
RH-Jira: RHEL-17587
|
|
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
RH-Commit: [13/20] fa695acadb9d693242b5221d2bc1958b929718e7
|
|
|
|
This is needed to avoid bit operations being applied to signed integers.
|
|
|
|
Suggested-by: László Érsek <lersek@redhat.com>
|
|
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
|
Message-Id: <20240116171105.37831-2-kraxel@redhat.com>
|
|
(cherry picked from commit 0395045ae307c43a41f72ca9a8bf4eb8f16b2fe0)
|
|
---
|
|
OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c | 2 +-
|
|
OvmfPkg/VirtNorFlashDxe/VirtNorFlash.h | 2 +-
|
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c b/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c
|
|
index 1afd60ce66..7f4743b003 100644
|
|
--- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c
|
|
+++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.c
|
|
@@ -581,7 +581,7 @@ NorFlashWriteSingleBlock (
|
|
// contents, while checking whether the old version had any bits cleared
|
|
// that we want to set. In that case, we will need to erase the block first.
|
|
for (CurOffset = 0; CurOffset < *NumBytes; CurOffset++) {
|
|
- if (~OrigData[CurOffset] & Buffer[CurOffset]) {
|
|
+ if (~(UINT32)OrigData[CurOffset] & (UINT32)Buffer[CurOffset]) {
|
|
goto DoErase;
|
|
}
|
|
|
|
diff --git a/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.h b/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.h
|
|
index b7f5d208b2..455eafacc2 100644
|
|
--- a/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.h
|
|
+++ b/OvmfPkg/VirtNorFlashDxe/VirtNorFlash.h
|
|
@@ -61,7 +61,7 @@
|
|
#define P30_MAX_BUFFER_SIZE_IN_BYTES ((UINTN)128)
|
|
#define P30_MAX_BUFFER_SIZE_IN_WORDS (P30_MAX_BUFFER_SIZE_IN_BYTES/((UINTN)4))
|
|
#define MAX_BUFFERED_PROG_ITERATIONS 10000000
|
|
-#define BOUNDARY_OF_32_WORDS 0x7F
|
|
+#define BOUNDARY_OF_32_WORDS ((UINTN)0x7F)
|
|
|
|
// CFI Addresses
|
|
#define P30_CFI_ADDR_QUERY_UNIQUE_QRY 0x10
|
|
--
|
|
2.41.0
|
|
|