Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp252108rdh; Thu, 23 Nov 2023 03:08:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IES5hFCqWECSdQd34yU9YHdklV8mxD/0+CU5t7R4d5yRrJnIcA+6RL+A8f/bg6OGd/x60YU X-Received: by 2002:a05:6602:498e:b0:7b3:6e09:9bf8 with SMTP id eg14-20020a056602498e00b007b36e099bf8mr1114664iob.4.1700737697755; Thu, 23 Nov 2023 03:08:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700737697; cv=none; d=google.com; s=arc-20160816; b=S5VQ407sKW+THqGGVa6kou29fTXegPhqwkq0nSGv3SqjCpbf2+BgxZKOb7VBwKfzGq 7DN8rt1rTAZqAwzX820tmUmQRS+Am1hJYAJEtzAsbAZlNkC0geBcCse607OhY9z2gBFD iOCh5vey41hO/kITR0daxk7h6UdwUVNIqjD5erHkFQcAuKemDWfMGSpExCWMQnQWSVck X4ptnJvOLyXP+gj7LavK57Jp+HDKeFomJpSP9yMt6JJAgKQcqtqdCOeBukjwXGovSwpy 09Mokh4+yuxnY+Iiv4ezIaKtdkKRtPDrYIpPQ+L6EoDQqUtGdE64hjg+1Gu/hj//r3r9 2wBQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=n4Skc8GoRCulLSc1L8sW+fd+URsNyF4CrxboNaek2t8=; fh=aaHoqsHmLsMDfF5mexhCrlIYGgNAhJwRUsAFWKc/acw=; b=OwHiBBnXl4EC0tHosn7TEXBugCeur5LKt6gaRCN7NmNIr1TjrDVehYmKm/ks4r7oZ+ GDITfgc/O5/dxGcfRDpBxLrbAeQtwnrJ2jDzcxxjVax5z84A7OqgUrFlb06xI/CdXZB8 LzWHn8ELj1w6B5PFL9/c5pX+z3xWme7NlvfdGoIUghvFbKpuW26PxCf328fCj4Pcu20Z mkUbnWLvg1vbMXZBNOBcNtP3xIJgL3E8Pvt/iTXAEtRU9QBfdvU3m6uoWNGs8CKJJtlD 4nHHOXW1mRd5I56FfEZnmFCex6iswI0Yy871UEErtLCinBJxNM5ScDi9w0IQ3spFq+7F y2zA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VstwxKW4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id bq17-20020a056a02045100b00573f9a427d9si1134185pgb.717.2023.11.23.03.08.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 03:08:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VstwxKW4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id D3D36804F45A; Thu, 23 Nov 2023 03:08:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344910AbjKWLIA (ORCPT + 99 others); Thu, 23 Nov 2023 06:08:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229664AbjKWLH6 (ORCPT ); Thu, 23 Nov 2023 06:07:58 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C7021BD for ; Thu, 23 Nov 2023 03:08:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700737683; 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=n4Skc8GoRCulLSc1L8sW+fd+URsNyF4CrxboNaek2t8=; b=VstwxKW4iv7BTCdjvMihVr2bciQgIA2Nv1YwGAfsHaeMNUN9FdIXCQ38CW4gk8YwXRRHjb LN5OK7umcMr6Gu+r+VQnGq98nSvo8QKljogQKNgulXNt3NTC2hNG9NX+S4CJRzM3/bVbho wSCBVyDaonX4a8X3v6rTi4MKhwuOwLo= 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-311-WTlpL2kTM2OxbsT10NKmbg-1; Thu, 23 Nov 2023 06:07:59 -0500 X-MC-Unique: WTlpL2kTM2OxbsT10NKmbg-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 4DF9981B562; Thu, 23 Nov 2023 11:07:59 +0000 (UTC) Received: from localhost (unknown [10.72.112.97]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 982EAC1596F; Thu, 23 Nov 2023 11:07:58 +0000 (UTC) Date: Thu, 23 Nov 2023 19:07:55 +0800 From: Baoquan He To: Ignat Korchagin Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-s390@vger.kernel.org, akpm@linux-foundation.org, eric_devolder@yahoo.com, kernel-team Subject: Re: [PATCH 1/3] kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP Message-ID: References: <20231123073652.507034-1-bhe@redhat.com> <20231123073652.507034-2-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 23 Nov 2023 03:08:15 -0800 (PST) On 11/23/23 at 08:23am, Ignat Korchagin wrote: > On Thu, Nov 23, 2023 at 7:37 AM Baoquan He wrote: > > > > Ignat Korchagin complained that a potential config regression was > > introduced by commit 89cde455915f ("kexec: consolidate kexec and > > crash options into kernel/Kconfig.kexec"). Before the commit, > > CONFIG_CRASH_DUMP has no dependency on CONFIG_KEXEC. After the commit, > > CRASH_DUMP selects KEXEC. That enforces system to have CONFIG_KEXEC=y > > as long as CONFIG_CRASH_DUMP=Y which people may not want. > > > > In Ignat's case, he sets CONFIG_CRASH_DUMP=y, CONFIG_KEXEC_FILE=y and > > CONFIG_KEXEC=n because kexec_load interface could have security issue if > > kernel/initrd has no chance to be signed and verified. > > > > CRASH_DUMP has select of KEXEC because Eric, author of above commit, > > met a LKP report of build failure when posting patch of earlier version. > > Please see below link to get detail of the LKP report: > > > > https://lore.kernel.org/all/3e8eecd1-a277-2cfb-690e-5de2eb7b988e@oracle.com/T/#u > > > > In fact, that LKP report is triggered because arm's is > > wrapped in CONFIG_KEXEC ifdeffery scope. That is wrong. CONFIG_KEXEC > > controls the enabling/disabling of kexec_load interface, but not kexec > > feature. Removing the wrongly added CONFIG_KEXEC ifdeffery scope in > > of arm allows us to drop the select KEXEC for CRASH_DUMP. > > Hm... With the patch, when cross compiling for arm and > CONFIG_KEXEC_CORE=y > # CONFIG_KEXEC is not set > CONFIG_CRASH_DUMP=y > > I get the following linker error at the end: > > CALL scripts/checksyscalls.sh > UPD include/generated/utsversion.h > CC init/version-timestamp.o > LD .tmp_vmlinux.kallsyms1 > arm-linux-gnueabi-ld: kernel/kexec_core.o: in function `kimage_free': > kexec_core.c:(.text+0xf5c): undefined reference to `machine_kexec_cleanup' > arm-linux-gnueabi-ld: kernel/kexec_core.o: in function `__crash_kexec': > kexec_core.c:(.text+0x15bc): undefined reference to `machine_crash_shutdown' > arm-linux-gnueabi-ld: kexec_core.c:(.text+0x15c4): undefined reference > to `machine_kexec' > arm-linux-gnueabi-ld: kernel/kexec_core.o: in function `kernel_kexec': > kexec_core.c:(.text+0x1a04): undefined reference to `machine_kexec' > make[2]: *** [scripts/Makefile.vmlinux:37: vmlinux] Error 1 > make[1]: *** [/home/ignat/git/linux-upstream/Makefile:1154: vmlinux] Error 2 > make: *** [Makefile:234: __sub-make] Error 2 Oops, I forgot this part. This should fix the link error. diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index d53f56d6f840..771264d4726a 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -59,7 +59,7 @@ obj-$(CONFIG_FUNCTION_TRACER) += entry-ftrace.o obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o insn.o patch.o obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o insn.o patch.o obj-$(CONFIG_JUMP_LABEL) += jump_label.o insn.o patch.o -obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o +obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o relocate_kernel.o # Main staffs in KPROBES are in arch/arm/probes/ . obj-$(CONFIG_KPROBES) += patch.o insn.o obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o