From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 0F9EEC433DF 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 C961B2068F for ; Mon, 10 Aug 2020 02:28:27 +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 C961B2068F 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) Received: by kanga.kvack.org (Postfix, from userid 40) id 6FCD06B0008; Sun, 9 Aug 2020 22:28:27 -0400 (EDT) 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-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-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 Content-Transfer-Encoding: quoted-printable 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 a= ddr, unsigned long end, return 0; } =20 -int vmap_range(unsigned long addr, unsigned long end, phys_addr_t phys_a= ddr, pgprot_t prot, - unsigned int max_page_shift) +static int vmap_range_noflush(unsigned long addr, unsigned long end, phy= s_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 en= d, phys_addr_t phys_addr, pgp break; } while (pgd++, phys_addr +=3D (next - addr), addr =3D next, addr !=3D = end); =20 - flush_cache_vmap(start, end); - if (mask & ARCH_PAGE_TABLE_SYNC_MASK) arch_sync_kernel_mappings(start, end); =20 return err; } =20 +int vmap_range(unsigned long addr, unsigned long end, phys_addr_t phys_a= ddr, pgprot_t prot, + unsigned int max_page_shift) +{ + int err; + + err =3D 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 lo= ng end, pgtbl_mod_mask *mask) { --=20 2.23.0