Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2448723rdb; Sun, 3 Dec 2023 18:10:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkJXXQJZvK4rc1jjHwvglm7+hLUIVVw+5MyFEEjQo04ukGmhiG7a2sQljCirnYPNZ2/o79 X-Received: by 2002:a05:6a20:d704:b0:18b:3297:3e1a with SMTP id iz4-20020a056a20d70400b0018b32973e1amr1004248pzb.47.1701655832802; Sun, 03 Dec 2023 18:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701655832; cv=none; d=google.com; s=arc-20160816; b=O3xMvOI3sigxHmWGKUFBU4RNVcfa8WHGqfZoAk076RwJKc/HbB5xf03Rjb/x8YYqxV gsec88uD+JtFn0m/Xlem7iyRmf1GLjc694Zx4z+ys/98LsWJaoIBFuf1qe1sYKw/3R0z ooYFlBlpiMBIy7j8PVV8fICzTrdbfD08OQqPtniIi8Z6SnZB8G5IOLtGnZkaf3KLMY5l RERb3GqKyBf3obj/HI8t9DvvzQpVW2lm3EYLCmtg6VfdjIvc9GNQRTgbwSRhYmAZCmjr 9dVWhXxKfbPx93I/BcjgAzptCW5wFfEf6lzNWxKJQVSU1qO0FIPq/t3PL3eEsQsnGglS 0epQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=7DpzMW9l8USWbr/TXZ2mqrkhEXzMDf/T6QpMPtMWGcY=; fh=HAejCrz4htgyq+AHWa8EfdAgsX8pXGw7u/85G1yKZnc=; b=loyAzPOVIQGG6gNK7sA1W7fAIvxPOK9d/zP9+Ka7QaTw0HiWzsyJkYQTyOJK9XCV0n l2V355CP6J2apWLNPIq6jw5KG4uY2ItjrGbuYPOH8MMAr3LB4Y1IWmWIYaC7X5/Gyk2w 1Q06qQqQ/EO1KX4Xi0Q95YJ+RdyuPxS1ErkqWLqzpwv3TMJ0eP5CwFy6eFmwkjo0wB8p Ez5fVB/sY3RpJodeoaMRBX4XVrexW/h/twBnfdlxoHpAMCA2KS5BtLzIfBlTa2dIqY5+ Y1ORcCT5xSRENZfbn4b6Xx0hOEWgGMCHLDf1PHpXY2Dr069IlW4JK09Etj7LiQmXLmi3 eSgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PZxFMb4i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id l10-20020a170902f68a00b001d08a8c56a7si1762841plg.279.2023.12.03.18.10.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 18:10:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PZxFMb4i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B93B2804755F; Sun, 3 Dec 2023 18:10:29 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234275AbjLDCKJ (ORCPT + 99 others); Sun, 3 Dec 2023 21:10:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbjLDCKH (ORCPT ); Sun, 3 Dec 2023 21:10:07 -0500 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 AFA5D95 for ; Sun, 3 Dec 2023 18:10:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701655812; 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; bh=7DpzMW9l8USWbr/TXZ2mqrkhEXzMDf/T6QpMPtMWGcY=; b=PZxFMb4ikpguo6/50z+wahNUXz7rsowHLzy4/8oemB4IumejVxkQK4ozcSds12L92ympoF +dyinJn5EVR43bVtN0mv/I+ALMJ02PJ6r+SiA5TYGv5R21Pjshnt64GpSwPsCFzfa8gSUU rC9u6W6TSSbdPmenUEKit1RJGJ7C40E= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-500-Xng4ZFAwNOuBMcJ3cikbmA-1; Sun, 03 Dec 2023 21:10:09 -0500 X-MC-Unique: Xng4ZFAwNOuBMcJ3cikbmA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 801BF811E86; Mon, 4 Dec 2023 02:10:08 +0000 (UTC) Received: from localhost (unknown [10.72.113.121]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C25C5C1596F; Mon, 4 Dec 2023 02:10:07 +0000 (UTC) Date: Mon, 4 Dec 2023 10:10:04 +0800 From: Baoquan He To: Randy Dunlap Cc: Stephen Rothwell , akpm@linux-foundation.org, ignat@cloudflare.com, linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, eric_devolder@yahoo.com Subject: Re: Re: linux-next: Tree for Dec 1 (riscv, crash_core) Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sun, 03 Dec 2023 18:10:29 -0800 (PST) eric_devolder@yahoo.com, ignat@cloudflare.com, Linux Next Mailing List , Linux Kernel Mailing List , linux-riscv , kexec Bcc: bhe@redhat.com Subject: Re: linux-next: Tree for Dec 1 (riscv, crash_core) Reply-To: In-Reply-To: On 12/01/23 at 11:53am, Randy Dunlap wrote: > > > On 11/30/23 18:37, Stephen Rothwell wrote: > > Hi all, > > > > Changes since 20231130: > > > > on riscv 32-bit or 64-bit, with > # CONFIG_MMU is not set Thanks for providing the kernel config to ease reproduction. In the config, there are: CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_CRASH_DUMP=y ...... # CONFIG_MMU is not set After investigation, I found this happened after Ignat's patch: commit 1c7a3fa49ef7 ("kexec: drop dependency on ARCH_SUPPORTS_KEXEC from CRASH_DUMP") Copy above commit change here for reference, and also risc-v's ARCH_SUPPORTS_KEXEC depends on MMU: -------------------------------------------------------- diff --git a/kernel/Kconfig.kexec b/kernel/Kconfig.kexec index fc38f1ae3a30..946dffa048b7 100644 --- a/kernel/Kconfig.kexec +++ b/kernel/Kconfig.kexec @@ -96,7 +96,6 @@ config KEXEC_JUMP config CRASH_DUMP bool "kernel crash dumps" depends on ARCH_SUPPORTS_CRASH_DUMP - depends on ARCH_SUPPORTS_KEXEC select CRASH_CORE select KEXEC_CORE help arch/riscv/Kconfig --------------------- config ARCH_SUPPORTS_KEXEC def_bool MMU Before Ignat's patch, once CONFIG_MMU is unset, CONFIG_CRASH_DUMP, CONFIG_KEXEC_CORE, CONFIG_CRASH_CORE are all unset automatically. The crash_core codes are not compiled. That's why no compiling error is seen. After Ignat's patch applied, we can enable CONFIG_CRASH_DUMP, CONFIG_KEXEC_CORE, CONFIG_CRASH_CORE independently. However, there are several macro definitions, such as VA_BITS, VMEMMAP_START, VMEMMAP_END, MODULES_VADDR, MODULES_END are only available when CONFIG_MMU=y. I made two patches to decouple the kexec/crash code with CONFIG_MMU. Not sure if risc-v wants that. Or we can simply add dependency on MMU for ARCH_SUPPORTS_CRASH_DUMP. Then when CONFIG_MMU=n, CONFIG_CRASH_DUMP, CONFIG_KEXEC_CORE, CONFIG_CRASH_CORE will be unset too. Please help check which one need be taken. diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 24c1799e2ec4..03d290da7262 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -708,6 +708,7 @@ config ARCH_SUPPORTS_KEXEC_PURGATORY config ARCH_SUPPORTS_CRASH_DUMP def_bool y + depends on MMU=y config ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION def_bool CRASH_CORE > > In file included from ../arch/riscv/kernel/crash_core.c:3: > ../arch/riscv/kernel/crash_core.c: In function 'arch_crash_save_vmcoreinfo': > ../arch/riscv/kernel/crash_core.c:8:27: error: 'VA_BITS' undeclared (first use in this function) > 8 | VMCOREINFO_NUMBER(VA_BITS); > | ^~~~~~~ > ../include/linux/crash_core.h:78:64: note: in definition of macro 'VMCOREINFO_NUMBER' > 78 | vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name) > | ^~~~ > ../arch/riscv/kernel/crash_core.c:8:27: note: each undeclared identifier is reported only once for each function it appears in > 8 | VMCOREINFO_NUMBER(VA_BITS); > | ^~~~~~~ > ../include/linux/crash_core.h:78:64: note: in definition of macro 'VMCOREINFO_NUMBER' > 78 | vmcoreinfo_append_str("NUMBER(%s)=%ld\n", #name, (long)name) > | ^~~~ > ../arch/riscv/kernel/crash_core.c:12:58: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'int' [-Wformat=] > 12 | vmcoreinfo_append_str("NUMBER(VMALLOC_START)=0x%lx\n", VMALLOC_START); > | ~~^ > | | > | long unsigned int > | %x > ../arch/riscv/kernel/crash_core.c:14:64: error: 'VMEMMAP_START' undeclared (first use in this function) > 14 | vmcoreinfo_append_str("NUMBER(VMEMMAP_START)=0x%lx\n", VMEMMAP_START); > | ^~~~~~~~~~~~~ > ../arch/riscv/kernel/crash_core.c:15:62: error: 'VMEMMAP_END' undeclared (first use in this function); did you mean 'MEMREMAP_ENC'? > 15 | vmcoreinfo_append_str("NUMBER(VMEMMAP_END)=0x%lx\n", VMEMMAP_END); > | ^~~~~~~~~~~ > | MEMREMAP_ENC > > 64-bit only: > > ../arch/riscv/kernel/crash_core.c:17:64: error: 'MODULES_VADDR' undeclared (first use in this function) > 17 | vmcoreinfo_append_str("NUMBER(MODULES_VADDR)=0x%lx\n", MODULES_VADDR); > | ^~~~~~~~~~~~~ > ../arch/riscv/kernel/crash_core.c:18:62: error: 'MODULES_END' undeclared (first use in this function) > 18 | vmcoreinfo_append_str("NUMBER(MODULES_END)=0x%lx\n", MODULES_END); > | ^~~~~~~~~~~ > > > > -- > ~Randy >