On Sun, Jun 23, 2024 at 06:57:35AM -0400, Brad Smith wrote: > On Sat, Jun 22, 2024 at 05:23:40AM -0400, Brad Smith wrote: > > On Sun, Jun 16, 2024 at 07:38:59AM -0400, Brad Smith wrote: > > > Here is an update to QEMU 9.0.1. > > > > > > > > > https://marc.info/?l=qemu-devel&m=171808086221928&w=2 > > > > > > An updated diff rolling in a diff that should fix building on > > powerpc/powerpc64 with an issue that popped up with 8.1 and > > a hack to resolve an issue naddy@ ran into where the tests > > will pull in gtk-vnc if it happens to exis, but then dpb > > garbage collected it. > > third rev, > I sent out the wrong diff and the meson buts weren't what I intended. I'm > going to look at that separately. > > I also added cpuinfo bits for arm64.
and a fourth rev now that everything has been pushed upstream. Index: Makefile =================================================================== RCS file: /cvs/ports/emulators/qemu/Makefile,v retrieving revision 1.240 diff -u -p -u -p -r1.240 Makefile --- Makefile 28 May 2024 13:57:37 -0000 1.240 +++ Makefile 7 Jul 2024 04:53:10 -0000 @@ -6,7 +6,7 @@ USE_NOBTCFI= Yes COMMENT-main= multi system emulator COMMENT-ga= QEMU guest agent -VERSION= 9.0.0 +VERSION= 9.0.1 DISTNAME= qemu-${VERSION} CATEGORIES= emulators SITES= https://download.qemu.org/ Index: distinfo =================================================================== RCS file: /cvs/ports/emulators/qemu/distinfo,v retrieving revision 1.73 diff -u -p -u -p -r1.73 distinfo --- distinfo 28 May 2024 13:57:37 -0000 1.73 +++ distinfo 7 Jul 2024 04:53:10 -0000 @@ -1,2 +1,2 @@ -SHA256 (qemu-9.0.0.tar.xz) = MnCKxmww2MiSYz6paMdxwcdtWX1w3erSGg0izPOG2mk= -SIZE (qemu-9.0.0.tar.xz) = 129789856 +SHA256 (qemu-9.0.1.tar.xz) = 0PTbD70VHAzxb4SusqUA9ulQCXMlRvRNr6uNIEm7uAU= +SIZE (qemu-9.0.1.tar.xz) = 132368412 Index: patches/patch-tcg_riscv_tcg-target_c_inc =================================================================== RCS file: /cvs/ports/emulators/qemu/patches/patch-tcg_riscv_tcg-target_c_inc,v retrieving revision 1.2 diff -u -p -u -p -r1.2 patch-tcg_riscv_tcg-target_c_inc --- patches/patch-tcg_riscv_tcg-target_c_inc 28 May 2024 13:57:37 -0000 1.2 +++ patches/patch-tcg_riscv_tcg-target_c_inc 7 Jul 2024 04:53:10 -0000 @@ -1,12 +1,21 @@ +util/cpuinfo-riscv: Support OpenBSD signal frame +adc028428a6da5ea8d6a688085966a33be4c97c7 + Index: tcg/riscv/tcg-target.c.inc --- tcg/riscv/tcg-target.c.inc.orig +++ tcg/riscv/tcg-target.c.inc -@@ -2116,7 +2116,7 @@ static void sigill_handler(int signo, siginfo_t *si, v +@@ -2116,7 +2116,14 @@ static void sigill_handler(int signo, siginfo_t *si, v { /* Skip the faulty instruction */ ucontext_t *uc = (ucontext_t *)data; -- uc->uc_mcontext.__gregs[REG_PC] += 4; ++ ++#ifdef __linux__ + uc->uc_mcontext.__gregs[REG_PC] += 4; ++#elif defined(__OpenBSD__) + uc->sc_sepc += 4; ++#else ++# error Unsupported OS ++#endif got_sigill = 1; } Index: patches/patch-util_cpuinfo-aarch64_c =================================================================== RCS file: patches/patch-util_cpuinfo-aarch64_c diff -N patches/patch-util_cpuinfo-aarch64_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-util_cpuinfo-aarch64_c 7 Jul 2024 04:53:10 -0000 @@ -0,0 +1,56 @@ +util/cpuinfo-aarch64: Add OpenBSD support +ab089908b42f22e7edfa0d40db963c136ab35419 + +Index: util/cpuinfo-aarch64.c +--- util/cpuinfo-aarch64.c.orig ++++ util/cpuinfo-aarch64.c +@@ -20,6 +20,12 @@ + #ifdef CONFIG_DARWIN + # include <sys/sysctl.h> + #endif ++#ifdef __OpenBSD__ ++# include <machine/armreg.h> ++# include <machine/cpu.h> ++# include <sys/types.h> ++# include <sys/sysctl.h> ++#endif + + unsigned cpuinfo; + +@@ -71,6 +77,36 @@ unsigned __attribute__((constructor)) cpuinfo_init(voi + info |= sysctl_for_bool("hw.optional.arm.FEAT_AES") * CPUINFO_AES; + info |= sysctl_for_bool("hw.optional.arm.FEAT_PMULL") * CPUINFO_PMULL; + info |= sysctl_for_bool("hw.optional.arm.FEAT_BTI") * CPUINFO_BTI; ++#endif ++#ifdef __OpenBSD__ ++ int mib[2]; ++ uint64_t isar0; ++ uint64_t pfr1; ++ size_t len; ++ ++ mib[0] = CTL_MACHDEP; ++ mib[1] = CPU_ID_AA64ISAR0; ++ len = sizeof(isar0); ++ if (sysctl(mib, 2, &isar0, &len, NULL, 0) != -1) { ++ if (ID_AA64ISAR0_ATOMIC(isar0) >= ID_AA64ISAR0_ATOMIC_IMPL) { ++ info |= CPUINFO_LSE; ++ } ++ if (ID_AA64ISAR0_AES(isar0) >= ID_AA64ISAR0_AES_BASE) { ++ info |= CPUINFO_AES; ++ } ++ if (ID_AA64ISAR0_AES(isar0) >= ID_AA64ISAR0_AES_PMULL) { ++ info |= CPUINFO_PMULL; ++ } ++ } ++ ++ mib[0] = CTL_MACHDEP; ++ mib[1] = CPU_ID_AA64PFR1; ++ len = sizeof(pfr1); ++ if (sysctl(mib, 2, &pfr1, &len, NULL, 0) != -1) { ++ if (ID_AA64PFR1_BT(pfr1) >= ID_AA64PFR1_BT_IMPL) { ++ info |= CPUINFO_BTI; ++ } ++ } + #endif + + cpuinfo = info; Index: patches/patch-util_cpuinfo-ppc_c =================================================================== RCS file: patches/patch-util_cpuinfo-ppc_c diff -N patches/patch-util_cpuinfo-ppc_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-util_cpuinfo-ppc_c 7 Jul 2024 04:53:10 -0000 @@ -0,0 +1,54 @@ +util/cpuinfo-ppc: Fix building on OpenBSD +272d3decc19aebe87955f4ec6d0c6cc8790471f1 + +Index: util/cpuinfo-ppc.c +--- util/cpuinfo-ppc.c.orig ++++ util/cpuinfo-ppc.c +@@ -6,11 +6,13 @@ + #include "qemu/osdep.h" + #include "host/cpuinfo.h" + +-#include <asm/cputable.h> +-#ifdef CONFIG_GETAUXVAL +-# include <sys/auxv.h> +-#else +-# include "elf.h" ++#ifdef CONFIG_LINUX ++# include <asm/cputable.h> ++# ifdef CONFIG_GETAUXVAL ++# include <sys/auxv.h> ++# else ++# include "elf.h" ++# endif + #endif + + unsigned cpuinfo; +@@ -19,16 +21,17 @@ unsigned cpuinfo; + unsigned __attribute__((constructor)) cpuinfo_init(void) + { + unsigned info = cpuinfo; +- unsigned long hwcap, hwcap2; + + if (info) { + return info; + } + +- hwcap = qemu_getauxval(AT_HWCAP); +- hwcap2 = qemu_getauxval(AT_HWCAP2); + info = CPUINFO_ALWAYS; + ++#ifdef CONFIG_LINUX ++ unsigned long hwcap = qemu_getauxval(AT_HWCAP); ++ unsigned long hwcap2 = qemu_getauxval(AT_HWCAP2); ++ + /* Version numbers are monotonic, and so imply all lower versions. */ + if (hwcap2 & PPC_FEATURE2_ARCH_3_1) { + info |= CPUINFO_V3_1 | CPUINFO_V3_0 | CPUINFO_V2_07 | CPUINFO_V2_06; +@@ -58,6 +61,7 @@ unsigned __attribute__((constructor)) cpuinfo_init(voi + } + } + } ++#endif + + cpuinfo = info; + return info;