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:           Sat Jun 13 17:29:01 UTC 2026

Modified Files:
        pkgsrc/emulators/qemu: Makefile distinfo
        pkgsrc/emulators/qemu/patches: patch-target_m68k_helper.c

Log Message:
Update the 68040 MMU mod/ref emulation fix to more accurately reflect
the hardware's behavior, from Laurent Vivier (who will incorporate this
change into the Qemu mainline).

Bump PKGREVISION to 2.


To generate a diff of this commit:
cvs rdiff -u -r1.406 -r1.407 pkgsrc/emulators/qemu/Makefile
cvs rdiff -u -r1.251 -r1.252 pkgsrc/emulators/qemu/distinfo
cvs rdiff -u -r1.1 -r1.2 \
    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.406 pkgsrc/emulators/qemu/Makefile:1.407
--- pkgsrc/emulators/qemu/Makefile:1.406        Thu Jun 11 07:16:57 2026
+++ pkgsrc/emulators/qemu/Makefile      Sat Jun 13 17:29:01 2026
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.406 2026/06/11 07:16:57 wiz Exp $
+# $NetBSD: Makefile,v 1.407 2026/06/13 17:29:01 thorpej Exp $
 
-PKGREVISION= 1
+PKGREVISION= 2
 .include "../../emulators/qemu/version.mk"
 
 DISTNAME=      qemu-${QEMU_VERSION}

Index: pkgsrc/emulators/qemu/distinfo
diff -u pkgsrc/emulators/qemu/distinfo:1.251 pkgsrc/emulators/qemu/distinfo:1.252
--- pkgsrc/emulators/qemu/distinfo:1.251        Thu May 28 05:05:51 2026
+++ pkgsrc/emulators/qemu/distinfo      Sat Jun 13 17:29:01 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.251 2026/05/28 05:05:51 adam Exp $
+$NetBSD: distinfo,v 1.252 2026/06/13 17:29:01 thorpej Exp $
 
 BLAKE2s (palcode-clipper-qemu-5.2.0nb8) = d388c896a80c1cc3d4785c8434d6688bbcfd54c28f7252ce550ab162a0bba321
 SHA512 (palcode-clipper-qemu-5.2.0nb8) = 33695d6001d86a19793a92d5e31775607c4dfc9ab9eea019ea6c4d543a2e11e8c07f83cca4934811a13ef829b528737ea37d9d2aaf66cba6f2746d44d2aa0b43
@@ -26,6 +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) = 129d4c350521382813eb667a2341120c5722251b
+SHA1 (patch-target_m68k_helper.c) = eb559e93dfaacf1ce546e89d31243c3933636b16
 SHA1 (patch-util_coroutine-ucontext.c) = 02cdf634e64f7e71029047b93747f192df715e6a
 SHA1 (patch-util_osdep.c) = 94144b7fc3c472ae7b21c3daa4fae62da3288c7d

Index: pkgsrc/emulators/qemu/patches/patch-target_m68k_helper.c
diff -u pkgsrc/emulators/qemu/patches/patch-target_m68k_helper.c:1.1 pkgsrc/emulators/qemu/patches/patch-target_m68k_helper.c:1.2
--- pkgsrc/emulators/qemu/patches/patch-target_m68k_helper.c:1.1        Sun May 10 04:12:37 2026
+++ pkgsrc/emulators/qemu/patches/patch-target_m68k_helper.c    Sat Jun 13 17:29:01 2026
@@ -1,4 +1,4 @@
-$NetBSD: patch-target_m68k_helper.c,v 1.1 2026/05/10 04:12:37 thorpej Exp $
+$NetBSD: patch-target_m68k_helper.c,v 1.2 2026/06/13 17:29:01 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,
@@ -7,9 +7,18 @@ marked as MODIFIED, which can lead to al
 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
+--- target/m68k/helper.c.orig  2026-05-27 16:39:40.000000000 +0000
++++ target/m68k/helper.c       2026-06-13 16:51:29.222776471 +0000
+@@ -736,6 +736,8 @@ static int get_physical_address(CPUM68KS
+     uint32_t next;
+     target_ulong page_mask;
+     bool debug = access_type & ACCESS_DEBUG;
++    bool writeprot = false;
++    uint32_t ptest_sr;
+     int page_bits;
+     int i;
+     MemTxResult txres;
+@@ -755,7 +757,7 @@ static int get_physical_address(CPUM68KS
      }
  
      /* Page Table Root Pointer */
@@ -18,43 +27,87 @@ pressure.
      if (access_type & ACCESS_CODE) {
          *prot |= PAGE_EXEC;
      }
-@@ -786,7 +786,6 @@ static int get_physical_address(CPUM68KS
+@@ -786,7 +788,7 @@ static int get_physical_address(CPUM68KS
          if (access_type & ACCESS_PTEST) {
              env->mmu.mmusr |= M68K_MMU_WP_040;
          }
 -        *prot &= ~PAGE_WRITE;
++      writeprot = true;
          if (access_type & ACCESS_STORE) {
              return -1;
          }
-@@ -813,7 +812,6 @@ static int get_physical_address(CPUM68KS
+@@ -813,7 +815,7 @@ static int get_physical_address(CPUM68KS
          if (access_type & ACCESS_PTEST) {
              env->mmu.mmusr |= M68K_MMU_WP_040;
          }
 -        *prot &= ~PAGE_WRITE;
++      writeprot = true;
          if (access_type & ACCESS_STORE) {
              return -1;
          }
-@@ -884,16 +882,18 @@ static int get_physical_address(CPUM68KS
+@@ -841,10 +843,12 @@ static int get_physical_address(CPUM68KS
+             goto txfail;
+         }
+     }
++    ptest_sr = next & M68K_MMU_SR_MASK_040;
+     if (access_type & ACCESS_STORE) {
+         if (next & M68K_DESC_WRITEPROT) {
+             if (!(next & M68K_DESC_USED) && !debug) {
+-                address_space_stl(cs->as, entry, next | M68K_DESC_USED,
++              next |= M68K_DESC_USED;
++              address_space_stl(cs->as, entry, next,
+                                   MEMTXATTRS_UNSPECIFIED, &txres);
+                 if (txres != MEMTX_OK) {
+                     goto txfail;
+@@ -852,8 +856,8 @@ static int get_physical_address(CPUM68KS
+             }
+         } else if ((next & (M68K_DESC_MODIFIED | M68K_DESC_USED)) !=
+                            (M68K_DESC_MODIFIED | M68K_DESC_USED) && !debug) {
+-            address_space_stl(cs->as, entry,
+-                              next | (M68K_DESC_MODIFIED | M68K_DESC_USED),
++          next |= M68K_DESC_MODIFIED | M68K_DESC_USED;
++          address_space_stl(cs->as, entry, next,
+                               MEMTXATTRS_UNSPECIFIED, &txres);
+             if (txres != MEMTX_OK) {
+                 goto txfail;
+@@ -861,7 +865,8 @@ static int get_physical_address(CPUM68KS
+         }
+     } else {
+         if (!(next & M68K_DESC_USED) && !debug) {
+-            address_space_stl(cs->as, entry, next | M68K_DESC_USED,
++          next |= M68K_DESC_USED;
++            address_space_stl(cs->as, entry, next,
+                               MEMTXATTRS_UNSPECIFIED, &txres);
+             if (txres != MEMTX_OK) {
+                 goto txfail;
+@@ -879,23 +884,28 @@ static int get_physical_address(CPUM68KS
+     *physical = (next & page_mask) + (address & (*page_size - 1));
+ 
+     if (access_type & ACCESS_PTEST) {
+-        env->mmu.mmusr |= next & M68K_MMU_SR_MASK_040;
++      env->mmu.mmusr |= ptest_sr;
+         env->mmu.mmusr |= *physical & 0xfffff000;
          env->mmu.mmusr |= M68K_MMU_R_040;
      }
  
--    if (next & M68K_DESC_WRITEPROT) {
+     if (next & M68K_DESC_WRITEPROT) {
 -        *prot &= ~PAGE_WRITE;
--        if (access_type & ACCESS_STORE) {
-+    if (next & M68K_DESC_SUPERONLY) {
-+        if ((access_type & ACCESS_SUPER) == 0) {
++      writeprot = true;
+         if (access_type & ACCESS_STORE) {
              return -1;
          }
      }
--    if (next & M68K_DESC_SUPERONLY) {
--        if ((access_type & ACCESS_SUPER) == 0) {
 +
-+    if (next & M68K_DESC_WRITEPROT) {
-+        if (access_type & ACCESS_STORE) {
+     if (next & M68K_DESC_SUPERONLY) {
+         if ((access_type & ACCESS_SUPER) == 0) {
              return -1;
          }
-+    } else if (next & M68K_DESC_MODIFIED) {
-+        *prot |= PAGE_WRITE;
      }
  
++    if (!writeprot && (next & M68K_DESC_MODIFIED)) {
++        *prot |= PAGE_WRITE;
++    }
++
      return 0;
+ 
+ txfail:



Home | Main Index | Thread Index | Old Index