Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2359907rdh; Sun, 26 Nov 2023 03:56:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBj5kbybI4c7knJjcFLJEhNMj5xMWvY7xyAF/7x+sMnPEtjPVWjdt+6kOIFojrGrsIT3/f X-Received: by 2002:a17:902:8e89:b0:1cc:7adb:16a5 with SMTP id bg9-20020a1709028e8900b001cc7adb16a5mr7287620plb.13.1700999771973; Sun, 26 Nov 2023 03:56:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700999771; cv=none; d=google.com; s=arc-20160816; b=RxfGjyApnWOEsNyCpqK+2FGNTRf+BlLlyTFggsGadjo0ginRFCFMFoc1dD8QXtTe8r cYF3gccZGuwR2ex5eiCZrCWJuedByXzhPBpIV7g5hmStemLs+jgGIyRDh4TvCtIMkoug Q3kVOCWB9lleIWJKXVfow8NWuW/0/KNeckYae++LBcmvOq22STSapxG+JaFpi/ZGWOiz wVAw6S49gOIBNkTTF9RoW4GmUFGcVVX30MSrjtV//iy1/U1ZBrzj/62rAPOMEftiRtzX tnevJU0Q9y9+2Xjt91I67/tT4CRRKimNJBVmZYwgOMx8bUPTY1kxbXCiFIhCUTDpBRtQ +hZw== 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=10f/Bul9KbIaMsjeanbNOmm62BHIxQH0eftSF3zeoHA=; fh=5p/xaNgNj/WwzcFntzMPuCER95FOpzc6kqv6Cv2pMo0=; b=EZujC/T0nRh5ppktqFwNYOdwFzlWQIltqk1WTBWG5GroDUXz24PPWblraWOKoW/hlu l39Mis5zGHcRlaDdZOkrvj3HwwJYBzYIKTR9q2ikvUTtSIIeYZVIm7apKQmGK/TgfNkp U98KLC3AC0wc3vQzRIS2E3ewq2t6ZS0eez0Hmu79erosBwT1abmyc+lwf0wSdrtkM02W +/CHElTndxcp0W0QnhitfWrgpQs+UA7hNwIaEeyFS6yC9Q6ZDRpLHniJ6a50njDgCAGG frFNNNMNlinDssXA/EpmVgctjbNhRuILddd9fozQF+CmfHo5B+PYHfvcsx2Qhs/9/dsH lqqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IXiDeKM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id i13-20020a170902c94d00b001cfa2aa2391si5848882pla.434.2023.11.26.03.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 03:56:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IXiDeKM6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 24EDA80B90BC; Sun, 26 Nov 2023 03:56:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229447AbjKZLzt (ORCPT + 99 others); Sun, 26 Nov 2023 06:55:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbjKZLzq (ORCPT ); Sun, 26 Nov 2023 06:55:46 -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 827E510F for ; Sun, 26 Nov 2023 03:55:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700999750; 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: in-reply-to:in-reply-to:references:references; bh=10f/Bul9KbIaMsjeanbNOmm62BHIxQH0eftSF3zeoHA=; b=IXiDeKM6E1pRz0aHXANjgB3J97HfSg2MI8kj1Qbv7ixMTk5kvOshWSH+1nfBzG9StVSS4L rx26h/szJb9S2etl8A60o5/n/QXs0LxaRslobBpTAlxWyK/mw1rNSIvbUJchrJKmPWu9F9 CKfipjWZa3Nlz54iZdbEKhyDw31CuCw= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-76-n79wBA5hOnSAQHO1OAsXyg-1; Sun, 26 Nov 2023 06:55:45 -0500 X-MC-Unique: n79wBA5hOnSAQHO1OAsXyg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 90DF23C0C88A; Sun, 26 Nov 2023 11:55:44 +0000 (UTC) Received: from localhost (unknown [10.72.112.36]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C8B1340C6EB9; Sun, 26 Nov 2023 11:55:43 +0000 (UTC) Date: Sun, 26 Nov 2023 19:55:40 +0800 From: Baoquan He To: kernel test robot Cc: linux-kernel@vger.kernel.org, llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, kexec@lists.infradead.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-parisc@vger.kernel.org, akpm@linux-foundation.org, joe@perches.com, nathan@kernel.org, yujie.liu@intel.com Subject: Re: [PATCH v2 4/7] kexec_file, arm64: print out debugging message if required Message-ID: References: <20231124033642.520686-5-bhe@redhat.com> <202311260548.1HaxcDnE-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202311260548.1HaxcDnE-lkp@intel.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 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 morse.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 (morse.vger.email [0.0.0.0]); Sun, 26 Nov 2023 03:56:09 -0800 (PST) On 11/26/23 at 05:26am, kernel test robot wrote: > Hi Baoquan, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on arm64/for-next/core] > [also build test ERROR on tip/x86/core powerpc/next powerpc/fixes linus/master v6.7-rc2 next-20231124] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Baoquan-He/kexec_file-add-kexec_file-flag-to-control-debug-printing/20231124-113942 > base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core > patch link: https://lore.kernel.org/r/20231124033642.520686-5-bhe%40redhat.com > patch subject: [PATCH v2 4/7] kexec_file, arm64: print out debugging message if required > config: arm64-randconfig-001-20231126 (https://download.01.org/0day-ci/archive/20231126/202311260548.1HaxcDnE-lkp@intel.com/config) > compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1) > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231126/202311260548.1HaxcDnE-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot > | Closes: https://lore.kernel.org/oe-kbuild-all/202311260548.1HaxcDnE-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > >> arch/arm64/kernel/machine_kexec.c:35:2: error: implicit declaration of function 'kexec_dprintk' is invalid in C99 [-Werror,-Wimplicit-function-declaration] > kexec_dprintk("%s:%d:\n", func, line); > ^ > 1 error generated. Thanks for reporting. It has below kexec related config items, whereas the kexec_drpintk() is only defined in CONFIG_KEXEC_FILE ifdeffery scope, moving it to CONFIG_KEXEC_CORE iddeffery scope in can fix it as below draft code. Will update patch 1 to include the code change. === CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_KEXEC=y # CONFIG_KEXEC_FILE is not set CONFIG_CRASH_DUMP=y === diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 66997efe36f1..b457b0d70f3f 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -265,13 +265,6 @@ arch_kexec_apply_relocations(struct purgatory_info *pi, Elf_Shdr *section, } #endif -extern bool kexec_file_dbg_print; - -#define kexec_dprintk(fmt, ...) \ - printk("%s" fmt, \ - kexec_file_dbg_print ? KERN_INFO : KERN_DEBUG, \ - ##__VA_ARGS__) - #endif /* CONFIG_KEXEC_FILE */ #ifdef CONFIG_KEXEC_ELF @@ -508,6 +501,13 @@ static inline int crash_hotplug_memory_support(void) { return 0; } static inline unsigned int crash_get_elfcorehdr_size(void) { return 0; } #endif +extern bool kexec_file_dbg_print; + +#define kexec_dprintk(fmt, ...) \ + printk("%s" fmt, \ + kexec_file_dbg_print ? KERN_INFO : KERN_DEBUG, \ + ##__VA_ARGS__) + #else /* !CONFIG_KEXEC_CORE */ struct pt_regs; struct task_struct; diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index be5642a4ec49..bddba29a1557 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -52,6 +52,8 @@ atomic_t __kexec_lock = ATOMIC_INIT(0); /* Flag to indicate we are going to kexec a new kernel */ bool kexec_in_progress = false; +bool kexec_file_dbg_print; + int kexec_should_crash(struct task_struct *p) { /* diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 7ae1b0901aa4..8f87644b4eec 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -38,8 +38,6 @@ void set_kexec_sig_enforced(void) } #endif -bool kexec_file_dbg_print; - static int kexec_calculate_store_digests(struct kimage *image); /* Maximum size in bytes for kernel/initrd files. */