* [PATCH 01/18] hw/ppc/spapr: Remove deprecated pseries-3.0 machine
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
@ 2025-10-20 10:37 ` Philippe Mathieu-Daudé
2025-10-20 10:37 ` [PATCH 02/18] hw/ppc/spapr: Remove SpaprMachineClass::spapr_irq_xics_legacy field Philippe Mathieu-Daudé
` (17 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:37 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
This machine has been supported for a period of more than 6 years.
According to our versioned machine support policy (see commit
ce80c4fa6ff "docs: document special exception for machine type
deprecation & removal") it can now be removed.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ppc/spapr.c | 18 ------------------
1 file changed, 18 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 97ab6bebd25..85c27f36535 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -5062,24 +5062,6 @@ static void spapr_machine_3_1_class_options(MachineClass *mc)
DEFINE_SPAPR_MACHINE(3, 1);
-/*
- * pseries-3.0
- */
-
-static void spapr_machine_3_0_class_options(MachineClass *mc)
-{
- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
- spapr_machine_3_1_class_options(mc);
- compat_props_add(mc->compat_props, hw_compat_3_0, hw_compat_3_0_len);
-
- smc->legacy_irq_allocation = true;
- smc->nr_xirqs = 0x400;
- smc->irq = &spapr_irq_xics_legacy;
-}
-
-DEFINE_SPAPR_MACHINE(3, 0);
-
static void spapr_machine_register_types(void)
{
type_register_static(&spapr_machine_info);
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 02/18] hw/ppc/spapr: Remove SpaprMachineClass::spapr_irq_xics_legacy field
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
2025-10-20 10:37 ` [PATCH 01/18] hw/ppc/spapr: Remove deprecated pseries-3.0 machine Philippe Mathieu-Daudé
@ 2025-10-20 10:37 ` Philippe Mathieu-Daudé
2025-10-20 10:37 ` [PATCH 03/18] hw/ppc/spapr: Remove SpaprMachineClass::legacy_irq_allocation field Philippe Mathieu-Daudé
` (16 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:37 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
The SpaprMachineClass::spapr_irq_xics_legacy field was only used by the
pseries-3.0 machine, which got removed. Remove it as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr_irq.h | 1 -
hw/ppc/spapr.c | 4 +---
hw/ppc/spapr_irq.c | 5 -----
3 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/include/hw/ppc/spapr_irq.h b/include/hw/ppc/spapr_irq.h
index cb9a85f6575..5ddd1107c39 100644
--- a/include/hw/ppc/spapr_irq.h
+++ b/include/hw/ppc/spapr_irq.h
@@ -100,7 +100,6 @@ typedef struct SpaprIrq {
} SpaprIrq;
extern SpaprIrq spapr_irq_xics;
-extern SpaprIrq spapr_irq_xics_legacy;
extern SpaprIrq spapr_irq_xive;
extern SpaprIrq spapr_irq_dual;
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 85c27f36535..ebc8e84512a 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3347,9 +3347,7 @@ static char *spapr_get_ic_mode(Object *obj, Error **errp)
{
SpaprMachineState *spapr = SPAPR_MACHINE(obj);
- if (spapr->irq == &spapr_irq_xics_legacy) {
- return g_strdup("legacy");
- } else if (spapr->irq == &spapr_irq_xics) {
+ if (spapr->irq == &spapr_irq_xics) {
return g_strdup("xics");
} else if (spapr->irq == &spapr_irq_xive) {
return g_strdup("xive");
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index d6d368dd08c..363bfc00db4 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -588,11 +588,6 @@ int spapr_irq_find(SpaprMachineState *spapr, int num, bool align, Error **errp)
return first + ics->offset;
}
-SpaprIrq spapr_irq_xics_legacy = {
- .xics = true,
- .xive = false,
-};
-
static void spapr_irq_register_types(void)
{
type_register_static(&spapr_intc_info);
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 03/18] hw/ppc/spapr: Remove SpaprMachineClass::legacy_irq_allocation field
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
2025-10-20 10:37 ` [PATCH 01/18] hw/ppc/spapr: Remove deprecated pseries-3.0 machine Philippe Mathieu-Daudé
2025-10-20 10:37 ` [PATCH 02/18] hw/ppc/spapr: Remove SpaprMachineClass::spapr_irq_xics_legacy field Philippe Mathieu-Daudé
@ 2025-10-20 10:37 ` Philippe Mathieu-Daudé
2025-10-20 10:38 ` [PATCH 04/18] hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field Philippe Mathieu-Daudé
` (15 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:37 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
The SpaprMachineClass::legacy_irq_allocation field was only used by the
pseries-3.0 machine, which got removed. Remove it as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr.h | 1 -
hw/ppc/spapr.c | 5 -----
hw/ppc/spapr_events.c | 20 ++++----------------
hw/ppc/spapr_irq.c | 11 +----------
hw/ppc/spapr_pci.c | 32 ++++----------------------------
hw/ppc/spapr_vio.c | 9 ---------
6 files changed, 9 insertions(+), 69 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 39bd5bd5ed3..0c1e5132de2 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -145,7 +145,6 @@ struct SpaprMachineClass {
/*< public >*/
bool dr_phb_enabled; /* enable dynamic-reconfig/hotplug of PHBs */
bool update_dt_enabled; /* enable KVMPPC_H_UPDATE_DT */
- bool legacy_irq_allocation;
uint32_t nr_xirqs;
bool broken_host_serial_model; /* present real host info to the guest */
bool pre_4_1_migration; /* don't migrate hpt-max-page-size */
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index ebc8e84512a..426a778d3e8 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -3361,11 +3361,6 @@ static void spapr_set_ic_mode(Object *obj, const char *value, Error **errp)
{
SpaprMachineState *spapr = SPAPR_MACHINE(obj);
- if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
- error_setg(errp, "This machine only uses the legacy XICS backend, don't pass ic-mode");
- return;
- }
-
/* The legacy IRQ backend can not be set */
if (strcmp(value, "xics") == 0) {
spapr->irq = &spapr_irq_xics;
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index 832b0212f31..892ddc7f8f7 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -1041,20 +1041,14 @@ void spapr_clear_pending_hotplug_events(SpaprMachineState *spapr)
void spapr_events_init(SpaprMachineState *spapr)
{
- int epow_irq = SPAPR_IRQ_EPOW;
-
- if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
- epow_irq = spapr_irq_findone(spapr, &error_fatal);
- }
-
- spapr_irq_claim(spapr, epow_irq, false, &error_fatal);
+ spapr_irq_claim(spapr, SPAPR_IRQ_EPOW, false, &error_fatal);
QTAILQ_INIT(&spapr->pending_events);
spapr->event_sources = spapr_event_sources_new();
spapr_event_sources_register(spapr->event_sources, EVENT_CLASS_EPOW,
- epow_irq);
+ SPAPR_IRQ_EPOW);
/* NOTE: if machine supports modern/dedicated hotplug event source,
* we add it to the device-tree unconditionally. This means we may
@@ -1065,16 +1059,10 @@ void spapr_events_init(SpaprMachineState *spapr)
* checking that it's enabled.
*/
if (spapr->use_hotplug_event_source) {
- int hp_irq = SPAPR_IRQ_HOTPLUG;
-
- if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
- hp_irq = spapr_irq_findone(spapr, &error_fatal);
- }
-
- spapr_irq_claim(spapr, hp_irq, false, &error_fatal);
+ spapr_irq_claim(spapr, SPAPR_IRQ_HOTPLUG, false, &error_fatal);
spapr_event_sources_register(spapr->event_sources, EVENT_CLASS_HOT_PLUG,
- hp_irq);
+ SPAPR_IRQ_HOTPLUG);
}
spapr->epow_notifier.notify = spapr_powerdown_req;
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index 363bfc00db4..14e47acc65b 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -33,11 +33,6 @@ static const TypeInfo spapr_intc_info = {
static void spapr_irq_msi_init(SpaprMachineState *spapr)
{
- if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
- /* Legacy mode doesn't use this allocator */
- return;
- }
-
spapr->irq_map_nr = spapr_irq_nr_msis(spapr);
spapr->irq_map = bitmap_new(spapr->irq_map_nr);
}
@@ -286,11 +281,7 @@ uint32_t spapr_irq_nr_msis(SpaprMachineState *spapr)
{
SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
- if (smc->legacy_irq_allocation) {
- return smc->nr_xirqs;
- } else {
- return SPAPR_XIRQ_BASE + smc->nr_xirqs - SPAPR_IRQ_MSI;
- }
+ return smc->nr_xirqs + SPAPR_XIRQ_BASE - SPAPR_IRQ_MSI;
}
void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index f9095552e86..bdec8f0728d 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -268,7 +268,6 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr,
target_ulong args, uint32_t nret,
target_ulong rets)
{
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
uint32_t config_addr = rtas_ld(args, 0);
uint64_t buid = rtas_ldq(args, 1);
unsigned int func = rtas_ld(args, 3);
@@ -373,13 +372,8 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr,
}
/* Allocate MSIs */
- if (smc->legacy_irq_allocation) {
- irq = spapr_irq_find(spapr, req_num, ret_intr_type == RTAS_TYPE_MSI,
- &err);
- } else {
- irq = spapr_irq_msi_alloc(spapr, req_num,
- ret_intr_type == RTAS_TYPE_MSI, &err);
- }
+ irq = spapr_irq_msi_alloc(spapr, req_num,
+ ret_intr_type == RTAS_TYPE_MSI, &err);
if (err) {
error_reportf_err(err, "Can't allocate MSIs for device %x: ",
config_addr);
@@ -393,9 +387,7 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, SpaprMachineState *spapr,
if (i) {
spapr_irq_free(spapr, irq, i);
}
- if (!smc->legacy_irq_allocation) {
- spapr_irq_msi_free(spapr, irq, req_num);
- }
+ spapr_irq_msi_free(spapr, irq, req_num);
error_reportf_err(err, "Can't allocate MSIs for device %x: ",
config_addr);
rtas_st(rets, 0, RTAS_OUT_HW_ERROR);
@@ -1789,12 +1781,9 @@ static void spapr_phb_unrealize(DeviceState *dev)
static void spapr_phb_destroy_msi(gpointer opaque)
{
SpaprMachineState *spapr = SPAPR_MACHINE(qdev_get_machine());
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
SpaprPciMsi *msi = opaque;
- if (!smc->legacy_irq_allocation) {
- spapr_irq_msi_free(spapr, msi->first_irq, msi->num);
- }
+ spapr_irq_msi_free(spapr, msi->first_irq, msi->num);
spapr_irq_free(spapr, msi->first_irq, msi->num);
g_free(msi);
}
@@ -1808,7 +1797,6 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
SpaprMachineState *spapr =
(SpaprMachineState *) object_dynamic_cast(qdev_get_machine(),
TYPE_SPAPR_MACHINE);
- SpaprMachineClass *smc = spapr ? SPAPR_MACHINE_GET_CLASS(spapr) : NULL;
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
SpaprPhbState *sphb = SPAPR_PCI_HOST_BRIDGE(sbd);
PCIHostState *phb = PCI_HOST_BRIDGE(sbd);
@@ -1956,18 +1944,6 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
for (i = 0; i < PCI_NUM_PINS; i++) {
int irq = SPAPR_IRQ_PCI_LSI + sphb->index * PCI_NUM_PINS + i;
- if (smc->legacy_irq_allocation) {
- irq = spapr_irq_findone(spapr, errp);
- if (irq < 0) {
- error_prepend(errp, "can't allocate LSIs: ");
- /*
- * Older machines will never support PHB hotplug, ie, this is an
- * init only path and QEMU will terminate. No need to rollback.
- */
- return;
- }
- }
-
if (spapr_irq_claim(spapr, irq, true, errp) < 0) {
error_prepend(errp, "can't allocate LSIs: ");
goto unrealize;
diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
index 7759436a4f5..c21a2a3274e 100644
--- a/hw/ppc/spapr_vio.c
+++ b/hw/ppc/spapr_vio.c
@@ -507,15 +507,6 @@ static void spapr_vio_busdev_realize(DeviceState *qdev, Error **errp)
dev->irq = spapr_vio_reg_to_irq(dev->reg);
- if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
- int irq = spapr_irq_findone(spapr, errp);
-
- if (irq < 0) {
- return;
- }
- dev->irq = irq;
- }
-
if (spapr_irq_claim(spapr, dev->irq, false, errp) < 0) {
return;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 04/18] hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2025-10-20 10:37 ` [PATCH 03/18] hw/ppc/spapr: Remove SpaprMachineClass::legacy_irq_allocation field Philippe Mathieu-Daudé
@ 2025-10-20 10:38 ` Philippe Mathieu-Daudé
2025-10-20 10:38 ` [PATCH 05/18] hw/ppc/spapr: Remove deprecated pseries-3.1 machine Philippe Mathieu-Daudé
` (14 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
The SpaprMachineClass::nr_xirqs field was only used by the
pseries-3.0 machine, which got removed. Remove it as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr.h | 1 -
hw/ppc/spapr.c | 1 -
hw/ppc/spapr_irq.c | 22 +++++++---------------
3 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 0c1e5132de2..494367fb99a 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -145,7 +145,6 @@ struct SpaprMachineClass {
/*< public >*/
bool dr_phb_enabled; /* enable dynamic-reconfig/hotplug of PHBs */
bool update_dt_enabled; /* enable KVMPPC_H_UPDATE_DT */
- uint32_t nr_xirqs;
bool broken_host_serial_model; /* present real host info to the guest */
bool pre_4_1_migration; /* don't migrate hpt-max-page-size */
bool linux_pci_probe;
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 426a778d3e8..b5d20bc1756 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4691,7 +4691,6 @@ static void spapr_machine_class_init(ObjectClass *oc, const void *data)
smc->dr_phb_enabled = true;
smc->linux_pci_probe = true;
smc->smp_threads_vsmt = true;
- smc->nr_xirqs = SPAPR_NR_XIRQS;
xfc->match_nvt = spapr_match_nvt;
vmc->client_architecture_support = spapr_vof_client_architecture_support;
vmc->quiesce = spapr_vof_quiesce;
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index 14e47acc65b..2ce323457be 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -279,15 +279,11 @@ void spapr_irq_dt(SpaprMachineState *spapr, uint32_t nr_servers,
uint32_t spapr_irq_nr_msis(SpaprMachineState *spapr)
{
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
-
- return smc->nr_xirqs + SPAPR_XIRQ_BASE - SPAPR_IRQ_MSI;
+ return SPAPR_NR_XIRQS + SPAPR_XIRQ_BASE - SPAPR_IRQ_MSI;
}
void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
{
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
-
if (kvm_enabled() && kvm_kernel_irqchip_split()) {
error_setg(errp, "kernel_irqchip split mode not supported on pseries");
return;
@@ -308,7 +304,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
object_property_add_child(OBJECT(spapr), "ics", obj);
object_property_set_link(obj, ICS_PROP_XICS, OBJECT(spapr),
&error_abort);
- object_property_set_int(obj, "nr-irqs", smc->nr_xirqs, &error_abort);
+ object_property_set_int(obj, "nr-irqs", SPAPR_NR_XIRQS, &error_abort);
if (!qdev_realize(DEVICE(obj), NULL, errp)) {
return;
}
@@ -322,7 +318,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
int i;
dev = qdev_new(TYPE_SPAPR_XIVE);
- qdev_prop_set_uint32(dev, "nr-irqs", smc->nr_xirqs + SPAPR_IRQ_NR_IPIS);
+ qdev_prop_set_uint32(dev, "nr-irqs", SPAPR_NR_XIRQS + SPAPR_IRQ_NR_IPIS);
/*
* 8 XIVE END structures per CPU. One for each available
* priority
@@ -349,7 +345,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
}
spapr->qirqs = qemu_allocate_irqs(spapr_set_irq, spapr,
- smc->nr_xirqs + SPAPR_IRQ_NR_IPIS);
+ SPAPR_NR_XIRQS + SPAPR_IRQ_NR_IPIS);
/*
* Mostly we don't actually need this until reset, except that not
@@ -364,11 +360,10 @@ int spapr_irq_claim(SpaprMachineState *spapr, int irq, bool lsi, Error **errp)
{
SpaprInterruptController *intcs[] = ALL_INTCS(spapr);
int i;
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
int rc;
assert(irq >= SPAPR_XIRQ_BASE);
- assert(irq < (smc->nr_xirqs + SPAPR_XIRQ_BASE));
+ assert(irq < (SPAPR_NR_XIRQS + SPAPR_XIRQ_BASE));
for (i = 0; i < ARRAY_SIZE(intcs); i++) {
SpaprInterruptController *intc = intcs[i];
@@ -388,10 +383,9 @@ void spapr_irq_free(SpaprMachineState *spapr, int irq, int num)
{
SpaprInterruptController *intcs[] = ALL_INTCS(spapr);
int i, j;
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
assert(irq >= SPAPR_XIRQ_BASE);
- assert((irq + num) <= (smc->nr_xirqs + SPAPR_XIRQ_BASE));
+ assert((irq + num) <= (SPAPR_NR_XIRQS + SPAPR_XIRQ_BASE));
for (i = irq; i < (irq + num); i++) {
for (j = 0; j < ARRAY_SIZE(intcs); j++) {
@@ -408,8 +402,6 @@ void spapr_irq_free(SpaprMachineState *spapr, int irq, int num)
qemu_irq spapr_qirq(SpaprMachineState *spapr, int irq)
{
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
-
/*
* This interface is basically for VIO and PHB devices to find the
* right qemu_irq to manipulate, so we only allow access to the
@@ -418,7 +410,7 @@ qemu_irq spapr_qirq(SpaprMachineState *spapr, int irq)
* interfaces, we can change this if we need to in future.
*/
assert(irq >= SPAPR_XIRQ_BASE);
- assert(irq < (smc->nr_xirqs + SPAPR_XIRQ_BASE));
+ assert(irq < (SPAPR_NR_XIRQS + SPAPR_XIRQ_BASE));
if (spapr->ics) {
assert(ics_valid_irq(spapr->ics, irq));
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 05/18] hw/ppc/spapr: Remove deprecated pseries-3.1 machine
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2025-10-20 10:38 ` [PATCH 04/18] hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field Philippe Mathieu-Daudé
@ 2025-10-20 10:38 ` Philippe Mathieu-Daudé
2025-10-20 10:38 ` [PATCH 06/18] hw/ppc/spapr: Remove SpaprMachineClass::broken_host_serial_model field Philippe Mathieu-Daudé
` (13 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
This machine has been supported for a period of more than 6 years.
According to our versioned machine support policy (see commit
ce80c4fa6ff "docs: document special exception for machine type
deprecation & removal") it can now be removed.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ppc/spapr.c | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index b5d20bc1756..2e07c5604aa 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -5032,28 +5032,6 @@ static void spapr_machine_4_0_class_options(MachineClass *mc)
DEFINE_SPAPR_MACHINE(4, 0);
-/*
- * pseries-3.1
- */
-static void spapr_machine_3_1_class_options(MachineClass *mc)
-{
- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
- spapr_machine_4_0_class_options(mc);
- compat_props_add(mc->compat_props, hw_compat_3_1, hw_compat_3_1_len);
-
- mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power8_v2.0");
- smc->update_dt_enabled = false;
- smc->dr_phb_enabled = false;
- smc->broken_host_serial_model = true;
- smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_BROKEN;
- smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_BROKEN;
- smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_BROKEN;
- smc->default_caps.caps[SPAPR_CAP_LARGE_DECREMENTER] = SPAPR_CAP_OFF;
-}
-
-DEFINE_SPAPR_MACHINE(3, 1);
-
static void spapr_machine_register_types(void)
{
type_register_static(&spapr_machine_info);
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 06/18] hw/ppc/spapr: Remove SpaprMachineClass::broken_host_serial_model field
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2025-10-20 10:38 ` [PATCH 05/18] hw/ppc/spapr: Remove deprecated pseries-3.1 machine Philippe Mathieu-Daudé
@ 2025-10-20 10:38 ` Philippe Mathieu-Daudé
2025-10-20 10:38 ` [PATCH 07/18] target/ppc/kvm: Remove kvmppc_get_host_serial() as unused Philippe Mathieu-Daudé
` (12 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
The SpaprMachineClass::broken_host_serial_model field was only used by
the pseries-3.1 machine, which got removed. Remove it as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr.h | 1 -
hw/ppc/spapr.c | 6 ------
2 files changed, 7 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 494367fb99a..06e2ad8ffe6 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -145,7 +145,6 @@ struct SpaprMachineClass {
/*< public >*/
bool dr_phb_enabled; /* enable dynamic-reconfig/hotplug of PHBs */
bool update_dt_enabled; /* enable KVMPPC_H_UPDATE_DT */
- bool broken_host_serial_model; /* present real host info to the guest */
bool pre_4_1_migration; /* don't migrate hpt-max-page-size */
bool linux_pci_probe;
bool smp_threads_vsmt; /* set VSMT to smp_threads by default */
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 2e07c5604aa..e06eefa3233 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1213,16 +1213,10 @@ void *spapr_build_fdt(SpaprMachineState *spapr, bool reset, size_t space)
/* Host Model & Serial Number */
if (spapr->host_model) {
_FDT(fdt_setprop_string(fdt, 0, "host-model", spapr->host_model));
- } else if (smc->broken_host_serial_model && kvmppc_get_host_model(&buf)) {
- _FDT(fdt_setprop_string(fdt, 0, "host-model", buf));
- g_free(buf);
}
if (spapr->host_serial) {
_FDT(fdt_setprop_string(fdt, 0, "host-serial", spapr->host_serial));
- } else if (smc->broken_host_serial_model && kvmppc_get_host_serial(&buf)) {
- _FDT(fdt_setprop_string(fdt, 0, "host-serial", buf));
- g_free(buf);
}
_FDT(fdt_setprop_cell(fdt, 0, "#address-cells", 2));
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 07/18] target/ppc/kvm: Remove kvmppc_get_host_serial() as unused
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2025-10-20 10:38 ` [PATCH 06/18] hw/ppc/spapr: Remove SpaprMachineClass::broken_host_serial_model field Philippe Mathieu-Daudé
@ 2025-10-20 10:38 ` Philippe Mathieu-Daudé
2025-10-20 10:38 ` [PATCH 08/18] target/ppc/kvm: Remove kvmppc_get_host_model() " Philippe Mathieu-Daudé
` (11 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/ppc/kvm_ppc.h | 6 ------
target/ppc/kvm.c | 6 ------
2 files changed, 12 deletions(-)
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
index a1d9ce9f9aa..f24cc4de3c2 100644
--- a/target/ppc/kvm_ppc.h
+++ b/target/ppc/kvm_ppc.h
@@ -22,7 +22,6 @@
uint32_t kvmppc_get_tbfreq(void);
uint64_t kvmppc_get_clockfreq(void);
bool kvmppc_get_host_model(char **buf);
-bool kvmppc_get_host_serial(char **buf);
int kvmppc_get_hasidle(CPUPPCState *env);
int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len);
int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int level);
@@ -134,11 +133,6 @@ static inline bool kvmppc_get_host_model(char **buf)
return false;
}
-static inline bool kvmppc_get_host_serial(char **buf)
-{
- return false;
-}
-
static inline uint64_t kvmppc_get_clockfreq(void)
{
return 0;
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index cd60893a17d..cb61e99f9d4 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -1864,12 +1864,6 @@ uint32_t kvmppc_get_tbfreq(void)
return cached_tbfreq;
}
-bool kvmppc_get_host_serial(char **value)
-{
- return g_file_get_contents("/proc/device-tree/system-id", value, NULL,
- NULL);
-}
-
bool kvmppc_get_host_model(char **value)
{
return g_file_get_contents("/proc/device-tree/model", value, NULL, NULL);
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 08/18] target/ppc/kvm: Remove kvmppc_get_host_model() as unused
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2025-10-20 10:38 ` [PATCH 07/18] target/ppc/kvm: Remove kvmppc_get_host_serial() as unused Philippe Mathieu-Daudé
@ 2025-10-20 10:38 ` Philippe Mathieu-Daudé
2025-10-20 10:38 ` [PATCH 09/18] hw/ppc/spapr: Remove SpaprMachineClass::dr_phb_enabled field Philippe Mathieu-Daudé
` (10 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/ppc/kvm_ppc.h | 6 ------
target/ppc/kvm.c | 5 -----
2 files changed, 11 deletions(-)
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
index f24cc4de3c2..742881231e1 100644
--- a/target/ppc/kvm_ppc.h
+++ b/target/ppc/kvm_ppc.h
@@ -21,7 +21,6 @@
uint32_t kvmppc_get_tbfreq(void);
uint64_t kvmppc_get_clockfreq(void);
-bool kvmppc_get_host_model(char **buf);
int kvmppc_get_hasidle(CPUPPCState *env);
int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len);
int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int level);
@@ -128,11 +127,6 @@ static inline uint32_t kvmppc_get_tbfreq(void)
return 0;
}
-static inline bool kvmppc_get_host_model(char **buf)
-{
- return false;
-}
-
static inline uint64_t kvmppc_get_clockfreq(void)
{
return 0;
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index cb61e99f9d4..43124bf1c78 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -1864,11 +1864,6 @@ uint32_t kvmppc_get_tbfreq(void)
return cached_tbfreq;
}
-bool kvmppc_get_host_model(char **value)
-{
- return g_file_get_contents("/proc/device-tree/model", value, NULL, NULL);
-}
-
/* Try to find a device tree node for a CPU with clock-frequency property */
static int kvmppc_find_cpu_dt(char *buf, int buf_len)
{
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 09/18] hw/ppc/spapr: Remove SpaprMachineClass::dr_phb_enabled field
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2025-10-20 10:38 ` [PATCH 08/18] target/ppc/kvm: Remove kvmppc_get_host_model() " Philippe Mathieu-Daudé
@ 2025-10-20 10:38 ` Philippe Mathieu-Daudé
2025-10-20 10:38 ` [PATCH 10/18] hw/ppc/spapr: Remove SpaprMachineClass::update_dt_enabled field Philippe Mathieu-Daudé
` (9 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
The SpaprMachineClass::dr_phb_enabled field was only used by the
pseries-3.1 machine, which got removed. Remove it as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr.h | 1 -
hw/ppc/spapr.c | 28 +++-------------------------
2 files changed, 3 insertions(+), 26 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 06e2ad8ffe6..bc75e29084b 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -143,7 +143,6 @@ struct SpaprMachineClass {
MachineClass parent_class;
/*< public >*/
- bool dr_phb_enabled; /* enable dynamic-reconfig/hotplug of PHBs */
bool update_dt_enabled; /* enable KVMPPC_H_UPDATE_DT */
bool pre_4_1_migration; /* don't migrate hpt-max-page-size */
bool linux_pci_probe;
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index e06eefa3233..b81eb7ffe73 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1182,7 +1182,6 @@ void *spapr_build_fdt(SpaprMachineState *spapr, bool reset, size_t space)
{
MachineState *machine = MACHINE(spapr);
MachineClass *mc = MACHINE_GET_CLASS(machine);
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine);
uint32_t root_drc_type_mask = 0;
int ret;
void *fdt;
@@ -1254,9 +1253,7 @@ void *spapr_build_fdt(SpaprMachineState *spapr, bool reset, size_t space)
/* ibm,drc-indexes and friends */
root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_LMB;
- if (smc->dr_phb_enabled) {
- root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_PHB;
- }
+ root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_PHB;
if (mc->nvdimm_supported) {
root_drc_type_mask |= SPAPR_DR_CONNECTOR_TYPE_PMEM;
}
@@ -3003,10 +3000,8 @@ static void spapr_machine_init(MachineState *machine)
* connectors for a PHBs PCI slots) are added as needed during their
* parent's realization.
*/
- if (smc->dr_phb_enabled) {
- for (i = 0; i < SPAPR_MAX_PHBS; i++) {
- spapr_dr_connector_new(OBJECT(machine), TYPE_SPAPR_DRC_PHB, i);
- }
+ for (i = 0; i < SPAPR_MAX_PHBS; i++) {
+ spapr_dr_connector_new(OBJECT(machine), TYPE_SPAPR_DRC_PHB, i);
}
/* Set up PCI */
@@ -4089,11 +4084,6 @@ static bool spapr_phb_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
const unsigned windows_supported = spapr_phb_windows_supported(sphb);
SpaprDrc *drc;
- if (dev->hotplugged && !smc->dr_phb_enabled) {
- error_setg(errp, "PHB hotplug not supported for this machine");
- return false;
- }
-
if (sphb->index == (uint32_t)-1) {
error_setg(errp, "\"index\" for PAPR PHB is mandatory");
return false;
@@ -4119,16 +4109,10 @@ static bool spapr_phb_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
static void spapr_phb_plug(HotplugHandler *hotplug_dev, DeviceState *dev)
{
- SpaprMachineState *spapr = SPAPR_MACHINE(OBJECT(hotplug_dev));
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
SpaprPhbState *sphb = SPAPR_PCI_HOST_BRIDGE(dev);
SpaprDrc *drc;
bool hotplugged = spapr_drc_hotplugged(dev);
- if (!smc->dr_phb_enabled) {
- return;
- }
-
drc = spapr_drc_by_id(TYPE_SPAPR_DRC_PHB, sphb->index);
/* hotplug hooks should check it's enabled before getting this far */
assert(drc);
@@ -4254,7 +4238,6 @@ static void spapr_machine_device_unplug_request(HotplugHandler *hotplug_dev,
{
SpaprMachineState *sms = SPAPR_MACHINE(OBJECT(hotplug_dev));
MachineClass *mc = MACHINE_GET_CLASS(sms);
- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {
if (spapr_memory_hot_unplug_supported(sms)) {
@@ -4269,10 +4252,6 @@ static void spapr_machine_device_unplug_request(HotplugHandler *hotplug_dev,
}
spapr_core_unplug_request(hotplug_dev, dev, errp);
} else if (object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_PCI_HOST_BRIDGE)) {
- if (!smc->dr_phb_enabled) {
- error_setg(errp, "PHB hot unplug not supported on this machine");
- return;
- }
spapr_phb_unplug_request(hotplug_dev, dev, errp);
} else if (object_dynamic_cast(OBJECT(dev), TYPE_SPAPR_TPM_PROXY)) {
spapr_tpm_proxy_unplug(hotplug_dev, dev);
@@ -4682,7 +4661,6 @@ static void spapr_machine_class_init(ObjectClass *oc, const void *data)
smc->default_caps.caps[SPAPR_CAP_AIL_MODE_3] = SPAPR_CAP_ON;
spapr_caps_add_properties(smc);
smc->irq = &spapr_irq_dual;
- smc->dr_phb_enabled = true;
smc->linux_pci_probe = true;
smc->smp_threads_vsmt = true;
xfc->match_nvt = spapr_match_nvt;
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 10/18] hw/ppc/spapr: Remove SpaprMachineClass::update_dt_enabled field
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2025-10-20 10:38 ` [PATCH 09/18] hw/ppc/spapr: Remove SpaprMachineClass::dr_phb_enabled field Philippe Mathieu-Daudé
@ 2025-10-20 10:38 ` Philippe Mathieu-Daudé
2025-10-20 10:38 ` [PATCH 11/18] hw/ppc/spapr: Remove deprecated pseries-4.0 machine Philippe Mathieu-Daudé
` (8 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
The SpaprMachineClass::update_dt_enabled field was only used by the
pseries-3.1 machine, which got removed. Remove it as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr.h | 1 -
hw/ppc/spapr.c | 9 ---------
hw/ppc/spapr_hcall.c | 5 -----
3 files changed, 15 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index bc75e29084b..1db67784de8 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -143,7 +143,6 @@ struct SpaprMachineClass {
MachineClass parent_class;
/*< public >*/
- bool update_dt_enabled; /* enable KVMPPC_H_UPDATE_DT */
bool pre_4_1_migration; /* don't migrate hpt-max-page-size */
bool linux_pci_probe;
bool smp_threads_vsmt; /* set VSMT to smp_threads by default */
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index b81eb7ffe73..feb1e78b7c0 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2052,13 +2052,6 @@ static const VMStateDescription vmstate_spapr_irq_map = {
},
};
-static bool spapr_dtb_needed(void *opaque)
-{
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(opaque);
-
- return smc->update_dt_enabled;
-}
-
static int spapr_dtb_pre_load(void *opaque)
{
SpaprMachineState *spapr = (SpaprMachineState *)opaque;
@@ -2074,7 +2067,6 @@ static const VMStateDescription vmstate_spapr_dtb = {
.name = "spapr_dtb",
.version_id = 1,
.minimum_version_id = 1,
- .needed = spapr_dtb_needed,
.pre_load = spapr_dtb_pre_load,
.fields = (const VMStateField[]) {
VMSTATE_UINT32(fdt_initial_size, SpaprMachineState),
@@ -4607,7 +4599,6 @@ static void spapr_machine_class_init(ObjectClass *oc, const void *data)
hc->unplug_request = spapr_machine_device_unplug_request;
hc->unplug = spapr_machine_device_unplug;
- smc->update_dt_enabled = true;
mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power10_v2.0");
mc->has_hotpluggable_cpus = true;
mc->nvdimm_supported = true;
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 8c1e0a4817b..8f03b3e7764 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -1475,16 +1475,11 @@ static target_ulong h_update_dt(PowerPCCPU *cpu, SpaprMachineState *spapr,
target_ulong dt = ppc64_phys_to_real(args[0]);
struct fdt_header hdr = { 0 };
unsigned cb;
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
void *fdt;
cpu_physical_memory_read(dt, &hdr, sizeof(hdr));
cb = fdt32_to_cpu(hdr.totalsize);
- if (!smc->update_dt_enabled) {
- return H_SUCCESS;
- }
-
/* Check that the fdt did not grow out of proportion */
if (cb > spapr->fdt_initial_size * 2) {
trace_spapr_update_dt_failed_size(spapr->fdt_initial_size, cb,
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 11/18] hw/ppc/spapr: Remove deprecated pseries-4.0 machine
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2025-10-20 10:38 ` [PATCH 10/18] hw/ppc/spapr: Remove SpaprMachineClass::update_dt_enabled field Philippe Mathieu-Daudé
@ 2025-10-20 10:38 ` Philippe Mathieu-Daudé
2025-10-20 10:38 ` [PATCH 12/18] hw/ppc/spapr: Remove SpaprMachineClass::pre_4_1_migration field Philippe Mathieu-Daudé
` (7 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
This machine has been supported for a period of more than 6 years.
According to our versioned machine support policy (see commit
ce80c4fa6ff "docs: document special exception for machine type
deprecation & removal") it can now be removed.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ppc/spapr.c | 27 ---------------------------
1 file changed, 27 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index feb1e78b7c0..e861a2e7466 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4968,33 +4968,6 @@ static void spapr_machine_4_1_class_options(MachineClass *mc)
DEFINE_SPAPR_MACHINE(4, 1);
-/*
- * pseries-4.0
- */
-static bool phb_placement_4_0(SpaprMachineState *spapr, uint32_t index,
- uint64_t *buid, hwaddr *pio,
- hwaddr *mmio32, hwaddr *mmio64,
- unsigned n_dma, uint32_t *liobns, Error **errp)
-{
- if (!spapr_phb_placement(spapr, index, buid, pio, mmio32, mmio64, n_dma,
- liobns, errp)) {
- return false;
- }
- return true;
-}
-static void spapr_machine_4_0_class_options(MachineClass *mc)
-{
- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
- spapr_machine_4_1_class_options(mc);
- compat_props_add(mc->compat_props, hw_compat_4_0, hw_compat_4_0_len);
- smc->phb_placement = phb_placement_4_0;
- smc->irq = &spapr_irq_xics;
- smc->pre_4_1_migration = true;
-}
-
-DEFINE_SPAPR_MACHINE(4, 0);
-
static void spapr_machine_register_types(void)
{
type_register_static(&spapr_machine_info);
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 12/18] hw/ppc/spapr: Remove SpaprMachineClass::pre_4_1_migration field
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (10 preceding siblings ...)
2025-10-20 10:38 ` [PATCH 11/18] hw/ppc/spapr: Remove deprecated pseries-4.0 machine Philippe Mathieu-Daudé
@ 2025-10-20 10:38 ` Philippe Mathieu-Daudé
2025-10-20 10:38 ` [PATCH 13/18] hw/ppc/spapr: Remove SpaprMachineClass::phb_placement callback Philippe Mathieu-Daudé
` (6 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
The SpaprMachineClass::pre_4_1_migration field was only used by the
pseries-4.0 machine, which got removed. Remove it as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr.h | 1 -
hw/ppc/spapr_caps.c | 6 ------
2 files changed, 7 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 1db67784de8..4c1acd7af5e 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -143,7 +143,6 @@ struct SpaprMachineClass {
MachineClass parent_class;
/*< public >*/
- bool pre_4_1_migration; /* don't migrate hpt-max-page-size */
bool linux_pci_probe;
bool smp_threads_vsmt; /* set VSMT to smp_threads by default */
hwaddr rma_limit; /* clamp the RMA to this size */
diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c
index 0f94c192fd4..f3620b1d9bd 100644
--- a/hw/ppc/spapr_caps.c
+++ b/hw/ppc/spapr_caps.c
@@ -336,11 +336,6 @@ static void cap_hpt_maxpagesize_apply(SpaprMachineState *spapr,
spapr_check_pagesize(spapr, qemu_minrampagesize(), errp);
}
-static bool cap_hpt_maxpagesize_migrate_needed(void *opaque)
-{
- return !SPAPR_MACHINE_GET_CLASS(opaque)->pre_4_1_migration;
-}
-
static bool spapr_pagesize_cb(void *opaque, uint32_t seg_pshift,
uint32_t pshift)
{
@@ -793,7 +788,6 @@ SpaprCapabilityInfo capability_table[SPAPR_CAP_NUM] = {
.type = "int",
.apply = cap_hpt_maxpagesize_apply,
.cpu_apply = cap_hpt_maxpagesize_cpu_apply,
- .migrate_needed = cap_hpt_maxpagesize_migrate_needed,
},
[SPAPR_CAP_NESTED_KVM_HV] = {
.name = "nested-hv",
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 13/18] hw/ppc/spapr: Remove SpaprMachineClass::phb_placement callback
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (11 preceding siblings ...)
2025-10-20 10:38 ` [PATCH 12/18] hw/ppc/spapr: Remove SpaprMachineClass::pre_4_1_migration field Philippe Mathieu-Daudé
@ 2025-10-20 10:38 ` Philippe Mathieu-Daudé
2025-10-20 11:35 ` [PATCH 14/18] hw/ppc/spapr: Remove deprecated pseries-4.1 machine Philippe Mathieu-Daudé
` (5 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 10:38 UTC (permalink / raw)
To: qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath,
Harsh Prateek Bora, Philippe Mathieu-Daudé
The SpaprMachineClass::phb_placement callback was only used by
the pseries-4.0 machine, which got removed. Remove it as now
unused, directly calling spapr_phb_placement().
Move spapr_phb_placement() definition to avoid forward declaration.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr.h | 5 --
hw/ppc/spapr.c | 114 ++++++++++++++++++++---------------------
2 files changed, 55 insertions(+), 64 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 4c1acd7af5e..82f556f97e1 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -149,11 +149,6 @@ struct SpaprMachineClass {
bool pre_5_1_assoc_refpoints;
bool pre_5_2_numa_associativity;
bool pre_6_2_numa_affinity;
-
- bool (*phb_placement)(SpaprMachineState *spapr, uint32_t index,
- uint64_t *buid, hwaddr *pio,
- hwaddr *mmio32, hwaddr *mmio64,
- unsigned n_dma, uint32_t *liobns, Error **errp);
SpaprResizeHpt resize_hpt_default;
SpaprCapabilities default_caps;
SpaprIrq *irq;
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index e861a2e7466..200e68b8bc2 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4067,12 +4067,62 @@ int spapr_phb_dt_populate(SpaprDrc *drc, SpaprMachineState *spapr,
return 0;
}
+static bool spapr_phb_placement(SpaprMachineState *spapr, uint32_t index,
+ uint64_t *buid, hwaddr *pio,
+ hwaddr *mmio32, hwaddr *mmio64,
+ unsigned n_dma, uint32_t *liobns, Error **errp)
+{
+ /*
+ * New-style PHB window placement.
+ *
+ * Goals: Gives large (1TiB), naturally aligned 64-bit MMIO window
+ * for each PHB, in addition to 2GiB 32-bit MMIO and 64kiB PIO
+ * windows.
+ *
+ * Some guest kernels can't work with MMIO windows above 1<<46
+ * (64TiB), so we place up to 31 PHBs in the area 32TiB..64TiB
+ *
+ * 32TiB..(33TiB+1984kiB) contains the 64kiB PIO windows for each
+ * PHB stacked together. (32TiB+2GiB)..(32TiB+64GiB) contains the
+ * 2GiB 32-bit MMIO windows for each PHB. Then 33..64TiB has the
+ * 1TiB 64-bit MMIO windows for each PHB.
+ */
+ const uint64_t base_buid = 0x800000020000000ULL;
+ int i;
+
+ /* Sanity check natural alignments */
+ QEMU_BUILD_BUG_ON((SPAPR_PCI_BASE % SPAPR_PCI_MEM64_WIN_SIZE) != 0);
+ QEMU_BUILD_BUG_ON((SPAPR_PCI_LIMIT % SPAPR_PCI_MEM64_WIN_SIZE) != 0);
+ QEMU_BUILD_BUG_ON((SPAPR_PCI_MEM64_WIN_SIZE % SPAPR_PCI_MEM32_WIN_SIZE) != 0);
+ QEMU_BUILD_BUG_ON((SPAPR_PCI_MEM32_WIN_SIZE % SPAPR_PCI_IO_WIN_SIZE) != 0);
+ /* Sanity check bounds */
+ QEMU_BUILD_BUG_ON((SPAPR_MAX_PHBS * SPAPR_PCI_IO_WIN_SIZE) >
+ SPAPR_PCI_MEM32_WIN_SIZE);
+ QEMU_BUILD_BUG_ON((SPAPR_MAX_PHBS * SPAPR_PCI_MEM32_WIN_SIZE) >
+ SPAPR_PCI_MEM64_WIN_SIZE);
+
+ if (index >= SPAPR_MAX_PHBS) {
+ error_setg(errp, "\"index\" for PAPR PHB is too large (max %llu)",
+ SPAPR_MAX_PHBS - 1);
+ return false;
+ }
+
+ *buid = base_buid + index;
+ for (i = 0; i < n_dma; ++i) {
+ liobns[i] = SPAPR_PCI_LIOBN(index, i);
+ }
+
+ *pio = SPAPR_PCI_BASE + index * SPAPR_PCI_IO_WIN_SIZE;
+ *mmio32 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM32_WIN_SIZE;
+ *mmio64 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM64_WIN_SIZE;
+ return true;
+}
+
static bool spapr_phb_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
Error **errp)
{
SpaprMachineState *spapr = SPAPR_MACHINE(OBJECT(hotplug_dev));
SpaprPhbState *sphb = SPAPR_PCI_HOST_BRIDGE(dev);
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
const unsigned windows_supported = spapr_phb_windows_supported(sphb);
SpaprDrc *drc;
@@ -4091,12 +4141,10 @@ static bool spapr_phb_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
* This will check that sphb->index doesn't exceed the maximum number of
* PHBs for the current machine type.
*/
- return
- smc->phb_placement(spapr, sphb->index,
- &sphb->buid, &sphb->io_win_addr,
- &sphb->mem_win_addr, &sphb->mem64_win_addr,
- windows_supported, sphb->dma_liobn,
- errp);
+ return spapr_phb_placement(spapr, sphb->index,
+ &sphb->buid, &sphb->io_win_addr,
+ &sphb->mem_win_addr, &sphb->mem64_win_addr,
+ windows_supported, sphb->dma_liobn, errp);
}
static void spapr_phb_plug(HotplugHandler *hotplug_dev, DeviceState *dev)
@@ -4344,57 +4392,6 @@ static const CPUArchIdList *spapr_possible_cpu_arch_ids(MachineState *machine)
return machine->possible_cpus;
}
-static bool spapr_phb_placement(SpaprMachineState *spapr, uint32_t index,
- uint64_t *buid, hwaddr *pio,
- hwaddr *mmio32, hwaddr *mmio64,
- unsigned n_dma, uint32_t *liobns, Error **errp)
-{
- /*
- * New-style PHB window placement.
- *
- * Goals: Gives large (1TiB), naturally aligned 64-bit MMIO window
- * for each PHB, in addition to 2GiB 32-bit MMIO and 64kiB PIO
- * windows.
- *
- * Some guest kernels can't work with MMIO windows above 1<<46
- * (64TiB), so we place up to 31 PHBs in the area 32TiB..64TiB
- *
- * 32TiB..(33TiB+1984kiB) contains the 64kiB PIO windows for each
- * PHB stacked together. (32TiB+2GiB)..(32TiB+64GiB) contains the
- * 2GiB 32-bit MMIO windows for each PHB. Then 33..64TiB has the
- * 1TiB 64-bit MMIO windows for each PHB.
- */
- const uint64_t base_buid = 0x800000020000000ULL;
- int i;
-
- /* Sanity check natural alignments */
- QEMU_BUILD_BUG_ON((SPAPR_PCI_BASE % SPAPR_PCI_MEM64_WIN_SIZE) != 0);
- QEMU_BUILD_BUG_ON((SPAPR_PCI_LIMIT % SPAPR_PCI_MEM64_WIN_SIZE) != 0);
- QEMU_BUILD_BUG_ON((SPAPR_PCI_MEM64_WIN_SIZE % SPAPR_PCI_MEM32_WIN_SIZE) != 0);
- QEMU_BUILD_BUG_ON((SPAPR_PCI_MEM32_WIN_SIZE % SPAPR_PCI_IO_WIN_SIZE) != 0);
- /* Sanity check bounds */
- QEMU_BUILD_BUG_ON((SPAPR_MAX_PHBS * SPAPR_PCI_IO_WIN_SIZE) >
- SPAPR_PCI_MEM32_WIN_SIZE);
- QEMU_BUILD_BUG_ON((SPAPR_MAX_PHBS * SPAPR_PCI_MEM32_WIN_SIZE) >
- SPAPR_PCI_MEM64_WIN_SIZE);
-
- if (index >= SPAPR_MAX_PHBS) {
- error_setg(errp, "\"index\" for PAPR PHB is too large (max %llu)",
- SPAPR_MAX_PHBS - 1);
- return false;
- }
-
- *buid = base_buid + index;
- for (i = 0; i < n_dma; ++i) {
- liobns[i] = SPAPR_PCI_LIOBN(index, i);
- }
-
- *pio = SPAPR_PCI_BASE + index * SPAPR_PCI_IO_WIN_SIZE;
- *mmio32 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM32_WIN_SIZE;
- *mmio64 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM64_WIN_SIZE;
- return true;
-}
-
static ICSState *spapr_ics_get(XICSFabric *dev, int irq)
{
SpaprMachineState *spapr = SPAPR_MACHINE(dev);
@@ -4605,7 +4602,6 @@ static void spapr_machine_class_init(ObjectClass *oc, const void *data)
smc->resize_hpt_default = SPAPR_RESIZE_HPT_ENABLED;
fwc->get_dev_path = spapr_get_fw_dev_path;
nc->nmi_monitor_handler = spapr_nmi;
- smc->phb_placement = spapr_phb_placement;
vhc->cpu_in_nested = spapr_cpu_in_nested;
vhc->deliver_hv_excp = spapr_exit_nested;
vhc->hypercall = emulate_spapr_hypercall;
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 14/18] hw/ppc/spapr: Remove deprecated pseries-4.1 machine
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (12 preceding siblings ...)
2025-10-20 10:38 ` [PATCH 13/18] hw/ppc/spapr: Remove SpaprMachineClass::phb_placement callback Philippe Mathieu-Daudé
@ 2025-10-20 11:35 ` Philippe Mathieu-Daudé
2025-10-20 11:35 ` [PATCH 15/18] hw/ppc/spapr: Remove SpaprMachineClass::smp_threads_vsmt field Philippe Mathieu-Daudé
` (4 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 11:35 UTC (permalink / raw)
To: qemu-devel
Cc: Chinmay Rath, Harsh Prateek Bora, qemu-ppc, Paolo Bonzini, kvm,
Nicholas Piggin, Philippe Mathieu-Daudé
This machine has been supported for a period of more than 6 years.
According to our versioned machine support policy (see commit
ce80c4fa6ff "docs: document special exception for machine type
deprecation & removal") it can now be removed.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ppc/spapr.c | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 200e68b8bc2..546e100c9cd 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4944,26 +4944,6 @@ static void spapr_machine_4_2_class_options(MachineClass *mc)
DEFINE_SPAPR_MACHINE(4, 2);
-/*
- * pseries-4.1
- */
-static void spapr_machine_4_1_class_options(MachineClass *mc)
-{
- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
- static GlobalProperty compat[] = {
- /* Only allow 4kiB and 64kiB IOMMU pagesizes */
- { TYPE_SPAPR_PCI_HOST_BRIDGE, "pgsz", "0x11000" },
- };
-
- spapr_machine_4_2_class_options(mc);
- smc->linux_pci_probe = false;
- smc->smp_threads_vsmt = false;
- compat_props_add(mc->compat_props, hw_compat_4_1, hw_compat_4_1_len);
- compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat));
-}
-
-DEFINE_SPAPR_MACHINE(4, 1);
-
static void spapr_machine_register_types(void)
{
type_register_static(&spapr_machine_info);
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 15/18] hw/ppc/spapr: Remove SpaprMachineClass::smp_threads_vsmt field
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (13 preceding siblings ...)
2025-10-20 11:35 ` [PATCH 14/18] hw/ppc/spapr: Remove deprecated pseries-4.1 machine Philippe Mathieu-Daudé
@ 2025-10-20 11:35 ` Philippe Mathieu-Daudé
2025-10-20 11:35 ` [PATCH 16/18] hw/ppc/spapr: Remove SpaprMachineClass::linux_pci_probe field Philippe Mathieu-Daudé
` (3 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 11:35 UTC (permalink / raw)
To: qemu-devel
Cc: Chinmay Rath, Harsh Prateek Bora, qemu-ppc, Paolo Bonzini, kvm,
Nicholas Piggin, Philippe Mathieu-Daudé
The SpaprMachineClass::smp_threads_vsmt field was only used by the
pseries-4.1 machine, which got removed. Remove it as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr.h | 1 -
hw/ppc/spapr.c | 11 -----------
2 files changed, 12 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 82f556f97e1..1629baf12ac 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -144,7 +144,6 @@ struct SpaprMachineClass {
/*< public >*/
bool linux_pci_probe;
- bool smp_threads_vsmt; /* set VSMT to smp_threads by default */
hwaddr rma_limit; /* clamp the RMA to this size */
bool pre_5_1_assoc_refpoints;
bool pre_5_2_numa_associativity;
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 546e100c9cd..c8558e47db2 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2588,7 +2588,6 @@ static CPUArchId *spapr_find_cpu_slot(MachineState *ms, uint32_t id, int *idx)
static void spapr_set_vsmt_mode(SpaprMachineState *spapr, Error **errp)
{
MachineState *ms = MACHINE(spapr);
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
Error *local_err = NULL;
bool vsmt_user = !!spapr->vsmt;
int kvm_smt = kvmppc_smt_threads();
@@ -2624,15 +2623,6 @@ static void spapr_set_vsmt_mode(SpaprMachineState *spapr, Error **errp)
return;
}
/* In this case, spapr->vsmt has been set by the command line */
- } else if (!smc->smp_threads_vsmt) {
- /*
- * Default VSMT value is tricky, because we need it to be as
- * consistent as possible (for migration), but this requires
- * changing it for at least some existing cases. We pick 8 as
- * the value that we'd get with KVM on POWER8, the
- * overwhelmingly common case in production systems.
- */
- spapr->vsmt = MAX(8, smp_threads);
} else {
spapr->vsmt = smp_threads;
}
@@ -4649,7 +4639,6 @@ static void spapr_machine_class_init(ObjectClass *oc, const void *data)
spapr_caps_add_properties(smc);
smc->irq = &spapr_irq_dual;
smc->linux_pci_probe = true;
- smc->smp_threads_vsmt = true;
xfc->match_nvt = spapr_match_nvt;
vmc->client_architecture_support = spapr_vof_client_architecture_support;
vmc->quiesce = spapr_vof_quiesce;
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 16/18] hw/ppc/spapr: Remove SpaprMachineClass::linux_pci_probe field
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (14 preceding siblings ...)
2025-10-20 11:35 ` [PATCH 15/18] hw/ppc/spapr: Remove SpaprMachineClass::smp_threads_vsmt field Philippe Mathieu-Daudé
@ 2025-10-20 11:35 ` Philippe Mathieu-Daudé
2025-10-20 11:35 ` [PATCH 17/18] hw/ppc/spapr: Remove deprecated pseries-4.2 machine Philippe Mathieu-Daudé
` (2 subsequent siblings)
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 11:35 UTC (permalink / raw)
To: qemu-devel
Cc: Chinmay Rath, Harsh Prateek Bora, qemu-ppc, Paolo Bonzini, kvm,
Nicholas Piggin, Philippe Mathieu-Daudé
The SpaprMachineClass::linux_pci_probe field was only used by the
pseries-4.1 machine, which got removed. Remove it as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr.h | 3 ---
hw/ppc/spapr.c | 6 +-----
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 1629baf12ac..60d9a8a0377 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -139,11 +139,8 @@ struct SpaprCapabilities {
* SpaprMachineClass:
*/
struct SpaprMachineClass {
- /*< private >*/
MachineClass parent_class;
- /*< public >*/
- bool linux_pci_probe;
hwaddr rma_limit; /* clamp the RMA to this size */
bool pre_5_1_assoc_refpoints;
bool pre_5_2_numa_associativity;
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index c8558e47db2..30ffcbf3d2b 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1072,7 +1072,6 @@ static void spapr_dt_ov5_platform_support(SpaprMachineState *spapr, void *fdt,
static void spapr_dt_chosen(SpaprMachineState *spapr, void *fdt, bool reset)
{
MachineState *machine = MACHINE(spapr);
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine);
int chosen;
_FDT(chosen = fdt_add_subnode(fdt, 0, "chosen"));
@@ -1143,9 +1142,7 @@ static void spapr_dt_chosen(SpaprMachineState *spapr, void *fdt, bool reset)
* We can deal with BAR reallocation just fine, advertise it
* to the guest
*/
- if (smc->linux_pci_probe) {
- _FDT(fdt_setprop_cell(fdt, chosen, "linux,pci-probe-only", 0));
- }
+ _FDT(fdt_setprop_cell(fdt, chosen, "linux,pci-probe-only", 0));
spapr_dt_ov5_platform_support(spapr, fdt, chosen);
}
@@ -4638,7 +4635,6 @@ static void spapr_machine_class_init(ObjectClass *oc, const void *data)
smc->default_caps.caps[SPAPR_CAP_AIL_MODE_3] = SPAPR_CAP_ON;
spapr_caps_add_properties(smc);
smc->irq = &spapr_irq_dual;
- smc->linux_pci_probe = true;
xfc->match_nvt = spapr_match_nvt;
vmc->client_architecture_support = spapr_vof_client_architecture_support;
vmc->quiesce = spapr_vof_quiesce;
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 17/18] hw/ppc/spapr: Remove deprecated pseries-4.2 machine
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (15 preceding siblings ...)
2025-10-20 11:35 ` [PATCH 16/18] hw/ppc/spapr: Remove SpaprMachineClass::linux_pci_probe field Philippe Mathieu-Daudé
@ 2025-10-20 11:35 ` Philippe Mathieu-Daudé
2025-10-20 11:35 ` [PATCH 18/18] hw/ppc/spapr: Remove SpaprMachineClass::rma_limit field Philippe Mathieu-Daudé
2025-10-21 4:54 ` [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Harsh Prateek Bora
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 11:35 UTC (permalink / raw)
To: qemu-devel
Cc: Chinmay Rath, Harsh Prateek Bora, qemu-ppc, Paolo Bonzini, kvm,
Nicholas Piggin, Philippe Mathieu-Daudé
This machine has been supported for a period of more than 6 years.
According to our versioned machine support policy (see commit
ce80c4fa6ff "docs: document special exception for machine type
deprecation & removal") it can now be removed.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/ppc/spapr.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 30ffcbf3d2b..97211bc2ddc 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4912,23 +4912,6 @@ static void spapr_machine_5_0_class_options(MachineClass *mc)
DEFINE_SPAPR_MACHINE(5, 0);
-/*
- * pseries-4.2
- */
-static void spapr_machine_4_2_class_options(MachineClass *mc)
-{
- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
-
- spapr_machine_5_0_class_options(mc);
- compat_props_add(mc->compat_props, hw_compat_4_2, hw_compat_4_2_len);
- smc->default_caps.caps[SPAPR_CAP_CCF_ASSIST] = SPAPR_CAP_OFF;
- smc->default_caps.caps[SPAPR_CAP_FWNMI] = SPAPR_CAP_OFF;
- smc->rma_limit = 16 * GiB;
- mc->nvdimm_supported = false;
-}
-
-DEFINE_SPAPR_MACHINE(4, 2);
-
static void spapr_machine_register_types(void)
{
type_register_static(&spapr_machine_info);
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* [PATCH 18/18] hw/ppc/spapr: Remove SpaprMachineClass::rma_limit field
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (16 preceding siblings ...)
2025-10-20 11:35 ` [PATCH 17/18] hw/ppc/spapr: Remove deprecated pseries-4.2 machine Philippe Mathieu-Daudé
@ 2025-10-20 11:35 ` Philippe Mathieu-Daudé
2025-10-21 4:54 ` [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Harsh Prateek Bora
18 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-20 11:35 UTC (permalink / raw)
To: qemu-devel
Cc: Chinmay Rath, Harsh Prateek Bora, qemu-ppc, Paolo Bonzini, kvm,
Nicholas Piggin, Philippe Mathieu-Daudé
The SpaprMachineClass::rma_limit field was only used by the
pseries-4.2 machine, which got removed. Remove it as now unused.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/ppc/spapr.h | 1 -
hw/ppc/spapr.c | 10 ----------
2 files changed, 11 deletions(-)
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index 60d9a8a0377..b9d884745fe 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -141,7 +141,6 @@ struct SpaprCapabilities {
struct SpaprMachineClass {
MachineClass parent_class;
- hwaddr rma_limit; /* clamp the RMA to this size */
bool pre_5_1_assoc_refpoints;
bool pre_5_2_numa_associativity;
bool pre_6_2_numa_affinity;
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 97211bc2ddc..52333250c68 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2728,7 +2728,6 @@ static PCIHostState *spapr_create_default_phb(void)
static hwaddr spapr_rma_size(SpaprMachineState *spapr, Error **errp)
{
MachineState *machine = MACHINE(spapr);
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
hwaddr rma_size = machine->ram_size;
hwaddr node0_size = spapr_node0_size(machine);
@@ -2741,15 +2740,6 @@ static hwaddr spapr_rma_size(SpaprMachineState *spapr, Error **errp)
*/
rma_size = MIN(rma_size, 1 * TiB);
- /*
- * Clamp the RMA size based on machine type. This is for
- * migration compatibility with older qemu versions, which limited
- * the RMA size for complicated and mostly bad reasons.
- */
- if (smc->rma_limit) {
- rma_size = MIN(rma_size, smc->rma_limit);
- }
-
if (rma_size < MIN_RMA_SLOF) {
error_setg(errp,
"pSeries SLOF firmware requires >= %" HWADDR_PRIx
--
2.51.0
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines
2025-10-20 10:37 [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Philippe Mathieu-Daudé
` (17 preceding siblings ...)
2025-10-20 11:35 ` [PATCH 18/18] hw/ppc/spapr: Remove SpaprMachineClass::rma_limit field Philippe Mathieu-Daudé
@ 2025-10-21 4:54 ` Harsh Prateek Bora
2025-10-21 6:31 ` Cédric Le Goater
18 siblings, 1 reply; 24+ messages in thread
From: Harsh Prateek Bora @ 2025-10-21 4:54 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, qemu-devel, Cédric Le Goater
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath
+Cedric
Hi Phillipe,
It had been done and the patches were reviewed already here (you were in
CC too):
https://lore.kernel.org/qemu-devel/20251009184057.19973-1-harshpb@linux.ibm.com/
Let us try to avoid duplication of implementation/review efforts.
If the motivation to re-do is just to split, I think let us consider the
original series to avoid duplication of review efforts. I should
probably send more frequent PRs to avoid such scenarios in future.
Thanks for your contribution in reviewing other patches though. It's
highly appreciated.
regards,
Harsh
On 10/20/25 16:07, Philippe Mathieu-Daudé wrote:
> Remove the deprecated pseries-3.0 up to pseries-4.2 machines,
> which are older than 6 years. Remove resulting dead code.
>
> Philippe Mathieu-Daudé (18):
> hw/ppc/spapr: Remove deprecated pseries-3.0 machine
> hw/ppc/spapr: Remove SpaprMachineClass::spapr_irq_xics_legacy field
> hw/ppc/spapr: Remove SpaprMachineClass::legacy_irq_allocation field
> hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field
> hw/ppc/spapr: Remove deprecated pseries-3.1 machine
> hw/ppc/spapr: Remove SpaprMachineClass::broken_host_serial_model field
> target/ppc/kvm: Remove kvmppc_get_host_serial() as unused
> target/ppc/kvm: Remove kvmppc_get_host_model() as unused
> hw/ppc/spapr: Remove SpaprMachineClass::dr_phb_enabled field
> hw/ppc/spapr: Remove SpaprMachineClass::update_dt_enabled field
> hw/ppc/spapr: Remove deprecated pseries-4.0 machine
> hw/ppc/spapr: Remove SpaprMachineClass::pre_4_1_migration field
> hw/ppc/spapr: Remove SpaprMachineClass::phb_placement callback
> hw/ppc/spapr: Remove deprecated pseries-4.1 machine
> hw/ppc/spapr: Remove SpaprMachineClass::smp_threads_vsmt field
> hw/ppc/spapr: Remove SpaprMachineClass::linux_pci_probe field
> hw/ppc/spapr: Remove deprecated pseries-4.2 machine
> hw/ppc/spapr: Remove SpaprMachineClass::rma_limit field
>
> include/hw/ppc/spapr.h | 16 --
> include/hw/ppc/spapr_irq.h | 1 -
> target/ppc/kvm_ppc.h | 12 --
> hw/ppc/spapr.c | 298 ++++++++-----------------------------
> hw/ppc/spapr_caps.c | 6 -
> hw/ppc/spapr_events.c | 20 +--
> hw/ppc/spapr_hcall.c | 5 -
> hw/ppc/spapr_irq.c | 36 +----
> hw/ppc/spapr_pci.c | 32 +---
> hw/ppc/spapr_vio.c | 9 --
> target/ppc/kvm.c | 11 --
> 11 files changed, 75 insertions(+), 371 deletions(-)
>
^ permalink raw reply [flat|nested] 24+ messages in thread* Re: [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines
2025-10-21 4:54 ` [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines Harsh Prateek Bora
@ 2025-10-21 6:31 ` Cédric Le Goater
2025-10-21 7:46 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 24+ messages in thread
From: Cédric Le Goater @ 2025-10-21 6:31 UTC (permalink / raw)
To: Harsh Prateek Bora, Philippe Mathieu-Daudé, qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath
Hi
On 10/21/25 06:54, Harsh Prateek Bora wrote:
> +Cedric
>
> Hi Phillipe,
>
> It had been done and the patches were reviewed already here (you were in CC too):
>
> https://lore.kernel.org/qemu-devel/20251009184057.19973-1-harshpb@linux.ibm.com/
I would take the already reviewed patches, as that work is done. This series
is fine, but it is extra effort for removing dead code, which isn't worth
the time.
Thanks,
C.
>
> Let us try to avoid duplication of implementation/review efforts.
> If the motivation to re-do is just to split, I think let us consider the original series to avoid duplication of review efforts. I should probably send more frequent PRs to avoid such scenarios in future.
>
> Thanks for your contribution in reviewing other patches though. It's highly appreciated.
>
> regards,
> Harsh
>
> On 10/20/25 16:07, Philippe Mathieu-Daudé wrote:
>> Remove the deprecated pseries-3.0 up to pseries-4.2 machines,
>> which are older than 6 years. Remove resulting dead code.
>>
>> Philippe Mathieu-Daudé (18):
>> hw/ppc/spapr: Remove deprecated pseries-3.0 machine
>> hw/ppc/spapr: Remove SpaprMachineClass::spapr_irq_xics_legacy field
>> hw/ppc/spapr: Remove SpaprMachineClass::legacy_irq_allocation field
>> hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field
>> hw/ppc/spapr: Remove deprecated pseries-3.1 machine
>> hw/ppc/spapr: Remove SpaprMachineClass::broken_host_serial_model field
>> target/ppc/kvm: Remove kvmppc_get_host_serial() as unused
>> target/ppc/kvm: Remove kvmppc_get_host_model() as unused
>> hw/ppc/spapr: Remove SpaprMachineClass::dr_phb_enabled field
>> hw/ppc/spapr: Remove SpaprMachineClass::update_dt_enabled field
>> hw/ppc/spapr: Remove deprecated pseries-4.0 machine
>> hw/ppc/spapr: Remove SpaprMachineClass::pre_4_1_migration field
>> hw/ppc/spapr: Remove SpaprMachineClass::phb_placement callback
>> hw/ppc/spapr: Remove deprecated pseries-4.1 machine
>> hw/ppc/spapr: Remove SpaprMachineClass::smp_threads_vsmt field
>> hw/ppc/spapr: Remove SpaprMachineClass::linux_pci_probe field
>> hw/ppc/spapr: Remove deprecated pseries-4.2 machine
>> hw/ppc/spapr: Remove SpaprMachineClass::rma_limit field
>>
>> include/hw/ppc/spapr.h | 16 --
>> include/hw/ppc/spapr_irq.h | 1 -
>> target/ppc/kvm_ppc.h | 12 --
>> hw/ppc/spapr.c | 298 ++++++++-----------------------------
>> hw/ppc/spapr_caps.c | 6 -
>> hw/ppc/spapr_events.c | 20 +--
>> hw/ppc/spapr_hcall.c | 5 -
>> hw/ppc/spapr_irq.c | 36 +----
>> hw/ppc/spapr_pci.c | 32 +---
>> hw/ppc/spapr_vio.c | 9 --
>> target/ppc/kvm.c | 11 --
>> 11 files changed, 75 insertions(+), 371 deletions(-)
>>
>
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines
2025-10-21 6:31 ` Cédric Le Goater
@ 2025-10-21 7:46 ` Philippe Mathieu-Daudé
2025-10-21 8:34 ` Harsh Prateek Bora
0 siblings, 1 reply; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-21 7:46 UTC (permalink / raw)
To: Cédric Le Goater, Harsh Prateek Bora, qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath
On 21/10/25 08:31, Cédric Le Goater wrote:
> Hi
>
> On 10/21/25 06:54, Harsh Prateek Bora wrote:
>> +Cedric
>>
>> Hi Phillipe,
>>
>> It had been done and the patches were reviewed already here (you were
>> in CC too):
>>
>> https://lore.kernel.org/qemu-devel/20251009184057.19973-1-
>> harshpb@linux.ibm.com/
>
> I would take the already reviewed patches, as that work is done. This
> series
> is fine, but it is extra effort for removing dead code, which isn't worth
> the time.
My bad for missing a series reviewed 2 weeks ago (and not yet merged).
Please consider cherry-picking the patches doing these cleanups then,
which were missed because "too many things changed in a single patch"
IMHO:
-- >8 --
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index a9cf8677ac8..b9d884745fe 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -139,19 +139,11 @@ struct SpaprCapabilities {
* SpaprMachineClass:
*/
struct SpaprMachineClass {
- /*< private >*/
MachineClass parent_class;
- /*< public >*/
- uint32_t nr_xirqs;
bool pre_5_1_assoc_refpoints;
bool pre_5_2_numa_associativity;
bool pre_6_2_numa_affinity;
-
- bool (*phb_placement)(SpaprMachineState *spapr, uint32_t index,
- uint64_t *buid, hwaddr *pio,
- hwaddr *mmio32, hwaddr *mmio64,
- unsigned n_dma, uint32_t *liobns, Error **errp);
SpaprResizeHpt resize_hpt_default;
SpaprCapabilities default_caps;
SpaprIrq *irq;
diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h
index a1d9ce9f9aa..742881231e1 100644
--- a/target/ppc/kvm_ppc.h
+++ b/target/ppc/kvm_ppc.h
@@ -21,8 +21,6 @@
uint32_t kvmppc_get_tbfreq(void);
uint64_t kvmppc_get_clockfreq(void);
-bool kvmppc_get_host_model(char **buf);
-bool kvmppc_get_host_serial(char **buf);
int kvmppc_get_hasidle(CPUPPCState *env);
int kvmppc_get_hypercall(CPUPPCState *env, uint8_t *buf, int buf_len);
int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int level);
@@ -129,16 +127,6 @@ static inline uint32_t kvmppc_get_tbfreq(void)
return 0;
}
-static inline bool kvmppc_get_host_model(char **buf)
-{
- return false;
-}
-
-static inline bool kvmppc_get_host_serial(char **buf)
-{
- return false;
-}
-
static inline uint64_t kvmppc_get_clockfreq(void)
{
return 0;
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index d704b8ce211..52333250c68 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2050,11 +2049,6 @@ static const VMStateDescription
vmstate_spapr_irq_map = {
},
};
-static bool spapr_dtb_needed(void *opaque)
-{
- return true; /* backward migration compat */
-}
-
static int spapr_dtb_pre_load(void *opaque)
{
SpaprMachineState *spapr = (SpaprMachineState *)opaque;
@@ -2070,7 +2064,6 @@ static const VMStateDescription vmstate_spapr_dtb = {
.name = "spapr_dtb",
.version_id = 1,
.minimum_version_id = 1,
- .needed = spapr_dtb_needed,
.pre_load = spapr_dtb_pre_load,
.fields = (const VMStateField[]) {
VMSTATE_UINT32(fdt_initial_size, SpaprMachineState),
@@ -2976,9 +2969,9 @@ static void spapr_machine_init(MachineState *machine)
* connectors for a PHBs PCI slots) are added as needed during their
* parent's realization.
*/
- for (i = 0; i < SPAPR_MAX_PHBS; i++) {
- spapr_dr_connector_new(OBJECT(machine), TYPE_SPAPR_DRC_PHB, i);
- }
+ for (i = 0; i < SPAPR_MAX_PHBS; i++) {
+ spapr_dr_connector_new(OBJECT(machine), TYPE_SPAPR_DRC_PHB, i);
+ }
/* Set up PCI */
spapr_pci_rtas_init();
@@ -4051,12 +4044,62 @@ int spapr_phb_dt_populate(SpaprDrc *drc,
SpaprMachineState *spapr,
return 0;
}
+static bool spapr_phb_placement(SpaprMachineState *spapr, uint32_t index,
+ uint64_t *buid, hwaddr *pio,
+ hwaddr *mmio32, hwaddr *mmio64,
+ unsigned n_dma, uint32_t *liobns, Error
**errp)
+{
+ /*
+ * New-style PHB window placement.
+ *
+ * Goals: Gives large (1TiB), naturally aligned 64-bit MMIO window
+ * for each PHB, in addition to 2GiB 32-bit MMIO and 64kiB PIO
+ * windows.
+ *
+ * Some guest kernels can't work with MMIO windows above 1<<46
+ * (64TiB), so we place up to 31 PHBs in the area 32TiB..64TiB
+ *
+ * 32TiB..(33TiB+1984kiB) contains the 64kiB PIO windows for each
+ * PHB stacked together. (32TiB+2GiB)..(32TiB+64GiB) contains the
+ * 2GiB 32-bit MMIO windows for each PHB. Then 33..64TiB has the
+ * 1TiB 64-bit MMIO windows for each PHB.
+ */
+ const uint64_t base_buid = 0x800000020000000ULL;
+ int i;
+
+ /* Sanity check natural alignments */
+ QEMU_BUILD_BUG_ON((SPAPR_PCI_BASE % SPAPR_PCI_MEM64_WIN_SIZE) != 0);
+ QEMU_BUILD_BUG_ON((SPAPR_PCI_LIMIT % SPAPR_PCI_MEM64_WIN_SIZE) != 0);
+ QEMU_BUILD_BUG_ON((SPAPR_PCI_MEM64_WIN_SIZE %
SPAPR_PCI_MEM32_WIN_SIZE) != 0);
+ QEMU_BUILD_BUG_ON((SPAPR_PCI_MEM32_WIN_SIZE %
SPAPR_PCI_IO_WIN_SIZE) != 0);
+ /* Sanity check bounds */
+ QEMU_BUILD_BUG_ON((SPAPR_MAX_PHBS * SPAPR_PCI_IO_WIN_SIZE) >
+ SPAPR_PCI_MEM32_WIN_SIZE);
+ QEMU_BUILD_BUG_ON((SPAPR_MAX_PHBS * SPAPR_PCI_MEM32_WIN_SIZE) >
+ SPAPR_PCI_MEM64_WIN_SIZE);
+
+ if (index >= SPAPR_MAX_PHBS) {
+ error_setg(errp, "\"index\" for PAPR PHB is too large (max %llu)",
+ SPAPR_MAX_PHBS - 1);
+ return false;
+ }
+
+ *buid = base_buid + index;
+ for (i = 0; i < n_dma; ++i) {
+ liobns[i] = SPAPR_PCI_LIOBN(index, i);
+ }
+
+ *pio = SPAPR_PCI_BASE + index * SPAPR_PCI_IO_WIN_SIZE;
+ *mmio32 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM32_WIN_SIZE;
+ *mmio64 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM64_WIN_SIZE;
+ return true;
+}
+
static bool spapr_phb_pre_plug(HotplugHandler *hotplug_dev,
DeviceState *dev,
Error **errp)
{
SpaprMachineState *spapr = SPAPR_MACHINE(OBJECT(hotplug_dev));
SpaprPhbState *sphb = SPAPR_PCI_HOST_BRIDGE(dev);
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
const unsigned windows_supported = spapr_phb_windows_supported(sphb);
SpaprDrc *drc;
@@ -4075,12 +4118,10 @@ static bool spapr_phb_pre_plug(HotplugHandler
*hotplug_dev, DeviceState *dev,
* This will check that sphb->index doesn't exceed the maximum
number of
* PHBs for the current machine type.
*/
- return
- smc->phb_placement(spapr, sphb->index,
- &sphb->buid, &sphb->io_win_addr,
- &sphb->mem_win_addr, &sphb->mem64_win_addr,
- windows_supported, sphb->dma_liobn,
- errp);
+ return spapr_phb_placement(spapr, sphb->index,
+ &sphb->buid, &sphb->io_win_addr,
+ &sphb->mem_win_addr, &sphb->mem64_win_addr,
+ windows_supported, sphb->dma_liobn, errp);
}
static void spapr_phb_plug(HotplugHandler *hotplug_dev, DeviceState *dev)
@@ -4328,57 +4369,6 @@ static const CPUArchIdList
*spapr_possible_cpu_arch_ids(MachineState *machine)
return machine->possible_cpus;
}
-static bool spapr_phb_placement(SpaprMachineState *spapr, uint32_t index,
- uint64_t *buid, hwaddr *pio,
- hwaddr *mmio32, hwaddr *mmio64,
- unsigned n_dma, uint32_t *liobns, Error
**errp)
-{
- /*
- * New-style PHB window placement.
- *
- * Goals: Gives large (1TiB), naturally aligned 64-bit MMIO window
- * for each PHB, in addition to 2GiB 32-bit MMIO and 64kiB PIO
- * windows.
- *
- * Some guest kernels can't work with MMIO windows above 1<<46
- * (64TiB), so we place up to 31 PHBs in the area 32TiB..64TiB
- *
- * 32TiB..(33TiB+1984kiB) contains the 64kiB PIO windows for each
- * PHB stacked together. (32TiB+2GiB)..(32TiB+64GiB) contains the
- * 2GiB 32-bit MMIO windows for each PHB. Then 33..64TiB has the
- * 1TiB 64-bit MMIO windows for each PHB.
- */
- const uint64_t base_buid = 0x800000020000000ULL;
- int i;
-
- /* Sanity check natural alignments */
- QEMU_BUILD_BUG_ON((SPAPR_PCI_BASE % SPAPR_PCI_MEM64_WIN_SIZE) != 0);
- QEMU_BUILD_BUG_ON((SPAPR_PCI_LIMIT % SPAPR_PCI_MEM64_WIN_SIZE) != 0);
- QEMU_BUILD_BUG_ON((SPAPR_PCI_MEM64_WIN_SIZE %
SPAPR_PCI_MEM32_WIN_SIZE) != 0);
- QEMU_BUILD_BUG_ON((SPAPR_PCI_MEM32_WIN_SIZE %
SPAPR_PCI_IO_WIN_SIZE) != 0);
- /* Sanity check bounds */
- QEMU_BUILD_BUG_ON((SPAPR_MAX_PHBS * SPAPR_PCI_IO_WIN_SIZE) >
- SPAPR_PCI_MEM32_WIN_SIZE);
- QEMU_BUILD_BUG_ON((SPAPR_MAX_PHBS * SPAPR_PCI_MEM32_WIN_SIZE) >
- SPAPR_PCI_MEM64_WIN_SIZE);
-
- if (index >= SPAPR_MAX_PHBS) {
- error_setg(errp, "\"index\" for PAPR PHB is too large (max %llu)",
- SPAPR_MAX_PHBS - 1);
- return false;
- }
-
- *buid = base_buid + index;
- for (i = 0; i < n_dma; ++i) {
- liobns[i] = SPAPR_PCI_LIOBN(index, i);
- }
-
- *pio = SPAPR_PCI_BASE + index * SPAPR_PCI_IO_WIN_SIZE;
- *mmio32 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM32_WIN_SIZE;
- *mmio64 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM64_WIN_SIZE;
- return true;
-}
-
static ICSState *spapr_ics_get(XICSFabric *dev, int irq)
{
SpaprMachineState *spapr = SPAPR_MACHINE(dev);
@@ -4589,7 +4579,6 @@ static void spapr_machine_class_init(ObjectClass
*oc, const void *data)
smc->resize_hpt_default = SPAPR_RESIZE_HPT_ENABLED;
fwc->get_dev_path = spapr_get_fw_dev_path;
nc->nmi_monitor_handler = spapr_nmi;
- smc->phb_placement = spapr_phb_placement;
vhc->cpu_in_nested = spapr_cpu_in_nested;
vhc->deliver_hv_excp = spapr_exit_nested;
vhc->hypercall = emulate_spapr_hypercall;
@@ -4636,7 +4625,6 @@ static void spapr_machine_class_init(ObjectClass
*oc, const void *data)
smc->default_caps.caps[SPAPR_CAP_AIL_MODE_3] = SPAPR_CAP_ON;
spapr_caps_add_properties(smc);
smc->irq = &spapr_irq_dual;
- smc->nr_xirqs = SPAPR_NR_XIRQS;
xfc->match_nvt = spapr_match_nvt;
vmc->client_architecture_support =
spapr_vof_client_architecture_support;
vmc->quiesce = spapr_vof_quiesce;
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index 548a190ce89..892ddc7f8f7 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -1041,16 +1041,14 @@ void
spapr_clear_pending_hotplug_events(SpaprMachineState *spapr)
void spapr_events_init(SpaprMachineState *spapr)
{
- int epow_irq = SPAPR_IRQ_EPOW;
-
- spapr_irq_claim(spapr, epow_irq, false, &error_fatal);
+ spapr_irq_claim(spapr, SPAPR_IRQ_EPOW, false, &error_fatal);
QTAILQ_INIT(&spapr->pending_events);
spapr->event_sources = spapr_event_sources_new();
spapr_event_sources_register(spapr->event_sources, EVENT_CLASS_EPOW,
- epow_irq);
+ SPAPR_IRQ_EPOW);
/* NOTE: if machine supports modern/dedicated hotplug event source,
* we add it to the device-tree unconditionally. This means we may
@@ -1061,12 +1059,10 @@ void spapr_events_init(SpaprMachineState *spapr)
* checking that it's enabled.
*/
if (spapr->use_hotplug_event_source) {
- int hp_irq = SPAPR_IRQ_HOTPLUG;
-
- spapr_irq_claim(spapr, hp_irq, false, &error_fatal);
+ spapr_irq_claim(spapr, SPAPR_IRQ_HOTPLUG, false, &error_fatal);
spapr_event_sources_register(spapr->event_sources,
EVENT_CLASS_HOT_PLUG,
- hp_irq);
+ SPAPR_IRQ_HOTPLUG);
}
spapr->epow_notifier.notify = spapr_powerdown_req;
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index 317d57a3802..2ce323457be 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -279,15 +279,11 @@ void spapr_irq_dt(SpaprMachineState *spapr,
uint32_t nr_servers,
uint32_t spapr_irq_nr_msis(SpaprMachineState *spapr)
{
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
-
- return SPAPR_XIRQ_BASE + smc->nr_xirqs - SPAPR_IRQ_MSI;
+ return SPAPR_NR_XIRQS + SPAPR_XIRQ_BASE - SPAPR_IRQ_MSI;
}
void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
{
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
-
if (kvm_enabled() && kvm_kernel_irqchip_split()) {
error_setg(errp, "kernel_irqchip split mode not supported on
pseries");
return;
@@ -308,7 +304,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error
**errp)
object_property_add_child(OBJECT(spapr), "ics", obj);
object_property_set_link(obj, ICS_PROP_XICS, OBJECT(spapr),
&error_abort);
- object_property_set_int(obj, "nr-irqs", smc->nr_xirqs,
&error_abort);
+ object_property_set_int(obj, "nr-irqs", SPAPR_NR_XIRQS,
&error_abort);
if (!qdev_realize(DEVICE(obj), NULL, errp)) {
return;
}
@@ -322,7 +318,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error
**errp)
int i;
dev = qdev_new(TYPE_SPAPR_XIVE);
- qdev_prop_set_uint32(dev, "nr-irqs", smc->nr_xirqs +
SPAPR_IRQ_NR_IPIS);
+ qdev_prop_set_uint32(dev, "nr-irqs", SPAPR_NR_XIRQS +
SPAPR_IRQ_NR_IPIS);
/*
* 8 XIVE END structures per CPU. One for each available
* priority
@@ -349,7 +345,7 @@ void spapr_irq_init(SpaprMachineState *spapr, Error
**errp)
}
spapr->qirqs = qemu_allocate_irqs(spapr_set_irq, spapr,
- smc->nr_xirqs + SPAPR_IRQ_NR_IPIS);
+ SPAPR_NR_XIRQS + SPAPR_IRQ_NR_IPIS);
/*
* Mostly we don't actually need this until reset, except that not
@@ -364,11 +360,10 @@ int spapr_irq_claim(SpaprMachineState *spapr, int
irq, bool lsi, Error **errp)
{
SpaprInterruptController *intcs[] = ALL_INTCS(spapr);
int i;
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
int rc;
assert(irq >= SPAPR_XIRQ_BASE);
- assert(irq < (smc->nr_xirqs + SPAPR_XIRQ_BASE));
+ assert(irq < (SPAPR_NR_XIRQS + SPAPR_XIRQ_BASE));
for (i = 0; i < ARRAY_SIZE(intcs); i++) {
SpaprInterruptController *intc = intcs[i];
@@ -388,10 +383,9 @@ void spapr_irq_free(SpaprMachineState *spapr, int
irq, int num)
{
SpaprInterruptController *intcs[] = ALL_INTCS(spapr);
int i, j;
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
assert(irq >= SPAPR_XIRQ_BASE);
- assert((irq + num) <= (smc->nr_xirqs + SPAPR_XIRQ_BASE));
+ assert((irq + num) <= (SPAPR_NR_XIRQS + SPAPR_XIRQ_BASE));
for (i = irq; i < (irq + num); i++) {
for (j = 0; j < ARRAY_SIZE(intcs); j++) {
@@ -408,8 +402,6 @@ void spapr_irq_free(SpaprMachineState *spapr, int
irq, int num)
qemu_irq spapr_qirq(SpaprMachineState *spapr, int irq)
{
- SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
-
/*
* This interface is basically for VIO and PHB devices to find the
* right qemu_irq to manipulate, so we only allow access to the
@@ -418,7 +410,7 @@ qemu_irq spapr_qirq(SpaprMachineState *spapr, int irq)
* interfaces, we can change this if we need to in future.
*/
assert(irq >= SPAPR_XIRQ_BASE);
- assert(irq < (smc->nr_xirqs + SPAPR_XIRQ_BASE));
+ assert(irq < (SPAPR_NR_XIRQS + SPAPR_XIRQ_BASE));
if (spapr->ics) {
assert(ics_valid_irq(spapr->ics, irq));
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index cd60893a17d..43124bf1c78 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -1864,17 +1864,6 @@ uint32_t kvmppc_get_tbfreq(void)
return cached_tbfreq;
}
-bool kvmppc_get_host_serial(char **value)
-{
- return g_file_get_contents("/proc/device-tree/system-id", value, NULL,
- NULL);
-}
-
-bool kvmppc_get_host_model(char **value)
-{
- return g_file_get_contents("/proc/device-tree/model", value, NULL,
NULL);
-}
-
/* Try to find a device tree node for a CPU with clock-frequency
property */
static int kvmppc_find_cpu_dt(char *buf, int buf_len)
{
---
^ permalink raw reply related [flat|nested] 24+ messages in thread* Re: [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines
2025-10-21 7:46 ` Philippe Mathieu-Daudé
@ 2025-10-21 8:34 ` Harsh Prateek Bora
2025-10-21 8:41 ` Philippe Mathieu-Daudé
0 siblings, 1 reply; 24+ messages in thread
From: Harsh Prateek Bora @ 2025-10-21 8:34 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Cédric Le Goater, qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath
On 10/21/25 13:16, Philippe Mathieu-Daudé wrote:
> On 21/10/25 08:31, Cédric Le Goater wrote:
>> Hi
>>
>> On 10/21/25 06:54, Harsh Prateek Bora wrote:
>>> +Cedric
>>>
>>> Hi Phillipe,
>>>
>>> It had been done and the patches were reviewed already here (you were
>>> in CC too):
>>>
>>> https://lore.kernel.org/qemu-devel/20251009184057.19973-1-
>>> harshpb@linux.ibm.com/
>>
>> I would take the already reviewed patches, as that work is done. This
>> series
>> is fine, but it is extra effort for removing dead code, which isn't worth
>> the time.
>
> My bad for missing a series reviewed 2 weeks ago (and not yet merged).
>
> Please consider cherry-picking the patches doing these cleanups then,
> which were missed because "too many things changed in a single patch"
> IMHO:
>
> -- >8 --
Thanks for highlighting the delta cleanups, we can take care.
regards,
Harsh
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [PATCH 00/18] hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines
2025-10-21 8:34 ` Harsh Prateek Bora
@ 2025-10-21 8:41 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 24+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-10-21 8:41 UTC (permalink / raw)
To: Harsh Prateek Bora, Cédric Le Goater, qemu-devel
Cc: Paolo Bonzini, Nicholas Piggin, qemu-ppc, kvm, Chinmay Rath
On 21/10/25 10:34, Harsh Prateek Bora wrote:
>
>
> On 10/21/25 13:16, Philippe Mathieu-Daudé wrote:
>> On 21/10/25 08:31, Cédric Le Goater wrote:
>>> Hi
>>>
>>> On 10/21/25 06:54, Harsh Prateek Bora wrote:
>>>> +Cedric
>>>>
>>>> Hi Phillipe,
>>>>
>>>> It had been done and the patches were reviewed already here (you
>>>> were in CC too):
>>>>
>>>> https://lore.kernel.org/qemu-devel/20251009184057.19973-1-
>>>> harshpb@linux.ibm.com/
>>>
>>> I would take the already reviewed patches, as that work is done. This
>>> series
>>> is fine, but it is extra effort for removing dead code, which isn't
>>> worth
>>> the time.
>>
>> My bad for missing a series reviewed 2 weeks ago (and not yet merged).
>>
>> Please consider cherry-picking the patches doing these cleanups then,
>> which were missed because "too many things changed in a single patch"
>> IMHO:
>>
>> -- >8 --
>
> Thanks for highlighting the delta cleanups, we can take care.
I'll do the job and repost, don't do it.
^ permalink raw reply [flat|nested] 24+ messages in thread