From patchwork Thu May 22 09:46:43 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 30583 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4CD3120671 for ; Thu, 22 May 2014 09:48:31 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id lc6sf10659382vcb.3 for ; Thu, 22 May 2014 02:48:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=aQTfinCefYf2lQ0hcLz0MjS1oXIAlfd4gANkcqIU2Dk=; b=iIySWGm9XVeR1M8DPgJVmFe3CPBQGS9/anIfCBxhvp2EklaQLLYzhbDAgBOFnQgbAu 8Un8urov1ukmQb2pmyRhqLQCPus42zY3I6Vsqr/LnrgCLpOfRC7MYtmoaG1JehkD3fi6 WlkKsyL9qTX4WKtrWoCqSsM8i2/nxH3qJD4q0RwOqouLkyd3PkInxAWANqcwymcEI9nd rpz5ONI6ebyo9/CEpO3fg8mvStg9cLbWedh/uaOi6U4nYvyr2QTbZo7HJ+sqdcG+vDbg pFlCx5pMNjCE/KGpBAaHVlamLtp/cpkBy7r+6bJ4FpYCpSbS2KNtAUpEDNQcOVjlkhgn VISw== X-Gm-Message-State: ALoCoQljIrfrSlNNrrpNVNhm2xHKQnrEhkH4gxFccT8+dBTnz0Q9ZqwdryYIxTUsWN4mMmhcMQgT X-Received: by 10.58.106.75 with SMTP id gs11mr16883026veb.18.1400752111138; Thu, 22 May 2014 02:48:31 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.145 with SMTP id f17ls966911qgd.95.gmail; Thu, 22 May 2014 02:48:31 -0700 (PDT) X-Received: by 10.221.24.207 with SMTP id rf15mr14833818vcb.17.1400752111044; Thu, 22 May 2014 02:48:31 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id u8si4534759vcn.26.2014.05.22.02.48.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 02:48:31 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id if11so718321vcb.22 for ; Thu, 22 May 2014 02:48:31 -0700 (PDT) X-Received: by 10.52.185.72 with SMTP id fa8mr12585236vdc.12.1400752110971; Thu, 22 May 2014 02:48:30 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp183726vcb; Thu, 22 May 2014 02:48:30 -0700 (PDT) X-Received: by 10.220.94.146 with SMTP id z18mr167421vcm.40.1400752110458; Thu, 22 May 2014 02:48:30 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id v18si4534289vcu.0.2014.05.22.02.48.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 22 May 2014 02:48:30 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WnPak-0005II-Gg; Thu, 22 May 2014 09:47:14 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WnPai-0005G2-I9 for xen-devel@lists.xen.org; Thu, 22 May 2014 09:47:12 +0000 Received: from [85.158.137.68:41889] by server-8.bemta-3.messagelabs.com id 71/62-21547-F97CD735; Thu, 22 May 2014 09:47:11 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-9.tower-31.messagelabs.com!1400752027!1741654!3 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 3503 invoked from network); 22 May 2014 09:47:10 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-9.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 22 May 2014 09:47:10 -0000 X-IronPort-AV: E=Sophos;i="4.98,886,1392163200"; d="scan'208";a="133839214" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 22 May 2014 09:46:53 +0000 Received: from ukmail1.uk.xensource.com (10.80.16.128) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.3.181.6; Thu, 22 May 2014 05:46:53 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=localhost.localdomain) by ukmail1.uk.xensource.com with smtp (Exim 4.69) (envelope-from ) id 1WnPaO-0000mO-Am; Thu, 22 May 2014 10:46:53 +0100 Received: by localhost.localdomain (sSMTP sendmail emulation); Thu, 22 May 2014 10:46:52 +0100 From: Ian Campbell To: , , , Date: Thu, 22 May 2014 10:46:43 +0100 Message-ID: <1400752004-9731-8-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1400751582.11409.46.camel@kazak.uk.xensource.com> References: <1400751582.11409.46.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell , xen-devel@lists.xen.org Subject: [Xen-devel] [PATCH v5 8/9] tools: arm: support up to (almost) 1TB of guest RAM X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ian.campbell@citrix.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: This creates a second bank of RAM starting at 8GB and potentially extending to the 1TB boundary, which is the limit imposed by our current use of a 3 level p2m with 2 pages at level 0 (2^40 bits). I've deliberately left a gap between the two banks just to exercise those code paths. The second bank is 1016GB in size which plus the 3GB below 4GB is 1019GB maximum guest RAM. At the point where the fact that this is slightly less than a full TB starts to become an issue for people then we can switch to a 4 level p2m, which would be needed to support guests larger than 1TB anyhow. Tested on 32-bit with 1, 4 and 6GB guests. Anything more than ~3GB requires an LPAE enabled kernel, or a 64-bit guest. Signed-off-by: Ian Campbell Acked-by: Julien Grall Acked-by: Ian Jackson --- v5: Use GUEST_RAM_BANK_{SIZE,BASE}S. v4: Significantly reworked (simplified) due to changes in earlier patches. Removed existing Acks. v3: remove inadvertent whitespace change --- xen/include/public/arch-arm.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index ea74295..fd30782 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -375,17 +375,20 @@ typedef uint64_t xen_callback_t; #define GUEST_MAGIC_BASE 0x39000000ULL #define GUEST_MAGIC_SIZE 0x01000000ULL -#define GUEST_RAM_BANKS 1 +#define GUEST_RAM_BANKS 2 -#define GUEST_RAM0_BASE 0x40000000ULL /* 3GB of RAM @ 1GB */ +#define GUEST_RAM0_BASE 0x40000000ULL /* 3GB of low RAM @ 1GB */ #define GUEST_RAM0_SIZE 0xc0000000ULL +#define GUEST_RAM1_BASE 0x0200000000ULL /* 1016GB of RAM @ 8GB */ +#define GUEST_RAM1_SIZE 0xfe00000000ULL + #define GUEST_RAM_BASE GUEST_RAM0_BASE /* Lowest RAM address */ /* Largest amount of actual RAM, not including holes */ -#define GUEST_RAM_MAX (GUEST_RAM0_SIZE) +#define GUEST_RAM_MAX (GUEST_RAM0_SIZE + GUEST_RAM1_SIZE) /* Suitable for e.g. const uint64_t ramfoo[] = GUEST_RAM_BANK_FOOS; */ -#define GUEST_RAM_BANK_BASES { GUEST_RAM0_BASE } -#define GUEST_RAM_BANK_SIZES { GUEST_RAM0_SIZE } +#define GUEST_RAM_BANK_BASES { GUEST_RAM0_BASE, GUEST_RAM1_BASE } +#define GUEST_RAM_BANK_SIZES { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE } /* Interrupts */ #define GUEST_TIMER_VIRT_PPI 27