From patchwork Tue Feb 11 14:11:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 24455 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D4A1B206FF for ; Tue, 11 Feb 2014 14:12:29 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id g12sf33959160oah.2 for ; Tue, 11 Feb 2014 06:12:28 -0800 (PST) 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=clLDmMk9JrELl+2fqIuOhCJq3+C2tC2XcL1zm8fQDGE=; b=nGeiY1aru1+AjHky3WhVhWR0noj9/6+a17vLkFSt7dGycfzzBt59E9Vlv03o+C11Sx Veca4m/XZC1Fv3/u+XxkpBb8rMa9jIznTBLy35aMxAeEI4ZPq0Kgd8TU1uD8bRTlGqK6 RmV8H+Ub1GayPd7bZAyXEheApZh5iWMfu77/xo21QK84E4ahiemaW4BfjTEjkR1W+Voo IkbjzeMWIxIUoSX083K6wsiIgZ/s1Nnylbgtvem1qNl/oI04ON0PwLCDgcMS2kh6TRtz aVf5BC50ApofN3V+NYVgQwEa7lpS8/yrJPp4Ocsj8gES4hb2B1U2knEyatqfKJ6JQUAZ JC1g== X-Gm-Message-State: ALoCoQlCnlzJ24Bv1F4h3vEIrHR8hahCCNxWtzQMCuopRHlZ1a+MTZSE8n3XRIQAbP1y56pCJWWP X-Received: by 10.182.236.74 with SMTP id us10mr1273253obc.36.1392127948504; Tue, 11 Feb 2014 06:12:28 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.107.228 with SMTP id h91ls1674878qgf.76.gmail; Tue, 11 Feb 2014 06:12:28 -0800 (PST) X-Received: by 10.221.55.133 with SMTP id vy5mr28565804vcb.17.1392127948395; Tue, 11 Feb 2014 06:12:28 -0800 (PST) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id ny8si5937800vcb.144.2014.02.11.06.12.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Feb 2014 06:12:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.173 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.173; Received: by mail-vc0-f173.google.com with SMTP id ld13so5881791vcb.18 for ; Tue, 11 Feb 2014 06:12:27 -0800 (PST) X-Received: by 10.58.54.15 with SMTP id f15mr28175570vep.5.1392127947796; Tue, 11 Feb 2014 06:12:27 -0800 (PST) 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.174.196 with SMTP id u4csp249291vcz; Tue, 11 Feb 2014 06:12:27 -0800 (PST) X-Received: by 10.42.197.134 with SMTP id ek6mr89923icb.97.1392127945354; Tue, 11 Feb 2014 06:12:25 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id kj7si17503667igb.61.2014.02.11.06.12.24 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Feb 2014 06:12:25 -0800 (PST) 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 1WDE3N-0002Yp-OB; Tue, 11 Feb 2014 14:11:13 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WDE3M-0002YQ-6h for xen-devel@lists.xen.org; Tue, 11 Feb 2014 14:11:12 +0000 Received: from [85.158.137.68:26589] by server-7.bemta-3.messagelabs.com id 74/D9-13775-F7F2AF25; Tue, 11 Feb 2014 14:11:11 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1392127868!1127751!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.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 23126 invoked from network); 11 Feb 2014 14:11:10 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 11 Feb 2014 14:11:10 -0000 X-IronPort-AV: E=Sophos;i="4.95,825,1384300800"; d="scan'208";a="101601009" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 11 Feb 2014 14:11:05 +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, 11 Feb 2014 09:11:04 -0500 Received: from drall.uk.xensource.com ([10.80.16.71] helo=drall.uk.xensource.com.) by norwich.cam.xci-test.com with esmtp (Exim 4.72) (envelope-from ) id 1WDE3E-00005n-DB; Tue, 11 Feb 2014 14:11:04 +0000 From: Ian Campbell To: Date: Tue, 11 Feb 2014 14:11:01 +0000 Message-ID: <1392127864-2605-2-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1392127796.26657.130.camel@kazak.uk.xensource.com> References: <1392127796.26657.130.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: julien.grall@linaro.org, tim@xen.org, Ian Campbell , stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH v5 2/5] xen: arm: rename p2m next_gfn_to_relinquish to lowest_mapped_gfn 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.173 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: This has other uses other than during relinquish, so rename it for clarity. This is a pure rename. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- xen/arch/arm/p2m.c | 9 ++++----- xen/include/asm-arm/p2m.h | 8 +++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index ace3c54..a61edeb 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -388,7 +388,7 @@ static int apply_p2m_changes(struct domain *d, { if ( hypercall_preempt_check() ) { - p2m->next_gfn_to_relinquish = addr >> PAGE_SHIFT; + p2m->lowest_mapped_gfn = addr >> PAGE_SHIFT; rc = -EAGAIN; goto out; } @@ -415,8 +415,7 @@ static int apply_p2m_changes(struct domain *d, unsigned long egfn = paddr_to_pfn(end_gpaddr); p2m->max_mapped_gfn = MAX(p2m->max_mapped_gfn, egfn); - /* Use next_gfn_to_relinquish to store the lowest gfn mapped */ - p2m->next_gfn_to_relinquish = MIN(p2m->next_gfn_to_relinquish, sgfn); + p2m->lowest_mapped_gfn = MIN(p2m->lowest_mapped_gfn, sgfn); } rc = 0; @@ -606,7 +605,7 @@ int p2m_init(struct domain *d) p2m->first_level = NULL; p2m->max_mapped_gfn = 0; - p2m->next_gfn_to_relinquish = ULONG_MAX; + p2m->lowest_mapped_gfn = ULONG_MAX; err: spin_unlock(&p2m->lock); @@ -619,7 +618,7 @@ int relinquish_p2m_mapping(struct domain *d) struct p2m_domain *p2m = &d->arch.p2m; return apply_p2m_changes(d, RELINQUISH, - pfn_to_paddr(p2m->next_gfn_to_relinquish), + pfn_to_paddr(p2m->lowest_mapped_gfn), pfn_to_paddr(p2m->max_mapped_gfn), pfn_to_paddr(INVALID_MFN), MATTR_MEM, p2m_invalid); diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h index 53b3266..e9c884a 100644 --- a/xen/include/asm-arm/p2m.h +++ b/xen/include/asm-arm/p2m.h @@ -24,9 +24,11 @@ struct p2m_domain { */ unsigned long max_mapped_gfn; - /* When releasing mapped gfn's in a preemptible manner, recall where - * to resume the search */ - unsigned long next_gfn_to_relinquish; + /* Lowest mapped gfn in the p2m. When releasing mapped gfn's in a + * preemptible manner this is update to track recall where to + * resume the search. Apart from during teardown this can only + * decrease. */ + unsigned long lowest_mapped_gfn; }; /* List of possible type for each page in the p2m entry.