From patchwork Wed Apr 24 16:59:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 162789 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp895678jan; Wed, 24 Apr 2019 10:01:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqySmiMLcxHWt1oNwpVnAKGoW8EfH45owGZS6VN5H117Mks0ft28FSRdGWDdxMoym+eUCR5+ X-Received: by 2002:a0d:ec86:: with SMTP id v128mr10102527ywe.128.1556125313593; Wed, 24 Apr 2019 10:01:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556125313; cv=none; d=google.com; s=arc-20160816; b=vgJSNdmmb/m44sr41fudnchmSbHLO0D7wxHaivnWOMEhjtRYFQTmhc4/tUv+tUJ1xa bGcjGYEIIo3ffVOlKKOPynetLxWFGcIVOj8B6sW3kVV/AkFg57G6cMYezGEf4JqzSkb2 jmuH5QHZ2U3FStqGL0kD60If+92+QtB0cwJe8w0jvZXGkUxB3kn7uYge2bekfHQ/6T04 C2IPthxXkPiqi+SGEn5AtDoSmDd9ftkM9HCbd9n+hc9RHYX0T5BPLd+nCG+yYGDvtgKa Zn+R++eoHhY6ZTjrr53iuJPsMV6Q7kANT9IuMzb0WSEpXDut+1jQwF80uSmUV4m6TGLL t6CQ== 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=8hguHsdSinYmO30SVyc5dThRBEseWvk43zMgI2E6Y+w=; b=agZr2doDCF/wKMxAbQNwyVKgYrytZUct9tTW2lUtPPzRidFWa9HhpYOEOfrIZV3j+E T+/PdTgvgPXebkMABo/evC/WNMItsqB5MV+PBMJ1E59srNUpJy2i2J0uwES2JFqVsOxg r9ZGI4VZ3xK54uGo/wQa0nPjZIuub6qNbjgRZgeTc4x+ntIxIEMIlR1IZ6XQArAXzfEp 8So+eV8WpIuIKl+pSQbe/shJpaVgASSgdGFT4OTInziRvK1kT2BKPuEz1XDhWI340oX4 UL24zstwDnAOnbb5Z7Arl+DBwAw6x95kJusqe8TbyDWw4BTO8gQqBpEpJMqGKq68CIds 5nXg== 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 l18si13671756ybp.183.2019.04.24.10.01.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2019 10:01:53 -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 1hJLFi-0007n2-CT; Wed, 24 Apr 2019 17:00:10 +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 1hJLFh-0007mw-4e for xen-devel@lists.xenproject.org; Wed, 24 Apr 2019 17:00:09 +0000 X-Inumbo-ID: 69ae0bec-66b2-11e9-9840-9b0330304ec4 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 69ae0bec-66b2-11e9-9840-9b0330304ec4; Wed, 24 Apr 2019 17:00:07 +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 38C5E15BE; Wed, 24 Apr 2019 10:00:07 -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 1E1143F557; Wed, 24 Apr 2019 10:00:05 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 24 Apr 2019 17:59:45 +0100 Message-Id: <20190424165955.23718-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190424165955.23718-1-julien.grall@arm.com> References: <20190424165955.23718-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 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 , sstabellini@kernel.org, Andrii_Anisov@epam.com 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 --- 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 d6157c35d6..df2ec3a36b 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -965,11 +965,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; @@ -1062,25 +1062,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 };