pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/emulators/qemu
Module Name: pkgsrc
Committed By: thorpej
Date: Sun May 10 04:12:38 UTC 2026
Modified Files:
pkgsrc/emulators/qemu: Makefile distinfo
Added Files:
pkgsrc/emulators/qemu/patches: patch-target_m68k_helper.c
Log Message:
Ensure that m68k TLB fills for read accesses do not include write
permission if the MODIFIED bit is not set in the PTE. Without this,
a page that is referenced before being modified may end up not being
marked as MODIFIED, which can lead to all sorts of problems if the
operating system decides it needs to start swapping due to memory
pressure.
Previously, Qemu's behavior did not match a real 68040 in this regard.
Now it does.
To generate a diff of this commit:
cvs rdiff -u -r1.401 -r1.402 pkgsrc/emulators/qemu/Makefile
cvs rdiff -u -r1.248 -r1.249 pkgsrc/emulators/qemu/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/emulators/qemu/patches/patch-target_m68k_helper.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/emulators/qemu/Makefile
diff -u pkgsrc/emulators/qemu/Makefile:1.401 pkgsrc/emulators/qemu/Makefile:1.402
--- pkgsrc/emulators/qemu/Makefile:1.401 Mon Apr 27 10:25:01 2026
+++ pkgsrc/emulators/qemu/Makefile Sun May 10 04:12:37 2026
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.401 2026/04/27 10:25:01 adam Exp $
+# $NetBSD: Makefile,v 1.402 2026/05/10 04:12:37 thorpej Exp $
.include "../../emulators/qemu/version.mk"
DISTNAME= qemu-${QEMU_VERSION}
+PKGREVISION= 1
CATEGORIES= emulators
MASTER_SITES= https://download.qemu.org/
EXTRACT_SUFX= .tar.xz
Index: pkgsrc/emulators/qemu/distinfo
diff -u pkgsrc/emulators/qemu/distinfo:1.248 pkgsrc/emulators/qemu/distinfo:1.249
--- pkgsrc/emulators/qemu/distinfo:1.248 Mon Apr 27 10:25:01 2026
+++ pkgsrc/emulators/qemu/distinfo Sun May 10 04:12:37 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.248 2026/04/27 10:25:01 adam Exp $
+$NetBSD: distinfo,v 1.249 2026/05/10 04:12:37 thorpej Exp $
BLAKE2s (palcode-clipper-qemu-5.2.0nb8) = d388c896a80c1cc3d4785c8434d6688bbcfd54c28f7252ce550ab162a0bba321
SHA512 (palcode-clipper-qemu-5.2.0nb8) = 33695d6001d86a19793a92d5e31775607c4dfc9ab9eea019ea6c4d543a2e11e8c07f83cca4934811a13ef829b528737ea37d9d2aaf66cba6f2746d44d2aa0b43
@@ -26,5 +26,6 @@ SHA1 (patch-roms_u-boot-sam460ex_Makefil
SHA1 (patch-target_arm_tcg_translate-sve.c) = 2d2feefe45b83191cccfea7e08fd7eb2756515a5
SHA1 (patch-target_i386_cpu.c) = 46a37ffc8ece4db52e8239b32dde37403ad568bb
SHA1 (patch-target_i386_nvmm_nvmm-all.c) = 405a3b7ee1c719704bd9517c9dea53f47380c1ab
+SHA1 (patch-target_m68k_helper.c) = b86e210a244a45d68ef8e42a4dcf58b197de6e9b
SHA1 (patch-util_coroutine-ucontext.c) = 02cdf634e64f7e71029047b93747f192df715e6a
SHA1 (patch-util_osdep.c) = 94144b7fc3c472ae7b21c3daa4fae62da3288c7d
Added files:
Index: pkgsrc/emulators/qemu/patches/patch-target_m68k_helper.c
diff -u /dev/null pkgsrc/emulators/qemu/patches/patch-target_m68k_helper.c:1.1
--- /dev/null Sun May 10 04:12:38 2026
+++ pkgsrc/emulators/qemu/patches/patch-target_m68k_helper.c Sun May 10 04:12:37 2026
@@ -0,0 +1,60 @@
+$NetBSD: patch-target_m68k_helper.c,v 1.1 2026/05/10 04:12:37 thorpej Exp $
+
+Ensure that m68k TLB fills for read accesses do not include write
+permission if the MODIFIED bit is not set in the PTE. Without this,
+a page that is referenced before being modified may end up not being
+marked as MODIFIED, which can lead to all sorts of problems if the
+operating system decides it needs to start swapping due to memory
+pressure.
+
+--- target/m68k/helper.c.orig 2026-05-09 22:41:53.289781118 +0000
++++ target/m68k/helper.c 2026-05-10 00:02:06.795840537 +0000
+@@ -755,7 +755,7 @@ static int get_physical_address(CPUM68KS
+ }
+
+ /* Page Table Root Pointer */
+- *prot = PAGE_READ | PAGE_WRITE;
++ *prot = PAGE_READ;
+ if (access_type & ACCESS_CODE) {
+ *prot |= PAGE_EXEC;
+ }
+@@ -786,7 +786,6 @@ static int get_physical_address(CPUM68KS
+ if (access_type & ACCESS_PTEST) {
+ env->mmu.mmusr |= M68K_MMU_WP_040;
+ }
+- *prot &= ~PAGE_WRITE;
+ if (access_type & ACCESS_STORE) {
+ return -1;
+ }
+@@ -813,7 +812,6 @@ static int get_physical_address(CPUM68KS
+ if (access_type & ACCESS_PTEST) {
+ env->mmu.mmusr |= M68K_MMU_WP_040;
+ }
+- *prot &= ~PAGE_WRITE;
+ if (access_type & ACCESS_STORE) {
+ return -1;
+ }
+@@ -884,16 +882,18 @@ static int get_physical_address(CPUM68KS
+ env->mmu.mmusr |= M68K_MMU_R_040;
+ }
+
+- if (next & M68K_DESC_WRITEPROT) {
+- *prot &= ~PAGE_WRITE;
+- if (access_type & ACCESS_STORE) {
++ if (next & M68K_DESC_SUPERONLY) {
++ if ((access_type & ACCESS_SUPER) == 0) {
+ return -1;
+ }
+ }
+- if (next & M68K_DESC_SUPERONLY) {
+- if ((access_type & ACCESS_SUPER) == 0) {
++
++ if (next & M68K_DESC_WRITEPROT) {
++ if (access_type & ACCESS_STORE) {
+ return -1;
+ }
++ } else if (next & M68K_DESC_MODIFIED) {
++ *prot |= PAGE_WRITE;
+ }
+
+ return 0;
Home |
Main Index |
Thread Index |
Old Index