]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/s390/kvm/kvm-s390.c
KVM: s390: Set guest storage limit and offset to sane values
[linux-2.6-omap-h63xx.git] / arch / s390 / kvm / kvm-s390.c
index b802ce6f675fdc2e3ed96a62dc25ca05878ae906..cdab57c5bc70736b154a90ba11f54a3b6cf74d3d 100644 (file)
@@ -247,11 +247,16 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu)
        vcpu->arch.sie_block->gbea = 1;
 }
 
+/* The current code can have up to 256 pages for virtio */
+#define VIRTIODESCSPACE (256ul * 4096ul)
+
 int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
 {
        atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH);
-       vcpu->arch.sie_block->gmslm = 0xffffffffffUL;
-       vcpu->arch.sie_block->gmsor = 0x000000000000;
+       vcpu->arch.sie_block->gmslm = vcpu->kvm->arch.guest_memsize +
+                                     vcpu->kvm->arch.guest_origin +
+                                     VIRTIODESCSPACE - 1ul;
+       vcpu->arch.sie_block->gmsor = vcpu->kvm->arch.guest_origin;
        vcpu->arch.sie_block->ecb   = 2;
        vcpu->arch.sie_block->eca   = 0xC1002001U;
        setup_timer(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup,