From patchwork Fri Apr 25 13:10:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 29071 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f70.google.com (mail-pb0-f70.google.com [209.85.160.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F0CC8202E6 for ; Fri, 25 Apr 2014 13:12:34 +0000 (UTC) Received: by mail-pb0-f70.google.com with SMTP id jt11sf5211159pbb.5 for ; Fri, 25 Apr 2014 06:12:34 -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:message-id:from:to:date:in-reply-to :references:organization: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=vOvhsrbScLNQsgU8BdD6esPAlzQyMmNkqrGY90KSPz8=; b=gzOXfNH7fisFOFdylabPOOGieHd6QX11ExHfVt5xJT5ynoO6kmmOZvi0Pf2Oz17n4s KmvsBgLLxwZo801rTnud/EnR/AgySX7gcJf99Vp43OcVcnozVRKE76Iy0kpeJ53DOSsO abYQB8UI8Svy9U6P/Ei5wUYCelfID7A1Af+Cq15ljmKDvahyJq0reW93SkBYijXS88yS RpVdjKoFNJBPaauUf7LtySPvpt+EJ0/o5LuxxoUYsRYY/zI+LPOTWPBei7zWVmMAOzGt 1uEhWzFDWKm8lA4FpRmHewN/9ZS8sqIJOdxIqZSYliGK0GL/ZYI2aCbZb0d2XSn7sMhZ ZSBA== X-Gm-Message-State: ALoCoQmnN6n1o8Km9IKkipHYFmJS6bOE2I91hJ3fptDut2m6rKKBpU/WWgA4OSNbb+42+oVWjMv1 X-Received: by 10.68.180.132 with SMTP id do4mr4463942pbc.4.1398431554154; Fri, 25 Apr 2014 06:12:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.70 with SMTP id u64ls1527911qgd.80.gmail; Fri, 25 Apr 2014 06:12:34 -0700 (PDT) X-Received: by 10.220.147.16 with SMTP id j16mr6828664vcv.14.1398431553995; Fri, 25 Apr 2014 06:12:33 -0700 (PDT) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id cm9si1692897vcb.46.2014.04.25.06.12.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 25 Apr 2014 06:12:33 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id oz11so4618617veb.6 for ; Fri, 25 Apr 2014 06:12:33 -0700 (PDT) X-Received: by 10.220.4.132 with SMTP id 4mr6843270vcr.9.1398431553922; Fri, 25 Apr 2014 06:12:33 -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 ib8csp96675vcb; Fri, 25 Apr 2014 06:12:33 -0700 (PDT) X-Received: by 10.140.92.230 with SMTP id b93mr3095627qge.12.1398431553525; Fri, 25 Apr 2014 06:12:33 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id s6si3781632qas.115.2014.04.25.06.12.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 25 Apr 2014 06:12:33 -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 1WdftY-0003Lj-2h; Fri, 25 Apr 2014 13:10:24 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WdftV-0003LU-Nw for xen-devel@lists.xen.org; Fri, 25 Apr 2014 13:10:21 +0000 Received: from [193.109.254.147:39258] by server-15.bemta-14.messagelabs.com id D0/C2-15813-CBE5A535; Fri, 25 Apr 2014 13:10:20 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-16.tower-27.messagelabs.com!1398431419!897902!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 14949 invoked from network); 25 Apr 2014 13:10:20 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-16.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 25 Apr 2014 13:10:20 -0000 X-IronPort-AV: E=Sophos;i="4.97,927,1389744000"; d="scan'208";a="124563367" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 25 Apr 2014 13:10:18 +0000 Received: from [10.80.2.80] (10.80.2.80) by FTLPEX01CL03.citrite.net (10.13.107.80) with Microsoft SMTP Server id 14.3.123.3; Fri, 25 Apr 2014 09:10:18 -0400 Message-ID: <1398431417.18537.462.camel@kazak.uk.xensource.com> From: Ian Campbell To: Julien Grall Date: Fri, 25 Apr 2014 14:10:17 +0100 In-Reply-To: <1398428540.18537.449.camel@kazak.uk.xensource.com> References: <1398424945.18537.424.camel@kazak.uk.xensource.com> <1398424967-9306-3-git-send-email-ian.campbell@citrix.com> <535A5080.3020608@linaro.org> <1398428540.18537.449.camel@kazak.uk.xensource.com> Organization: Citrix Systems, Inc. X-Mailer: Evolution 3.8.5-2+b3 MIME-Version: 1.0 X-Originating-IP: [10.80.2.80] X-DLP: MIA1 Cc: tim@xen.org, xen-devel@lists.xen.org, ian.jackson@eu.citrix.com, stefano.stabellini@eu.citrix.com Subject: Re: [Xen-devel] [PATCH v2 3/8] tools: 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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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: On Fri, 2014-04-25 at 13:22 +0100, Ian Campbell wrote: > On Fri, 2014-04-25 at 13:09 +0100, Julien Grall wrote: > > > > On 25/04/14 12:22, Ian Campbell wrote: > > > diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h > > > index dd53c94..a94d16b 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 > > > + > > > > I'm wondering if we need to move NR_MAGIC_PAGES or add a comment in > > arch-arm.h if someone wants to bump the number page magic page. > > > > Or perhaps a BUG_ON in libxc to check at compilation time the hole is > > large enought to hold all special pages. > > I'll add GUEST_MAGIC_SIZE and a (BUILD_)BUG_ON to check against it. Doing that in this patch would require a full repost since it has knock on effects on other patches. So instead I have tacked on the end: 8<--------------- >From f38f5e3e6e5be151e7734ffb114bbee3ce251c81 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 25 Apr 2014 14:07:45 +0100 Subject: [PATCH v3 9/8] tools: arm: make the size of the magic page region explicit Signed-off-by: Ian Campbell --- tools/libxc/xc_dom_arm.c | 2 ++ xen/include/public/arch-arm.h | 1 + 2 files changed, 3 insertions(+) diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c index 7216d2a..c2f6d27 100644 --- a/tools/libxc/xc_dom_arm.c +++ b/tools/libxc/xc_dom_arm.c @@ -62,6 +62,8 @@ static int alloc_magic_pages(struct xc_dom_image *dom) const xen_pfn_t base = GUEST_MAGIC_BASE >> PAGE_SHIFT; xen_pfn_t p2m[NR_MAGIC_PAGES]; + XC_BUILD_BUG_ON(NR_MAGIC_PAGES > GUEST_MAGIC_SIZE >> XC_PAGE_SHIFT); + DOMPRINTF_CALLED(dom->xch); for (i = 0; i < NR_MAGIC_PAGES; i++) diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h index 061d59d..31ba44d 100644 --- a/xen/include/public/arch-arm.h +++ b/xen/include/public/arch-arm.h @@ -376,6 +376,7 @@ typedef uint64_t xen_callback_t; #define GUEST_GNTTAB_SIZE 0x01000000ULL #define GUEST_MAGIC_BASE 0x39000000ULL +#define GUEST_MAGIC_SIZE 0x01000000ULL #define GUEST_RAM0_BASE 0x40000000ULL /* 3GB of low RAM @ 1GB */ #define GUEST_RAM0_SIZE 0xc0000000ULL