qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Matthew Rosato <mjrosato@linux.vnet.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Alexander Graf <agraf@suse.de>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Jens Freimann <jfrei@linux.vnet.ibm.com>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PULL 12/19] sclp-s390: Add device to manage s390 memory hotplug
Date: Mon,  1 Sep 2014 14:54:23 +0200	[thread overview]
Message-ID: <1409576070-55803-13-git-send-email-borntraeger@de.ibm.com> (raw)
In-Reply-To: <1409576070-55803-1-git-send-email-borntraeger@de.ibm.com>

From: Matthew Rosato <mjrosato@linux.vnet.ibm.com>

Add sclpMemoryHotplugDev to contain associated data structures, etc.

Signed-off-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 hw/s390x/sclp.c         | 30 ++++++++++++++++++++++++++++++
 include/hw/s390x/sclp.h | 20 ++++++++++++++++++++
 2 files changed, 50 insertions(+)

diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index d8ddf35..769d7c3 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -183,3 +183,33 @@ void s390_sclp_init(void)
                               OBJECT(dev), NULL);
     qdev_init_nofail(dev);
 }
+
+sclpMemoryHotplugDev *init_sclp_memory_hotplug_dev(void)
+{
+    DeviceState *dev;
+    dev = qdev_create(NULL, TYPE_SCLP_MEMORY_HOTPLUG_DEV);
+    object_property_add_child(qdev_get_machine(),
+                              TYPE_SCLP_MEMORY_HOTPLUG_DEV,
+                              OBJECT(dev), NULL);
+    qdev_init_nofail(dev);
+    return SCLP_MEMORY_HOTPLUG_DEV(object_resolve_path(
+                                   TYPE_SCLP_MEMORY_HOTPLUG_DEV, NULL));
+}
+
+sclpMemoryHotplugDev *get_sclp_memory_hotplug_dev(void)
+{
+    return SCLP_MEMORY_HOTPLUG_DEV(object_resolve_path(
+                                   TYPE_SCLP_MEMORY_HOTPLUG_DEV, NULL));
+}
+
+static TypeInfo sclp_memory_hotplug_dev_info = {
+    .name = TYPE_SCLP_MEMORY_HOTPLUG_DEV,
+    .parent = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(sclpMemoryHotplugDev),
+};
+
+static void register_types(void)
+{
+    type_register_static(&sclp_memory_hotplug_dev_info);
+}
+type_init(register_types);
diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h
index 7ef1622..5c43574 100644
--- a/include/hw/s390x/sclp.h
+++ b/include/hw/s390x/sclp.h
@@ -37,6 +37,7 @@
 #define SCLP_STARTING_SUBINCREMENT_ID           0x10001
 #define SCLP_INCREMENT_UNIT                     0x10000
 #define MAX_AVAIL_SLOTS                         32
+#define MAX_STORAGE_INCREMENTS                  1020
 
 /* CPU hotplug SCLP codes */
 #define SCLP_HAS_CPU_INFO                       0x0C00000000000000ULL
@@ -156,6 +157,23 @@ typedef struct SCCB {
     char data[SCCB_DATA_LEN];
  } QEMU_PACKED SCCB;
 
+typedef struct sclpMemoryHotplugDev sclpMemoryHotplugDev;
+
+#define TYPE_SCLP_MEMORY_HOTPLUG_DEV "sclp-memory-hotplug-dev"
+#define SCLP_MEMORY_HOTPLUG_DEV(obj) \
+  OBJECT_CHECK(sclpMemoryHotplugDev, (obj), TYPE_SCLP_MEMORY_HOTPLUG_DEV)
+
+struct sclpMemoryHotplugDev {
+    SysBusDevice parent;
+    ram_addr_t standby_mem_size;
+    ram_addr_t padded_ram_size;
+    ram_addr_t pad_size;
+    ram_addr_t standby_subregion_size;
+    ram_addr_t rzm;
+    int increment_size;
+    char *standby_state_map;
+};
+
 static inline int sccb_data_len(SCCB *sccb)
 {
     return be16_to_cpu(sccb->h.length) - sizeof(sccb->h);
@@ -163,6 +181,8 @@ static inline int sccb_data_len(SCCB *sccb)
 
 
 void s390_sclp_init(void);
+sclpMemoryHotplugDev *init_sclp_memory_hotplug_dev(void);
+sclpMemoryHotplugDev *get_sclp_memory_hotplug_dev(void);
 void sclp_service_interrupt(uint32_t sccb);
 void raise_irq_cpu_hotplug(void);
 
-- 
1.8.4.2

  parent reply	other threads:[~2014-09-01 12:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01 12:54 [Qemu-devel] [PULL 00/19] s390x/kvm: Several updates/fixes/features Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 01/19] s390x/kvm: run guest triggered resets on the target vcpu thread Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 02/19] s390x/kvm: execute sigp orders " Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 03/19] s390x/kvm: execute "system reset" cpu resets on the " Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 04/19] s390x/kvm: execute the first cpu reset " Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 05/19] pc-bios/s390-ccw: support all virtio block size Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 06/19] pc-bios/s390-ccw: handle more ECKD DASD block sizes Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 07/19] pc-bios/s390-ccw Improve ECKD informational message Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 08/19] pc-bios/s390-ccw Really big EAV ECKD DASD handling Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 09/19] pc-bios/s390-ccw: IPL from DASD with format variations Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 10/19] pc-bios/s390-ccw: Do proper console setup Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 11/19] pc-bios/s390-ccw.img binary update Christian Borntraeger
2014-09-01 12:54 ` Christian Borntraeger [this message]
2014-09-01 12:54 ` [Qemu-devel] [PULL 13/19] virtio-ccw: Include standby memory when calculating storage increment Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 14/19] s390-virtio: Apply same memory boundaries as virtio-ccw Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 15/19] sclp-s390: Add memory hotplug SCLPs Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 16/19] s390x/gdb: don't touch the cc if tcg is not enabled Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 17/19] s390x/gdb: add the feature xml files for s390x Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 18/19] s390x/gdb: generate target.xml and handle fp/ac as coprocessors Christian Borntraeger
2014-09-01 12:54 ` [Qemu-devel] [PULL 19/19] s390x/gdb: coding style fixes Christian Borntraeger
2014-09-01 13:44 ` [Qemu-devel] [PULL 00/19] s390x/kvm: Several updates/fixes/features Peter Maydell

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=1409576070-55803-13-git-send-email-borntraeger@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=cornelia.huck@de.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=mjrosato@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).