hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines
v2 cover hw/ppc/spapr: Remove deprecated pseries-3.0 -> pseries-4.2 machines
v2: Rebased on https://lore.kernel.org/qemu-devel/[email protected]/
Remove the deprecated pseries-3.0 up to pseries-4.2 machines, which are older than 6 years. Remove resulting dead code.
Harsh Prateek Bora (5):
ppc/spapr: remove deprecated machine pseries-3.0 ppc/spapr: remove deprecated machine pseries-3.1 ppc/spapr: remove deprecated machine pseries-4.0 ppc/spapr: remove deprecated machine pseries-4.1 ppc/spapr: remove deprecated machine pseries-4.2
Philippe Mathieu-Daudé (6):
hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field hw/ppc/spapr: Inline spapr_dtb_needed() hw/ppc/spapr: Inline few SPAPR_IRQ_* uses 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::phb_placement callback
include/hw/ppc/spapr.h | 16 -- include/hw/ppc/spapr_irq.h | 1 - target/ppc/kvm_ppc.h | 12 -- hw/ppc/spapr.c | 299 ++++++++----------------------------- hw/ppc/spapr_caps.c | 12 +- 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, 77 insertions(+), 376 deletions(-)
Signature · 1 line
2.51.0
PATCH v2 1/11 ppc/spapr: remove deprecated machine pseries-3.0
From: Harsh Prateek Bora <[email protected]>
pseries-3.0 had been deprecated and due for removal now as per policy. Also remove legacy irq support which existed for pre pseries-3.1 machines.
--- include/hw/ppc/spapr.h | 1 - include/hw/ppc/spapr_irq.h | 1 - hw/ppc/spapr.c | 27 +-------------------------- hw/ppc/spapr_events.c | 8 -------- hw/ppc/spapr_irq.c | 16 +--------------- hw/ppc/spapr_pci.c | 32 ++++---------------------------- hw/ppc/spapr_vio.c | 9 --------- 7 files changed, 6 insertions(+), 88 deletions(-)
include/hw/ppc/spapr.h +0 -1
@@ -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 */
include/hw/ppc/spapr_irq.h +0 -1
@@ -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;
hw/ppc/spapr.c +1 -26
@@ -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" );
@@ -3363,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;
@@ -5062,24 +5055,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);
hw/ppc/spapr_events.c +0 -8
@@ -1043,10 +1043,6 @@ 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);QTAILQ_INIT (&spapr->pending_events);
@@ -1067,10 +1063,6 @@ void spapr_events_init(SpaprMachineState *spapr)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_event_sources_register(spapr->event_sources, EVENT_CLASS_HOT_PLUG,
hw/ppc/spapr_irq.c +1 -15
@@ -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 SPAPR_XIRQ_BASE + smc->nr_xirqs -SPAPR_IRQ_MSI ; }void spapr_irq_init (SpaprMachineState *spapr,Error **errp)
@@ -588,11 +579,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);
hw/ppc/spapr_pci.c +4 -28
@@ -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;
hw/ppc/spapr_vio.c +0 -9
@@ -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 ; }
Signature · 1 line
2.51.0
PATCH v2 2/11 hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field
In reply to 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.
--- include/hw/ppc/spapr.h | 1 - hw/ppc/spapr.c | 1 - hw/ppc/spapr_irq.c | 22 +++++++--------------- 3 files changed, 7 insertions(+), 17 deletions(-)
include/hw/ppc/spapr.h +0 -1
@@ -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;
hw/ppc/spapr.c +0 -1
@@ -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;
hw/ppc/spapr_irq.c +7 -15
@@ -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));
Signature · 1 line
2.51.0
Re: [PATCH v2 02/11] hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field
Quoted 39 lines · Philippe Mathieu-Daudé
The
SpaprMachineClass::nr_xirqsfield was only used by the pseries-3.0 machine, which got removed. Remove it as now unused.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/ppc/spapr.h | 1 - hw/ppc/spapr.c | 1 - hw/ppc/spapr_irq.c | 22 +++++++--------------- 3 files changed, 7 insertions(+), 17 deletions(-)include/hw/ppc/spapr.h +0
-1@@ -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;hw/ppc/spapr.c +0
-1@@ -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;hw/ppc/spapr_irq.c +0
-0
hw/ppc/spapr_irq.c void spapr_irq_dt(SpaprMachineState *spapr, uint32_t nr_servers, · line 283
Quoted 8 lines
hw/ppc/spapr_irq.c +1
-3@@ -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 ; }
Hey,
With this cleanup, I think we can get rid of the SpaprMachineState argument passed to spapr_irq_nr_msis function since it is not used anymore ^.
Regards,
Chinmay
Quoted 78 lines
hw/ppc/spapr_irq.c +6
-12void 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));
Re: [PATCH v2 02/11] hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field
Quoted 53 lines · Chinmay Rath
Quoted 40 lines · Philippe Mathieu-Daudé
The
SpaprMachineClass::nr_xirqsfield was only used by the pseries-3.0 machine, which got removed. Remove it as now unused.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
include/hw/ppc/spapr.h| 1 - hw/ppc/spapr.c | 1 - hw/ppc/spapr_irq.c | 22 +++++++---------------3 files changed, 7 insertions(+), 17 deletions(-)include/hw/ppc/spapr.h +0
-0@@ -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_tnr_xirqs;
boolbroken_host_serial_model; /* present real host info to the guest */ boolpre_4_1_migration; /* don't migrate hpt-max-page-size */ boollinux_pci_probe;hw/ppc/spapr.c +0
-1@@ -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;hw/ppc/spapr_irq.c +0
-0hw/ppc/spapr_irq.c void spapr_irq_dt(SpaprMachineState *spapr, · line 283
Quoted 8 lines
hw/ppc/spapr_irq.c +1
-3@@ -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; }Hey,
With this cleanup, I think we can get rid of the SpaprMachineState argument passed tospapr_irq_nr_msisfunction since it is not used anymore ^.
Quoted 2 lines
Regards,
Chinmay
On second thoughts, since the functions is just returning a constant value now, would it make sense to get rid of the functions all together and replace the calls with the respective constant ?
Regards,
Chinmay
Quoted 82 lines
Quoted 81 lines
hw/ppc/spapr_irq.c +1
-3void 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;
}hw/ppc/spapr_irq.c +1
-1@@ -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
* priorityhw/ppc/spapr_irq.c +1
-1@@ -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
hw/ppc/spapr_irq.c +3
-7@@ -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, intirq) * 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));
PATCH v2 3/11 ppc/spapr: remove deprecated machine pseries-3.1
In reply to Philippe Mathieu-DaudéFrom: Harsh Prateek Bora <[email protected]>
pseries-3.1 had been deprecated and due for removal now as per policy. Also remove backward compatibility flags and related code introduced for pre pseries-4.0 machines.
--- include/hw/ppc/spapr.h | 3 -- hw/ppc/spapr.c | 62 ++++-------------------------------------- hw/ppc/spapr_hcall.c | 5 ---- 3 files changed, 5 insertions(+), 65 deletions(-)
include/hw/ppc/spapr.h +0 -3
@@ -143,9 +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 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 */
hw/ppc/spapr.c +5 -57
142 lines not on this page · raw message
hw/ppc/spapr_hcall.c +0 -5
@@ -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,
Signature · 1 line
2.51.0
PATCH v2 4/11 hw/ppc/spapr: Inline spapr_dtb_needed()
In reply to Philippe Mathieu-Daudé--- hw/ppc/spapr.c | 6 ------ 1 file changed, 6 deletions(-)
hw/ppc/spapr.c +0 -6
@@ -2053,11 +2053,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;
@@ -2073,7 +2068,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),
Signature · 1 line
2.51.0
Re: [PATCH v2 04/11] hw/ppc/spapr: Inline spapr_dtb_needed()
Hey Philippe,
The commit message says that this commit is inline-ing spapr_dtb_needed(), but it is actually removing it. I think it's better to convey that in the commit message. Or did I miss something ?
Quoted 22 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/ppc/spapr.c | 6 ------ 1 file changed, 6 deletions(-)hw/ppc/spapr.c +0
-5@@ -2053,11 +2053,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;
hw/ppc/spapr.c static const VMStateDescription vmstate_spapr_dtb = { · line 2069
Quoted 2 lines
hw/ppc/spapr.c +0
-0@@ -2073,7 +2068,6 @@ static const VMStateDescription vmstate_spapr_dtb = { .name = "spapr_dtb", .version_id = 1,
Does this version number need to be incremented ?
Regards,
Chinmay
Quoted 5 lines
hw/ppc/spapr.c +0
-1.minimum_version_id = 1, - .needed = spapr_dtb_needed, .pre_load = spapr_dtb_pre_load, .fields = (const VMStateField []) {VMSTATE_UINT32 (fdt_initial_size, SpaprMachineState),
Re: [PATCH v2 04/11] hw/ppc/spapr: Inline spapr_dtb_needed()
Quoted 24 lines · Chinmay Rath
Hey Philippe,
The commit message says that this commit is inline-ingspapr_dtb_needed(), but it is actually removing it. I think it's better to convey that in the commit message. Or did I miss something ?Quoted 19 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
hw/ppc/spapr.c| 6 ------1 file changed, 6 deletions(-)hw/ppc/spapr.c +0
-5@@ -2053,11 +2053,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)
Quoted 8 lines
hw/ppc/spapr.c static const VMStateDescription · line 2070
Quoted 6 lines
hw/ppc/spapr.c +0
-0{ SpaprMachineState *spapr = (SpaprMachineState *)opaque;@@ -2073,7 +2068,6 @@ static const VMStateDescription vmstate_spapr_dtb = { .name = "spapr_dtb", .version_id = 1,Does this version number need to be incremented ?
No, this is a no-op.
Quoted 6 lines
Regards,
ChinmayQuoted 2 lines
hw/ppc/spapr.c +0
-1.minimum_version_id = 1, - .needed = spapr_dtb_needed,
Here is the inlining, as '.needed = true' is the default.
Would "Inline and remove spapr_dtb_needed()" be clearer?
Quoted 3 lines
Quoted 3 lines
hw/ppc/spapr.c +0
-0.pre_load = spapr_dtb_pre_load, .fields = (const VMStateField[]) {
VMSTATE_UINT32(fdt_initial_size, SpaprMachineState),
Re: [PATCH v2 04/11] hw/ppc/spapr: Inline spapr_dtb_needed()
Quoted 37 lines · Philippe Mathieu-Daudé
Quoted 24 lines · Chinmay Rath
Hey Philippe,
The commit message says that this commit is inline-ingspapr_dtb_needed(), but it is actually removing it. I think it's better to convey that in the commit message. Or did I miss something ?Quoted 19 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
hw/ppc/spapr.c| 6 ------1 file changed, 6 deletions(-)hw/ppc/spapr.c +0
-5@@ -2053,11 +2053,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)Quoted 8 lines
hw/ppc/spapr.c static const VMStateDescription · line 2070
Quoted 6 lines
hw/ppc/spapr.c +0
-0{ SpaprMachineState *spapr = (SpaprMachineState *)opaque;@@ -2073,7 +2068,6 @@ static const VMStateDescription vmstate_spapr_dtb = { .name = "spapr_dtb", .version_id = 1,Does this version number need to be incremented ?
No, this is a no-op.
Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Regards,
ChinmayQuoted 2 lines
hw/ppc/spapr.c +0
-1.minimum_version_id = 1, - .needed = spapr_dtb_needed,Here is the inlining, as '.needed = true' is the default.
Ahh I see.
Quoted 1 line
Would "Inline and remove
spapr_dtb_needed()" be clearer?
Yeah that'd be nice.
Thanks,
Chinmay
Quoted 6 lines
Quoted 4 lines
Quoted 4 lines
hw/ppc/spapr.c +0
-0.pre_load = spapr_dtb_pre_load, .fields = (const VMStateField[]) {
VMSTATE_UINT32(fdt_initial_size, SpaprMachineState),
PATCH v2 5/11 hw/ppc/spapr: Inline few SPAPR_IRQ_* uses
In reply to Philippe Mathieu-Daudé--- hw/ppc/spapr_events.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
hw/ppc/spapr_events.c +4 -8
@@ -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;
Signature · 1 line
2.51.0
Re: [PATCH v2 05/11] hw/ppc/spapr: Inline few SPAPR_IRQ_* uses
Quoted 33 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/ppc/spapr_events.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)hw/ppc/spapr_events.c +2
-5@@ -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 ;
hw/ppc/spapr_events.c void spapr_events_init(SpaprMachineState *spapr) · line 1068
Quoted 10 lines
hw/ppc/spapr_events.c +2
-3- -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;
PATCH v2 6/11 target/ppc/kvm: Remove kvmppc_get_host_serial() as unused
In reply to Philippe Mathieu-Daudé--- target/ppc/kvm_ppc.h | 6 ------ target/ppc/kvm.c | 6 ------ 2 files changed, 12 deletions(-)
target/ppc/kvm_ppc.h +0 -6
@@ -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 ;
target/ppc/kvm.c +0 -6
@@ -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 );
Signature · 1 line
2.51.0
Re: [PATCH v2 06/11] target/ppc/kvm: Remove kvmppc_get_host_serial() as unused
Quoted 37 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/ppc/kvm_ppc.h | 6 ------ target/ppc/kvm.c | 6 ------ 2 files changed, 12 deletions(-)target/ppc/kvm_ppc.h +0
-6@@ -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 ;target/ppc/kvm.c +0
-0@@ -1864,12 +1864,6 @@ uint32_t kvmppc_get_tbfreq(void)return cached_tbfreq; }
target/ppc/kvm.c uint32_t kvmppc_get_tbfreq(void) · line 1869
Quoted 10 lines
target/ppc/kvm.c +0
-6-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 );
PATCH v2 7/11 target/ppc/kvm: Remove kvmppc_get_host_model() as unused
In reply to Philippe Mathieu-Daudé--- target/ppc/kvm_ppc.h | 6 ------ target/ppc/kvm.c | 5 ----- 2 files changed, 11 deletions(-)
target/ppc/kvm_ppc.h +0 -6
@@ -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 ;
target/ppc/kvm.c +0 -5
@@ -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) {
Signature · 1 line
2.51.0
Re: [PATCH v2 07/11] target/ppc/kvm: Remove kvmppc_get_host_model() as unused
Quoted 36 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- target/ppc/kvm_ppc.h | 6 ------ target/ppc/kvm.c | 5 ----- 2 files changed, 11 deletions(-)target/ppc/kvm_ppc.h +0
-6@@ -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 ;target/ppc/kvm.c +0
-0@@ -1864,11 +1864,6 @@ uint32_t kvmppc_get_tbfreq(void)return cached_tbfreq;
target/ppc/kvm.c uint32_t kvmppc_get_tbfreq(void) · line 1869
Quoted 10 lines
target/ppc/kvm.c +0
-5} -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) {
PATCH v2 8/11 ppc/spapr: remove deprecated machine pseries-4.0
In reply to Philippe Mathieu-DaudéFrom: Harsh Prateek Bora <[email protected]>
pseries-4.0 had been deprecated and due for removal now as per policy. Also remove pre-4.1 migration hacks which were introduced for backward compatibility.
--- include/hw/ppc/spapr.h | 3 --- hw/ppc/spapr.c | 27 --------------------------- hw/ppc/spapr_caps.c | 12 +----------- 3 files changed, 1 insertion(+), 41 deletions(-)
include/hw/ppc/spapr.h +0 -3
@@ -139,11 +139,8 @@ struct SpaprCapabilities {* SpaprMachineClass: */ struct SpaprMachineClass { -/*< private >*/ 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 */
hw/ppc/spapr.c +0 -27
@@ -4969,33 +4969,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);
hw/ppc/spapr_caps.c +1 -11
@@ -66,7 +66,6 @@ typedef struct SpaprCapabilityInfo {void (*apply)(SpaprMachineState *spapr,uint8_t val,Error **errp);void (*cpu_apply)(SpaprMachineState *spapr,PowerPCCPU *cpu,uint8_t val,Error **errp); -bool (*migrate_needed)(void *opaque); } SpaprCapabilityInfo; static void spapr_cap_get_bool(Object *obj, Visitor *v, const char *name,
@@ -336,11 +335,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 +787,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",
@@ -982,11 +975,8 @@ int spapr_caps_post_migration(SpaprMachineState *spapr) static bool spapr_cap_##sname##_needed(void *opaque) \ { \SpaprMachineState *spapr = opaque; \ -bool (*needed)(void *opaque) = \ - capability_table[cap].migrate_needed; \ \ -return needed ?needed (opaque) : true && \ - spapr->cmd_line_caps[cap] && \ +return spapr->cmd_line_caps[cap] && \ (spapr->eff.caps[cap] != \ spapr->def.caps[cap]); \ } \
Signature · 1 line
2.51.0
PATCH v2 9/11 hw/ppc/spapr: Remove SpaprMachineClass::phb_placement callback
In reply to 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.
--- include/hw/ppc/spapr.h | 5 -- hw/ppc/spapr.c | 114 ++++++++++++++++++++--------------------- 2 files changed, 55 insertions(+), 64 deletions(-)
include/hw/ppc/spapr.h +0 -5
@@ -147,11 +147,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;
hw/ppc/spapr.c +55 -59
143 lines not on this page · raw message
Signature · 1 line
2.51.0
Re: [PATCH v2 09/11] hw/ppc/spapr: Remove SpaprMachineClass::phb_placement callback
Quoted 7 lines · Philippe Mathieu-Daudé
The
SpaprMachineClass::phb_placementcallback was only used by the pseries-4.0 machine, which got removed. Remove it as now unused, directly callingspapr_phb_placement().
Movespapr_phb_placement()definition to avoid forward declaration.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Quoted 171 lines
include/hw/ppc/spapr.h | 5 -- hw/ppc/spapr.c | 114 ++++++++++++++++++++--------------------- 2 files changed, 55 insertions(+), 64 deletions(-)include/hw/ppc/spapr.h +0
-5@@ -147,11 +147,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;hw/ppc/spapr.c +55
-59@@ -4068,12 +4068,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;@@ -4092,12 +4142,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)@@ -4345,57 +4393,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);@@ -4606,7 +4603,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;
PATCH v2 10/11 ppc/spapr: remove deprecated machine pseries-4.1
In reply to Philippe Mathieu-DaudéFrom: Harsh Prateek Bora <[email protected]>
Remove the pseries-4.1 machine specific logic as had been deprecated and due for removal now as per policy.
--- include/hw/ppc/spapr.h | 2 -- hw/ppc/spapr.c | 37 +------------------------------------ 2 files changed, 1 insertion(+), 38 deletions(-)
include/hw/ppc/spapr.h +0 -2
@@ -141,8 +141,6 @@ struct SpaprCapabilities {struct SpaprMachineClass {MachineClass parent_class; -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;
hw/ppc/spapr.c +1 -36
@@ -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); }
@@ -2589,7 +2586,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 ();
@@ -2625,15 +2621,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,8 +4636,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; - 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;
@@ -4945,26 +4930,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);
Signature · 1 line
2.51.0
PATCH v2 11/11 ppc/spapr: remove deprecated machine pseries-4.2
In reply to Philippe Mathieu-DaudéFrom: Harsh Prateek Bora <[email protected]>
Remove the pseries-4.2 machine specific logic as had been deprecated and due for removal now as per policy.
--- include/hw/ppc/spapr.h | 1 - hw/ppc/spapr.c | 27 --------------------------- 2 files changed, 28 deletions(-)
include/hw/ppc/spapr.h +0 -1
@@ -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;
hw/ppc/spapr.c +0 -27
@@ -2729,7 +2729,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);
@@ -2742,15 +2741,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
@@ -4913,23 +4903,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);
Signature · 1 line
2.51.0
Hello,
I noticed removal of old pSeries revisions.
FTR to boot Linux 3.0 I need pSeries-2.7 (already removed earlier).
The thing that broke booting linux 3.0 for me is 357d1e3bc7d2d80e5271bc4f3ac8537e30dc8046 spapr: Improved placement of PCI host bridges in guest memory map
I do not use Linux 3.0 anymore which is the reason I did not notice this breakage due to old platform revision removal.
At the same time quemu is sometimes touted as a way to run old OS revisions. That does not work very well for pSeries.
Thanks
Michal
Quoted 37 lines · Philippe Mathieu-Daudé
v2: Rebased on https://lore.kernel.org/qemu-devel/[email protected]/
Remove the deprecated pseries-3.0 up to pseries-4.2 machines, which are older than 6 years. Remove resulting dead code.
Harsh Prateek Bora (5):
ppc/spapr: remove deprecated machine pseries-3.0 ppc/spapr: remove deprecated machine pseries-3.1 ppc/spapr: remove deprecated machine pseries-4.0 ppc/spapr: remove deprecated machine pseries-4.1 ppc/spapr: remove deprecated machine pseries-4.2Philippe Mathieu-Daudé (6):
hw/ppc/spapr: RemoveSpaprMachineClass::nr_xirqsfield hw/ppc/spapr: Inlinespapr_dtb_needed()hw/ppc/spapr: Inline few SPAPR_IRQ_* uses target/ppc/kvm: Removekvmppc_get_host_serial()as unused target/ppc/kvm: Removekvmppc_get_host_model()as unused hw/ppc/spapr: RemoveSpaprMachineClass::phb_placementcallbackinclude/hw/ppc/spapr.h | 16 -- include/hw/ppc/spapr_irq.h | 1 - target/ppc/kvm_ppc.h | 12 -- hw/ppc/spapr.c | 299 ++++++++----------------------------- hw/ppc/spapr_caps.c | 12 +- 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, 77 insertions(+), 376 deletions(-)Signature · 1 line
2.51.0
Hi Michal,
Quoted 4 lines · Michal Suchánek
Hello,
I noticed removal of old pSeries revisions.
Quoted 8 lines
FTR to boot Linux 3.0 I need pSeries-2.7 (already removed earlier).
The thing that broke booting linux 3.0 for me is
357d1e3bc7d2d80e5271bc4f3ac8537e30dc8046spapr: Improved placement of PCI host bridges in guest memory mapI do not use Linux 3.0 anymore which is the reason I did not notice this breakage due to old platform revision removal.
I tried booting linux kernel 3.13.0-170-generic from ubuntu 14.04.6 LTS with the oldest supported machine pseries-5.0 as of now.
It worked fine.
qemu-system-ppc64 -machine pseries-5.0 -accel tcg -nographic -m size=12G -cpu power8 -smp 1 -drive file=/root/images/ubuntu16.04.qcow2,format=qcow2,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 -serial mon:stdio -kernel /root/images/vmlinux-3.13.0-170-generic -initrd /root/images/initrd.img-3.13.0-170-generic -append "BOOT_IMAGE=/boot/vmlinux-4.4.0-142-generic root=UUID=94fba90c-dbb0-4f8d-bc3e-acd5f2e54749 ro vt.handoff=7"
shiva@ubuntu:~$ uname -a Linux ubuntu 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:44:25 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux shiva@ubuntu:~$ cat /proc/cpuinfo processor : 0 cpu : POWER8 (architected), altivec supported clock : 1000.000000MHz revision : 2.0 (pvr 004d 0200)
timebase : 512000000
platform : pSeries
model : IBM pSeries (emulated by qemu) machine : CHRP IBM pSeries (emulated by qemu)
Hope that helps.
Thanks,
Shivaprasad
Quoted 40 lines · Shivaprasad G Bhat
Hi Michal,
Quoted 4 lines · Michal Suchánek
Hello,
I noticed removal of old pSeries revisions.
Quoted 8 lines
FTR to boot Linux 3.0 I need pSeries-2.7 (already removed earlier).
The thing that broke booting linux 3.0 for me is
357d1e3bc7d2d80e5271bc4f3ac8537e30dc8046spapr: Improved placement of PCI host bridges in guest memory mapI do not use Linux 3.0 anymore which is the reason I did not notice this breakage due to old platform revision removal.
I tried booting linux kernel 3.13.0-170-generic from ubuntu 14.04.6 LTS with the oldest supported machine pseries-5.0 as of now.
It worked fine.
qemu-system-ppc64 -machine pseries-5.0 -accel tcg -nographic -m size=12G
(quoted diff) +0
-2-cpu power8 -smp 1 -drive file=/root/images/ubuntu16.04.qcow2,format=qcow2,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0 -serialmon:stdio -kernel
/root/images/vmlinux-3.13.0-170-generic-initrd/root/images/initrd.img-3.13.0-170-generic-append "BOOT_IMAGE=/boot/vmlinux-4.4.0-142-generic root=UUID=94fba90c-dbb0-4f8d-bc3e-acd5f2e54749 ro vt.handoff=7"shiva@ubuntu:~$ uname -a Linux ubuntu 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:44:25 UTC 2019 ppc64le ppc64le ppc64le GNU/Linux shiva@ubuntu:~$ cat /proc/cpuinfo processor : 0 cpu : POWER8 (architected), altivec supported clock : 1000.000000MHz revision : 2.0 (pvr 004d 0200)
Quoted 7 lines
timebase : 512000000
platform : pSeries
model : IBM pSeries (emulated by qemu) machine : CHRP IBM pSeries (emulated by qemu)Hope that helps.
How does that help?
Of course newer kernels do work.
However, distributions using Linux 3.0 don't anymore, at least that particular Linux 3.0 build.
I am not particularly concerned, only noting that the qemu pSeries emulation is not suitable for running very old distributions because they are not compatible with newer qemu.
It can be a bug in the old kernel but it's not triggered by actual hardware nor older qemu. Or it may bee a bug with that new qemu PCI bus organization that is not triggered by newer kernel. I don't know and since nobody cared enough to diagnose it so far we will probably never know.
Thanks
Michal
Quoted 12 lines · Philippe Mathieu-Daudé
v2: Rebased on https://lore.kernel.org/qemu-devel/[email protected]/
Remove the deprecated pseries-3.0 up to pseries-4.2 machines, which are older than 6 years. Remove resulting dead code.
Harsh Prateek Bora (5):
ppc/spapr: remove deprecated machine pseries-3.0 ppc/spapr: remove deprecated machine pseries-3.1 ppc/spapr: remove deprecated machine pseries-4.0 ppc/spapr: remove deprecated machine pseries-4.1 ppc/spapr: remove deprecated machine pseries-4.2
Quoted 7 lines
Philippe Mathieu-Daudé (6):
hw/ppc/spapr: RemoveSpaprMachineClass::nr_xirqsfield hw/ppc/spapr: Inlinespapr_dtb_needed()hw/ppc/spapr: Inline few SPAPR_IRQ_* uses target/ppc/kvm: Removekvmppc_get_host_serial()as unused target/ppc/kvm: Removekvmppc_get_host_model()as unused hw/ppc/spapr: RemoveSpaprMachineClass::phb_placementcallback
Queued and posted PR.
Additional cleanup suggestions on patch 2 can be taken up as a follow-up. Thanks.
regards,
Harsh