From patchwork Sun Aug 16 09:09:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11716047 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 83A28138C for ; Sun, 16 Aug 2020 09:10:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4E8642078D for ; Sun, 16 Aug 2020 09:10:01 +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="oQlIsW4j" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E8642078D 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 79DBA6B000D; Sun, 16 Aug 2020 05:10:00 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 727216B000E; Sun, 16 Aug 2020 05:10:00 -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 5CC2B6B0010; Sun, 16 Aug 2020 05:10:00 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0234.hostedemail.com [216.40.44.234]) by kanga.kvack.org (Postfix) with ESMTP id 438176B000D for ; Sun, 16 Aug 2020 05:10:00 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 03584180AD80F for ; Sun, 16 Aug 2020 09:10:00 +0000 (UTC) X-FDA: 77155859760.11.snail65_3500a562700c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id C9197180F8B80 for ; Sun, 16 Aug 2020 09:09:59 +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.216.66:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04ygardnhnroo8edkpp51zfuhtc56ocr9fix7m89shg5c1o6xwjojwo7djb75td.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:24,LUA_SUMMARY:none X-HE-Tag: snail65_3500a562700c X-Filterd-Recvd-Size: 4927 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by imf15.hostedemail.com (Postfix) with ESMTP for ; Sun, 16 Aug 2020 09:09:59 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id e4so6321140pjd.0 for ; Sun, 16 Aug 2020 02:09:59 -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=oQlIsW4jf6QdaM41v1DAzwkm/rUCXyiKKAHM7uRLQyLEF7lxXjR7GmEvQPShvtKNQf dETlAFV1UwJxM+uJ3hw4p+i6HjdZ1KaUBRDFnyZ1LZfv7LViQGsume3ZFDlou062UCRW JERsTRYkRNxB8GTDfdMkpO6z8LDG5x9/cYyiDL0NPA8A8r/rv4NwzlGCwJiFTznJYcLi a9+GxQoBiIh/oEFboZbnFS+PIOXYCRnGyGpdqYXeMHtOssz4U0nXw/L2tDv8F5qCy41R eQO0EaYIzsJnXoToRJzFrrJ1hrJkMkk9481LETndvWuLQcDVqKpHKM0dWPQNXgse3SQy uL6Q== 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=k4WyHsz6cdRO/GqwXEOeGq0gVHQQfZaEJhvOHXCEqO4Q3Wek9xVPi2Y4/8wvbHVlkz Y8TufdAP9Gr5uekMfT5wcojqQ0Rj9fUQjCEecx92TCZh7U0tvFpxlR0lOuRVZJ8XirGo HAmBWNDWXlxfOQfZuRmt2ZIIqZCU6rOP+qiboTshF73pfyIQDs7vPIEaGleZtFSifM25 m5HN3iA7SQVvrIibEr+fBnL1/m/7ofYFL3C5Sis5Gx/7CwYgUHDcXdlv14TjgseFRWfu CJUqPGgu8/677O2OmEbKSjbzwMpLQtd0vNkPRq1a1qTioecIQqYC0FgZGw7UkqVieKxO J1Fw== X-Gm-Message-State: AOAM530G0sbKKRMYAWGcjnbvdIImGYHkymI7sDnavsIWx3bTWQuqRh4p ye0vauD35RKXCRSTUb6KAKjCMn3s2w0= X-Google-Smtp-Source: ABdhPJzRG648jeLeZZ2Z4oujD6qX3vm8KDLEE34yBusy/W9VPlVLdok2Quap0oZrYbchmPfC1Ozb0A== X-Received: by 2002:a17:90a:f68b:: with SMTP id cl11mr8361244pjb.68.1597568998489; Sun, 16 Aug 2020 02:09:58 -0700 (PDT) Received: from bobo.ozlabs.ibm.com (193-116-193-175.tpgi.com.au. [193.116.193.175]) by smtp.gmail.com with ESMTPSA id o19sm12768369pjs.8.2020.08.16.02.09.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2020 02:09:58 -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 , Jonathan Cameron Subject: [PATCH v4 7/8] mm/vmalloc: add vmap_range_noflush variant Date: Sun, 16 Aug 2020 19:09:03 +1000 Message-Id: <20200816090904.83947-8-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20200816090904.83947-1-npiggin@gmail.com> References: <20200816090904.83947-1-npiggin@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: C9197180F8B80 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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) {