From patchwork Wed Mar 21 04:47:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 132190 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1696858ljb; Tue, 20 Mar 2018 21:50:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx48xrOJ/mo8MLa94OBM+4vtPgtloMH32I4EysmE8gtidrir+1fwJSe4kMHzyQ1c4ytxm0KqQ X-Received: by 2002:a24:a0c6:: with SMTP id o189-v6mr2481423ite.52.1521607846817; Tue, 20 Mar 2018 21:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521607846; cv=none; d=google.com; s=arc-20160816; b=LcPLPGnekovxY9vdiqJbai4mYUCEmpyga0xKXZ7VgUM/IIuB1DwrJ9enCnRy8HeBhS f6YmmWJ3eCZhbQJr1TKhc4RvQ8CYek8sazndFiSsG/fQyrs8RSrRbTtQ5CuLi3oEfTKW 415O+iZ0eQCW+yXYZig+BL6FuuW7YYDH1KmI6iEKedkDm+zB1xkZXp4Jg0gu8UPK38dQ uvMWg7eB7oAvsS4/H2Mwd8UBOMxfb3zItRmJ62+EIi3be+3JdoP81ZLWMvkkTC4nF49x TRmzckBT6gqwhVzm6iJvQe8diF6c/3sB7cxMhjZvJXbYU5dyUEftt4UL1iqTugRh4lVo TL5g== 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=GUbZlwmp6BuDksmtEfJr5My3+jgJD8PAu9Jb/34Rfo/MiA5Oxfdnnnmcin3+jaoSHa xevRMtqt2MqMBDN+jRx6PcCsr83UuL95dbKWDw4NmnYKHyKul6ZSqO4HF9q2zRZuXYWk QAwXipVSpcju7M161LC4+cghbaZZh/24WS97X6/8St8QYJQeywYNX6oHSPGNaYCqMQOW mJ+K5n3jtkyQJYLiBG92ogUIwta9ijyqBzTb8s7rbLWns2KtTYEPUi2B7+hDIAlaSOAW FAtMi1cRx8MzsjGN+q+pm7HxIxKmvy/hnHiqXkafunTCXgbpNTyete3sTbXm+NT9AZyI B8tw== 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 g19si2246783iog.184.2018.03.20.21.50.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 20 Mar 2018 21:50:46 -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 1eyVfR-0006pp-Pa; Wed, 21 Mar 2018 04:48:05 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1eyVfQ-0006p6-9z for xen-devel@lists.xen.org; Wed, 21 Mar 2018 04:48:04 +0000 X-Inumbo-ID: 01477fae-2cc3-11e8-9728-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 01477fae-2cc3-11e8-9728-bc764e045a96; Wed, 21 Mar 2018 05:47:48 +0100 (CET) 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 636E9164F; Tue, 20 Mar 2018 21:48:02 -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 99C6C3F487; Tue, 20 Mar 2018 21:48:00 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 21 Mar 2018 04:47:29 +0000 Message-Id: <20180321044737.20794-9-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180321044737.20794-1-julien.grall@arm.com> References: <20180321044737.20794-1-julien.grall@arm.com> Subject: [Xen-devel] [for-4.11][PATCH v6 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 --- 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);