Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp243225rwl; Thu, 6 Apr 2023 18:22:42 -0700 (PDT) X-Google-Smtp-Source: AKy350ZNN84cgua4uvm/05jBq1WLOx2UC8tWZ9nS3tUnYHC1VRocVJP2acdKMYWVibybtjZj33j/ X-Received: by 2002:a05:6a20:1e4d:b0:d6:4003:e38a with SMTP id cy13-20020a056a201e4d00b000d64003e38amr1199192pzb.43.1680830562681; Thu, 06 Apr 2023 18:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680830562; cv=none; d=google.com; s=arc-20160816; b=NpzFlM1S4/1rjjaUyTZ6Te0wuBq7Zk7rknKEPNqnuoFadJgQq5DD+XOvRUIboVSyBH i8euzwIwLlY03NzlhMF2iDZxLQpjlUPLVK8aXH1SpcMXicDfOTm4ITPfnZ9NeQz77s6Q 3RGUHvbXLlnkCkV+K+6RRTWuvbODf2E4HKQpAHWdJV+MuJhtSZ1Lorg3CfBOiweNpcSh bw7JCRDYomdo3Cxss9AsiVRM6JleIef5Jfb6X0E54RUnNBTzjqRUSMy+1DS1CW8fYjFa q5Q0AW6AAPZVteKIo1ZuQv1o6UP/J1CvkCw7ivNs6sHw4PfjuDcPabuP/UbdXNF584w+ FUcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5wyhFBqDO1MjHjj4hsjkNBn2UQkr+0AMWB+0eD0EOGw=; b=XxpadPgRBPhRHr+756pIno2996r7JSjdogW6zGfMmHd9vJXXJz0l5Bj2vE/iIaU6rx 7bLN38kTMe+bKnzltKILtdx7mivNzaC/srtUBdCIK/20ho3vAswvGlQEyOq+ItBfCdLC cfwxMpd0u4rnpPraaPffy4ey6wvtMtsYduA24/XCUmGJAcOXvfciLI+jFCIWbWYZuUjS y8v9KicfviM9yXWyIImWTSfPpxMrMkLr132PY1D8K57QJ3L25fjqQ+KJuR4U1+KokutC RJeC+TZ218GTV3faFjyycpeDxMyGwkBjfBsi8Q7geXQY9gyL+gIPEeNwqrZuHj9UsgJ9 Uupg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PijeifTk; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w38-20020a634766000000b00508b12a837bsi2448880pgk.156.2023.04.06.18.22.30; Thu, 06 Apr 2023 18:22:42 -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=@redhat.com header.s=mimecast20190719 header.b=PijeifTk; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238443AbjDGBQb (ORCPT + 99 others); Thu, 6 Apr 2023 21:16:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231509AbjDGBQ3 (ORCPT ); Thu, 6 Apr 2023 21:16:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A982C83C0 for ; Thu, 6 Apr 2023 18:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1680830142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5wyhFBqDO1MjHjj4hsjkNBn2UQkr+0AMWB+0eD0EOGw=; b=PijeifTktCu6Kl86hBfMQqlacvq90SM0pPepD7Qp5kQUmQbBxZJuRHxjKMTyR0rosGgnhh 8fUdE6hdfU78CvJck/+RXya+mpQnaYt8nIHlhcEfWhNxudRvUxJ0l0s59ryQLOazd2rPwW 8G0eNxSTMEY30d2WSlojrLXr5N54x4M= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-642-TfRYGdxlOGyQDUCWR8k82w-1; Thu, 06 Apr 2023 21:15:31 -0400 X-MC-Unique: TfRYGdxlOGyQDUCWR8k82w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6D2CD101A550; Fri, 7 Apr 2023 01:15:30 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-86.pek2.redhat.com [10.72.12.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB2E218EC7; Fri, 7 Apr 2023 01:15:24 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: catalin.marinas@arm.com, rppt@kernel.org, thunder.leizhen@huawei.com, will@kernel.org, ardb@kernel.org, horms@kernel.org, John.p.donnelly@oracle.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Baoquan He Subject: [PATCH v2 2/3] arm64: kdump: do not map crashkernel region specifically Date: Fri, 7 Apr 2023 09:15:06 +0800 Message-Id: <20230407011507.17572-3-bhe@redhat.com> In-Reply-To: <20230407011507.17572-1-bhe@redhat.com> References: <20230407011507.17572-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 After taking off the protection functions on crashkernel memory region, there's no need to map crashkernel region with page granularity during linear mapping. With this change, the system can make use of block or section mapping on linear region to largely improve perforcemence during system bootup and running. Signed-off-by: Baoquan He Acked-by: Catalin Marinas Acked-by: Mike Rapoport (IBM) Reviewed-by: Zhen Lei --- arch/arm64/mm/mmu.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 6f9d8898a025..7556020a27b7 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -510,21 +510,6 @@ void __init mark_linear_text_alias_ro(void) PAGE_KERNEL_RO); } -static bool crash_mem_map __initdata; - -static int __init enable_crash_mem_map(char *arg) -{ - /* - * Proper parameter parsing is done by reserve_crashkernel(). We only - * need to know if the linear map has to avoid block mappings so that - * the crashkernel reservations can be unmapped later. - */ - crash_mem_map = true; - - return 0; -} -early_param("crashkernel", enable_crash_mem_map); - static void __init map_mem(pgd_t *pgdp) { static const u64 direct_map_end = _PAGE_END(VA_BITS_MIN); @@ -554,16 +539,6 @@ static void __init map_mem(pgd_t *pgdp) */ memblock_mark_nomap(kernel_start, kernel_end - kernel_start); -#ifdef CONFIG_KEXEC_CORE - if (crash_mem_map) { - if (defer_reserve_crashkernel()) - flags |= NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS; - else if (crashk_res.end) - memblock_mark_nomap(crashk_res.start, - resource_size(&crashk_res)); - } -#endif - /* map all the memory banks */ for_each_mem_range(i, &start, &end) { if (start >= end) @@ -590,24 +565,6 @@ static void __init map_mem(pgd_t *pgdp) __map_memblock(pgdp, kernel_start, kernel_end, PAGE_KERNEL, NO_CONT_MAPPINGS); memblock_clear_nomap(kernel_start, kernel_end - kernel_start); - - /* - * Use page-level mappings here so that we can shrink the region - * in page granularity and put back unused memory to buddy system - * through /sys/kernel/kexec_crash_size interface. - */ -#ifdef CONFIG_KEXEC_CORE - if (crash_mem_map && !defer_reserve_crashkernel()) { - if (crashk_res.end) { - __map_memblock(pgdp, crashk_res.start, - crashk_res.end + 1, - PAGE_KERNEL, - NO_BLOCK_MAPPINGS | NO_CONT_MAPPINGS); - memblock_clear_nomap(crashk_res.start, - resource_size(&crashk_res)); - } - } -#endif } void mark_rodata_ro(void) -- 2.34.1