Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp534294ybb; Wed, 8 Apr 2020 05:03:56 -0700 (PDT) X-Google-Smtp-Source: APiQypJzwyBV/nzZx9y5QD9R7Z/ytxh6EjzTXu+c7Ppeb2Z0VmQXjKJ0rEGmVQgndmnDVU6Z2p15 X-Received: by 2002:a9d:5787:: with SMTP id q7mr5046301oth.137.1586347436771; Wed, 08 Apr 2020 05:03:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586347436; cv=none; d=google.com; s=arc-20160816; b=e6RsOq/LGtfdihX2PO5Q+SFouWd+5nFMZakx4ZxcJ3QnOGVJq4i0kljuG03S9NR9JA IfuP/pPRYw5Ftsofw+sY+R7nb+R4fOrUeTuKfofS2ZDVNm8HIZCcjJR4OUdKLb1B3SF2 EyooEveC6wweWo4b+sFJ1Z2kh9qRvyJvE4m/dLe+pVvhhgY3AYY/CWqoM2LMUDTY1kz7 WHCBj42c+q3sxbzzA7xUStbPUsVqalvxx/DmFXgo6eXXeuwcgdZcNxJtHmLW1UNbKDsq wbv2Hc2XH4FP/xLule+GLcNvc7gWYh7eP5ENdv4xIJLIEMf+bb5Pv27kA+5E4hZjYwKb mb2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=F8FiHBCrG9trCoDrLT1wvc+8HEEyslQ5M3nlqbAOi4Y=; b=wxHoaaifP6zVXoJy4MXs6biGukPs/ZQ+0ot4OGA+gsRBVDHa3W1wtDMjyDGHDRNxYu 1kaZcohhO0MWtWLXcUgjobXNX6Q8SjeZ37U9HOAd0gmj2ApB9eIyKlMtVuuAUErKfcgp FqbRkXLdqwbppyF1clQKj+Ef7CwYNXLG6nHE6G0fFmX3a0Nmkc+GXQHVMuxcmL8971gp P6tR454fzQmOWphf7/yqOLDQOA6jLhIVA5ZcTCjZfYWryETb14cv/3ZvG25XIIKdzI+m G0aqTLsBMHZLvHLIy9a3B2sZRDyZlL2z975Cd+lmQkoxItd1F3jIlEoh1IXSm4j1oAz5 k/bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OK8x5jof; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17si2400651otq.269.2020.04.08.05.03.24; Wed, 08 Apr 2020 05:03:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=OK8x5jof; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728950AbgDHMAn (ORCPT + 99 others); Wed, 8 Apr 2020 08:00:43 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48970 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728919AbgDHMAj (ORCPT ); Wed, 8 Apr 2020 08:00:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=F8FiHBCrG9trCoDrLT1wvc+8HEEyslQ5M3nlqbAOi4Y=; b=OK8x5jofz7Eq/Xji6qnn9UGlM2 TK7yIE7ID6JsM28vlnHqYgIaHdHgzlOuQ4TuXiLbTmA6Q2ZfI6PvPBN5pBXyc5Auc5dz3qF+T+9E6 0fpZoHk7kEzc1hBMz1Ec7FEOEA4EKRMDJ24m5gnidsGdLXbDq9pJisggellU6ich7aN2xKVAUQ4sq BaqxsyzSZSL7NbfmIXfHlEXX3rUqlQYguPTztiusz2CKeZOlZwsyMFGgWgAwhD7Rcu2AhOKjV+tGp m885HKFsmwwNcIkjhdQGgEsJlbnGE0L2z/sy4m55mkoDauXiGLQj/Sofo/PT8Y5uY3xBoA7RmgOMg wAu3tP5Q==; Received: from [2001:4bb8:180:5765:65b6:f11e:f109:b151] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jM9NR-00049e-7q; Wed, 08 Apr 2020 12:00:18 +0000 From: Christoph Hellwig To: Andrew Morton , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , x86@kernel.org, David Airlie , Daniel Vetter , Laura Abbott , Sumit Semwal , Sakari Ailus , Minchan Kim , Nitin Gupta Cc: Robin Murphy , Christophe Leroy , Peter Zijlstra , linuxppc-dev@lists.ozlabs.org, linux-hyperv@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 13/28] mm: rename vmap_page_range to map_kernel_range Date: Wed, 8 Apr 2020 13:59:11 +0200 Message-Id: <20200408115926.1467567-14-hch@lst.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200408115926.1467567-1-hch@lst.de> References: <20200408115926.1467567-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This matches the map_kernel_range_noflush API. Also change to pass a size instead of the end, similar to the noflush version. Signed-off-by: Christoph Hellwig --- mm/vmalloc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 55df5dc6a9fc..a3d810def567 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -272,13 +272,13 @@ int map_kernel_range_noflush(unsigned long addr, unsigned long size, return nr; } -static int vmap_page_range(unsigned long start, unsigned long end, +static int map_kernel_range(unsigned long start, unsigned long size, pgprot_t prot, struct page **pages) { int ret; - ret = map_kernel_range_noflush(start, end - start, prot, pages); - flush_cache_vmap(start, end); + ret = map_kernel_range_noflush(start, size, prot, pages); + flush_cache_vmap(start, start + size); return ret; } @@ -1866,7 +1866,7 @@ void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t pro kasan_unpoison_vmalloc(mem, size); - if (vmap_page_range(addr, addr + size, prot, pages) < 0) { + if (map_kernel_range(addr, size, prot, pages) < 0) { vm_unmap_ram(mem, count); return NULL; } @@ -2030,10 +2030,9 @@ void unmap_kernel_range(unsigned long addr, unsigned long size) int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page **pages) { unsigned long addr = (unsigned long)area->addr; - unsigned long end = addr + get_vm_area_size(area); int err; - err = vmap_page_range(addr, end, prot, pages); + err = map_kernel_range(addr, get_vm_area_size(area), prot, pages); return err > 0 ? 0 : err; } -- 2.25.1