[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 14/19] s390-virtio: Apply same memory boundaries as v
From: |
Christian Borntraeger |
Subject: |
[Qemu-devel] [PULL 14/19] s390-virtio: Apply same memory boundaries as virtio-ccw |
Date: |
Mon, 1 Sep 2014 14:54:25 +0200 |
From: Matthew Rosato <address@hidden>
Although s390-virtio won't support memory hotplug, it should
enforce the same memory boundaries so that it can use shared codepaths
(like read_SCP_info).
Signed-off-by: Matthew Rosato <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
---
hw/s390x/s390-virtio.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
index 1a75a1c..4ca52b7 100644
--- a/hw/s390x/s390-virtio.c
+++ b/hw/s390x/s390-virtio.c
@@ -230,18 +230,21 @@ static void s390_init(MachineState *machine)
ram_addr_t my_ram_size = machine->ram_size;
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
- int shift = 0;
+ int increment_size = 20;
uint8_t *storage_keys;
void *virtio_region;
hwaddr virtio_region_len;
hwaddr virtio_region_start;
- /* s390x ram size detection needs a 16bit multiplier + an increment. So
- guests > 64GB can be specified in 2MB steps etc. */
- while ((my_ram_size >> (20 + shift)) > 65535) {
- shift++;
+ /*
+ * The storage increment size is a multiple of 1M and is a power of 2.
+ * The number of storage increments must be MAX_STORAGE_INCREMENTS or
+ * fewer.
+ */
+ while ((my_ram_size >> increment_size) > MAX_STORAGE_INCREMENTS) {
+ increment_size++;
}
- my_ram_size = my_ram_size >> (20 + shift) << (20 + shift);
+ my_ram_size = my_ram_size >> increment_size << increment_size;
/* let's propagate the changed ram size into the global variable. */
ram_size = my_ram_size;
--
1.8.4.2
- [Qemu-devel] [PULL 00/19] s390x/kvm: Several updates/fixes/features, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 02/19] s390x/kvm: execute sigp orders on the target vcpu thread, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 01/19] s390x/kvm: run guest triggered resets on the target vcpu thread, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 03/19] s390x/kvm: execute "system reset" cpu resets on the vcpu thread, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 10/19] pc-bios/s390-ccw: Do proper console setup, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 09/19] pc-bios/s390-ccw: IPL from DASD with format variations, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 07/19] pc-bios/s390-ccw Improve ECKD informational message, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 04/19] s390x/kvm: execute the first cpu reset on the vcpu thread, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 14/19] s390-virtio: Apply same memory boundaries as virtio-ccw,
Christian Borntraeger <=
- [Qemu-devel] [PULL 16/19] s390x/gdb: don't touch the cc if tcg is not enabled, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 05/19] pc-bios/s390-ccw: support all virtio block size, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 13/19] virtio-ccw: Include standby memory when calculating storage increment, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 11/19] pc-bios/s390-ccw.img binary update, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 15/19] sclp-s390: Add memory hotplug SCLPs, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 06/19] pc-bios/s390-ccw: handle more ECKD DASD block sizes, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 08/19] pc-bios/s390-ccw Really big EAV ECKD DASD handling, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 17/19] s390x/gdb: add the feature xml files for s390x, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 18/19] s390x/gdb: generate target.xml and handle fp/ac as coprocessors, Christian Borntraeger, 2014/09/01
- [Qemu-devel] [PULL 12/19] sclp-s390: Add device to manage s390 memory hotplug, Christian Borntraeger, 2014/09/01