From patchwork Tue May 10 12:49:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 94981 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 134A1B6F11 for ; Tue, 10 May 2011 22:49:32 +1000 (EST) Received: from localhost ([::1]:49698 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJmNV-0005gR-Fi for incoming@patchwork.ozlabs.org; Tue, 10 May 2011 08:49:29 -0400 Received: from eggs.gnu.org ([140.186.70.92]:39208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJmNL-0005dL-Ej for qemu-devel@nongnu.org; Tue, 10 May 2011 08:49:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJmNH-0004zg-6R for qemu-devel@nongnu.org; Tue, 10 May 2011 08:49:19 -0400 Received: from mtagate3.uk.ibm.com ([194.196.100.163]:57884) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJmNG-0004z7-VE for qemu-devel@nongnu.org; Tue, 10 May 2011 08:49:15 -0400 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate3.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p4ACnBYx022158 for ; Tue, 10 May 2011 12:49:11 GMT Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p4ACnBWV1745006 for ; Tue, 10 May 2011 13:49:11 +0100 Received: from d06av08.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p4ACnBlE001704 for ; Tue, 10 May 2011 13:49:11 +0100 Received: from [9.152.224.62] (dyn-9-152-224-62.boeblingen.de.ibm.com [9.152.224.62]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p4ACnB1E001335; Tue, 10 May 2011 13:49:11 +0100 Message-ID: <4DC93446.3000807@de.ibm.com> Date: Tue, 10 May 2011 14:49:10 +0200 From: Christian Borntraeger User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Alexander Graf X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 194.196.100.163 Cc: Carsten Otte , "qemu-devel@nongnu.org" Subject: [Qemu-devel] s390x: change mapping base to allow guests > 2GB X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Alex, the current s390x qemu memory layout is 0x1000000: guest start 0x80000000: qemu binary which limits the amount of available memory to <2GB. This patch moves the guest pages to 32GB to not collide with the binary and to leave some space for the program break of qemu. Signed-off-by: Christian Borntraeger Make sure that big guests (e.g. 4 GB do not collide with the binary) --- qemu-kvm.orig/exec.c 2011-05-04 09:25:22.411957322 +0200 +++ qemu-kvm/exec.c 2011-05-10 14:45:28.158409982 +0200 @@ -2900,10 +2900,14 @@ #endif } else { #if defined(TARGET_S390X) && defined(CONFIG_KVM) - /* XXX S390 KVM requires the topmost vma of the RAM to be < 256GB */ - new_block->host = mmap((void*)0x1000000, size, + /* S390 KVM requires the topmost vma of the RAM to be smaller than + an system defined value, which is at least 256GB. Larger systems + have larger values. We put the guest between the end of data + segment (system break) and this value. We use 32GB as a base to + have enough room for the system break to grow. */ + new_block->host = mmap((void*)0x800000000, size, PROT_EXEC|PROT_READ|PROT_WRITE, - MAP_SHARED | MAP_ANONYMOUS, -1, 0); + MAP_SHARED | MAP_ANONYMOUS | MAP_FIXED, -1, 0); #else new_block->host = qemu_vmalloc(size); #endif