All of lore.kernel.org
 help / color / mirror / Atom feed
From: 54weasels <54weasels@gmail.com>
To: qemu-devel@nongnu.org
Cc: laurent@vivier.eu, 54weasels <54weasels@gmail.com>
Subject: [PATCH v4 1/6] target/m68k: Add dummy CAAR register
Date: Mon, 17 Aug 2026 19:22:17 -0700	[thread overview]
Message-ID: <20260818022225.31801-2-54weasels@gmail.com> (raw)
In-Reply-To: <20260818022225.31801-1-54weasels@gmail.com>

High level description:
The Sun-3 ROM expects the Cache Control Register (CAAR) to exist on the 68020. Reading/writing this register currently aborts QEMU. This patch provides a dummy implementation that simply ignores writes and returns 0 on reads, allowing the ROM to continue booting.

Impact on existing functionality:
No impact on existing targets. ColdFire and Mac targets do not access CAAR in a way that currently aborts, and providing a safe dummy implementation ensures robustness across M68k boards.

Context: This patch was originally submitted as part of the monolithic Sun-3 Machine Emulation series (https://patchew.org/QEMU/20260503015756.99176-1-54weasels@gmail.com/) and has been split into atomic components.
---
 target/m68k/helper.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/target/m68k/helper.c b/target/m68k/helper.c
index 5f91d206f5..68f523ea84 100644
--- a/target/m68k/helper.c
+++ b/target/m68k/helper.c
@@ -281,8 +281,10 @@ void HELPER(m68k_movec_to)(CPUM68KState *env, uint32_t reg, uint32_t val)
             return;
         }
         break;
-    /* Unimplemented Registers */
+    /* Dummy implementation for CAAR */
     case M68K_CR_CAAR:
+        return;
+    /* Unimplemented Registers */
     case M68K_CR_PCR:
     case M68K_CR_BUSCR:
         cpu_abort(env_cpu(env),
@@ -385,8 +387,10 @@ uint32_t HELPER(m68k_movec_from)(CPUM68KState *env, uint32_t reg)
             return env->mmu.ttr[M68K_DTTR1];
         }
         break;
-    /* Unimplemented Registers */
+    /* Dummy implementation for CAAR */
     case M68K_CR_CAAR:
+        return 0;
+    /* Unimplemented Registers */
     case M68K_CR_PCR:
     case M68K_CR_BUSCR:
         cpu_abort(env_cpu(env), "Unimplemented control register read 0x%x\n",
-- 
2.50.1 (Apple Git-155)



  reply	other threads:[~2026-08-18  2:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  2:22 [PATCH v4 0/6] Implement missing functionality and hooks in mk68k to support upcoming sun3 impl 54weasels
2026-08-18  2:22 ` 54weasels [this message]
2026-08-18  2:22 ` [PATCH v4 2/6] target/m68k: Fix fsave/frestore for 68881 FPU 54weasels
2026-08-18 10:52   ` BALATON Zoltan
2026-08-20  4:37     ` Purr Box
2026-08-20  9:55       ` BALATON Zoltan
2026-08-18  2:22 ` [PATCH v4 3/6] target/m68k: Fix NMI pending for Level 7 interrupts 54weasels
2026-08-18 10:56   ` BALATON Zoltan
2026-08-20  7:37     ` Purr Box
2026-08-18  2:22 ` [PATCH v4 4/6] target/m68k: Extract Function Codes during TLB fills 54weasels
2026-08-18  2:22 ` [PATCH v4 5/6] target/m68k: Implement custom MMU intercept hook 54weasels
2026-08-18  2:22 ` [PATCH v4 6/6] target/m68k: Implement Physical Bus Error and Stack 54weasels

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260818022225.31801-2-54weasels@gmail.com \
    --to=54weasels@gmail.com \
    --cc=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.