Power11 core is same as Power10, declare PNV11_HOMER as a child
class of PNV10_HOMER, so it goes through same class init
Cc: Cédric Le Goater <clg@kaod.org>
Cc: Frédéric Barrat <fbarrat@linux.ibm.com>
Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
---
hw/ppc/pnv_homer.c | 8 ++++++++
include/hw/ppc/pnv_homer.h | 3 +++
2 files changed, 11 insertions(+)
diff --git a/hw/ppc/pnv_homer.c b/hw/ppc/pnv_homer.c
index 18a53a80c183..fdd3db41828f 100644
--- a/hw/ppc/pnv_homer.c
+++ b/hw/ppc/pnv_homer.c
@@ -238,6 +238,13 @@ static const TypeInfo pnv_homer_power10_type_info = {
.parent = TYPE_PNV_HOMER,
.instance_size = sizeof(PnvHomer),
.class_init = pnv_homer_power10_class_init,
+ .class_base_init = pnv_homer_power10_class_init,
+};
+
+static const TypeInfo pnv_homer_power11_type_info = {
+ .name = TYPE_PNV11_HOMER,
+ .parent = TYPE_PNV10_HOMER,
+ .instance_size = sizeof(PnvHomer),
};
static void pnv_homer_realize(DeviceState *dev, Error **errp)
@@ -291,6 +298,7 @@ static void pnv_homer_register_types(void)
type_register_static(&pnv_homer_power8_type_info);
type_register_static(&pnv_homer_power9_type_info);
type_register_static(&pnv_homer_power10_type_info);
+ type_register_static(&pnv_homer_power11_type_info);
}
type_init(pnv_homer_register_types);
diff --git a/include/hw/ppc/pnv_homer.h b/include/hw/ppc/pnv_homer.h
index a6f2710fa16b..ab7b43f4c910 100644
--- a/include/hw/ppc/pnv_homer.h
+++ b/include/hw/ppc/pnv_homer.h
@@ -35,6 +35,9 @@ DECLARE_INSTANCE_CHECKER(PnvHomer, PNV9_HOMER,
#define TYPE_PNV10_HOMER TYPE_PNV_HOMER "-POWER10"
DECLARE_INSTANCE_CHECKER(PnvHomer, PNV10_HOMER,
TYPE_PNV10_HOMER)
+#define TYPE_PNV11_HOMER TYPE_PNV_HOMER "-POWER11"
+DECLARE_INSTANCE_CHECKER(PnvHomer, PNV11_HOMER,
+ TYPE_PNV11_HOMER)
struct PnvHomer {
DeviceState parent;
--
2.49.0
On 3/25/25 12:23, Aditya Gupta wrote:
> Power11 core is same as Power10, declare PNV11_HOMER as a child
> class of PNV10_HOMER, so it goes through same class init
>
> Cc: Cédric Le Goater <clg@kaod.org>
> Cc: Frédéric Barrat <fbarrat@linux.ibm.com>
> Cc: Mahesh J Salgaonkar <mahesh@linux.ibm.com>
> Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Reviewed-by: Cédric Le Goater <clg@kaod.org>
> Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
> ---
> hw/ppc/pnv_homer.c | 8 ++++++++
> include/hw/ppc/pnv_homer.h | 3 +++
> 2 files changed, 11 insertions(+)
>
> diff --git a/hw/ppc/pnv_homer.c b/hw/ppc/pnv_homer.c
> index 18a53a80c183..fdd3db41828f 100644
> --- a/hw/ppc/pnv_homer.c
> +++ b/hw/ppc/pnv_homer.c
> @@ -238,6 +238,13 @@ static const TypeInfo pnv_homer_power10_type_info = {
> .parent = TYPE_PNV_HOMER,
> .instance_size = sizeof(PnvHomer),
> .class_init = pnv_homer_power10_class_init,
> + .class_base_init = pnv_homer_power10_class_init,
I didn't see that previously.
Why are you introducing new types for P11 if they are the same as
P10 ? Why not use them directly in the P11 chip instance ?
C.
> +};
> +
> +static const TypeInfo pnv_homer_power11_type_info = {
> + .name = TYPE_PNV11_HOMER,
> + .parent = TYPE_PNV10_HOMER,
> + .instance_size = sizeof(PnvHomer),
> };
>
> static void pnv_homer_realize(DeviceState *dev, Error **errp)
> @@ -291,6 +298,7 @@ static void pnv_homer_register_types(void)
> type_register_static(&pnv_homer_power8_type_info);
> type_register_static(&pnv_homer_power9_type_info);
> type_register_static(&pnv_homer_power10_type_info);
> + type_register_static(&pnv_homer_power11_type_info);
> }
>
> type_init(pnv_homer_register_types);
> diff --git a/include/hw/ppc/pnv_homer.h b/include/hw/ppc/pnv_homer.h
> index a6f2710fa16b..ab7b43f4c910 100644
> --- a/include/hw/ppc/pnv_homer.h
> +++ b/include/hw/ppc/pnv_homer.h
> @@ -35,6 +35,9 @@ DECLARE_INSTANCE_CHECKER(PnvHomer, PNV9_HOMER,
> #define TYPE_PNV10_HOMER TYPE_PNV_HOMER "-POWER10"
> DECLARE_INSTANCE_CHECKER(PnvHomer, PNV10_HOMER,
> TYPE_PNV10_HOMER)
> +#define TYPE_PNV11_HOMER TYPE_PNV_HOMER "-POWER11"
> +DECLARE_INSTANCE_CHECKER(PnvHomer, PNV11_HOMER,
> + TYPE_PNV11_HOMER)
>
> struct PnvHomer {
> DeviceState parent;
Hi Cedric,
Thanks for your reviews.
On 25/03/25 20:04, Cédric Le Goater wrote:
> On 3/25/25 12:23, Aditya Gupta wrote:
>> <...snip...>
>>
>> @@ -238,6 +238,13 @@ static const TypeInfo
>> pnv_homer_power10_type_info = {
>> .parent = TYPE_PNV_HOMER,
>> .instance_size = sizeof(PnvHomer),
>> .class_init = pnv_homer_power10_class_init,
>> + .class_base_init = pnv_homer_power10_class_init,
>
> I didn't see that previously.
>
> Why are you introducing new types for P11 if they are the same as
> P10 ? Why not use them directly in the P11 chip instance ?
>
Cosmetic reasons only. The behavior is same for those models, p10 & p11,
just the typenames and description are different.
I can use p10 models instead of declaring these, only difference will be
that 'info qom-tree' in qemu will show p10 types for those models:
(qemu) info qom-tree
/homer (pnv-homer-POWER10)
/homer-chip0-memory[0] (memory-region)
/xscom-pba[0] (memory-region)
Will do it in v7 ?
Thanks,
- Aditya G
> C.
>
>> +};
>> +
>> +static const TypeInfo pnv_homer_power11_type_info = {
>> + .name = TYPE_PNV11_HOMER,
>> + .parent = TYPE_PNV10_HOMER,
>> + .instance_size = sizeof(PnvHomer),
>> };
>> static void pnv_homer_realize(DeviceState *dev, Error **errp)
>> @@ -291,6 +298,7 @@ static void pnv_homer_register_types(void)
>> type_register_static(&pnv_homer_power8_type_info);
>> type_register_static(&pnv_homer_power9_type_info);
>> type_register_static(&pnv_homer_power10_type_info);
>> + type_register_static(&pnv_homer_power11_type_info);
>> }
>> type_init(pnv_homer_register_types);
>> diff --git a/include/hw/ppc/pnv_homer.h b/include/hw/ppc/pnv_homer.h
>> index a6f2710fa16b..ab7b43f4c910 100644
>> --- a/include/hw/ppc/pnv_homer.h
>> +++ b/include/hw/ppc/pnv_homer.h
>> @@ -35,6 +35,9 @@ DECLARE_INSTANCE_CHECKER(PnvHomer, PNV9_HOMER,
>> #define TYPE_PNV10_HOMER TYPE_PNV_HOMER "-POWER10"
>> DECLARE_INSTANCE_CHECKER(PnvHomer, PNV10_HOMER,
>> TYPE_PNV10_HOMER)
>> +#define TYPE_PNV11_HOMER TYPE_PNV_HOMER "-POWER11"
>> +DECLARE_INSTANCE_CHECKER(PnvHomer, PNV11_HOMER,
>> + TYPE_PNV11_HOMER)
>> struct PnvHomer {
>> DeviceState parent;
>
© 2016 - 2026 Red Hat, Inc.