From patchwork Sat Dec 5 06:57:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11952963 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C32BC4361A for ; Sat, 5 Dec 2020 06:58:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B3AB822D2A for ; Sat, 5 Dec 2020 06:58:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3AB822D2A 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 4D37F6B0078; Sat, 5 Dec 2020 01:58:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 45FF26B007B; Sat, 5 Dec 2020 01:58:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 372566B007D; Sat, 5 Dec 2020 01:58:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0079.hostedemail.com [216.40.44.79]) by kanga.kvack.org (Postfix) with ESMTP id 20F096B0078 for ; Sat, 5 Dec 2020 01:58:40 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E1E968249980 for ; Sat, 5 Dec 2020 06:58:39 +0000 (UTC) X-FDA: 77558325558.02.brass68_171372f273cb Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id BD31E10097AA0 for ; Sat, 5 Dec 2020 06:58:39 +0000 (UTC) X-HE-Tag: brass68_171372f273cb X-Filterd-Recvd-Size: 4737 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Sat, 5 Dec 2020 06:58:39 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id e23so4927007pgk.12 for ; Fri, 04 Dec 2020 22:58:39 -0800 (PST) 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=cxeoavWkBKpHEVfZRK3a60KePQvEOREDyC26QCPQwGc=; b=ukqOtiGe7P2XNpwcoCHPv4PLVVLigIR0wfkbWLYHCk03Qwl78XRRc25X9C1RXu0jHe 71KyORclr783FXhdRwXEwnRYE8V5N9Dlyrpf+r1au98v+1tkhP1N6fl1HslUf7ZQ6F5a XTq1ZFQ+e2jvjUGVPu2b86zd+bEI1VIn6WCJ/qjsEj8yxdBoHFWiVg+eMQZWOAY5xRFj C11oel1teBnWh8SCk/mPyWyo/bfzkUXfP4dXdfU1VwuAWLs0NLmFg3F0v74OQujpFaki 9EIdB0FMiyQGzJUoI3N8vq5BLpK4IyZzsPMZT6nSzTsZ26MvND8g+ErfJa8+fsz1pJ2o 6LkQ== 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=cxeoavWkBKpHEVfZRK3a60KePQvEOREDyC26QCPQwGc=; b=oJ137X8nH+ZMYtgq0lFxuXxIUMIDQLj3AvMzFOlNA+GbK/bpeuMKGlKojysNNNBbxM ttiynp6GjxC9gZMqftfPZUxy7VyN4CGO9K8DLF+igD6FERTp47hQvfn8rJMxR9xTrf2W FeQODJeUOogROrSgGHgBfJ2RaQqWJnH7ct2FufW/GxFbpxUJDU8Di3mWezVxRy6vHJrj RMhW/s1eV7WDoqXVQ8Y+jSbMLYB1Rm1Jksm6cSEN3xfYZf3MD0BFP8LeaeqA2gCNUQ5M ++gTOG8O4S/uJe57c5ehkS1OPVzLNfABs+HzNpYj5GbMnvpqU1QjusmIbBUmkt5Tl41/ aatw== X-Gm-Message-State: AOAM533vmnFQsR+zW/Zlq5885Qv1A6arL24vl+RXZ7VwLfHDhhimHrWG vvkURfRWv7ak6RMFq/9TrQFyx+BC3j0+lA== X-Google-Smtp-Source: ABdhPJy4ceoebyQbTqB4fE0S1EBU/ZP1A2fSE/NXY9uIYYRFQfIy2FdDgibtFhuJU5XMFvZqvTYP+Q== X-Received: by 2002:aa7:8052:0:b029:196:4dbb:99fe with SMTP id y18-20020aa780520000b02901964dbb99femr7374783pfm.11.1607151518507; Fri, 04 Dec 2020 22:58:38 -0800 (PST) Received: from bobo.ozlabs.ibm.com ([1.129.145.238]) by smtp.gmail.com with ESMTPSA id a14sm1110848pfl.141.2020.12.04.22.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2020 22:58:38 -0800 (PST) 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 , Rick Edgecombe Subject: [PATCH v9 10/12] mm/vmalloc: add vmap_range_noflush variant Date: Sat, 5 Dec 2020 16:57:23 +1000 Message-Id: <20201205065725.1286370-11-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20201205065725.1286370-1-npiggin@gmail.com> References: <20201205065725.1286370-1-npiggin@gmail.com> MIME-Version: 1.0 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 2f236aeeac24..ee9c3bee67f5 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -235,7 +235,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) { @@ -257,14 +257,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) {