From patchwork Tue Feb 4 14:22:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 24106 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7257E202FA for ; Tue, 4 Feb 2014 14:24:24 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id le5sf21884933vcb.11 for ; Tue, 04 Feb 2014 06:24:23 -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=iwO/wsdu/v2gwgrm2FEEzbBTyOFWZodbSag78C+vcQZsxtafa1mRPgcFJUY0+1760C QWnhETJfh1w7fMvu4NpI1hnNL5O1iaO22lUcbOaIXa4WCo/pfN+kOAjn26WUp/o4KU64 ZdZtyh6Smnu5p9pxOAQZNNW3yG+0T5HbtXpS8zGl2vlptLnNKSo4gJ7Cq4Hr5IJB8Skt Ii48M/WWwjJoAdLa7jeiGz5Kqphjzte4NrVWsY5f2ZRGobOyo8imxnLFgFuelzJBZdQR fCnYVYUZJ86brsR2G2XRHgR+PVGugWIVMgiLUtnQhaL8Z5RU9d4Ggx/AywhpOtegB4i/ w8Mw== X-Gm-Message-State: ALoCoQkTlhWsJwEBap38MnvpEnL75lUnApJ7aAaxdBDOhwRtbC6nQ/DgTffGz451JNadbW7DQUPY X-Received: by 10.236.98.104 with SMTP id u68mr43112yhf.1.1391523863443; Tue, 04 Feb 2014 06:24:23 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.96.52 with SMTP id j49ls2305397qge.7.gmail; Tue, 04 Feb 2014 06:24:23 -0800 (PST) X-Received: by 10.58.146.5 with SMTP id sy5mr252792veb.43.1391523863368; Tue, 04 Feb 2014 06:24:23 -0800 (PST) Received: from mail-ve0-f175.google.com (mail-ve0-f175.google.com [209.85.128.175]) by mx.google.com with ESMTPS id b7si8185870vej.70.2014.02.04.06.24.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Feb 2014 06:24:23 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.175; Received: by mail-ve0-f175.google.com with SMTP id c14so5926821vea.6 for ; Tue, 04 Feb 2014 06:24:23 -0800 (PST) X-Received: by 10.58.170.106 with SMTP id al10mr51382vec.61.1391523863282; Tue, 04 Feb 2014 06:24:23 -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 u4csp238152vcz; Tue, 4 Feb 2014 06:24:22 -0800 (PST) X-Received: by 10.220.133.80 with SMTP id e16mr33256655vct.13.1391523861615; Tue, 04 Feb 2014 06:24:21 -0800 (PST) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id p9si2715145vdv.18.2014.02.04.06.24.21 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 04 Feb 2014 06:24:21 -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 1WAgtW-0006F4-3i; Tue, 04 Feb 2014 14:22:34 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WAgtU-0006EM-Ic for xen-devel@lists.xen.org; Tue, 04 Feb 2014 14:22:32 +0000 Received: from [85.158.139.211:48226] by server-16.bemta-5.messagelabs.com id D6/0D-05060-7A7F0F25; Tue, 04 Feb 2014 14:22:31 +0000 X-Env-Sender: Ian.Campbell@citrix.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1391523748!1583330!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 2298 invoked from network); 4 Feb 2014 14:22:30 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 4 Feb 2014 14:22:30 -0000 X-IronPort-AV: E=Sophos;i="4.95,779,1384300800"; d="scan'208";a="97743708" Received: from accessns.citrite.net (HELO FTLPEX01CL03.citrite.net) ([10.9.154.239]) by FTLPIPO02.CITRIX.COM with ESMTP; 04 Feb 2014 14:22:26 +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, 4 Feb 2014 09:22:26 -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 1WAgtN-0004zY-Tt; Tue, 04 Feb 2014 14:22:25 +0000 From: Ian Campbell To: Date: Tue, 4 Feb 2014 14:22:23 +0000 Message-ID: <1391523745-21139-2-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391523701.5635.6.camel@kazak.uk.xensource.com> References: <1391523701.5635.6.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 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.128.175 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 --- 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.