From patchwork Tue Apr 8 14:19:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 27981 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2098420447 for ; Tue, 8 Apr 2014 14:20:55 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id wo20sf4311300obc.6 for ; Tue, 08 Apr 2014 07:20:54 -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=ixATOpVDSJEr29b5HuKEnW71Ee2721ZLjsZAuYF32PA=; b=Xr/HNYyhxHheUxFQjWFWOJfvHtVVX65uUZ9X+Ijuduk7klOKCP5k2MtfUj82NS0rkI 4ZAaZxkK6Pggn9lOTZvd+Qd5BROkUseV1Cewe2oomQbQD7zo8c1vK+JEhwHQNexY7NJ5 fyP8+IaLDbYd1Xm2LBkewv6Zrn3Jai4qp1L549E25e+Upc6rz3cjouzLXEOIAVSnTxTV dPd6/d8p6qc6Y9Z9nzK28DMqlFtMW3t4fAfCuCii44lWowlcDDJCHRzswHFzdiUOcF95 Poi+keaX+UdRZtFSBdURGtq2DuYFilskBsXc+u8MKuA+oOpU07ObZN2dlSl9FhFug0oG Ttlg== X-Gm-Message-State: ALoCoQncxkhLxLGHmZEXWvU5KKhmj+XUQYYZHSSvyzMN4Zct5snf30Qmrds4nIyZa4M7jDZYWS8d X-Received: by 10.182.219.226 with SMTP id pr2mr1896458obc.44.1396966854698; Tue, 08 Apr 2014 07:20:54 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.22.75 with SMTP id 69ls219388qgm.94.gmail; Tue, 08 Apr 2014 07:20:54 -0700 (PDT) X-Received: by 10.220.106.84 with SMTP id w20mr3481557vco.18.1396966854548; Tue, 08 Apr 2014 07:20:54 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id h11si415647vcu.152.2014.04.08.07.20.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Apr 2014 07:20:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so803920vcb.6 for ; Tue, 08 Apr 2014 07:20:54 -0700 (PDT) X-Received: by 10.58.111.163 with SMTP id ij3mr788254veb.26.1396966854480; Tue, 08 Apr 2014 07:20:54 -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.12.8 with SMTP id v8csp249698vcv; Tue, 8 Apr 2014 07:20:54 -0700 (PDT) X-Received: by 10.52.251.199 with SMTP id zm7mr2915503vdc.21.1396966854094; Tue, 08 Apr 2014 07:20:54 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id k4si411864vcv.204.2014.04.08.07.20.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 08 Apr 2014 07:20:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) 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 1WXWs5-00051I-50; Tue, 08 Apr 2014 14:19:29 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WXWs3-0004yo-C8 for xen-devel@lists.xen.org; Tue, 08 Apr 2014 14:19:27 +0000 Received: from [85.158.139.211:17106] by server-3.bemta-5.messagelabs.com id 12/F3-28132-E6504435; Tue, 08 Apr 2014 14:19:26 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1396966762!4412070!2 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.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8268 invoked from network); 8 Apr 2014 14:19:25 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 8 Apr 2014 14:19:25 -0000 X-IronPort-AV: E=Sophos;i="4.97,818,1389744000"; d="scan'208";a="117888861" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 08 Apr 2014 14:19:22 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.80) with Microsoft SMTP Server id 14.2.342.4; Tue, 8 Apr 2014 10:19:21 -0400 Received: from marilith-n13-p0.uk.xensource.com ([10.80.229.115] helo=marilith-n13.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WXWrx-0005Fw-6U; Tue, 08 Apr 2014 14:19:21 +0000 From: Ian Campbell To: Date: Tue, 8 Apr 2014 15:19:18 +0100 Message-ID: <1396966760-7752-2-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1396966739.22845.233.camel@kazak.uk.xensource.com> References: <1396966739.22845.233.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH 2/4] xen: arm: move magic pfns out of guest RAM region 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=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: Because toolstacks (at least libxl) only allow RAM to be specified in 1M increments these two pages were effectively costing 1M of guest RAM space. Since these pages don't actually need to live in RAM just move them out. With this a guest can now use the full 768M of the address space reserved for RAM. (ok, not that impressive, but it simplifies things later) Signed-off-by: Ian Campbell Acked-by: Julien Grall --- tools/libxc/xc_dom_arm.c | 10 +++++----- xen/include/public/arch-arm.h | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c index c085b4a..36b1487 100644 --- a/tools/libxc/xc_dom_arm.c +++ b/tools/libxc/xc_dom_arm.c @@ -58,12 +58,12 @@ static int setup_pgtables_arm(struct xc_dom_image *dom) static int alloc_magic_pages(struct xc_dom_image *dom) { int rc, i; + const xen_pfn_t base = GUEST_MAGIC_BASE >> PAGE_SHIFT; xen_pfn_t p2m[NR_MAGIC_PAGES]; - DOMPRINTF_CALLED(dom->xch); for (i = 0; i < NR_MAGIC_PAGES; i++) - p2m[i] = dom->rambase_pfn + dom->total_pages + i; + p2m[i] = base + i; rc = xc_domain_populate_physmap_exact( dom->xch, dom->guest_domid, NR_MAGIC_PAGES, @@ -71,8 +71,8 @@ static int alloc_magic_pages(struct xc_dom_image *dom) if ( rc < 0 ) return rc; - dom->console_pfn = dom->rambase_pfn + dom->total_pages + CONSOLE_PFN_OFFSET; - dom->xenstore_pfn = dom->rambase_pfn + dom->total_pages + XENSTORE_PFN_OFFSET; + dom->console_pfn = base + CONSOLE_PFN_OFFSET; + dom->xenstore_pfn = base + XENSTORE_PFN_OFFSET; xc_clear_domain_page(dom->xch, dom->guest_domid, dom->console_pfn); xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn); @@ -262,7 +262,7 @@ int arch_setup_meminit(struct xc_dom_image *dom) const uint64_t modsize = dtb_size + ramdisk_size; const uint64_t ram128mb = rambase + (128<<20); - if ( ramend - 1 > GUEST_RAM_END - NR_MAGIC_PAGES*XC_PAGE_SIZE ) + if ( ramend - 1 > GUEST_RAM_END ) { DOMPRINTF("%s: ram size is too large for guest address space: " "%"PRIx64" > %"PRIx64, diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index dc11040..b860da5 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -375,6 +375,8 @@ typedef uint64_t xen_callback_t; #define GUEST_GNTTAB_BASE 0xb0000000ULL #define GUEST_GNTTAB_SIZE 0x00020000ULL +#define GUEST_MAGIC_BASE 0xc0000000ULL + /* Interrupts */ #define GUEST_TIMER_VIRT_PPI 27 #define GUEST_TIMER_PHYS_S_PPI 29