From patchwork Tue May 14 12:31:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 164192 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2561696ili; Tue, 14 May 2019 05:32:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIKBhQoU6XLy9mvUOwl57zrwFFGlXqiTqVitt1TOP5tywDGlvC5Ab6OJSU0h4HBOWr9xRa X-Received: by 2002:a02:1cc6:: with SMTP id c189mr22530256jac.119.1557837153409; Tue, 14 May 2019 05:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557837153; cv=none; d=google.com; s=arc-20160816; b=NESnBlq3kGAzyRG7xRryC4lSaM9hgc7rsJRO8zApdgbWuXw3pWHMW+PySGXKWHJOjB m+tNeIDZFIVHANPZahAckKl2doB+d3bJVeYh0cy/k/me5+zqNuHLOxwtQ2QnXLEddrPG q1fa28U7dssNXvrniz2QPQpRip4jBTjrzq9hzsM33xmg7UOxI+e+G1THbgZODDzK2Vvb QtRQb0zR5tcLlPPgB5e4+N7Ot/uNOvTwxRE8YirU84CFZEmc87kqE0TH3vnwl0Ya5ALG /FWtykOakKV9P5hSQODEsrykQnaBpA4uAxBn9ldXU9pyMxAKgG4irKsi39gooveBemc+ 2w/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=DzCZSgyav+mtmOFNt5O6rV4PUjXSBF4b36MR1VD+oL8=; b=X2yaVsuuzxR47rQb78Tx4Iqi9C9QbpvrlhGcbNyzS+s6XtVSXHf3qrFsWQzE+VTFqZ E61YL50OCAqp7ryuRFnzHs+SO0E23Setmm+VmDVocw1QPZqh0Ld3vh5yAqEAh306LuUP Q3svYvHEJGxjU0MvJsPK8NmTXMl70dYxBEML6k9EGPA0Sp7v38V8MtLvHi6eoc0Rv0Nn T+FYmGig6dYNBER4nQsfO9aRsoR+wZXnRFBUZf14U9y+svMorKdrmYQvpxQu68mvei5t sVsO2tKRIhKhJaTdANub07JtCKTi4lVzEcU4WeE8L3HulAY10vklN3EntP/cIlz2aR8U 2u/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id a6si8949483ios.154.2019.05.14.05.32.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 05:32:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQWam-0005LE-Gh; Tue, 14 May 2019 12:31:36 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hQWal-0005L9-P6 for xen-devel@lists.xenproject.org; Tue, 14 May 2019 12:31:35 +0000 X-Inumbo-ID: 35d8d544-7644-11e9-bbf8-af7ffef685ad Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 35d8d544-7644-11e9-bbf8-af7ffef685ad; Tue, 14 May 2019 12:31:34 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 318DC15AD; Tue, 14 May 2019 05:31:34 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F25383F71E; Tue, 14 May 2019 05:31:32 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Tue, 14 May 2019 13:31:15 +0100 Message-Id: <20190514123125.29086-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190514123125.29086-1-julien.grall@arm.com> References: <20190514123125.29086-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH MM-PART3 v2 02/12] xen/arm: mm: Rename create_xen_entries() to xen_pt_update() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Oleksandr_Tyshchenko@epam.com, Julien Grall , Stefano Stabellini , Andrii Anisov MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" create_xen_entries() is doing more than creating entries. It can also modify and remove entries. Rename the function to make clear what the function is actually doing. Signed-off-by: Julien Grall Reviewed-by: Andrii Anisov Acked-by: Stefano Stabellini --- Changes in v2: - Add Andrii's reviewed-by --- xen/arch/arm/mm.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index b408de7c75..36e22fc9ad 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -970,11 +970,11 @@ enum xenmap_operation { static DEFINE_SPINLOCK(xen_pt_lock); -static int create_xen_entries(enum xenmap_operation op, - unsigned long virt, - mfn_t mfn, - unsigned long nr_mfns, - unsigned int flags) +static int xen_pt_update(enum xenmap_operation op, + unsigned long virt, + mfn_t mfn, + unsigned long nr_mfns, + unsigned int flags) { int rc = 0; unsigned long addr = virt, addr_end = addr + nr_mfns * PAGE_SIZE; @@ -1067,25 +1067,24 @@ int map_pages_to_xen(unsigned long virt, unsigned long nr_mfns, unsigned int flags) { - return create_xen_entries(INSERT, virt, mfn, nr_mfns, flags); + return xen_pt_update(INSERT, virt, mfn, nr_mfns, flags); } int populate_pt_range(unsigned long virt, unsigned long nr_mfns) { - return create_xen_entries(RESERVE, virt, INVALID_MFN, nr_mfns, 0); + return xen_pt_update(RESERVE, virt, INVALID_MFN, nr_mfns, 0); } int destroy_xen_mappings(unsigned long v, unsigned long e) { ASSERT(v <= e); - return create_xen_entries(REMOVE, v, INVALID_MFN, (e - v) >> PAGE_SHIFT, 0); + return xen_pt_update(REMOVE, v, INVALID_MFN, (e - v) >> PAGE_SHIFT, 0); } int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int flags) { ASSERT(s <= e); - return create_xen_entries(MODIFY, s, INVALID_MFN, (e - s) >> PAGE_SHIFT, - flags); + return xen_pt_update(MODIFY, s, INVALID_MFN, (e - s) >> PAGE_SHIFT, flags); } enum mg { mg_clear, mg_ro, mg_rw, mg_rx };