From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Eric Farman" <farman@linux.ibm.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
qemu-s390x@nongnu.org, "Thomas Huth" <thuth@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Jason Herne" <jjherne@linux.ibm.com>,
"David Hildenbrand" <david@redhat.com>,
"Matthew Rosato" <mjrosato@linux.ibm.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: [PATCH v2 2/3] hw/s390x/ccw: Remove SCLPDevice::increment_size field
Date: Mon, 20 Oct 2025 11:49:01 +0200 [thread overview]
Message-ID: <20251020094903.72182-3-philmd@linaro.org> (raw)
In-Reply-To: <20251020094903.72182-1-philmd@linaro.org>
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.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/s390x/sclp.h | 5 +----
hw/s390x/sclp.c | 34 +++-------------------------------
2 files changed, 4 insertions(+), 35 deletions(-)
diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h
index d32f6180e0d..33f01f85bb1 100644
--- a/include/hw/s390x/sclp.h
+++ b/include/hw/s390x/sclp.h
@@ -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 {
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 8602a566a49..c9a9c4bb375 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -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)
--
2.51.0
next prev parent reply other threads:[~2025-10-20 9:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 9:48 [PATCH v2 0/3] hw/s390x: Remove s390-ccw-virtio-4.2 machine Philippe Mathieu-Daudé
2025-10-20 9:49 ` [PATCH v2 1/3] hw/s390x/ccw: Remove deprecated " Philippe Mathieu-Daudé
2025-10-20 10:20 ` Thomas Huth
2025-10-20 9:49 ` Philippe Mathieu-Daudé [this message]
2025-10-20 10:23 ` [PATCH v2 2/3] hw/s390x/ccw: Remove SCLPDevice::increment_size field Thomas Huth
2025-10-20 9:49 ` [PATCH v2 3/3] hw/core/machine: Remove MachineClass::fixup_ram_size callback Philippe Mathieu-Daudé
2025-10-20 10:24 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251020094903.72182-3-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=eduardo@habkost.net \
--cc=farman@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=jjherne@linux.ibm.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mjrosato@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
--cc=wangyanan55@huawei.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).