From patchwork Wed Feb 5 16:03: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: 24186 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4AAE6202B2 for ; Wed, 5 Feb 2014 16:05:37 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wo20sf2811351obc.7 for ; Wed, 05 Feb 2014 08:05:36 -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=hkoUrtCuvATZ7FjIYMGRufV+U2zYUaQ/duHhgXXAtQ1QIZrHfed90h90R8S2kzfb94 d72sQGufYVC3aRmr4GrrfbGm+uwSB7y0uDoXk2M5/AN1gpLogu8sK8/W9DDrAYjSnf6A pf98O1BjhtLUgRdIli3c+nktIbPv5cEcuAN+YhKIMt+fioQHL9IEmsIcW0DiF47SRqZM TCmyT0mDMjZgP3DNd5ltFROS4Axa1z6cKMyarbDa4sGyd7jHA8j2yD/J0NidvLGlqxKb uNKx9XhObVh+7NvVXhYuDK0IBYWbie52IS7BWbkI35+yIuymNtJLOS300NZctJjajiTf nZzQ== X-Gm-Message-State: ALoCoQmJVEia55AyTXjPPEDQmdzk0Kv/O0Rln158sC3UYgEWpuX1nBVrIIvE4wewzySQT1BoPlt0 X-Received: by 10.182.24.134 with SMTP id u6mr900308obf.24.1391616336224; Wed, 05 Feb 2014 08:05:36 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.119 with SMTP id h110ls153493qge.54.gmail; Wed, 05 Feb 2014 08:05:36 -0800 (PST) X-Received: by 10.52.170.241 with SMTP id ap17mr1285683vdc.13.1391616336120; Wed, 05 Feb 2014 08:05:36 -0800 (PST) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id tj7si9801031vdc.7.2014.02.05.08.05.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 08:05:36 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.179 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.179; Received: by mail-vc0-f179.google.com with SMTP id lh14so437787vcb.38 for ; Wed, 05 Feb 2014 08:05:36 -0800 (PST) X-Received: by 10.221.39.138 with SMTP id tm10mr1539677vcb.7.1391616336032; Wed, 05 Feb 2014 08:05:36 -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 u4csp57577vcz; Wed, 5 Feb 2014 08:05:35 -0800 (PST) X-Received: by 10.58.66.137 with SMTP id f9mr1523674vet.11.1391616332091; Wed, 05 Feb 2014 08:05:32 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id rx9si9807105vcb.138.2014.02.05.08.05.26 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 05 Feb 2014 08:05:32 -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 1WB4xL-00040O-LL; Wed, 05 Feb 2014 16:04:07 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WB4xD-0003zE-Vc for xen-devel@lists.xen.org; Wed, 05 Feb 2014 16:04:00 +0000 Received: from [85.158.139.211:54086] by server-14.bemta-5.messagelabs.com id AD/B3-27598-FE062F25; Wed, 05 Feb 2014 16:03:59 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-15.tower-206.messagelabs.com!1391616236!1892776!1 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 17360 invoked from network); 5 Feb 2014 16:03:58 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-15.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 5 Feb 2014 16:03:58 -0000 X-IronPort-AV: E=Sophos;i="4.95,787,1384300800"; d="scan'208";a="98266512" Received: from accessns.citrite.net (HELO FTLPEX01CL01.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 05 Feb 2014 16:03:56 +0000 Received: from norwich.cam.xci-test.com (10.80.248.129) by smtprelay.citrix.com (10.13.107.78) with Microsoft SMTP Server id 14.2.342.4; Wed, 5 Feb 2014 11:03:55 -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 1WB4x9-00064X-Bb; Wed, 05 Feb 2014 16:03:55 +0000 From: Ian Campbell To: Date: Wed, 5 Feb 2014 16:03:53 +0000 Message-ID: <1391616235-22703-2-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391616214.23098.9.camel@kazak.uk.xensource.com> References: <1391616214.23098.9.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 v2 2/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.179 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.