summaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorNick Wang <jfwang@us.ibm.com>2012-07-03 11:28:36 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-05-02 15:50:24 +0200
commitedefc7107afedd6bd59e80bc0586ddb276edfcbe (patch)
tree23e32ee83912acf8dac905625262af9f8665eca2 /drivers/s390
parent7b1e427d685e2aee91f9a622f9c2691130f8e57d (diff)
downloadop-kernel-dev-edefc7107afedd6bd59e80bc0586ddb276edfcbe.zip
op-kernel-dev-edefc7107afedd6bd59e80bc0586ddb276edfcbe.tar.gz
s390/kvm: Change the virtual memory mapping location for Virtio devices
The current location for mapping Virtio devices does not take into consideration of the standby memory. This causes the failure of mapping standby memory since the location for the mapping is already taken by the Virtio devices. To fix the problem, we move the location to beyond the end of standby memory. Signed-off-by: Nick Wang <jfwang@us.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/kvm/kvm_virtio.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/s390/kvm/kvm_virtio.c b/drivers/s390/kvm/kvm_virtio.c
index 6711e65..2ea6165 100644
--- a/drivers/s390/kvm/kvm_virtio.c
+++ b/drivers/s390/kvm/kvm_virtio.c
@@ -443,29 +443,30 @@ static int __init test_devices_support(unsigned long addr)
}
/*
* Init function for virtio
- * devices are in a single page above top of "normal" mem
+ * devices are in a single page above top of "normal" + standby mem
*/
static int __init kvm_devices_init(void)
{
int rc;
+ unsigned long total_memory_size = sclp_get_rzm() * sclp_get_rnmax();
if (!MACHINE_IS_KVM)
return -ENODEV;
- if (test_devices_support(real_memory_size) < 0)
+ if (test_devices_support(total_memory_size) < 0)
return -ENODEV;
- rc = vmem_add_mapping(real_memory_size, PAGE_SIZE);
+ rc = vmem_add_mapping(total_memory_size, PAGE_SIZE);
if (rc)
return rc;
- kvm_devices = (void *) real_memory_size;
+ kvm_devices = (void *) total_memory_size;
kvm_root = root_device_register("kvm_s390");
if (IS_ERR(kvm_root)) {
rc = PTR_ERR(kvm_root);
printk(KERN_ERR "Could not register kvm_s390 root device");
- vmem_remove_mapping(real_memory_size, PAGE_SIZE);
+ vmem_remove_mapping(total_memory_size, PAGE_SIZE);
return rc;
}
OpenPOWER on IntegriCloud