From patchwork Fri Aug 21 15:12:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11729743 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 06DDD109B for ; Fri, 21 Aug 2020 15:13:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C72C5207DF for ; Fri, 21 Aug 2020 15:13:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="u6yhubFc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C72C5207DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BA0658D0035; Fri, 21 Aug 2020 11:13:27 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B2AC48D0022; Fri, 21 Aug 2020 11:13:27 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F18B8D0035; Fri, 21 Aug 2020 11:13:27 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0072.hostedemail.com [216.40.44.72]) by kanga.kvack.org (Postfix) with ESMTP id 8661C8D0022 for ; Fri, 21 Aug 2020 11:13:27 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 430DF824556B for ; Fri, 21 Aug 2020 15:13:27 +0000 (UTC) X-FDA: 77174919654.16.slip27_5515b0a2703a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 0C855100E6912 for ; Fri, 21 Aug 2020 15:13:27 +0000 (UTC) X-Spam-Summary: 1,0,0,b3e82260f0628319,d41d8cd98f00b204,npiggin@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2731:3138:3139:3140:3141:3142:3352:3865:3866:3868:3870:3874:4321:5007:6261:6653:7514:7875:9413:9592:10004:11026:11473:11658:11914:12043:12297:12438:12517:12519:12555:12895:13069:13161:13229:13311:13357:13894:14096:14181:14384:14394:14687:14721:21080:21444:21451:21627:21666:21990:30054,0,RBL:209.85.210.195:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04yfnyrwe4khdwytcdxgomq3agoinyc71khjzgrret6jjxbm968kb1o7tqbr6oh.wayfyuxek4dsc75hxrzzi1fs4ai6dohy185ep76t6xabuhrhf38t46hw8jmmjho.6-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: slip27_5515b0a2703a X-Filterd-Recvd-Size: 4661 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Aug 2020 15:13:26 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id r11so1193146pfl.11 for ; Fri, 21 Aug 2020 08:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ik3l57t0FyOClvLjEe+sb/BhE/y0hhY0gnEqux751Uc=; b=u6yhubFcXihID2fWq+QiE0CcG9dvjSoF59E015bcoBinPTWoTc6VB4OCRmb/y5KRsT qJkbjXob1gFUX91mcQBSG3U26lx8vo9W5U8g0dpaAxpbW8ExWeJzgZEfBwuwalftHFZn 0wke4MbGjU2ojD8aQbwZOkVbPO2SYtKoHSz12zM/hQNNjeYeWZF7jE5g2AHPO0aB+DYw 8C6ylDWaxR7KccTt7GD+eLNOYbuhrkEsjTe/Yv3CvgZ8RSQ10W7DxFdo98xlAAYx2wTT XzgU57hcg/H50XvMaweP1v5brBYXdmpavwyQpD5YyHUNi2KfejW5mx/+gd2ao61mGiJ9 ZR+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ik3l57t0FyOClvLjEe+sb/BhE/y0hhY0gnEqux751Uc=; b=QgFOcYJN3LgDMOl9ZmOD1DS4x/yown5g31YR02dy4CkhlI2FDgL8JR0iCfxX2Togd2 QlsnFIVc0eYxv8/ueADXU5LtNlHpG/jk14g7NiLkCWLbjtI9oJQIsDQd/WYXRojEt4j5 n/ZOJfYALWdcupsdUGyBGqEXo/tTPxF9D6miT/jSerXbz5Yusxm4pLfp3Vj2yXN74Fc/ 1koTBBjBLFSV8gbIlQHnXlyakLUcjkOksVJpSstsatSyYx3Pv9oA9qbSEge5ou8JxE1E MXnm8vozP9tQ2Xvejlqu41tjRBgRckcoauuwt/8QL+9T94NFiPtji8tf7DitjokqQBD2 DolQ== X-Gm-Message-State: AOAM533rtHTCK13Ufs9ui+ENPcqPG881/R61+33UoyKqu5WWtQgSBJxR 2bowtoIJPlyHZBV6JThVOhR0w2dkEnM= X-Google-Smtp-Source: ABdhPJzOk8LezUqei41Rt5u2ralsl0Vc1m91oWRQQQjcIB5tNWY2WeZkdOIgpy1cX1Su0SK2t1NhyA== X-Received: by 2002:a63:5256:: with SMTP id s22mr2774026pgl.325.1598022805468; Fri, 21 Aug 2020 08:13:25 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (61-68-212-105.tpgi.com.au. [61.68.212.105]) by smtp.gmail.com with ESMTPSA id s8sm3126985pfc.122.2020.08.21.08.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 08:13:24 -0700 (PDT) From: Nicholas Piggin To: linux-mm@kvack.org, Andrew Morton Cc: Nicholas Piggin , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Zefan Li , Jonathan Cameron , Christoph Hellwig , Christophe Leroy Subject: [PATCH v6 10/12] mm/vmalloc: add vmap_range_noflush variant Date: Sat, 22 Aug 2020 01:12:14 +1000 Message-Id: <20200821151216.1005117-11-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200821151216.1005117-1-npiggin@gmail.com> References: <20200821151216.1005117-1-npiggin@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 0C855100E6912 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: As a side-effect, the order of flush_cache_vmap() and arch_sync_kernel_mappings() calls are switched, but that now matches the other callers in this file. Signed-off-by: Nicholas Piggin --- mm/vmalloc.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 256554d598e6..1d6cad16bda3 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -237,7 +237,7 @@ static int vmap_p4d_range(pgd_t *pgd, unsigned long addr, unsigned long end, return 0; } -int vmap_range(unsigned long addr, unsigned long end, +static int vmap_range_noflush(unsigned long addr, unsigned long end, phys_addr_t phys_addr, pgprot_t prot, unsigned int max_page_shift) { @@ -259,14 +259,24 @@ int vmap_range(unsigned long addr, unsigned long end, break; } while (pgd++, phys_addr += (next - addr), addr = next, addr != end); - flush_cache_vmap(start, end); - if (mask & ARCH_PAGE_TABLE_SYNC_MASK) arch_sync_kernel_mappings(start, end); return err; } +int vmap_range(unsigned long addr, unsigned long end, + phys_addr_t phys_addr, pgprot_t prot, + unsigned int max_page_shift) +{ + int err; + + err = vmap_range_noflush(addr, end, phys_addr, prot, max_page_shift); + flush_cache_vmap(addr, end); + + return err; +} + static void vunmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, pgtbl_mod_mask *mask) {