From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: Richard Henderson <richard.henderson@linaro.org>,
Keith Monahan <keith@techtravels.org>,
"Kirill A . Korinsky" <kirill@korins.ky>,
Helge Deller <deller@gmx.de>
Subject: [PATCH 4/8] target/hppa: Implement local broadcast I/O space
Date: Tue, 27 Oct 2026 22:52:05 +0100 [thread overview]
Message-ID: <20261027215209.21150-5-deller@kernel.org> (raw)
In-Reply-To: <20261027215209.21150-1-deller@kernel.org>
From: Keith Monahan <keith@techtravels.org>
The local broadcast I/O space is used by older operating systems like HP-UX 9.05
to send an interrupt to all CPUs, or to issue a system reset.
Wire it up on the emulated 715 machine to allow HP-UX 9.05 to run.
Signed-off-by: Keith Monahan <keith@techtravels.org>
Signed-off-by: Helge Deller <deller@gmx.de>
---
hw/hppa/machine.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 96d57b9b0f..8d378385b2 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -573,6 +573,47 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
cpu[0]->env.kernel_entry = kernel_entry;
}
+/*
+ * Local broadcast I/O space: a write to IO_EIR (offset 0) posts an external
+ * interrupt on all processors, CMD_RESET (5) written to IO_COMMAND (0x30)
+ * resets the system. HP-UX 9 reboots through the latter.
+ */
+#define HPPA_BROADCAST_HPA 0xfffc0000
+#define HPPA_IO_COMMAND 0x30
+#define HPPA_CMD_RESET 5
+
+static uint64_t hppa_broadcast_read(void *opaque, hwaddr addr, unsigned size)
+{
+ return 0;
+}
+
+static void hppa_broadcast_write(void *opaque, hwaddr addr, uint64_t val,
+ unsigned size)
+{
+ unsigned int i;
+
+ switch (addr) {
+ case 0:
+ for (i = 0; i < current_machine->smp.cpus; i++) {
+ hppa_io_eir_ops.write(cpu[i], 0, val, 4);
+ }
+ break;
+ case HPPA_IO_COMMAND:
+ if (val == HPPA_CMD_RESET) {
+ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET);
+ }
+ break;
+ }
+}
+
+static const MemoryRegionOps hppa_broadcast_ops = {
+ .read = hppa_broadcast_read,
+ .write = hppa_broadcast_write,
+ .endianness = DEVICE_BIG_ENDIAN,
+ .valid.min_access_size = 4,
+ .valid.max_access_size = 4,
+};
+
/*
* Create HP 715/64 workstation
*/
@@ -597,6 +638,14 @@ static void machine_HP_715_init(MachineState *machine)
isa_bus = hppa_isa_bus(translate(NULL, IDE_HPA));
assert(isa_bus);
+ /* Local broadcast I/O space */
+ MemoryRegion *dev_mr_bcast = g_new(MemoryRegion, 1);
+ memory_region_init_io(dev_mr_bcast, NULL, &hppa_broadcast_ops, NULL,
+ "local-broadcast", 0x1000);
+ memory_region_add_subregion(addr_space,
+ translate(NULL, HPPA_BROADCAST_HPA),
+ dev_mr_bcast);
+
/* Init Lasi chip */
lasi_dev = DEVICE(lasi_init());
hpm->lasi_dev = lasi_dev;
--
2.54.0
next prev parent reply other threads:[~2026-10-27 21:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 21:52 [PATCH 0/8] HPPA architecture patches for HP-UX 9 and 715 machine Helge Deller
2026-10-27 21:52 ` [PATCH 1/8] target/hppa: restore lazy FPU context isolation Helge Deller
2026-10-27 21:52 ` [PATCH 2/8] target/hppa: Use 15 bit protection IDs on PA1.1 CPUs Helge Deller
2026-10-27 21:52 ` [PATCH 3/8] target/hppa: Only allow 8 BTLB entries for HP-UX 9.05 Helge Deller
2026-10-27 21:52 ` Helge Deller [this message]
2026-10-27 21:52 ` [PATCH 5/8] target/hppa: Preload I/O-space BTLB entries for LASI and the central bus Helge Deller
2026-10-27 21:52 ` [PATCH 6/8] artist: Redraw screen on colormap changes Helge Deller
2026-10-27 21:52 ` [PATCH 7/8] hw/misc/lasi: LASI Harmony Audio presence emulation Helge Deller
2026-10-27 21:52 ` [PATCH 8/8] target/hppa: Map CPUs at same addresses as on physical machines Helge Deller
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=20261027215209.21150-5-deller@kernel.org \
--to=deller@kernel.org \
--cc=deller@gmx.de \
--cc=keith@techtravels.org \
--cc=kirill@korins.ky \
--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.