Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1421060imw; Tue, 5 Jul 2022 09:09:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uerzPaTT4pEhMqR8AeZq7s3YxnCLdqQRALlblzfAMZZpENqJxlydgX54FbrUvDKL5DJr82 X-Received: by 2002:a17:906:6a11:b0:726:97b8:51e9 with SMTP id qw17-20020a1709066a1100b0072697b851e9mr35426508ejc.115.1657037345774; Tue, 05 Jul 2022 09:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657037345; cv=none; d=google.com; s=arc-20160816; b=I+FBoHLBZUsBwj2nKDB5/8yoYf1ZLnZCB/a83qR6Gh9Ovdyb4/0JGzL9GdiXiAQioy dfMFNdWAsUeL/Ecn6afpGXw67aLPA9NUtrEtiZZ1qlSVjpKMPYkRgpCKULLFOQkOCL2k q+XIQ4MCslOXwprHYX8JgtgJCkXBBLqmyQyA6vB/XDssCGYRFY7vw7md0lCBGXtiDO4h s2n2z9vdV5BmBt55bR+NPFuC1R6kbz6UzlNYEsiqB4jjDCpulCuXgIyyZm9qmPsnIDQ0 H61/nQ+ZCML4NJQvHedU4DvBMwuEEoSFNcbP/pvJzTTK5PaZT5CjD9haoopgfx6babVQ 3jMQ== 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; bh=nvGcph9CQsKMx8l4DAKrSpLV1hq9uXsnMfA1sEoFCYY=; b=o6fmp3CK+qvuDyfdYU4fpYPq0Z7l1w56EsLMMpfC5v0OCyENPP80BivbTay8SZR1B+ aThabFklmdwNzlCzQ2GsOwiHanHq4pxg5C/cEZCz+FXbfcfkGe4/xzzm8pIlVSespK5f lNpLo6OkHqt3GX5EA8dj06njrxaGICcDYs1bk5bQ3OATN2vEnPaS/we9ldp8alGFRkjH ybQqN6dnddjoCwn1q2M7gIEtScH4Fr9SfoNYum/VFSobx4xEoDUXr1qE0VoqdVkw2hCc Q32hvrDWwvhmCsQFFWh+PJxeniHXiAWV1s+uEjfu/xC4HYY+gqlrUz6CMAq0Oi9xs+r1 oIVw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l15-20020a056402254f00b004357a6c5e3bsi12901075edb.151.2022.07.05.09.08.40; Tue, 05 Jul 2022 09:09:05 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231556AbiGEPeV (ORCPT + 99 others); Tue, 5 Jul 2022 11:34:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbiGEPeT (ORCPT ); Tue, 5 Jul 2022 11:34:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FE4D13DE9 for ; Tue, 5 Jul 2022 08:34:19 -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 81BD161B18 for ; Tue, 5 Jul 2022 15:34:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE516C341C7; Tue, 5 Jul 2022 15:34:13 +0000 (UTC) Date: Tue, 5 Jul 2022 16:34:09 +0100 From: Catalin Marinas To: Mike Rapoport Cc: Will Deacon , "guanghui.fgh" , Ard Biesheuvel , baolin.wang@linux.alibaba.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, linux-mm@kvack.org, yaohongbo@linux.alibaba.com, alikernel-developer@linux.alibaba.com Subject: Re: [PATCH v4] arm64: mm: fix linear mem mapping access performance degradation Message-ID: References: <20220704131516.GC31684@willie-the-truck> <2ae1cae0-ee26-aa59-7ed9-231d67194dce@linux.alibaba.com> <20220704142313.GE31684@willie-the-truck> <6977c692-78ca-5a67-773e-0389c85f2650@linux.alibaba.com> <20220704163815.GA32177@willie-the-truck> <20220705095231.GB552@willie-the-truck> <5d044fdd-a61a-d60f-d294-89e17de37712@linux.alibaba.com> <20220705121115.GB1012@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Tue, Jul 05, 2022 at 06:02:02PM +0300, Mike Rapoport wrote: > +void __init remap_crashkernel(void) > +{ > +#ifdef CONFIG_KEXEC_CORE > + phys_addr_t start, end, size; > + phys_addr_t aligned_start, aligned_end; > + > + if (can_set_direct_map() || IS_ENABLED(CONFIG_KFENCE)) > + return; > + > + if (!crashk_res.end) > + return; > + > + start = crashk_res.start & PAGE_MASK; > + end = PAGE_ALIGN(crashk_res.end); > + > + aligned_start = ALIGN_DOWN(crashk_res.start, PUD_SIZE); > + aligned_end = ALIGN(end, PUD_SIZE); > + > + /* Clear PUDs containing crash kernel memory */ > + unmap_hotplug_range(__phys_to_virt(aligned_start), > + __phys_to_virt(aligned_end), false, NULL); What I don't understand is what happens if there's valid kernel data between aligned_start and crashk_res.start (or the other end of the range). -- Catalin