[PATCH v2 4/4] hppa: Add C3600 machine with PA-8600 CPU

Anton Johansson via qemu development posted 4 patches 6 hours ago
[PATCH v2 4/4] hppa: Add C3600 machine with PA-8600 CPU
Posted by Anton Johansson via qemu development 6 hours ago
Adds a C3600/PA-8600 machine/CPU, which from the perspective of
QEMU differ only in the size of the physical address, compared to
C3700/PA-8700.

With this addition, PA-8700 is changed to use the correct 44 bit
physical address space.

Signed-off-by: Anton Johansson <anjo@rev.ng>
---
 target/hppa/cpu-qom.h                 |  1 +
 hw/hppa/machine.c                     | 41 ++++++++++++++++++++++++++++++-----
 target/hppa/cpu.c                     | 10 ++++++++-
 tests/functional/hppa/test_seabios.py |  3 +++
 4 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h
index c6b82dc09b..078aa3b08a 100644
--- a/target/hppa/cpu-qom.h
+++ b/target/hppa/cpu-qom.h
@@ -28,6 +28,7 @@
 #define HPPA_CPU_TYPE_NAME(name) (name HPPA_CPU_TYPE_SUFFIX)
 
 #define TYPE_HPPA_CPU_PA_7300LC HPPA_CPU_TYPE_NAME("pa-7300lc")
+#define TYPE_HPPA_CPU_PA_8600   HPPA_CPU_TYPE_NAME("pa-8600")
 #define TYPE_HPPA_CPU_PA_8700   HPPA_CPU_TYPE_NAME("pa-8700")
 
 OBJECT_DECLARE_CPU_TYPE(HPPACPU, HPPACPUClass, HPPA_CPU)
diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
index 8246f6bf65..ab5b8b6422 100644
--- a/hw/hppa/machine.c
+++ b/hw/hppa/machine.c
@@ -689,9 +689,9 @@ static AstroState *astro_init(void)
 }
 
 /*
- * Create HP C3700 workstation
+ * Create HP C3000 series workstation
  */
-static void machine_HP_C3700_init(MachineState *machine)
+static void machine_HP_C3000_init(MachineState *machine)
 {
     PCIBus *pci_bus;
     AstroState *astro;
@@ -804,9 +804,30 @@ static void HP_B160L_machine_init_class_init(ObjectClass *oc, const void *data)
     mc->default_ram_size = 512 * MiB;
 }
 
+static void HP_C3600_machine_init_class_init(ObjectClass *oc, const void *data)
+{
+    static const char * const valid_cpu_types[] = {
+        TYPE_HPPA_CPU_PA_8600,
+        NULL
+    };
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->desc = "HP C3600 workstation";
+    mc->default_cpu_type = TYPE_HPPA_CPU_PA_8600;
+    mc->valid_cpu_types = valid_cpu_types;
+    mc->init = machine_HP_C3000_init;
+    mc->max_cpus = HPPA_MAX_CPUS;
+    mc->default_ram_size = 1024 * MiB;
+}
+
 static void HP_C3700_machine_init_class_init(ObjectClass *oc, const void *data)
 {
+    /*
+     * SeaBIOS for C3700 currently uses a 40 bit physical address space,
+     * allow use of use the PA-8600.
+     */
     static const char * const valid_cpu_types[] = {
+        TYPE_HPPA_CPU_PA_8600,
         TYPE_HPPA_CPU_PA_8700,
         NULL
     };
@@ -815,7 +836,7 @@ static void HP_C3700_machine_init_class_init(ObjectClass *oc, const void *data)
     mc->desc = "HP C3700 workstation";
     mc->default_cpu_type = TYPE_HPPA_CPU_PA_8700;
     mc->valid_cpu_types = valid_cpu_types;
-    mc->init = machine_HP_C3700_init;
+    mc->init = machine_HP_C3000_init;
     mc->max_cpus = HPPA_MAX_CPUS;
     mc->default_ram_size = 1024 * MiB;
 }
@@ -855,15 +876,23 @@ static const TypeInfo hppa_machine_types[] = {
             { TYPE_NMI },
             { }
         },
-    }, {
+    },
+    {
         .name = MACHINE_TYPE_NAME("B160L"),
         .parent = TYPE_HPPA_COMMON_MACHINE,
         .class_init = HP_B160L_machine_init_class_init,
-    }, {
+    },
+    {
+        .name = MACHINE_TYPE_NAME("C3600"),
+        .parent = TYPE_HPPA_COMMON_MACHINE,
+        .class_init = HP_C3600_machine_init_class_init,
+    },
+    {
         .name = MACHINE_TYPE_NAME("C3700"),
         .parent = TYPE_HPPA_COMMON_MACHINE,
         .class_init = HP_C3700_machine_init_class_init,
-    }, {
+    },
+    {
         .name = MACHINE_TYPE_NAME("715"),
         .parent = TYPE_HPPA_COMMON_MACHINE,
         .class_init = HP_715_machine_init_class_init,
diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c
index 1ba281df20..c88252e071 100644
--- a/target/hppa/cpu.c
+++ b/target/hppa/cpu.c
@@ -335,13 +335,21 @@ static const TypeInfo hppa_cpu_type_infos[] = {
         },
     },
     {
-        .name = TYPE_HPPA_CPU_PA_8700,
+        .name = TYPE_HPPA_CPU_PA_8600,
         .parent = TYPE_HPPA_CPU,
         .class_data = &(const HPPACPUDef) {
             .phys_addr_bits = 40,
             .is_pa20 = true,
         },
     },
+    {
+        .name = TYPE_HPPA_CPU_PA_8700,
+        .parent = TYPE_HPPA_CPU,
+        .class_data = &(const HPPACPUDef) {
+            .phys_addr_bits = 44,
+            .is_pa20 = true,
+        },
+    },
 };
 
 DEFINE_TYPES(hppa_cpu_type_infos)
diff --git a/tests/functional/hppa/test_seabios.py b/tests/functional/hppa/test_seabios.py
index 661b2464e1..41a429d4c4 100755
--- a/tests/functional/hppa/test_seabios.py
+++ b/tests/functional/hppa/test_seabios.py
@@ -29,6 +29,9 @@ def test_hppa_32(self):
 
     def test_hppa_64(self):
         self.set_machine('C3700')
+        # SeaBIOS for C3700 currently uses a 40 bit physical address space,
+        # use the PA-8600 CPU instead of the default PA-8700.
+        self.cpu = 'pa-8600'
         self.boot_seabios()
 
 if __name__ == '__main__':

-- 
2.52.0
Re: [PATCH v2 4/4] hppa: Add C3600 machine with PA-8600 CPU
Posted by BALATON Zoltan 6 hours ago
On Tue, 10 Feb 2026, Anton Johansson via qemu development wrote:
> Adds a C3600/PA-8600 machine/CPU, which from the perspective of
> QEMU differ only in the size of the physical address, compared to
> C3700/PA-8700.
>
> With this addition, PA-8700 is changed to use the correct 44 bit
> physical address space.
>
> Signed-off-by: Anton Johansson <anjo@rev.ng>
> ---
> target/hppa/cpu-qom.h                 |  1 +
> hw/hppa/machine.c                     | 41 ++++++++++++++++++++++++++++++-----
> target/hppa/cpu.c                     | 10 ++++++++-
> tests/functional/hppa/test_seabios.py |  3 +++
> 4 files changed, 48 insertions(+), 7 deletions(-)
>
> diff --git a/target/hppa/cpu-qom.h b/target/hppa/cpu-qom.h
> index c6b82dc09b..078aa3b08a 100644
> --- a/target/hppa/cpu-qom.h
> +++ b/target/hppa/cpu-qom.h
> @@ -28,6 +28,7 @@
> #define HPPA_CPU_TYPE_NAME(name) (name HPPA_CPU_TYPE_SUFFIX)
>
> #define TYPE_HPPA_CPU_PA_7300LC HPPA_CPU_TYPE_NAME("pa-7300lc")
> +#define TYPE_HPPA_CPU_PA_8600   HPPA_CPU_TYPE_NAME("pa-8600")
> #define TYPE_HPPA_CPU_PA_8700   HPPA_CPU_TYPE_NAME("pa-8700")
>
> OBJECT_DECLARE_CPU_TYPE(HPPACPU, HPPACPUClass, HPPA_CPU)
> diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c
> index 8246f6bf65..ab5b8b6422 100644
> --- a/hw/hppa/machine.c
> +++ b/hw/hppa/machine.c
> @@ -689,9 +689,9 @@ static AstroState *astro_init(void)
> }
>
> /*
> - * Create HP C3700 workstation
> + * Create HP C3000 series workstation
>  */
> -static void machine_HP_C3700_init(MachineState *machine)
> +static void machine_HP_C3000_init(MachineState *machine)
> {
>     PCIBus *pci_bus;
>     AstroState *astro;
> @@ -804,9 +804,30 @@ static void HP_B160L_machine_init_class_init(ObjectClass *oc, const void *data)
>     mc->default_ram_size = 512 * MiB;
> }
>
> +static void HP_C3600_machine_init_class_init(ObjectClass *oc, const void *data)
> +{
> +    static const char * const valid_cpu_types[] = {
> +        TYPE_HPPA_CPU_PA_8600,
> +        NULL
> +    };
> +    MachineClass *mc = MACHINE_CLASS(oc);
> +
> +    mc->desc = "HP C3600 workstation";
> +    mc->default_cpu_type = TYPE_HPPA_CPU_PA_8600;
> +    mc->valid_cpu_types = valid_cpu_types;
> +    mc->init = machine_HP_C3000_init;
> +    mc->max_cpus = HPPA_MAX_CPUS;
> +    mc->default_ram_size = 1024 * MiB;
> +}
> +
> static void HP_C3700_machine_init_class_init(ObjectClass *oc, const void *data)
> {
> +    /*
> +     * SeaBIOS for C3700 currently uses a 40 bit physical address space,
> +     * allow use of use the PA-8600.

Something seems to be missing from this comment or too many uses of "use"?

Regards,
BALATON Zoltan