pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/qemu Fix a bug in the Qemu Alpha PALcode's u...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e20fa898e621
branches:  trunk
changeset: 453114:e20fa898e621
user:      thorpej <thorpej%pkgsrc.org@localhost>
date:      Sun May 23 13:53:10 2021 +0000

description:
Fix a bug in the Qemu Alpha PALcode's unaligned access exception vector:
after advancing the PC past the faulting instruction as defined by the
architecture spec, actually store it in the stack frame passed to the
operating system.

Fixes the difference in behavior between Qemu and real hardware in
PR bin/56198.

diffstat:

 emulators/qemu/Makefile                              |  16 +++++++++++-----
 emulators/qemu/distinfo                              |  12 ++++++------
 emulators/qemu/patches/patch-roms_qemu-palcode_pal.S |  18 +++++++++++++++---
 3 files changed, 32 insertions(+), 14 deletions(-)

diffs (99 lines):

diff -r cd4322c6ba53 -r e20fa898e621 emulators/qemu/Makefile
--- a/emulators/qemu/Makefile   Sun May 23 13:48:20 2021 +0000
+++ b/emulators/qemu/Makefile   Sun May 23 13:53:10 2021 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.277 2021/04/21 13:24:37 adam Exp $
+# $NetBSD: Makefile,v 1.278 2021/05/23 13:53:10 thorpej Exp $
 
 DISTNAME=      qemu-5.2.0
-PKGREVISION=   7
+PKGREVISION=   8
 CATEGORIES=    emulators
 MASTER_SITES=  https://download.qemu.org/
 EXTRACT_SUFX=  .tar.xz
@@ -34,9 +34,15 @@
 
 .include "../../mk/bsd.prefs.mk"
 
+# When upgrading Qemu, you need to determine if this PALcode binary for
+# the Alpha emulator needs to be re-built.  If it does not, then you do
+# not need to bump the version of this PALcode binary blob (which is
+# supplied as a separate distfile).  Contact thorpej@ for details.
+PALCODE_CLIPPER=       palcode-clipper-qemu-5.2.0nb8
+
 DISTFILES=             ${DEFAULT_DISTFILES}
-DISTFILES+=            palcode-clipper
-SITES.palcode-clipper= http://ftp.NetBSD.org/pub/NetBSD/arch/alpha/qemu/
+DISTFILES+=            ${PALCODE_CLIPPER}
+SITES.${PALCODE_CLIPPER}= http://ftp.NetBSD.org/pub/NetBSD/arch/alpha/qemu/
 
 CONFIGURE_ARGS+=       --prefix=${PREFIX}
 CONFIGURE_ARGS+=       --interp-prefix=${PREFIX}/share/qemu
@@ -150,7 +156,7 @@
 PYTHON_FOR_BUILD_ONLY= tool
 
 post-extract:
-       cp ${WRKDIR}/palcode-clipper ${WRKSRC}/pc-bios/palcode-clipper
+       cp ${WRKDIR}/${PALCODE_CLIPPER} ${WRKSRC}/pc-bios/palcode-clipper
        cp ${FILESDIR}/hw-mips-mipssim_virtio.c ${WRKSRC}/hw/mips/mipssim_virtio.c
 
 do-build:
diff -r cd4322c6ba53 -r e20fa898e621 emulators/qemu/distinfo
--- a/emulators/qemu/distinfo   Sun May 23 13:48:20 2021 +0000
+++ b/emulators/qemu/distinfo   Sun May 23 13:53:10 2021 +0000
@@ -1,9 +1,9 @@
-$NetBSD: distinfo,v 1.176 2021/03/31 08:52:27 reinoud Exp $
+$NetBSD: distinfo,v 1.177 2021/05/23 13:53:10 thorpej Exp $
 
-SHA1 (palcode-clipper) = e25ae10a10e0801e47b62b9ee2d10c8ccb4ee940
-RMD160 (palcode-clipper) = a637f1cc38dabfdff36e3f02b6dd02d7c63cb8db
-SHA512 (palcode-clipper) = 8d6966e59b59bc17c563bae3648af4ac99108990294edd0398ee91d8e61ec8f890608b9326b175d6a3a5668106b67b019a2c51b79f5b2935d4a516d34490056c
-Size (palcode-clipper) = 156704 bytes
+SHA1 (palcode-clipper-qemu-5.2.0nb8) = ddbf1dffb7c2b2157e0bbe9fb7db7e57105130b1
+RMD160 (palcode-clipper-qemu-5.2.0nb8) = 3f9fe19a40f7ca72ecfe047d1449e55b63cba3ee
+SHA512 (palcode-clipper-qemu-5.2.0nb8) = 33695d6001d86a19793a92d5e31775607c4dfc9ab9eea019ea6c4d543a2e11e8c07f83cca4934811a13ef829b528737ea37d9d2aaf66cba6f2746d44d2aa0b43
+Size (palcode-clipper-qemu-5.2.0nb8) = 159808 bytes
 SHA1 (qemu-5.2.0.tar.xz) = 146578267387e301423502d19024f8ffe35ab332
 RMD160 (qemu-5.2.0.tar.xz) = 2c33e773f012e333f99237e3d4ff1653ea0bc88f
 SHA512 (qemu-5.2.0.tar.xz) = bddd633ce111471ebc651e03080251515178808556b49a308a724909e55dac0be0cc0c79c536ac12d239678ae94c60100dc124be9b9d9538340c03a2f27177f3
@@ -37,7 +37,7 @@
 SHA1 (patch-roms_qemu-palcode_init.c) = 7a0ebcd86f4106318791e7d90273fb55a424f1b8
 SHA1 (patch-roms_qemu-palcode_memcpy.c) = 7761774ae9092d0f494deaf302d663ba479a09cf
 SHA1 (patch-roms_qemu-palcode_memset.c) = 55fa4e52e03a351eb98475e7c4755e5edc409e6c
-SHA1 (patch-roms_qemu-palcode_pal.S) = 4f41194ffaeaddb39fa7bff953bd75c2f070dfa5
+SHA1 (patch-roms_qemu-palcode_pal.S) = fd13cf4ff7a4ba48a9cbb773d520eacf06615301
 SHA1 (patch-roms_qemu-palcode_pci.c) = 1d5b240fd6c940cbbe8518e4db529adba23d6fec
 SHA1 (patch-roms_qemu-palcode_pci.h) = 081c9d6d9955be24fd19455ae653339cdb133f02
 SHA1 (patch-roms_qemu-palcode_printf.c) = 7fb158f85bd1be9a939850d9d86175013f7a142b
diff -r cd4322c6ba53 -r e20fa898e621 emulators/qemu/patches/patch-roms_qemu-palcode_pal.S
--- a/emulators/qemu/patches/patch-roms_qemu-palcode_pal.S      Sun May 23 13:48:20 2021 +0000
+++ b/emulators/qemu/patches/patch-roms_qemu-palcode_pal.S      Sun May 23 13:53:10 2021 +0000
@@ -1,4 +1,7 @@
-$NetBSD: patch-roms_qemu-palcode_pal.S,v 1.1 2020/10/04 20:39:25 thorpej Exp $
+$NetBSD: patch-roms_qemu-palcode_pal.S,v 1.2 2021/05/23 13:53:10 thorpej Exp $
+
+In the unaligned access exception vector, fix an apparent typo that
+prevented the return PC from being stored in the trap frame.
 
 In SWPPAL, allow an additional, non-architected argument for the
 switch to OSF/1 PALcode.  This extra argument specifies the desired
@@ -11,8 +14,17 @@
 its own purposes; this change merely gives control of this behavior
 to internal SWPPAL callers.
 
---- roms/qemu-palcode/pal.S.orig       2020-10-04 16:32:44.901663159 +0000
-+++ roms/qemu-palcode/pal.S    2020-10-04 16:31:30.356343608 +0000
+--- roms/qemu-palcode/pal.S.orig       2020-12-08 17:00:57.000000000 +0000
++++ roms/qemu-palcode/pal.S    2021-05-23 06:23:53.826566568 +0000
+@@ -278,7 +278,7 @@ Pal_Unalign:
+       blbs    p6, MchkBugCheck
+       addq    p6, 4, p6               // increment past the faulting insn
+ 
+-      STACK_FRAME p0, p1, p2, 1
++      STACK_FRAME p0, p6, p2, 1
+ 
+       mfpr    p0, ptEntUna
+       mfpr    $gp, ptKgp
 @@ -566,6 +566,8 @@ ENDFN      CallPal_Cserve_Cont
   *    r17 (a1) = New PC
   *    r18 (a2) = New PCB



Home | Main Index | Thread Index | Old Index