From: Helge Deller <deller@kernel.org>
To: qemu-devel@nongnu.org
Cc: Keith Monahan <keith@techtravels.org>,
Helge Deller <deller@gmx.de>,
Richard Henderson <richard.henderson@linaro.org>
Subject: [PULL 3/4] Revert "target/hppa: Move emulated power button into CPU I/O region"
Date: Thu, 19 Nov 2026 23:47:43 +0100 [thread overview]
Message-ID: <20261119224744.31309-4-deller@kernel.org> (raw)
In-Reply-To: <20261119224744.31309-1-deller@kernel.org>
From: Keith Monahan <keith@techtravels.org>
This reverts commit a524a188c0c01cc39d4af518ee7a39addcdc1091.
NetBSD 9.4, 10.1, 10.2 and 11.1 panic at boot on -M 715: power0 cannot
map the power switch register inside the CPU I/O page, and its polling
thread then reads through a NULL mapping. HP-UX 9.05 is handled by a
BTLB entry for the power button page instead.
Signed-off-by: Keith Monahan <keith@techtravels.org>
Signed-off-by: Helge Deller <deller@gmx.de>
---
hw/hppa/machine.c | 13 ++++---------
target/hppa/cpu.h | 2 --
2 files changed, 4 insertions(+), 11 deletions(-)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 8a3f673daf..f23936fc5b 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -50,6 +50,7 @@ struct HppaMachineState {
#define MIN_SEABIOS_HPPA_VERSION 26 /* require at least this fw version */
+#define HPA_POWER_BUTTON (FIRMWARE_END - 0x10)
static hwaddr soft_power_reg;
static void hppa_powerdown_req(Notifier *n, void *opaque)
@@ -122,7 +123,6 @@ static time_t rtc_ref;
static uint64_t io_cpu_read(void *opaque, hwaddr addr, unsigned size)
{
- HPPACPU *cpu = opaque;
uint64_t val = 0;
switch (addr) {
@@ -132,8 +132,6 @@ static uint64_t io_cpu_read(void *opaque, hwaddr addr, unsigned size)
break;
case 8: /* DebugOutputPort */
return 0xe9; /* readback */
- case 16: /* Power switch button */
- return cpu->env.power_btn;
}
return val;
}
@@ -141,7 +139,6 @@ static uint64_t io_cpu_read(void *opaque, hwaddr addr, unsigned size)
static void io_cpu_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
- HPPACPU *cpu = opaque;
unsigned char ch;
Chardev *debugout;
@@ -158,9 +155,6 @@ static void io_cpu_write(void *opaque, hwaddr addr,
fprintf(stderr, "%c", ch);
}
break;
- case 16:
- cpu->env.power_btn = val;
- break;
}
}
@@ -318,6 +312,8 @@ static TranslateFn *machine_HP_common_init_cpus(MachineState *machine,
ram_max = FIRMWARE_START; /* 3.75 GB (32-bit CPU) */
}
+ soft_power_reg = translate(NULL, HPA_POWER_BUTTON);
+
for (unsigned int i = 0; i < smp_cpus; i++) {
g_autofree char *name = g_strdup_printf("cpu%u-io-eir", i);
g_autofree char *cflush_name = NULL;
@@ -352,11 +348,10 @@ static TranslateFn *machine_HP_common_init_cpus(MachineState *machine,
/* RTC and DebugOutputPort on CPU #0 */
cpu_region = g_new(MemoryRegion, 1);
memory_region_init_io(cpu_region, OBJECT(cpu[0]), &hppa_io_helper_ops,
- cpu[0], "cpu0-io-rtc", 3 * sizeof(uint64_t));
+ cpu[0], "cpu0-io-rtc", 2 * sizeof(uint64_t));
memory_region_add_subregion(addr_space,
translate(NULL, cpu[0]->env.cpu_hpa + 16),
cpu_region);
- soft_power_reg = translate(NULL, cpu[0]->env.cpu_hpa + 16 + 16);
/* Main memory region. */
if (machine->ram_size > ram_max) {
diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h
index 22f8a1727d..7b708a564b 100644
--- a/target/hppa/cpu.h
+++ b/target/hppa/cpu.h
@@ -269,8 +269,6 @@ typedef struct CPUArchState {
HPPATLBEntry tlb[HPPA_TLB_ENTRIES];
- target_ulong power_btn; /* virtual power button (0 = reboot) */
-
/* Fields up to this point are cleared by a CPU reset */
struct {} end_reset_fields;
--
2.54.0
next prev parent reply other threads:[~2026-11-19 22:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 22:47 [PULL 0/4] Hp715 fixes patches Helge Deller
2026-11-19 22:47 ` [PULL 1/4] target/hppa: clear EIRR under the BQL and keep the interval timer matching Helge Deller
2026-11-19 22:47 ` [PULL 2/4] target/hppa: re-arm the interval timer after loadvm Helge Deller
2026-11-19 22:47 ` Helge Deller [this message]
2026-11-19 22:47 ` [PULL 4/4] hw/hppa: preload a BTLB entry for the soft power button page Helge Deller
2026-11-20 19:43 ` [PULL 0/4] Hp715 fixes patches Richard Henderson
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=20261119224744.31309-4-deller@kernel.org \
--to=deller@kernel.org \
--cc=deller@gmx.de \
--cc=keith@techtravels.org \
--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.