summaryrefslogtreecommitdiff
path: root/hw/s390x/s390-virtio-ccw.c
diff options
context:
space:
mode:
authorJason J. Herne <jjherne@linux.vnet.ibm.com>2015-06-26 14:01:00 -0400
committerCornelia Huck <cornelia.huck@de.ibm.com>2015-09-03 12:17:54 +0200
commit0f5f669147b52f89928bdf180165f74c4219210e (patch)
tree80daed9c487d7bdb2bf64bd2867b7305cc701a0c /hw/s390x/s390-virtio-ccw.c
parent0efe406cac8a4d9f0b52eada4c6c2a768fe4b7d2 (diff)
downloadqemu-0f5f669147b52f89928bdf180165f74c4219210e.tar.gz
qemu-0f5f669147b52f89928bdf180165f74c4219210e.tar.bz2
qemu-0f5f669147b52f89928bdf180165f74c4219210e.zip
s390x: Enable new s390-storage-keys device
s390 guest initialization is modified to make use of new s390-storage-keys device. Old code that globally allocated storage key array is removed. The new device enables storage key access for kvm guests. Cache storage key QOM objects in frequently used helper functions to avoid a performance hit every time we use one of these functions. Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/s390x/s390-virtio-ccw.c')
-rw-r--r--hw/s390x/s390-virtio-ccw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 71df282f5f..0a057aeb90 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -19,6 +19,7 @@
#include "virtio-ccw.h"
#include "qemu/config-file.h"
#include "s390-pci-bus.h"
+#include "hw/s390x/storage-keys.h"
#define TYPE_S390_CCW_MACHINE "s390-ccw-machine"
@@ -105,7 +106,6 @@ static void ccw_init(MachineState *machine)
MemoryRegion *sysmem = get_system_memory();
MemoryRegion *ram = g_new(MemoryRegion, 1);
sclpMemoryHotplugDev *mhd = init_sclp_memory_hotplug_dev();
- uint8_t *storage_keys;
int ret;
VirtualCssBus *css_bus;
DeviceState *dev;
@@ -179,11 +179,11 @@ static void ccw_init(MachineState *machine)
mhd->standby_mem_size = standby_mem_size;
}
- /* allocate storage keys */
- storage_keys = g_malloc0(my_ram_size / TARGET_PAGE_SIZE);
+ /* Initialize storage key device */
+ s390_skeys_init();
/* init CPUs */
- s390_init_cpus(machine->cpu_model, storage_keys);
+ s390_init_cpus(machine->cpu_model);
if (kvm_enabled()) {
kvm_s390_enable_css_support(s390_cpu_addr2state(0));