From patchwork Tue Apr 3 15:32:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 132764 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3954206ljb; Tue, 3 Apr 2018 08:35:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/5zoOcESRH9+sAZRoIhCKZKac131SmFLGKAh3efZuNxzke3wmHejr9Gl/yuWL9gaO6+l/r X-Received: by 10.107.57.133 with SMTP id g127mr11900904ioa.52.1522769720599; Tue, 03 Apr 2018 08:35:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522769720; cv=none; d=google.com; s=arc-20160816; b=mnkO2oh4QZc8vopPAOaXsc4cc+Y4lBYI/uYTU8ieazmO6jIp0vsUJAenj1Z+OhtWIr nj/tr033gTijMmtTAb55bwFs3uaoDiI1yPuhGotd42utGBKNfVU8RrbU4hAWNNqOf/3j Q12V/p2Mt9M1wV7wcP0Q0E+82CcPG6BceTyzbsbsUB2a5MPioZQa2Cz7M9/NUHZ7ZHA1 yVyuQzl4OVvJTOJ3q/aj2HGJhaSCAzjdyMJt4t1N9xwetKsaMw3kdNeyzbD/HOs0Erwd /uGKQz3sNtvjqADVJZWWqflQiQJaeawKA1uXGW6PIoOZdDRCK4FH/e/H/3oRVEK3ZLwW NFzQ== 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 :arc-authentication-results; bh=sriRTEYQi35uFDEGxdj6+knBm4zJCeZ88JGJTzDIVrA=; b=GLzIAG/bLqqTnmgjSk2nc18XUIipFhAaKpMwgDpJ0rcLNBi3GOFaWxFBW8WVkqmzFE 6GpdkXzD7ZY9FCgS1+Krrf6OyOJRwQnWEymjFyIdq0k9Fd67GzoRPoIaFYT1GgCHlLAD fk3Ak1Fhq+lxwqegpFhuLzMLBV19Ua4i0+0QG2YVjcCDQazHom44uzLcUTA96fzH4CEw sJk8pp56Csr2eAQ43LBz0FuCtipf7rG43+AktRGn4VFssuhu3l0cGsnrqqrkvD3gsUQk M9RLKE3CEKYSkbLTmuxLiyYQbVhP3dyEJxvywng5vl+iLWwox8jruzrcCS2rzouqz75M xt9w== 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 d12-v6si2287674itj.71.2018.04.03.08.35.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Apr 2018 08:35:20 -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 1f3Nvv-0007uK-Ak; Tue, 03 Apr 2018 15:33:15 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1f3Nvt-0007sl-UD for xen-devel@lists.xen.org; Tue, 03 Apr 2018 15:33:13 +0000 X-Inumbo-ID: 7c228b36-3754-11e8-8249-2fda3a446a53 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 7c228b36-3754-11e8-8249-2fda3a446a53; Tue, 03 Apr 2018 15:34:23 +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 8C65A1596; Tue, 3 Apr 2018 08:33:12 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C290D3F24A; Tue, 3 Apr 2018 08:33:10 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Tue, 3 Apr 2018 16:32:43 +0100 Message-Id: <20180403153251.19595-9-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180403153251.19595-1-julien.grall@arm.com> References: <20180403153251.19595-1-julien.grall@arm.com> Subject: [Xen-devel] [for-4.11][PATCH v7 08/16] xen/mm: Drop the parameter mfn from populate_pt_range 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: Stefano Stabellini , Wei Liu , Andrew Cooper , Ian Jackson , George Dunlap , Tim Deegan , Julien Grall , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The function populate_pt_range is used to populate in advance the page-table but it will not do the actual mapping. So passing the MFN in parameter is pointless. Note that the only caller pass 0... At the same time replace 0 by INVALID_MFNs. While this does not matter as the entry will marked as not valid and populated, INVALID_MFN helps the reader to know the MFN is invalid. Signed-off-by: Julien Grall Acked-by: Andrew Cooper Reviewed-by: Wei Liu Reviewed-by: George Dunlap Acked-by: Stefano Stabellini --- Cc: Stefano Stabellini Cc: Julien Grall Cc: Ian Jackson Cc: Jan Beulich Cc: Konrad Rzeszutek Wilk Cc: Tim Deegan Changes in v6: - Add George's and Wei's reviewed-by - Add Andrew's acked-by Changes in v5: - Update the commit message to explain why 0 -> INVALID_MFN. Changes in v4: - Patch added. --- xen/arch/arm/mm.c | 5 ++--- xen/arch/x86/mm.c | 5 ++--- xen/common/vmap.c | 2 +- xen/include/xen/mm.h | 3 +-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 1126e246c0..436df6936b 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1072,10 +1072,9 @@ int map_pages_to_xen(unsigned long virt, return create_xen_entries(INSERT, virt, _mfn(mfn), nr_mfns, flags); } -int populate_pt_range(unsigned long virt, unsigned long mfn, - unsigned long nr_mfns) +int populate_pt_range(unsigned long virt, unsigned long nr_mfns) { - return create_xen_entries(RESERVE, virt, _mfn(mfn), nr_mfns, 0); + return create_xen_entries(RESERVE, virt, INVALID_MFN, nr_mfns, 0); } int destroy_xen_mappings(unsigned long v, unsigned long e) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 605f4377fa..6d5f40482e 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5007,10 +5007,9 @@ int map_pages_to_xen( return 0; } -int populate_pt_range(unsigned long virt, unsigned long mfn, - unsigned long nr_mfns) +int populate_pt_range(unsigned long virt, unsigned long nr_mfns) { - return map_pages_to_xen(virt, mfn, nr_mfns, MAP_SMALL_PAGES); + return map_pages_to_xen(virt, mfn_x(INVALID_MFN), nr_mfns, MAP_SMALL_PAGES); } /* diff --git a/xen/common/vmap.c b/xen/common/vmap.c index 0b23f8fb97..11785ffb0a 100644 --- a/xen/common/vmap.c +++ b/xen/common/vmap.c @@ -42,7 +42,7 @@ void __init vm_init_type(enum vmap_region type, void *start, void *end) bitmap_fill(vm_bitmap(type), vm_low[type]); /* Populate page tables for the bitmap if necessary. */ - populate_pt_range(va, 0, vm_low[type] - nr); + populate_pt_range(va, vm_low[type] - nr); } static void *vm_alloc(unsigned int nr, unsigned int align, diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h index 142aa73354..538478fa24 100644 --- a/xen/include/xen/mm.h +++ b/xen/include/xen/mm.h @@ -175,8 +175,7 @@ int destroy_xen_mappings(unsigned long v, unsigned long e); * Create only non-leaf page table entries for the * page range in Xen virtual address space. */ -int populate_pt_range(unsigned long virt, unsigned long mfn, - unsigned long nr_mfns); +int populate_pt_range(unsigned long virt, unsigned long nr_mfns); /* Claim handling */ unsigned long domain_adjust_tot_pages(struct domain *d, long pages); int domain_set_outstanding_pages(struct domain *d, unsigned long pages);