From patchwork Wed Jan 29 12:11:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 23831 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 255C6202FA for ; Wed, 29 Jan 2014 12:13:41 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id e9sf3629339qcy.7 for ; Wed, 29 Jan 2014 04:13:40 -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=OJWhDX0dW2hR+dKzfDlAUCLcDnlCmXGJDrvZq+vdwos=; b=PVu1KbhUb2A0/KSnEyRdVS6OxLFFyK0Xk8YoaW5VS/OM0GS1YIhPol1BKWT8Qm7CKE AEQ1CCgfigtY6fk9IwpjY3+pMqdSD0NHvnf/1a0bUrRAcxPwgJF7Yi419b1u5iF/m1LD GLQScgm8B7ws+rQo+WBEW2PNvmKNxQoE95KZdSyufue8/aAQQXoBiska4MB39we5Jn0y 5F5vp8Dy2QyV5TkxxekuXenNXZNX+dfaGXhPBF/jsnbViLXjChSicZo4XSNr+iZkDCx+ ZFG+9RWCGa9RJePSd9IP0KDsbBEfBaRyV7/89ErZ3FsOtDT1KbClHoOTYdOnrG5C29tY 4nwg== X-Gm-Message-State: ALoCoQl+arqmVigmJgM2rYEdKAEKOB8vgrILB8NRRRNV1ZZGs1ANdUUDZ/KV1/j0PCbsLwcf3+yt X-Received: by 10.236.149.198 with SMTP id x46mr2592131yhj.7.1390997620362; Wed, 29 Jan 2014 04:13:40 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.149 with SMTP id c21ls86867qgd.52.gmail; Wed, 29 Jan 2014 04:13:40 -0800 (PST) X-Received: by 10.52.181.33 with SMTP id dt1mr5405620vdc.21.1390997620244; Wed, 29 Jan 2014 04:13:40 -0800 (PST) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id sm10si740475vec.5.2014.01.29.04.13.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 04:13:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.182 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.182; Received: by mail-vc0-f182.google.com with SMTP id id10so1124855vcb.27 for ; Wed, 29 Jan 2014 04:13:40 -0800 (PST) X-Received: by 10.220.95.139 with SMTP id d11mr6341807vcn.21.1390997620162; Wed, 29 Jan 2014 04:13:40 -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 u4csp107816vcz; Wed, 29 Jan 2014 04:13:39 -0800 (PST) X-Received: by 10.229.171.8 with SMTP id f8mr11174114qcz.13.1390997619614; Wed, 29 Jan 2014 04:13:39 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id a8si1587514qak.80.2014.01.29.04.13.39 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Jan 2014 04:13:39 -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 1W8Tzb-0005jf-Pl; Wed, 29 Jan 2014 12:11:43 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W8TzZ-0005j5-Lh for xen-devel@lists.xen.org; Wed, 29 Jan 2014 12:11:41 +0000 Received: from [85.158.143.35:15303] by server-3.bemta-4.messagelabs.com id 3D/1A-11539-DFFE8E25; Wed, 29 Jan 2014 12:11:41 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-14.tower-21.messagelabs.com!1390997497!1622469!2 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 4621 invoked from network); 29 Jan 2014 12:11:40 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-14.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 29 Jan 2014 12:11:40 -0000 X-IronPort-AV: E=Sophos;i="4.95,741,1384300800"; d="scan'208";a="97649452" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO01.CITRIX.COM with ESMTP; 29 Jan 2014 12:11:28 +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; Wed, 29 Jan 2014 07:11:27 -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 1W8TzK-0000ow-Gk; Wed, 29 Jan 2014 12:11:26 +0000 From: Ian Campbell To: Date: Wed, 29 Jan 2014 12:11:25 +0000 Message-ID: <1390997486-3986-3-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1390997452.31814.90.camel@kazak.uk.xensource.com> References: <1390997452.31814.90.camel@kazak.uk.xensource.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Ian Campbell , julien.grall@linaro.org, tim@xen.org, george.dunlap@citrix.com, stefano.stabellini@eu.citrix.com Subject: [Xen-devel] [PATCH 3/4] 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.182 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.