Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1048680rdb; Sun, 7 Jan 2024 00:52:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IF8ZcA7q+H5uz27vR/lPVgvTdi4onJvvyesCvIgrFEOw93IHVO6q++McTKy3uQdYHs+oC76 X-Received: by 2002:a05:6e02:17cc:b0:360:5e23:301 with SMTP id z12-20020a056e0217cc00b003605e230301mr4004359ilu.94.1704617563431; Sun, 07 Jan 2024 00:52:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704617563; cv=none; d=google.com; s=arc-20160816; b=dPY2StWe64s1kA8VAU2dmeYTu0A3aRhZI1QormPhUz1k/YOh0gfzPxpwWE6rShQyoh FfDgzC+OVqFNzL3PAQMvId/4fI2XtmXMAkI0czn3BFKqZRy/3Ov2WKe1VvyH2PZqL1Fv he7+24j8qxvcg81stwFv+my8NrPEgI82DcuetsQN8zTI+oskwmJXuIsEkDSKdtnAnBwo OfbgkZMC6wqZZfdkTYoKruyyt9xZytkg/gMs0C81VMVizlR7/rX6mxrqiaJ71NE7cIBt 6+LLFzt1gk3NZVbYAS0G5lfyODJkoWSMQZViyR1gQNr5o4Xb2H6K34bdC75/rmyBYeQA LEZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Jm4zrLgU02qTNuKz7yvXlAxsX0awHq5pYJjTqaiF7Dk=; fh=Yrg8P+GYQuHATUxRLpzGlNPiU7X7YbMA1fmChJ6CR9U=; b=rmlstmwIKsWNzFYBdoxyeY4/9/NzTrrbejjjUFbI8EIxA5z00Vls3hw6ypYhtFIECZ JmAEf4QMF6EbbOEwe2HbARCD8sF6eekwoVtqMjx4U74XPjXPWGBVjYXpzPPTIU6VXFx9 hXGLdxbbWbbZVLPY/jOpD64tX4OTX3JTbj1gMLIg3/xGFUj648nfn6okTSh0pdmY5GEU 0splhr0DjTfarFLvcmdXjEILL5x+IEQDqzaRQrPpvp1Te2LkEhxx2Ye89oPBeMrHIVSp bkoQ5+ZrhLJdBlr3moJf7jxNcCMeTqSbYYGijaOqGwzVMtVqoZtEdPM5trn5e3UU0lg2 PsNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="YvSlb/gD"; spf=pass (google.com: domain of linux-kernel+bounces-18818-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18818-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y5-20020a170902ed4500b001d4b6540324si4084559plb.183.2024.01.07.00.52.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 00:52:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-18818-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="YvSlb/gD"; spf=pass (google.com: domain of linux-kernel+bounces-18818-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-18818-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 58169B21CB6 for ; Sun, 7 Jan 2024 08:52:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19F54125C4; Sun, 7 Jan 2024 08:52:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="YvSlb/gD" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82ADB12B60 for ; Sun, 7 Jan 2024 08:52:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704617548; 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=Jm4zrLgU02qTNuKz7yvXlAxsX0awHq5pYJjTqaiF7Dk=; b=YvSlb/gDVPE+nj63ubqHEWm+hhs35/bw/EG7mv4OjnmbpMNZpX2rS5WKfGxBY6O11DtYMi RloDAYqGzc6aZAqcErQ7ZySe7Vh5Gm0+SfT3zmZe5C5wNNP+hbXZ80X/qbQ5PuNzhyd0mW szHP036SSTMp33Pkif3k33qNCDjLxhg= 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-518-xIoNME9aOIiDikbTzkUdwA-1; Sun, 07 Jan 2024 03:52:25 -0500 X-MC-Unique: xIoNME9aOIiDikbTzkUdwA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 3263F8350E3; Sun, 7 Jan 2024 08:52:24 +0000 (UTC) Received: from localhost (unknown [10.72.116.129]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F7742026D6F; Sun, 7 Jan 2024 08:52:22 +0000 (UTC) Date: Sun, 7 Jan 2024 16:52:15 +0800 From: Baoquan He To: kernel test robot Cc: linux-kernel@vger.kernel.org, llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, akpm@linux-foundation.org, kexec@lists.infradead.org, hbathini@linux.ibm.com, arnd@arndb.de, ignat@cloudflare.com, eric_devolder@yahoo.com, viro@zeniv.linux.org.uk, ebiederm@xmission.com, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c Message-ID: References: <20240105103305.557273-2-bhe@redhat.com> <202401062212.LXqinfjE-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202401062212.LXqinfjE-lkp@intel.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 On 01/06/24 at 10:58pm, kernel test robot wrote: > Hi Baoquan, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on linus/master] > [also build test ERROR on v6.7-rc8] > [cannot apply to powerpc/next powerpc/fixes tip/x86/core arm64/for-next/core next-20240105] > [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_core-move-kdump-related-codes-from-crash_core-c-to-kexec_core-c/20240105-223735 > base: linus/master > patch link: https://lore.kernel.org/r/20240105103305.557273-2-bhe%40redhat.com > patch subject: [PATCH 1/5] kexec_core: move kdump related codes from crash_core.c to kexec_core.c > config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20240106/202401062212.LXqinfjE-lkp@intel.com/config) > compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240106/202401062212.LXqinfjE-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/202401062212.LXqinfjE-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > >> arch/x86/kernel/crash.c:154:17: error: invalid application of 'sizeof' to an incomplete type 'struct crash_mem' > 154 | cmem = vzalloc(struct_size(cmem, ranges, nr_ranges)); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thanks for reporting. I mistakenly put the struct crash_mem definition and the two function delcarations inside CONFIG_KEXEC_FILE ifdeffery scope, so with the lkp's config as below, the compiling failed. The code change at bottom can fix it. Will update patch in v2. # # Kexec and crash features # CONFIG_CRASH_CORE=y CONFIG_KEXEC_CORE=y CONFIG_KEXEC=y # CONFIG_KEXEC_FILE is not set CONFIG_CRASH_DUMP=y CONFIG_CRASH_HOTPLUG=y CONFIG_CRASH_MAX_MEMORY_RANGES=8192 --- include/linux/kexec.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index be1e5c2fdbdc..4df6ef72db84 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -228,21 +228,6 @@ static inline int arch_kexec_locate_mem_hole(struct kexec_buf *kbuf) } #endif -/* Alignment required for elf header segment */ -#define ELF_CORE_HEADER_ALIGN 4096 - -struct crash_mem { - unsigned int max_nr_ranges; - unsigned int nr_ranges; - struct range ranges[] __counted_by(max_nr_ranges); -}; - -extern int crash_exclude_mem_range(struct crash_mem *mem, - unsigned long long mstart, - unsigned long long mend); -extern int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map, - void **addr, unsigned long *sz); - #ifndef arch_kexec_apply_relocations_add /* * arch_kexec_apply_relocations_add - apply relocations of type RELA @@ -525,6 +510,20 @@ static inline unsigned int crash_get_elfcorehdr_size(void) { return 0; } #define KEXEC_CRASH_HP_INVALID_CPU -1U #endif +/* Alignment required for elf header segment */ +#define ELF_CORE_HEADER_ALIGN 4096 + +struct crash_mem { + unsigned int max_nr_ranges; + unsigned int nr_ranges; + struct range ranges[] __counted_by(max_nr_ranges); +}; + +extern int crash_exclude_mem_range(struct crash_mem *mem, + unsigned long long mstart, + unsigned long long mend); +extern int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map, + void **addr, unsigned long *sz); #else /* !CONFIG_KEXEC_CORE */ struct pt_regs; struct task_struct; @@ -541,6 +540,7 @@ void set_kexec_sig_enforced(void); static inline void set_kexec_sig_enforced(void) {} #endif + #endif /* !defined(__ASSEBMLY__) */ #endif /* LINUX_KEXEC_H */ -- 2.41.0