mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
KVM: s390: Change the virtual memory mapping location for virtio devices
The current location for mapping virtio devices does not take into consideration 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> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
This commit is contained in:
parent
b13b5dc7c9
commit
3188bf6b80
@ -443,29 +443,30 @@ static int __init test_devices_support(unsigned long addr)
|
|||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Init function for virtio
|
* 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)
|
static int __init kvm_devices_init(void)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
|
unsigned long total_memory_size = sclp_get_rzm() * sclp_get_rnmax();
|
||||||
|
|
||||||
if (!MACHINE_IS_KVM)
|
if (!MACHINE_IS_KVM)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
if (test_devices_support(real_memory_size) < 0)
|
if (test_devices_support(total_memory_size) < 0)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
rc = vmem_add_mapping(real_memory_size, PAGE_SIZE);
|
rc = vmem_add_mapping(total_memory_size, PAGE_SIZE);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
kvm_devices = (void *) real_memory_size;
|
kvm_devices = (void *) total_memory_size;
|
||||||
|
|
||||||
kvm_root = root_device_register("kvm_s390");
|
kvm_root = root_device_register("kvm_s390");
|
||||||
if (IS_ERR(kvm_root)) {
|
if (IS_ERR(kvm_root)) {
|
||||||
rc = PTR_ERR(kvm_root);
|
rc = PTR_ERR(kvm_root);
|
||||||
printk(KERN_ERR "Could not register kvm_s390 root device");
|
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;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user