[S390] kvm_s390: Fix oops in virtio device detection with "mem="
authorChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 14 Nov 2008 17:18:02 +0000 (18:18 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 14 Nov 2008 17:18:52 +0000 (18:18 +0100)
The current virtio model on s390 has the descriptor page above the main
memory. The guest virtio detection will oops if the mem= parameter is
used to reduce/change the memory size.
We have to use real_memory_size instead of max_pfn to detect the virtio
descriptor pages.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
drivers/s390/kvm/kvm_virtio.c

index ff4a6931bb8e680b4f429577fc81e481df4cd786..3d442444c618ccb431d7e4d6b6e1b5bc4f16924b 100644 (file)
@@ -322,13 +322,13 @@ static int __init kvm_devices_init(void)
                return rc;
        }
 
-       rc = vmem_add_mapping(PFN_PHYS(max_pfn), PAGE_SIZE);
+       rc = vmem_add_mapping(real_memory_size, PAGE_SIZE);
        if (rc) {
                s390_root_dev_unregister(kvm_root);
                return rc;
        }
 
-       kvm_devices = (void *) PFN_PHYS(max_pfn);
+       kvm_devices = (void *) real_memory_size;
 
        ctl_set_bit(0, 9);
        register_external_interrupt(0x2603, kvm_extint_handler);