From patchwork Fri Feb 7 12:12:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 24294 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8D49B2096A for ; Fri, 7 Feb 2014 12:14:45 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf5663152pab.3 for ; Fri, 07 Feb 2014 04:14:44 -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=jjI45QqsLT/DOeC/sDpCBUZN0y5j15QgIXYnuT99v8RrJ/WMyjYWTxCZpkEw07hWzT 1GZtGzgyuF3RKQGj+nyWSriFXss7WnfGKzU68rU1oOQj0uGEZwc/5ua8mrK8mxzmAUa6 W9FcKMHCzAfk5Sar/9297PgqAI2iy7xZiPjW1tl9cjIW54NI8dXvQhrLCaLYe1RfRcIU aFFvNNQi88weIpEe0vgb4PwgLqHl+sSu1Lxqi6+RPAOKMZvuhr/nZgvrG1j82eA2E2Iq roXLf4PpsJ7Ch0WMjmqJs9QlbraShOr+NaQQekt+g0zOAc3VEhMRTP3z1NOJGWZmyf07 9Z7w== X-Gm-Message-State: ALoCoQmNTPDC8q5lK+C3jYCDQr+4yYqWrNIDyMtO1EmngB5IoCLnreBem4F99AOpPAK4H2TgZLUT X-Received: by 10.66.140.8 with SMTP id rc8mr2478299pab.41.1391775284799; Fri, 07 Feb 2014 04:14:44 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.103 with SMTP id k94ls44093qgd.39.gmail; Fri, 07 Feb 2014 04:14:44 -0800 (PST) X-Received: by 10.52.120.81 with SMTP id la17mr34177vdb.44.1391775284691; Fri, 07 Feb 2014 04:14:44 -0800 (PST) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id cz20si1261147veb.53.2014.02.07.04.14.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 07 Feb 2014 04:14:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id f12so2554356vbg.31 for ; Fri, 07 Feb 2014 04:14:44 -0800 (PST) X-Received: by 10.220.192.71 with SMTP id dp7mr31278vcb.45.1391775284595; Fri, 07 Feb 2014 04:14:44 -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 u4csp98753vcz; Fri, 7 Feb 2014 04:14:43 -0800 (PST) X-Received: by 10.140.32.98 with SMTP id g89mr19930948qgg.37.1391775282218; Fri, 07 Feb 2014 04:14:42 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id v8si3325551qab.33.2014.02.07.04.14.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 07 Feb 2014 04:14:42 -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 1WBkIp-0008KB-5j; Fri, 07 Feb 2014 12:13:03 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WBkIn-0008JX-DN for xen-devel@lists.xen.org; Fri, 07 Feb 2014 12:13:01 +0000 Received: from [85.158.139.211:64803] by server-9.bemta-5.messagelabs.com id CE/AB-11237-CCDC4F25; Fri, 07 Feb 2014 12:13:00 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-6.tower-206.messagelabs.com!1391775177!2373221!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.9.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24244 invoked from network); 7 Feb 2014 12:12:59 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 7 Feb 2014 12:12:59 -0000 X-IronPort-AV: E=Sophos;i="4.95,800,1384300800"; d="scan'208";a="98945533" Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 07 Feb 2014 12:12:57 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Fri, 7 Feb 2014 07:12:57 -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 1WBkIi-0002qV-To; Fri, 07 Feb 2014 12:12:56 +0000 From: Ian Campbell To: Date: Fri, 7 Feb 2014 12:12:53 +0000 Message-ID: <1391775176-30313-2-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391775139.2162.88.camel@kazak.uk.xensource.com> References: <1391775139.2162.88.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 v4 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.212.44 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.