From patchwork Mon Aug 10 02:27:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11706901 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 85CD2913 for ; Mon, 10 Aug 2020 02:28:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 51C1F2068F for ; Mon, 10 Aug 2020 02:28: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="fvgC0Iga" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 51C1F2068F 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 74CDF8D0006; Sun, 9 Aug 2020 22:28:27 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6FCD06B0008; Sun, 9 Aug 2020 22:28: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 6130A8D0006; Sun, 9 Aug 2020 22:28:27 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id 4E5F56B0007 for ; Sun, 9 Aug 2020 22:28:27 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 15551248E for ; Mon, 10 Aug 2020 02:28:27 +0000 (UTC) X-FDA: 77133075054.06.stamp55_6317f2226fd6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id D7E6E1004C628 for ; Mon, 10 Aug 2020 02:28:26 +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:6742: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.214.195:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100;04yghjgftk7u9jjcrie83d1gtzw6mycr9fix7m89shg5c1o6xwjojwo7djb75td.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: stamp55_6317f2226fd6 X-Filterd-Recvd-Size: 4877 Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by imf02.hostedemail.com (Postfix) with ESMTP for ; Mon, 10 Aug 2020 02:28:26 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id g19so4055501plq.0 for ; Sun, 09 Aug 2020 19:28: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=8C8wdRPXIlS04tUD/986mX054vDuu2PdIQ/xTcAZZAA=; b=fvgC0IgaVGBBCP46Zn2yjyIZBeVrRa8NWp7JGxI+yUxhgJTd3YVhaytoaDsU/lDFxs 4iHYUOz1X6WPpfvjY4IF1lTRGWy4UjbYIjINrDDfjUjnH8Hv2o6be0jAQjOR4a4F7CLi 2RVr+OFdQqc/sDLwlZ1kM/3YAAHJN7AadRjMtJsROlN1GaMxJ8U9SxHRPbwbs9d5PTiK Aq4OFkLg9VtrOcx/FpLXPv5ctO8m9w9rrlcTOmRnfvSDCUXu9gcTF/7W4PID3Hqf3Iwu eaRu+KC82AZk5/OL9BigF/IAiD7pXYIiFsHSf6z1CuFlumZsmCM6WM4iS6Z0hakBUkZ+ //MQ== 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=ns6Ddu6BpYBpyyqnIR+BF6afK7KiNpPpEaeM/XS2Tv5eYr6uN0ey/bfC/wK78lg6+D GevqYG4nOAhkFkpKrP1efTEUTY8jmedcEnC7W9AuNwTDWGS2UZLyq87wiJEZ9qNVLLtE qb3CMWIvklZeoC1HCwrvjYC1nDSjmgsB+QtjT5Ggpx6Gf4AJEtuxWVVJfqfbHjU2vjgg wGg5ID0ZmZ9ZrsAU8KhjBLfAE0wT9wHcKbhpYoSw5W7JOGQEbo7ENZKCAKrMorbm1Uhf 5gZPiRlIF/lirqp3oT2LGFqAVf/bx/HkMnk81KzLHYcwePpmNYhBxuFz0bNHWH49TsK5 +I0Q== X-Gm-Message-State: AOAM533qWYLhDX0xTavc+2AtC+3CItz1Sn+NI+ch2UIOg9OfqZT+U9q2 kW+uv0dmFXBNq0NP9/Z3mOuwGWP9 X-Google-Smtp-Source: ABdhPJzqg/csRjQI/X8gAPnWHF45ru/8heKZxPOpRtPbcR9UPs4MpJo+AuvP7KubNHtfifF+p8MeWw== X-Received: by 2002:a17:902:8685:: with SMTP id g5mr22059716plo.201.1597026505571; Sun, 09 Aug 2020 19:28:25 -0700 (PDT) Received: from bobo.ibm.com (193-116-100-32.tpgi.com.au. [193.116.100.32]) by smtp.gmail.com with ESMTPSA id l17sm21863475pff.126.2020.08.09.19.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Aug 2020 19:28:25 -0700 (PDT) From: Nicholas Piggin To: linux-mm@kvack.org Cc: Nicholas Piggin , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Catalin Marinas , Will Deacon , linux-arm-kernel@lists.infradead.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Zefan Li Subject: [PATCH v3 7/8] mm/vmalloc: add vmap_range_noflush variant Date: Mon, 10 Aug 2020 12:27:31 +1000 Message-Id: <20200810022732.1150009-8-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200810022732.1150009-1-npiggin@gmail.com> References: <20200810022732.1150009-1-npiggin@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: D7E6E1004C628 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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) {