From patchwork Fri Aug 21 04:44:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11728121 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 72CBB618 for ; Fri, 21 Aug 2020 04:45:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 368FC206FA for ; Fri, 21 Aug 2020 04:45:09 +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="J4ddgUza" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 368FC206FA 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 27E588D001F; Fri, 21 Aug 2020 00:45:08 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 20BD78D0005; Fri, 21 Aug 2020 00:45:08 -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 0CF398D001F; Fri, 21 Aug 2020 00:45:08 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0084.hostedemail.com [216.40.44.84]) by kanga.kvack.org (Postfix) with ESMTP id E6E808D0005 for ; Fri, 21 Aug 2020 00:45:07 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B1613181AEF09 for ; Fri, 21 Aug 2020 04:45:07 +0000 (UTC) X-FDA: 77173336254.18.spade96_5d123f027036 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 4B154100EC667 for ; Fri, 21 Aug 2020 04:45:07 +0000 (UTC) X-Spam-Summary: 1,0,0,7d21970e6d30d201,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:6119:6261:6653:7514:7875:9413:9592:10004:11026:11473:11658:11914:12043:12297:12438:12517:12519:12555:12895:12986: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;04yf7wiaktzk8c44qxsg7o3qpg1qrycr9fix7m89shg5c1o6xwjojwo7djb75td.ir6cy6dga9bykxkjxoj31dn3sei6dohy1857cqsagdd9qpxmu8g4mmzzhzimrqp.e-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:23,LUA_SUMMARY:none X-HE-Tag: spade96_5d123f027036 X-Filterd-Recvd-Size: 4682 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Fri, 21 Aug 2020 04:45:06 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id k18so463919pfp.7 for ; Thu, 20 Aug 2020 21:45:06 -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=8C8wdRPXIlS04tUD/986mX054vDuu2PdIQ/xTcAZZAA=; b=J4ddgUzasDXInj6ZCF2fxwiLsaEtScdGAOu8lOPhDFaYakCO3NrGk1LBxDUoJ2mXDg Cl7ESjYKzCuQKNbvsXKKZvD2eOHZhUqWcZF5TMNmPbRLGU4MsaPYfq+QCQcLA8q9W26z hs0tBFGG6129YBPGD1vMB9R7gD0+37YOzqN4rBxndaMqpt0WgDpXD19Gspzzq2JQo3gA mqxkfxRpdKad9bmkpLvHnAPblr3MCauTS/S9XUd5dMBBYpocjBbgU1hNHm7zJBi6Okwm 3b89yZyODzFGBBBHGRL6KzHhFuU/alVEYGDYpKF20JifG2kUrdfIClwhUGnoMUoqi0ys PZvQ== 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=8C8wdRPXIlS04tUD/986mX054vDuu2PdIQ/xTcAZZAA=; b=DSSSSsLb5DD4yuOD5tZxcmVvGNedFXGDTwBKjEexYXD4mLnscDa1hKHTEAtWJdmQdZ 3Os0ZTzp7WZqfbLNj58Ovdizh17DC46dsJnYpDpvWLgbNn7GNTeztWyUKsLqnAaBqaVG Vibufpz8ocqFObCiqH8Soay2MiZRyMJ4xcqYWhwz8ERGi3QsKMGYDWNe19yE7oKmyxQC w9C4DVswwpA1mVQ+mZmT0iFP+75f4rMIjrVa5QTPtlo6/fPGvuaSxgdHaXLc/8G4lOxo 85ppqPqJFfREoi7dM/MIdoJ3VGI7HwuWLhO5VJm3LgOT348iFAQCNYfZRDYt/Hf9kUtO E+kQ== X-Gm-Message-State: AOAM531Dpktf+gr/yj24qs/+0M1BYL87wc354LYkpU4GnTJVprbDrmC5 Ga72iuARPz23xenA42Gki6j4GgyTEvA= X-Google-Smtp-Source: ABdhPJy7zCMoLaQ0q66stfVNfIyt+ykygBNPJfPuPBH8S4/UD8Lo5p19sMJZjysKorBqq4yJjZdPbQ== X-Received: by 2002:a63:b24b:: with SMTP id t11mr1038962pgo.233.1597985106002; Thu, 20 Aug 2020 21:45:06 -0700 (PDT) Received: from bobo.ibm.com (61-68-212-105.tpgi.com.au. [61.68.212.105]) by smtp.gmail.com with ESMTPSA id l9sm683374pgg.29.2020.08.20.21.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2020 21:45:05 -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 Subject: [PATCH v5 7/8] mm/vmalloc: add vmap_range_noflush variant Date: Fri, 21 Aug 2020 14:44:26 +1000 Message-Id: <20200821044427.736424-8-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200821044427.736424-1-npiggin@gmail.com> References: <20200821044427.736424-1-npiggin@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4B154100EC667 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 129f10545bb1..4e5cb7c7f780 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -234,8 +234,8 @@ 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, phys_addr_t phys_addr, pgprot_t prot, - unsigned int max_page_shift) +static int vmap_range_noflush(unsigned long addr, unsigned long end, phys_addr_t phys_addr, + pgprot_t prot, unsigned int max_page_shift) { pgd_t *pgd; unsigned long start; @@ -255,14 +255,23 @@ int vmap_range(unsigned long addr, unsigned long end, phys_addr_t phys_addr, pgp 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) {