diff mbox series

[v3,2/2] ovmf: fix build error with Nasm 3.0

Message ID 20251126034801.1997488-2-ankur.tyagi85@gmail.com
State New
Headers show
Series [v3,1/2] nasm: upgrade 2.16.03 -> 3.01 | expand

Commit Message

Ankur Tyagi Nov. 26, 2025, 3:48 a.m. UTC
From: Ankur Tyagi <ankur.tyagi85@gmail.com>

Signed-off-by: Ankur Tyagi <ankur.tyagi85@gmail.com>
---
Changes in v3:
- fix ovmf build error
Changes in v2:
- not applicable
---
 ...ceptionHandlerLib-fix-push-instructi.patch | 43 +++++++++++++++++++
 meta/recipes-core/ovmf/ovmf_git.bb            |  1 +
 2 files changed, 44 insertions(+)
 create mode 100644 meta/recipes-core/ovmf/ovmf/0005-UefiCpuPkg-CpuExceptionHandlerLib-fix-push-instructi.patch
diff mbox series

Patch

diff --git a/meta/recipes-core/ovmf/ovmf/0005-UefiCpuPkg-CpuExceptionHandlerLib-fix-push-instructi.patch b/meta/recipes-core/ovmf/ovmf/0005-UefiCpuPkg-CpuExceptionHandlerLib-fix-push-instructi.patch
new file mode 100644
index 0000000000..43c402b91a
--- /dev/null
+++ b/meta/recipes-core/ovmf/ovmf/0005-UefiCpuPkg-CpuExceptionHandlerLib-fix-push-instructi.patch
@@ -0,0 +1,43 @@ 
+From 7dcf5ed06b5a256436521f892d2579421c163902 Mon Sep 17 00:00:00 2001
+From: Gerd Hoffmann <kraxel@redhat.com>
+Date: Mon, 3 Nov 2025 09:56:52 +0100
+Subject: [PATCH] UefiCpuPkg/CpuExceptionHandlerLib: fix push instructions
+
+Nasm 3.0 complains about 'dword' being invalid.  The comment talks about
+a '8-byte value' so 'qword' should be correct here.
+
+With this change the extra comment explaining that the instruction
+actually pushes an 8-byte value despite the 'dword' keyword is not
+needed any more.  Drop it.
+
+Fixes: https://github.com/tianocore/edk2/issues/11635
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+Upstream-Status: Backport [https://github.com/tianocore/edk2/commit/9ccf8751a74f26142e584c7b7c7572a182b67997]
+(cherry picked from commit 9ccf8751a74f26142e584c7b7c7572a182b67997)
+Signed-off-by: Ankur Tyagi <ankur.tyagi@navicogroup.com>
+---
+ .../CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm       | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
+index 3d64ac9080..671ed98f85 100644
+--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
++++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.nasm
+@@ -57,7 +57,7 @@ ALIGN   8
+ AsmIdtVectorBegin:
+ %assign Vector 0
+ %rep  256
+-    push    strict dword %[Vector] ; This instruction pushes sign-extended 8-byte value on stack
++    push    strict qword %[Vector]
+     push    rax
+ %ifdef NO_ABSOLUTE_RELOCS_IN_TEXT
+     mov     rax, strict qword 0    ; mov     rax, ASM_PFX(CommonInterruptEntry)
+@@ -70,7 +70,7 @@ AsmIdtVectorBegin:
+ AsmIdtVectorEnd:
+ 
+ HookAfterStubHeaderBegin:
+-    push    strict dword 0      ; 0 will be fixed
++    push    strict qword 0      ; 0 will be fixed
+ VectorNum:
+     push    rax
+ %ifdef NO_ABSOLUTE_RELOCS_IN_TEXT
diff --git a/meta/recipes-core/ovmf/ovmf_git.bb b/meta/recipes-core/ovmf/ovmf_git.bb
index 577310a678..6b42041ac7 100644
--- a/meta/recipes-core/ovmf/ovmf_git.bb
+++ b/meta/recipes-core/ovmf/ovmf_git.bb
@@ -25,6 +25,7 @@  SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https;ta
            file://0002-BaseTools-makefile-adjust-to-build-in-under-bitbake.patch \
            file://0003-debug-prefix-map.patch \
            file://0004-reproducible.patch \
+           file://0005-UefiCpuPkg-CpuExceptionHandlerLib-fix-push-instructi.patch \
            "
 
 PV = "edk2-stable202508"