All of lore.kernel.org
 help / color / mirror / Atom feed
From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: Helge Deller <deller@gmx.de>,
	Richard Henderson <richard.henderson@linaro.org>,
	Anton Johansson <anjo@rev.ng>
Subject: [PATCH 5/6] hw/hppa: Fix crash of 64-bit HP-UX 11 while flushing caches
Date: Tue, 17 Mar 2026 20:51:48 +0100	[thread overview]
Message-ID: <20260317195149.8386-6-deller@kernel.org> (raw)
In-Reply-To: <20260317195149.8386-1-deller@kernel.org>

From: Helge Deller <deller@gmx.de>

HP-UX 11 64-bit reads at bootup a word from address CPU_HPA + 0x500
while flushing the the cache of a T600.
Add a memory handler to avoid crashing while reading this word.

Signed-off-by: Helge Deller <deller@gmx.de>
---
 hw/hppa/machine.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index e72dda2a68..7e8ebbca3b 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -313,6 +313,22 @@ static TranslateFn *machine_HP_common_init_cpus(MachineState *machine)
         memory_region_add_subregion(addr_space,
                                     translate(NULL, CPU_HPA + i * 0x1000),
                                     cpu_region);
+
+        if (!hppa_is_pa20(&cpu[0]->env))
+            continue;
+
+        /* HP-UX 11 64-bit reads a word from address CPU_HPA + 0x500
+         * while flushing the the cache of a T600, which was the first
+         * server with a 64-bit PA-RISC 2.0 CPU.
+         * We return 0, since the value isn't used anyway. */
+        g_autofree char *cflush_name;
+        cflush_name = g_strdup_printf("cpu%u-T600-cacheflush", i);
+        MemoryRegion *cflush = g_new(MemoryRegion, 1);
+        memory_region_init_io(cflush, NULL, &hppa_pci_ignore_ops,
+                              NULL, cflush_name, 4);
+        memory_region_add_subregion(addr_space,
+                              translate(NULL, CPU_HPA + i * 0x1000 + 0x500),
+                              cflush);
     }
 
     /* RTC and DebugOutputPort on CPU #0 */
-- 
2.53.0



  parent reply	other threads:[~2026-03-17 19:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-17 19:51 [PATCH 0/6] HPPA fixes for v11 Helge Deller
2026-03-17 19:51 ` [PATCH 1/6] hw/hppa: Fix description of the HP A400-44 server Helge Deller
2026-03-18 17:22   ` Anton Johansson via qemu development
2026-03-17 19:51 ` [PATCH 2/6] hw/hppa: Adjust physical addresses of Astro and Elroy Helge Deller
2026-03-18 17:26   ` Anton Johansson via qemu development
2026-03-17 19:51 ` [PATCH 3/6] target/hppa: Always map 64-bit firmware at 0xfffffff0f0000000 Helge Deller
2026-03-18 17:29   ` Anton Johansson via qemu development
2026-03-17 19:51 ` [PATCH 4/6] hw/pci-host/astro: Use proper region names Helge Deller
2026-03-18  6:47   ` Philippe Mathieu-Daudé
2026-03-17 19:51 ` Helge Deller [this message]
2026-03-18 21:15   ` [PATCH 5/6] hw/hppa: Fix crash of 64-bit HP-UX 11 while flushing caches Anton Johansson via qemu development
     [not found] ` <20260317195149.8386-7-deller@kernel.org>
2026-03-18 21:16   ` [PATCH 6/6] target/hppa: Update SeaBIOS-hppa to version 23 Anton Johansson via qemu development

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=20260317195149.8386-6-deller@kernel.org \
    --to=deller@kernel.org \
    --cc=anjo@rev.ng \
    --cc=deller@gmx.de \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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.