From patchwork Tue Jun 23 15:24:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 31993 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5NFRV1M007600 for ; Tue, 23 Jun 2009 15:27:32 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755508AbZFWP10 (ORCPT ); Tue, 23 Jun 2009 11:27:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755299AbZFWP10 (ORCPT ); Tue, 23 Jun 2009 11:27:26 -0400 Received: from mtagate3.de.ibm.com ([195.212.29.152]:46711 "EHLO mtagate3.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753667AbZFWP1Z (ORCPT ); Tue, 23 Jun 2009 11:27:25 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.14.3/8.13.8) with ESMTP id n5NFRRvk224390 for ; Tue, 23 Jun 2009 15:27:27 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n5NFRQfW3674222 for ; Tue, 23 Jun 2009 17:27:26 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n5NFRQNb012641 for ; Tue, 23 Jun 2009 17:27:26 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n5NFRQHa012638; Tue, 23 Jun 2009 17:27:26 +0200 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 17FA71224229; Tue, 23 Jun 2009 17:27:26 +0200 (CEST) Message-Id: <20090623152725.354167000@de.ibm.com> User-Agent: quilt/0.47-1 Date: Tue, 23 Jun 2009 17:24:06 +0200 From: Christian Borntraeger To: Avi Kivity Cc: Carsten Otte , Heiko Carstens , Martin Schwidefsky , KVM , Christian Borntraeger Subject: [patch 1/3] kvm-s390: Fix memslot initialization for userspace_addr != 0 References: <20090623152405.582759000@de.ibm.com> Content-Disposition: inline; filename=fix_memslot.patch Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Christian Borntraeger Since commit 854b5338196b1175706e99d63be43a4f8d8ab607 Author: Christian Ehrhardt KVM: s390: streamline memslot handling s390 uses the values of the memslot instead of doing everything in the arch ioctl handler of the KVM_SET_USER_MEMORY_REGION. Unfortunately we missed to set the userspace_addr of our memslot due to our s390 ifdef in __kvm_set_memory_region. Old s390 userspace launchers did not notice, since they started the guest at userspace address 0. Because of CONFIG_DEFAULT_MMAP_MIN_ADDR we now put the guest at 1M userspace, which does not work. This patch makes sure that new.userspace_addr is set on s390. This fix should go in quickly. Nevertheless, looking at the code we should clean up that ifdef in the long term. Any kernel janitors? Signed-off-by: Christian Borntraeger --- virt/kvm/kvm_main.c | 4 ++++ 1 file changed, 4 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: kvm/virt/kvm/kvm_main.c =================================================================== --- kvm.orig/virt/kvm/kvm_main.c +++ kvm/virt/kvm/kvm_main.c @@ -1199,6 +1199,10 @@ int __kvm_set_memory_region(struct kvm * if (old.npages) kvm_arch_flush_shadow(kvm); } +#else /* not defined CONFIG_S390 */ + new.user_alloc = user_alloc; + if (user_alloc) + new.userspace_addr = mem->userspace_addr; #endif /* not defined CONFIG_S390 */ if (!npages)