Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp2526196imi; Mon, 25 Jul 2022 00:24:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ss7QwYjPBc70Cj+0A1SXYMwUNTYrXwHqI/VAY15TKdDTaJPpoJAb+CtTEXoNSGuPImZL8O X-Received: by 2002:a17:902:d507:b0:16d:7d89:15bf with SMTP id b7-20020a170902d50700b0016d7d8915bfmr2528632plg.137.1658733857260; Mon, 25 Jul 2022 00:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658733857; cv=none; d=google.com; s=arc-20160816; b=SedPnMhJpn9A6oNfn+Tb2xXrvm1MTELXiEIvnKUOE6YPHhR5dJgGIpoyWmr64Nr1Qp u1c0VsVA6GDs/WOAke8JLSOgWOrZrzYjLdklx0sLFcm8JCAKI8STF9aqolmD2g7zCfde 5Xi4RrSi1YDN833Wxmo3wFJj4ZguOCvZEBcpTmWU7plyf786gXY9tIa0fTwLizVseOWp UZtkYxBJdyVbLPa3ZJfj1qsXgsBcVu09Jb4zO3oNLs18Ug0c2cYNlTY5vFUPk4FSmA95 3zfWke9fSsISuCPq5g/xcnlJ7JelMXvaacrSkiEBBIdOE/g5u3jlJYcEb7nV85vpbJ1t v1WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=I6Pcrf1wa3c7ch0xmCEFsRTJHT6mCDfuRRjoL6HA6Uo=; b=Sym5XhVpWnm8MV0KvKwU+ihysalASDRIzuFBXEFRe9EqCoqgqEH8/8O84B6EMH0VFZ 0jfa8a/peVI1HnjubguKcJM3MD8QDHOgvO28UyHoUwAr4wQNIUqMD9kMh4ZI906IOYgQ w8AJTxY2YY5rDTNfcQiakaGGADLjLhqhsEfm6IKl7NMtttcLK96IdOdAkM3JbJ81Uob4 Z5NO/6HI10Ue6a34guc2TcP74U1jwESHa/Jy2x2fajTSRWCgF4JWkglXzytvwGvwJXcW VK/j7Bv+EFLLjCMAbPrFl4/dvMDCwemgmg/dx+QfjlPad8QVOSQoGV338cSHOHcqpOsp K/QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=osNv7G6b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z10-20020a170903018a00b0016d2dcb9b91si15063150plg.599.2022.07.25.00.24.00; Mon, 25 Jul 2022 00:24:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=osNv7G6b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231460AbiGYGqS (ORCPT + 99 others); Mon, 25 Jul 2022 02:46:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbiGYGqQ (ORCPT ); Mon, 25 Jul 2022 02:46:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29A8FB1FD for ; Sun, 24 Jul 2022 23:46:16 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A2D066112A for ; Mon, 25 Jul 2022 06:46:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBF0EC341C7; Mon, 25 Jul 2022 06:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658731575; bh=hIZrYAxn265ebgeF7Bwq7AWTsRMM8aNkjPhwdYrVvPo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=osNv7G6brArIxFH6QeFgaRQ6faY2Q0HTiCZ1w/P+kGwwRNfXEJMAHrbYdJY2g1aFa qHTyjZ/CCqMxNbJd6JjQSSBfbLFbXr7PAtJKicGfARZgvm/uATPZ9KNmKkophIW5lo XdagoKwJqC3B78lYz417IQxdGlnTr/RiojJn2nBPN9GOwtJ17VSDxlkZFtfdqPlr9U BienTQy1Fcxw2C1faujgJCrzJdQXrwhaKOtLnaitvQe50I44I6mQqR+0rnwfHQk/SC iKl7uAedh7x2u8PAJqiGQnIfoII+C6ypUkQAP7GARtMT/Cd7hYryBlytp56Vh/4lqh M5fNWDCiB67rw== Date: Mon, 25 Jul 2022 09:46:04 +0300 From: Mike Rapoport To: Will Deacon Cc: "guanghui.fgh" , baolin.wang@linux.alibaba.com, catalin.marinas@arm.com, akpm@linux-foundation.org, david@redhat.com, jianyong.wu@arm.com, james.morse@arm.com, quic_qiancai@quicinc.com, christophe.leroy@csgroup.eu, jonathan@marek.ca, mark.rutland@arm.com, thunder.leizhen@huawei.com, anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, geert+renesas@glider.be, ardb@kernel.org, linux-mm@kvack.org, yaohongbo@linux.alibaba.com, alikernel-developer@linux.alibaba.com Subject: Re: [PATCH v5] arm64: mm: fix linear mem mapping access performance degradation Message-ID: References: <1657460657-25698-1-git-send-email-guanghuifeng@linux.alibaba.com> <20220718131005.GA12406@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220718131005.GA12406@willie-the-truck> X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 18, 2022 at 02:10:06PM +0100, Will Deacon wrote: > On Sun, Jul 10, 2022 at 11:33:02PM +0800, guanghui.fgh wrote: > > In short, this path work: > > > > 1.Before doing work for rebuiling crashkernel mem, the pgd is swapper_pg_dir > > in [[[ttbr1]]] > > > > 2.Change the [[[ttbr0]]]to use idmap_pg_dir pgd > > > > 3.The [[[idmap_cpu_replace_ttbr1_with_flush_tlb]]] are mapped [[[only]]] > > with idmap_pg_dir mapping in [[[ttbr0]]] > > > > 4.The [[[idmap_cpu_replace_ttbr1_with_flush_tlb]]] will flush tlb all, > > switch [[[ttbr1]]] to use init_pg_dir pgd(and flush tlb all again). > > There is no tlb conflict to swapper_pg_dir. > > There is no tlb cache for swapper_pg_dir. > > > > 5.Woring with init_pg_dir pgd to access swapper_pg_dir pagetable with fix > > mapping. And modify crashkernel mapping in the swapper_pg_dir without any > > tlb conflict and flush. > > > > 6.When finishing the work, switch ttbr1 pgd to the origin swapper_pg_dir > > with cpu_replace_ttbr1 function(similar to the above). > > I do not think that this complexity is justified. As I have stated on > numerous occasions already, I would prefer that we leave the crashkernel > mapped when rodata is not "full". That fixes your performance issue and > matches what we do for module code, so I do not see a security argument > against it. The protection of the crash kernel is not about security. This is about an ability to do post mortem with kdump and such when the things go awry. I think it's possible to have both large pages in the linear map and the protection of crash kernel in much simpler way that this patch does, I'll try to send an RFC Really Soon. > I do not plan to merge this patch as-is. > > Thanks, > > Will -- Sincerely yours, Mike.