hw/s390x: Remove s390-ccw-virtio-4.2 machine
v2 cover hw/s390x: Remove s390-ccw-virtio-4.2 machine
Since v1:
- Do not remove s390-ccw-virtio-5.0 -> 7.2 machines (Thomas)
- Remove MachineClass::fixup_ram_size (Thomas)
Remove the deprecated s390-ccw-virtio-4.2 machine, which is older than 6 years. Remove resulting dead code.
Philippe Mathieu-Daudé (3):
hw/s390x/ccw: Remove deprecated s390-ccw-virtio-4.2 machine hw/s390x/ccw: Remove SCLPDevice::increment_size field hw/core/machine: Remove MachineClass::fixup_ram_size callback
include/hw/boards.h | 7 ------- include/hw/s390x/sclp.h | 5 +---- hw/core/machine.c | 3 --- hw/s390x/s390-virtio-ccw.c | 33 --------------------------------- hw/s390x/sclp.c | 34 +++------------------------------- 5 files changed, 4 insertions(+), 78 deletions(-)
Signature · 1 line
2.51.0
PATCH v2 1/3 hw/s390x/ccw: Remove deprecated s390-ccw-virtio-4.2 machine
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.
--- hw/s390x/s390-virtio-ccw.c | 33 --------------------------------- 1 file changed, 33 deletions(-)
hw/s390x/s390-virtio-ccw.c +0 -33
@@ -715,26 +715,6 @@ static void s390_nmi(NMIState *n, int cpu_index, Error **errp)s390_cpu_restart (S390_CPU (cs)); } -static ram_addr_t s390_fixup_ram_size (ram_addr_t sz) -{ -/* same logic as in sclp.c */ -int increment_size =20 ; -ram_addr_t newsz; - -while ((sz >> increment_size) >MAX_STORAGE_INCREMENTS ) { - increment_size++; - } - newsz = sz >> increment_size << increment_size; - -if (sz != newsz) { -qemu_printf ("Ram size %" PRIu64"MB was fixed up to %" PRIu64 -"MB to match machine restrictions. Consider updating " -"the guest definition.\n" , (uint64_t ) (sz / MiB), - (uint64_t ) (newsz / MiB)); - } -return newsz; -} -static inline bool machine_get_aes_key_wrap (Object *obj,Error **errp) {S390CcwMachineState *ms =S390_CCW_MACHINE (obj);
@@ -1165,19 +1145,6 @@ static void ccw_machine_5_0_class_options(MachineClass *mc) }DEFINE_CCW_MACHINE (5 ,0 ); -static void ccw_machine_4_2_instance_options (MachineState *machine) -{ -ccw_machine_5_0_instance_options (machine); -} - -static void ccw_machine_4_2_class_options (MachineClass *mc) -{ -ccw_machine_5_0_class_options (mc); - mc->fixup_ram_size = s390_fixup_ram_size; -compat_props_add (mc->compat_props, hw_compat_4_2, hw_compat_4_2_len); -} -DEFINE_CCW_MACHINE (4 ,2 ); -static void ccw_machine_register_types (void ) {type_register_static (&ccw_machine_info);
Signature · 1 line
2.51.0
Re: [PATCH v2 1/3] hw/s390x/ccw: Remove deprecated s390-ccw-virtio-4.2 machine
Quoted 9 lines · 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é <[email protected]>--- hw/s390x/s390-virtio-ccw.c | 33 --------------------------------- 1 file changed, 33 deletions(-)
PATCH v2 2/3 hw/s390x/ccw: Remove SCLPDevice::increment_size field
In reply to Philippe Mathieu-DaudéThe SCLPDevice::increment_size field was only used by the s390-ccw-virtio-4.2 machine, which got removed. Remove it as now unused, along with the sclp_memory_init() method.
--- include/hw/s390x/sclp.h | 5 +---- hw/s390x/sclp.c | 34 +++------------------------------- 2 files changed, 4 insertions(+), 35 deletions(-)
include/hw/s390x/sclp.h +1 -4
@@ -197,12 +197,9 @@ OBJECT_DECLARE_TYPE(SCLPDevice, SCLPDeviceClass,struct SCLPEventFacility ;struct SCLPDevice { -/* private */ DeviceState parent_obj; -struct SCLPEventFacility *event_facility; -int increment_size; -/* public */ +struct SCLPEventFacility *event_facility; };struct SCLPDeviceClass {
hw/s390x/sclp.c +3 -31
@@ -110,7 +110,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)ReadInfo *read_info = (ReadInfo *) sccb;MachineState *machine =MACHINE (qdev_get_machine ());int cpu_count; -int rnsize, rnmax; +int rnmax;int required_len =SCCB_REQ_LEN (ReadInfo, machine->possible_cpus->len);int offset_cpu =s390_has_feat (S390_FEAT_EXTENDED_LENGTH_SCCB ) ? offsetof(ReadInfo, entries) :
@@ -153,21 +153,14 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) read_info->mha_pow =s390_get_mha_pow (); read_info->hmfai =cpu_to_be32 (s390_get_hmfai ()); - - rnsize =1 << (sclp->increment_size -20 ); -if (rnsize <=128 ) { - read_info->rnsize = rnsize; - }else { - read_info->rnsize =0 ; - read_info->rnsize2 =cpu_to_be32 (rnsize); - } + read_info->rnsize =1 ;/* * We don't support standby memory. maxram_size is used for sizing the * memory device region, which is not exposed through SCLP but through * diag500. */ - rnmax = machine->ram_size >> sclp->increment_size; + rnmax = machine->ram_size >>20 ;if (rnmax <0x10000 ) { read_info->rnmax =cpu_to_be16 (rnmax); }else {
@@ -406,25 +399,6 @@ static void sclp_realize(DeviceState *dev, Error **errp) } } -static void sclp_memory_init (SCLPDevice *sclp) -{ -MachineState *machine =MACHINE (qdev_get_machine ()); -MachineClass *machine_class =MACHINE_GET_CLASS (qdev_get_machine ()); -ram_addr_t initial_mem = machine->ram_size; -int increment_size =20 ; - -/* The storage increment size is a multiple of 1M and is a power of 2. -* For some machine types, the number of storage increments must be -* MAX_STORAGE_INCREMENTS or fewer. -* The variable 'increment_size' is an exponent of 2 that can be -* used to calculate the size (in bytes) of an increment. */ -while (machine_class->fixup_ram_size !=NULL && - (initial_mem >> increment_size) >MAX_STORAGE_INCREMENTS ) { - increment_size++; - } - sclp->increment_size = increment_size; -} -static void sclp_init (Object *obj) {SCLPDevice *sclp =SCLP (obj);
@@ -434,8 +408,6 @@ static void sclp_init(Object *obj)object_property_add_child (obj,TYPE_SCLP_EVENT_FACILITY , new);object_unref (new); sclp->event_facility =EVENT_FACILITY (new); - -sclp_memory_init (sclp); }static void sclp_class_init (ObjectClass *oc,const void *data)
Signature · 1 line
2.51.0
Re: [PATCH v2 2/3] hw/s390x/ccw: Remove SCLPDevice::increment_size field
Quoted 9 lines · Philippe Mathieu-Daudé
The
SCLPDevice::increment_sizefield was only used by the s390-ccw-virtio-4.2 machine, which got removed. Remove it as now unused, along with thesclp_memory_init()method.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/s390x/sclp.h | 5 +---- hw/s390x/sclp.c | 34 +++------------------------------- 2 files changed, 4 insertions(+), 35 deletions(-)
PATCH v2 3/3 hw/core/machine: Remove MachineClass::fixup_ram_size callback
In reply to Philippe Mathieu-DaudéThe MachineClass::fixup_ram_size callback, which was added in commit 5c30ef937f5 ("vl/s390x: fixup ram sizes for compat machines"), was only used by the s390-ccw-virtio-4.2 machine, which got removed. Remove it as now unused.
--- include/hw/boards.h | 7 ------- hw/core/machine.c | 3 --- 2 files changed, 10 deletions(-)
include/hw/boards.h +0 -7
@@ -250,12 +250,6 @@ typedef struct {* It also will be used as a way to option into "-m" option support. * If it's not set by board, '-m' will be ignored and generic code will * not create default RAM MemoryRegion. -* @fixup_ram_size: -* Amends user provided ram size (with -m option) using machine -* specific algorithm. To be used by old machine types for compat -* purposes only. -* Applies only to default memory backend, i.e., explicit memory backend -* wasn't used. * @smbios_memory_device_size: * Default size of memory device, * SMBIOS 3.1.0 "7.18 Memory Device (Type 17)"
@@ -325,7 +319,6 @@ struct MachineClass { unsigned cpu_index);const CPUArchIdList *(*possible_cpu_arch_ids)(MachineState *machine);int64_t (*get_default_cpu_node_id)(const MachineState *ms,int idx); -ram_addr_t (*fixup_ram_size)(ram_addr_t size);uint64_t smbios_memory_device_size;bool (*create_default_memdev)(MachineState *ms,const char *path,Error **errp);
hw/core/machine.c +0 -3
@@ -648,9 +648,6 @@ static void machine_set_mem(Object *obj, Visitor *v, const char *name, mem->size = mc->default_ram_size; } mem->size =QEMU_ALIGN_UP (mem->size,8192 ); -if (mc->fixup_ram_size) { - mem->size = mc->fixup_ram_size (mem->size); - }if ((ram_addr_t )mem->size != mem->size) { error_setg(errp, "ram size %llu exceeds permitted maximum %llu", (unsigned long long)mem->size,
Signature · 1 line
2.51.0
Re: [PATCH v2 3/3] hw/core/machine: Remove MachineClass::fixup_ram_size callback
Quoted 11 lines · Philippe Mathieu-Daudé
The
MachineClass::fixup_ram_sizecallback, which was added in commit5c30ef937f5("vl/s390x: fixup ram sizes for compat machines"), was only used by the s390-ccw-virtio-4.2 machine, which got removed. Remove it as now unused.Reported-by Thomas Huth <[email protected]>Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/hw/boards.h | 7 ------- hw/core/machine.c | 3 --- 2 files changed, 10 deletions(-)