Skip to contentSkip to conversation

hppa updates

PATCH In review [email protected] 4 participants 10 messages Jan 22, 2025 – Oct 8, 2025

lore
Share & tools
lore
#0 lore raw

cover hppa updates

From: Helge Deller <[email protected]>

Two patches: The first fixes booting a Linux kernel which is provided on the command line.
The second patch adds support for more than 4GB RAM on 64-bit boxes (requires additional patch for SeaBIOS-hppa which will be pushed before qemu v10).

Helge Deller (2):
hw/hppa: Support up to 256 GiB RAM on 64-bit machines hw/hppa: Fix booting Linux kernel with initrd

 hw/hppa/hppa_hardware.h |  2 ++
 hw/hppa/machine.c       | 74 +++++++++++++++++++++--------------------
 target/hppa/cpu.h       |  4 +++
 3 files changed, 44 insertions(+), 36 deletions(-)
Signature · 1 line
2.47.0
#1 lore raw

PATCH 1/2 hw/hppa: Support up to 256 GiB RAM on 64-bit machines

From: Helge Deller <[email protected]>

Allow up to 256 GB RAM, which is the maximum a rp8440 machine (the very last 64-bit PA-RISC machine) physically supports.

---
 hw/hppa/hppa_hardware.h |  2 ++
 hw/hppa/machine.c       | 26 +++++++++++++++++++-------
 2 files changed, 21 insertions(+), 7 deletions(-)
hw/hppa/hppa_hardware.h +2 -0
index a9be7bb851..a276240967 100644
@@ -49,4 +49,6 @@
 #define CPU_HPA_CR_REG  7       /* store CPU HPA in cr7 (SeaBIOS internal) */
 #define PIM_STORAGE_SIZE 600	/* storage size of pdc_pim_toc_struct (64bit) */
 
+#define RAM_MAP_HIGH  0x0100000000  /* memory above 3.75 GB is mapped here */
+
 #endif
hw/hppa/machine.c +19 -7
index 8230f43e41..4bcc66cd6f 100644
@@ -283,16 +283,13 @@ static TranslateFn *machine_HP_common_init_cpus(MachineState *machine)
         cpu[i] = HPPA_CPU(cpu_create(machine->cpu_type));
     }
 
-    /*
-     * For now, treat address layout as if PSW_W is clear.
-     * TODO: create a proper hppa64 board model and load elf64 firmware.
-     */
+    /* Initialize memory */
     if (hppa_is_pa20(&cpu[0]->env)) {
         translate = translate_pa20;
-        ram_max = 0xf0000000;      /* 3.75 GB (limited by 32-bit firmware) */
+        ram_max = 256 * GiB;       /* like HP rp8440 */
     } else {
         translate = translate_pa10;
-        ram_max = 0xf0000000;      /* 3.75 GB (32-bit CPU) */
+        ram_max = FIRMWARE_START;  /* 3.75 GB (32-bit CPU) */
     }
 
     soft_power_reg = translate(NULL, HPA_POWER_BUTTON);
@@ -320,7 +317,22 @@ static TranslateFn *machine_HP_common_init_cpus(MachineState *machine)
         info_report("Max RAM size limited to %" PRIu64 " MB", ram_max / MiB);
         machine->ram_size = ram_max;
     }
-    memory_region_add_subregion_overlap(addr_space, 0, machine->ram, -1);
+    if (machine->ram_size <= FIRMWARE_START) {
+        /* contiguous memory up to 3.75 GB RAM */
+        memory_region_add_subregion_overlap(addr_space, 0, machine->ram, -1);
+    } else {
+        /* non-contiguous: Memory above 3.75 GB is mapped at RAM_MAP_HIGH */
+        MemoryRegion *mem_region;
+        mem_region = g_new(MemoryRegion, 2);
+        memory_region_init_alias(&mem_region[0], &addr_space->parent_obj,
+                              "LowMem", machine->ram, 0, FIRMWARE_START);
+        memory_region_init_alias(&mem_region[1], &addr_space->parent_obj,
+                              "HighMem", machine->ram, FIRMWARE_START,
+                              machine->ram_size - FIRMWARE_START);
+        memory_region_add_subregion_overlap(addr_space, 0, &mem_region[0], -1);
+        memory_region_add_subregion_overlap(addr_space, RAM_MAP_HIGH,
+                                            &mem_region[1], -1);
+    }
 
     return translate;
 }
Signature · 1 line
2.47.0
#5 lore raw

PATCH 2/2 hw/hppa: Fix booting Linux kernel with initrd

In reply to [email protected]

From: Helge Deller <[email protected]>

Commit 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()") broke booting the Linux kernel with initrd which may have been provided on the command line. The problem is, that the mentioned commit zeroes out initial registers which were preset with addresses for the Linux kernel and initrd.

Fix it by adding proper variables which are set shortly before starting the firmware.

Fixes 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()")
Cc Philippe Mathieu-Daudé <[email protected]>
---
 hw/hppa/machine.c | 48 +++++++++++++++++++----------------------------
 target/hppa/cpu.h |  4 ++++
 2 files changed, 23 insertions(+), 29 deletions(-)
hw/hppa/machine.c +19 -29
index 4bcc66cd6f..0dd1908214 100644
@@ -356,7 +356,6 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
     uint64_t kernel_entry = 0, kernel_low, kernel_high;
     MemoryRegion *addr_space = get_system_memory();
     MemoryRegion *rom_region;
-    unsigned int smp_cpus = machine->smp.cpus;
     SysBusDevice *s;
 
     /* SCSI disk setup. */
@@ -482,8 +481,8 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
                       kernel_low, kernel_high, kernel_entry, size / KiB);
 
         if (kernel_cmdline) {
-            cpu[0]->env.gr[24] = 0x4000;
-            pstrcpy_targphys("cmdline", cpu[0]->env.gr[24],
+            cpu[0]->env.cmdline_or_bootorder = 0x4000;
+            pstrcpy_targphys("cmdline", cpu[0]->env.cmdline_or_bootorder,
                              TARGET_PAGE_SIZE, kernel_cmdline);
         }
 
@@ -513,32 +512,22 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
             }
 
             load_image_targphys(initrd_filename, initrd_base, initrd_size);
-            cpu[0]->env.gr[23] = initrd_base;
-            cpu[0]->env.gr[22] = initrd_base + initrd_size;
+            cpu[0]->env.initrd_base = initrd_base;
+            cpu[0]->env.initrd_end  = initrd_base + initrd_size;
         }
     }
 
     if (!kernel_entry) {
         /* When booting via firmware, tell firmware if we want interactive
-         * mode (kernel_entry=1), and to boot from CD (gr[24]='d')
-         * or hard disc * (gr[24]='c').
+         * mode (kernel_entry=1), and to boot from CD (cmdline_or_bootorder='d')
+         * or hard disc (cmdline_or_bootorder='c').
          */
         kernel_entry = machine->boot_config.has_menu ? machine->boot_config.menu : 0;
-        cpu[0]->env.gr[24] = machine->boot_config.order[0];
+        cpu[0]->env.cmdline_or_bootorder = machine->boot_config.order[0];
     }
 
-    /* We jump to the firmware entry routine and pass the
-     * various parameters in registers. After firmware initialization,
-     * firmware will start the Linux kernel with ramdisk and cmdline.
-     */
-    cpu[0]->env.gr[26] = machine->ram_size;
-    cpu[0]->env.gr[25] = kernel_entry;
-
-    /* tell firmware how many SMP CPUs to present in inventory table */
-    cpu[0]->env.gr[21] = smp_cpus;
-
-    /* tell firmware fw_cfg port */
-    cpu[0]->env.gr[19] = FW_CFG_IO_BASE;
+    /* Keep initial kernel_entry for first boot */
+    cpu[0]->env.kernel_entry = kernel_entry;
 }
 
 /*
@@ -675,18 +664,19 @@ static void hppa_machine_reset(MachineState *ms, ResetType type)
         cpu[i]->env.gr[5] = CPU_HPA + i * 0x1000;
     }
 
-    /* already initialized by machine_hppa_init()? */
-    if (cpu[0]->env.gr[26] == ms->ram_size) {
-        return;
-    }
-
     cpu[0]->env.gr[26] = ms->ram_size;
-    cpu[0]->env.gr[25] = 0; /* no firmware boot menu */
-    cpu[0]->env.gr[24] = 'c';
-    /* gr22/gr23 unused, no initrd while reboot. */
+    cpu[0]->env.gr[25] = cpu[0]->env.kernel_entry;
+    cpu[0]->env.gr[24] = cpu[0]->env.cmdline_or_bootorder;
+    cpu[0]->env.gr[23] = cpu[0]->env.initrd_base;
+    cpu[0]->env.gr[22] = cpu[0]->env.initrd_end;
     cpu[0]->env.gr[21] = smp_cpus;
-    /* tell firmware fw_cfg port */
     cpu[0]->env.gr[19] = FW_CFG_IO_BASE;
+
+    /* reset static fields to avoid starting Linux kernel & initrd on reboot */
+    cpu[0]->env.kernel_entry = 0;
+    cpu[0]->env.initrd_base = 0;
+    cpu[0]->env.initrd_end = 0;
+    cpu[0]->env.cmdline_or_bootorder = 'c';
 }
 
 static void hppa_nmi(NMIState *n, int cpu_index, Error **errp)
target/hppa/cpu.h +4 -0
index 083d4f5a56..beea42d105 100644
@@ -268,6 +268,10 @@ typedef struct CPUArchState {
     struct {} end_reset_fields;
 
     bool is_pa20;
+
+    target_ulong kernel_entry; /* Linux kernel was loaded here */
+    target_ulong cmdline_or_bootorder;
+    target_ulong initrd_base, initrd_end;
 } CPUHPPAState;
 
 /**
Signature · 1 line
2.47.0
Reviewed-by on v1 2/2
#6 lore raw

Re: [PATCH 2/2] hw/hppa: Fix booting Linux kernel with initrd

Quoted 11 lines · On 1/22/25 10:09, [email protected] wrote:

From: Helge Deller<[email protected]>

Commit 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()") broke booting the Linux kernel with initrd which may have been provided on the command line. The problem is, that the mentioned commit zeroes out initial registers which were preset with addresses for the Linux kernel and initrd.

Fix it by adding proper variables which are set shortly before starting the firmware.

Quoted 7 lines
Fixes 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()")
Cc Philippe Mathieu-Daudé<[email protected]>
---
  hw/hppa/machine.c | 48 +++++++++++++++++++----------------------------
  target/hppa/cpu.h |  4 ++++
  2 files changed, 23 insertions(+), 29 deletions(-)

r~

Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] hw/hppa: Support up to 256 GiB RAM on 64-bit machines

In reply to [email protected]
Quoted 10 lines · On 1/22/25 10:09, [email protected] wrote:

From: Helge Deller <[email protected]>

Allow up to 256 GB RAM, which is the maximum a rp8440 machine (the very last 64-bit PA-RISC machine) physically supports.

---
  hw/hppa/hppa_hardware.h |  2 ++
  hw/hppa/machine.c       | 26 +++++++++++++++++++-------
  2 files changed, 21 insertions(+), 7 deletions(-)

r~

#3 lore raw

Re: [PATCH 1/2] hw/hppa: Support up to 256 GiB RAM on 64-bit machines

In reply to [email protected]
Quoted 16 lines · On 22/1/25 19:09, [email protected] wrote:

From: Helge Deller <[email protected]>

Allow up to 256 GB RAM, which is the maximum a rp8440 machine (the very last 64-bit PA-RISC machine) physically supports.

---
  hw/hppa/hppa_hardware.h |  2 ++
  hw/hppa/machine.c       | 26 +++++++++++++++++++-------
  2 files changed, 21 insertions(+), 7 deletions(-)
hw/hppa/hppa_hardware.h +0 -0
index a9be7bb851..a276240967 100644

hw/hppa/hppa_hardware.h line 52

Quoted 4 lines
hw/hppa/hppa_hardware.h +1 -0
@@ -49,4 +49,6 @@
  #define CPU_HPA_CR_REG  7       /* store CPU HPA in cr7 (SeaBIOS internal) */
  #define PIM_STORAGE_SIZE 600	/* storage size of pdc_pim_toc_struct (64bit) */
 
+#define RAM_MAP_HIGH  0x0100000000  /* memory above 3.75 GB is mapped here */

Should we use ull suffix?

Quoted 2 lines
hw/hppa/hppa_hardware.h +1 -0
+
  #endif
#4 lore raw

Re: [PATCH 1/2] hw/hppa: Support up to 256 GiB RAM on 64-bit machines

Quoted 12 lines · Philippe Mathieu-Daudé
Quoted 11 lines · On 22/1/25 19:09, [email protected] wrote:

From: Helge Deller <[email protected]>

Allow up to 256 GB RAM, which is the maximum a rp8440 machine (the very last 64-bit PA-RISC machine) physically supports.

---
  hw/hppa/hppa_hardware.h |  2 ++ hw/hppa/machine.c       | 26 +++++++++++++++++++-------

  2 files changed, 21 insertions(+), 7 deletions(-)
Quoted 10 lines

hw/hppa/hppa_hardware.h line 51

Quoted 8 lines
hw/hppa/hppa_hardware.h +1 -0
index a9be7bb851..a276240967 100644
@@ -49,4 +49,6 @@
   #define CPU_HPA_CR_REG  7       /* store CPU HPA in cr7 (SeaBIOS internal) */
   #define PIM_STORAGE_SIZE 600    /* storage size of pdc_pim_toc_struct (64bit) */
+#define RAM_MAP_HIGH  0x0100000000  /* memory above 3.75 GB is mapped here */

Should we use ull suffix?

I prefer not to add this suffix, as this file is shared as-is with SeaBIOS-hppa sources and included by the hppa assembler.

Helge

#7 lore raw

Re: [PATCH 2/2] hw/hppa: Fix booting Linux kernel with initrd

In reply to [email protected]

Hi Helge,

Quoted 32 lines · On 22/1/25 19:09, [email protected] wrote:

From: Helge Deller <[email protected]>

Commit 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()") broke booting the Linux kernel with initrd which may have been provided on the command line. The problem is, that the mentioned commit zeroes out initial registers which were preset with addresses for the Linux kernel and initrd.

Fix it by adding proper variables which are set shortly before starting the firmware.

Fixes 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()")
Cc Philippe Mathieu-Daudé <[email protected]>
---
  hw/hppa/machine.c | 48 +++++++++++++++++++----------------------------
  target/hppa/cpu.h |  4 ++++
  2 files changed, 23 insertions(+), 29 deletions(-)
hw/hppa/machine.c +0 -1
index 4bcc66cd6f..0dd1908214 100644
@@ -356,7 +356,6 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
      uint64_t kernel_entry = 0, kernel_low, kernel_high;
      MemoryRegion *addr_space = get_system_memory();
      MemoryRegion *rom_region;
-    unsigned int smp_cpus = machine->smp.cpus;
      SysBusDevice *s;
 
      /* SCSI disk setup. */

hw/hppa/machine.c static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, · line 486

Quoted 8 lines
hw/hppa/machine.c +2 -2
@@ -482,8 +481,8 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
                        kernel_low, kernel_high, kernel_entry, size / KiB);
 
          if (kernel_cmdline) {
-            cpu[0]->env.gr[24] = 0x4000;
-            pstrcpy_targphys("cmdline", cpu[0]->env.gr[24],
+            cpu[0]->env.cmdline_or_bootorder = 0x4000;
+            pstrcpy_targphys("cmdline", cpu[0]->env.cmdline_or_bootorder,
                               TARGET_PAGE_SIZE, kernel_cmdline);

I am a bit confused, here @cmdline_or_bootorder contains the physical address of the kernel command line, ...

Quoted 13 lines
hw/hppa/machine.c +2 -2
          }
 
@@ -513,32 +512,22 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
              }
 
              load_image_targphys(initrd_filename, initrd_base, initrd_size);
-            cpu[0]->env.gr[23] = initrd_base;
-            cpu[0]->env.gr[22] = initrd_base + initrd_size;
+            cpu[0]->env.initrd_base = initrd_base;
+            cpu[0]->env.initrd_end  = initrd_base + initrd_size;
          }
      }
 

hw/hppa/machine.c static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, · line 526

Quoted 10 lines
hw/hppa/machine.c +3 -3
      if (!kernel_entry) {
          /* When booting via firmware, tell firmware if we want interactive
-         * mode (kernel_entry=1), and to boot from CD (gr[24]='d')
-         * or hard disc * (gr[24]='c').
+         * mode (kernel_entry=1), and to boot from CD (cmdline_or_bootorder='d')
+         * or hard disc (cmdline_or_bootorder='c').
           */
          kernel_entry = machine->boot_config.has_menu ? machine->boot_config.menu : 0;
-        cpu[0]->env.gr[24] = machine->boot_config.order[0];
+        cpu[0]->env.cmdline_or_bootorder = machine->boot_config.order[0];

... but here a char ('c' or 'd'). Both seems different things. Is that expected?

Quoted 63 lines
hw/hppa/machine.c +12 -21
      }
 
-    /* We jump to the firmware entry routine and pass the
-     * various parameters in registers. After firmware initialization,
-     * firmware will start the Linux kernel with ramdisk and cmdline.
-     */
-    cpu[0]->env.gr[26] = machine->ram_size;
-    cpu[0]->env.gr[25] = kernel_entry;
-
-    /* tell firmware how many SMP CPUs to present in inventory table */
-    cpu[0]->env.gr[21] = smp_cpus;
-
-    /* tell firmware fw_cfg port */
-    cpu[0]->env.gr[19] = FW_CFG_IO_BASE;
+    /* Keep initial kernel_entry for first boot */
+    cpu[0]->env.kernel_entry = kernel_entry;
  }
 
  /*
@@ -675,18 +664,19 @@ static void hppa_machine_reset(MachineState *ms, ResetType type)
          cpu[i]->env.gr[5] = CPU_HPA + i * 0x1000;
      }
 
-    /* already initialized by machine_hppa_init()? */
-    if (cpu[0]->env.gr[26] == ms->ram_size) {
-        return;
-    }
-
      cpu[0]->env.gr[26] = ms->ram_size;
-    cpu[0]->env.gr[25] = 0; /* no firmware boot menu */
-    cpu[0]->env.gr[24] = 'c';
-    /* gr22/gr23 unused, no initrd while reboot. */
+    cpu[0]->env.gr[25] = cpu[0]->env.kernel_entry;
+    cpu[0]->env.gr[24] = cpu[0]->env.cmdline_or_bootorder;
+    cpu[0]->env.gr[23] = cpu[0]->env.initrd_base;
+    cpu[0]->env.gr[22] = cpu[0]->env.initrd_end;
      cpu[0]->env.gr[21] = smp_cpus;
-    /* tell firmware fw_cfg port */
      cpu[0]->env.gr[19] = FW_CFG_IO_BASE;
+
+    /* reset static fields to avoid starting Linux kernel & initrd on reboot */
+    cpu[0]->env.kernel_entry = 0;
+    cpu[0]->env.initrd_base = 0;
+    cpu[0]->env.initrd_end = 0;
+    cpu[0]->env.cmdline_or_bootorder = 'c';
  }
 
  static void hppa_nmi(NMIState *n, int cpu_index, Error **errp)
target/hppa/cpu.h +4 -0
index 083d4f5a56..beea42d105 100644
@@ -268,6 +268,10 @@ typedef struct CPUArchState {
      struct {} end_reset_fields;
 
      bool is_pa20;
+
+    target_ulong kernel_entry; /* Linux kernel was loaded here */
+    target_ulong cmdline_or_bootorder;
+    target_ulong initrd_base, initrd_end;
  } CPUHPPAState;
 
  /**
#8 lore raw

Re: [PATCH 2/2] hw/hppa: Fix booting Linux kernel with initrd

Hi Philippe,

Quoted 42 lines · Philippe Mathieu-Daudé
Quoted 31 lines · On 22/1/25 19:09, [email protected] wrote:

From: Helge Deller <[email protected]>

Commit 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()") broke booting the Linux kernel with initrd which may have been provided on the command line. The problem is, that the mentioned commit zeroes out initial registers which were preset with addresses for the Linux kernel and initrd.

Fix it by adding proper variables which are set shortly before starting the firmware.

Fixes 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()")
Cc Philippe Mathieu-Daudé <[email protected]>

---
  hw/hppa/machine.c | 48 +++++++++++++++++++---------------------------- target/hppa/cpu.h |  4 ++++

  2 files changed, 23 insertions(+), 29 deletions(-)
hw/hppa/machine.c +0 -1
index 4bcc66cd6f..0dd1908214 100644
@@ -356,7 +356,6 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
       uint64_t kernel_entry = 0, kernel_low, kernel_high;
       MemoryRegion *addr_space = get_system_memory();
       MemoryRegion *rom_region;
-    unsigned int smp_cpus = machine->smp.cpus;
       SysBusDevice *s;
       /* SCSI disk setup. */

hw/hppa/machine.c static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus, · line 485

Quoted 7 lines
hw/hppa/machine.c +2 -2
@@ -482,8 +481,8 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
                         kernel_low, kernel_high, kernel_entry, size / KiB);
           if (kernel_cmdline) {
-            cpu[0]->env.gr[24] = 0x4000;
-            pstrcpy_targphys("cmdline", cpu[0]->env.gr[24],
+            cpu[0]->env.cmdline_or_bootorder = 0x4000;
+            pstrcpy_targphys("cmdline", cpu[0]->env.cmdline_or_bootorder,
                                TARGET_PAGE_SIZE, kernel_cmdline);

I am a bit confused, here @cmdline_or_bootorder contains the physical address of the kernel command line, ...

...

Quoted 6 lines
Quoted 3 lines

          kernel_entry = machine->boot_config.has_menu ? machine->boot_config.menu : 0; -        cpu[0]->env.gr[24] = machine->boot_config.order[0];
+        cpu[0]->env.cmdline_or_bootorder = machine->boot_config.order[0];

... but here a char ('c' or 'd'). Both seems different things. Is that expected?

Yes. That's why this variable is called "cmdline" or "bootorder". If kernel and cmdline is given, the bios does not need to follow any bootorder (which means: boot kernel from C or D).
If no kernel/cmdline, this parameter tells the firmare to load bootloader from c (harddisc) or d (cdrom).

So, it's ok.

Helge

#9 lore raw

Re: [PATCH 2/2] hw/hppa: Fix booting Linux kernel with initrd

Quoted 55 lines · Helge Deller

Hi Philippe,

Quoted 45 lines · Philippe Mathieu-Daudé
Quoted 32 lines · On 22/1/25 19:09, [email protected] wrote:

From: Helge Deller <[email protected]>

Commit 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()") broke booting the Linux kernel with initrd which may have been provided on the command line. The problem is, that the mentioned commit zeroes out initial registers which were preset with addresses for the Linux kernel and initrd.

Fix it by adding proper variables which are set shortly before starting the firmware.

Fixes 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()")
Cc Philippe Mathieu-Daudé <[email protected]>

---
  hw/hppa/machine.c | 48 +++++++++++++++++++---------------------------- target/hppa/cpu.h |  4 ++++

  2 files changed, 23 insertions(+), 29 deletions(-)
hw/hppa/machine.c +0 -1
index 4bcc66cd6f..0dd1908214 100644
@@ -356,7 +356,6 @@ static void 
 machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
       uint64_t kernel_entry = 0, kernel_low, kernel_high;
       MemoryRegion *addr_space = get_system_memory();
       MemoryRegion *rom_region;
-    unsigned int smp_cpus = machine->smp.cpus;
       SysBusDevice *s;
       /* SCSI disk setup. */

hw/hppa/machine.c static void · line 487

Quoted 9 lines
hw/hppa/machine.c +2 -2
@@ -482,8 +481,8 @@ static void 
 machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
                         kernel_low, kernel_high, kernel_entry, size / KiB);
           if (kernel_cmdline) {
-            cpu[0]->env.gr[24] = 0x4000;
-            pstrcpy_targphys("cmdline", cpu[0]->env.gr[24],
+            cpu[0]->env.cmdline_or_bootorder = 0x4000;
+            pstrcpy_targphys("cmdline", cpu[0]- 
 >env.cmdline_or_bootorder,
                                TARGET_PAGE_SIZE, kernel_cmdline);

I am a bit confused, here @cmdline_or_bootorder contains the physical address of the kernel command line, ...

...

Quoted 6 lines
Quoted 5 lines

          kernel_entry = machine->boot_config.has_menu ? machine-

Quoted 1 line

boot_config.menu : 0;

-        cpu[0]->env.gr[24] = machine->boot_config.order[0]; +        cpu[0]->env.cmdline_or_bootorder = machine-

Quoted 1 line

boot_config.order[0];

Quoted 7 lines
Quoted 2 lines

... but here a char ('c' or 'd'). Both seems different things. Is that expected?

Yes. That's why this variable is called "cmdline" or "bootorder". If kernel and cmdline is given, the bios does not need to follow any bootorder (which means: boot kernel from C or D).
If no kernel/cmdline, this parameter tells the firmare to load bootloader from c (harddisc) or d (cdrom).

Ah, now I get the variable name... cmdline is used as hwaddr, and bootorder as plain char. OK!