qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Helge Deller" <deller@gmx.de>, "Anton Johansson" <anjo@rev.ng>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH v2 6/6] hw/hppa: Move CPU::initrd_base/end -> Machine::boot_info.gr22/23
Date: Fri, 10 Oct 2025 08:18:36 +0200	[thread overview]
Message-ID: <20251010061836.45739-7-philmd@linaro.org> (raw)
In-Reply-To: <20251010061836.45739-1-philmd@linaro.org>

These variables don't belong to CPUHPPAState, they depend on how
the machine is started, and only apply to the first CPU.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 target/hppa/cpu.h |  2 --
 hw/hppa/machine.c | 12 ++++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/target/hppa/cpu.h b/target/hppa/cpu.h
index 6c9bcbd9078..49d0243f677 100644
--- a/target/hppa/cpu.h
+++ b/target/hppa/cpu.h
@@ -271,8 +271,6 @@ typedef struct CPUArchState {
     struct {} end_reset_fields;
 
     bool is_pa20;
-
-    target_ulong initrd_base, initrd_end;
 } CPUHPPAState;
 
 /**
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index b6f15bc61a3..61e83daaadb 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -43,6 +43,8 @@ struct HppaMachineState {
     MachineState parent_obj;
 
     struct {
+        uint64_t gr22;
+        uint64_t gr23;
         uint64_t gr24;
         uint64_t gr25;
     } boot_info;
@@ -524,8 +526,8 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
             }
 
             load_image_targphys(initrd_filename, initrd_base, initrd_size);
-            cpu[0]->env.initrd_base = initrd_base;
-            cpu[0]->env.initrd_end  = initrd_base + initrd_size;
+            hms->boot_info.gr23 = initrd_base;
+            hms->boot_info.gr22 = initrd_base + initrd_size;
         }
     } else {
         /* When booting via firmware, tell firmware if we want interactive
@@ -677,15 +679,13 @@ static void hppa_machine_reset(MachineState *ms, ResetType type)
     cpu[0]->env.gr[26] = ms->ram_size;
     cpu[0]->env.gr[25] = hms->boot_info.gr25;
     cpu[0]->env.gr[24] = hms->boot_info.gr24;
-    cpu[0]->env.gr[23] = cpu[0]->env.initrd_base;
-    cpu[0]->env.gr[22] = cpu[0]->env.initrd_end;
+    cpu[0]->env.gr[23] = hms->boot_info.gr23;
+    cpu[0]->env.gr[22] = hms->boot_info.gr22;
     cpu[0]->env.gr[21] = smp_cpus;
     cpu[0]->env.gr[19] = FW_CFG_IO_BASE;
 
     /* reset static fields to avoid starting Linux kernel & initrd on reboot */
     memset(&hms->boot_info, 0, sizeof(hms->boot_info));
-    cpu[0]->env.initrd_base = 0;
-    cpu[0]->env.initrd_end = 0;
 }
 
 static void hppa_nmi(NMIState *n, int cpu_index, Error **errp)
-- 
2.51.0



  parent reply	other threads:[~2025-10-10  6:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10  6:18 [PATCH v2 0/6] hw/hppa: Clarify machine variables and move them out of CPUArchState Philippe Mathieu-Daudé
2025-10-10  6:18 ` [PATCH v2 1/6] hw/hppa: Convert type_init() -> DEFINE_TYPES() Philippe Mathieu-Daudé
2025-10-10  6:18 ` [PATCH v2 2/6] hw/hppa: Factor QOM HPPA_COMMON_MACHINE out Philippe Mathieu-Daudé
2025-10-10  6:18 ` [PATCH v2 3/6] hw/hppa: Reduce variables scope in common_init() Philippe Mathieu-Daudé
2025-10-10 17:23   ` Richard Henderson
2025-10-10  6:18 ` [PATCH v2 4/6] hw/hppa: Move CPU::kernel_entry -> Machine::boot_info.gr25 Philippe Mathieu-Daudé
2025-10-10 17:54   ` Richard Henderson
2025-10-10  6:18 ` [PATCH v2 5/6] hw/hppa: Move CPU::cmdline_or_bootorder -> Machine::boot_info.gr24 Philippe Mathieu-Daudé
2025-10-10 17:57   ` Richard Henderson
2025-10-10  6:18 ` Philippe Mathieu-Daudé [this message]
2025-10-10 17:59   ` [PATCH v2 6/6] hw/hppa: Move CPU::initrd_base/end -> Machine::boot_info.gr22/23 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=20251010061836.45739-7-philmd@linaro.org \
    --to=philmd@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).