Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2871306rdb; Wed, 15 Nov 2023 13:06:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IFuLNNSJoMMtPzrTD3UF1Su+3lfoi3Mz4r8s1yKDzAVBQVCUPnzThFdHxKbeMKsuYdYnWF4 X-Received: by 2002:a17:902:ce0f:b0:1cc:7a8e:606b with SMTP id k15-20020a170902ce0f00b001cc7a8e606bmr8430768plg.43.1700082409480; Wed, 15 Nov 2023 13:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700082409; cv=none; d=google.com; s=arc-20160816; b=P8BCp0k+R8Ml4+OxHyHxJgeckRZDoQKpwQiFXUE+rdSXZRz6dOICJHyRBcBrvfzgrZ kdE3liFLn3IGDRDZQy2axcum172MgT8laxZdP5d/qegkDDQ6ce0WbOe2nEeXzdibMm4T 97ACoZeNTZ5fJHaI+lLLP0aXpYgmiR4M4i2XL/tFYhEEKvMbpxSSjF39U+Vbh9b83AIh f+oId77D1esNeKKX0YGX4IBz89F6gufUwTeBbLxCH7hIQySgRbInvOMRte5YObsh578Z O1xTRIOpnwsEYT/aEOKnKPcIQnZZsNHLiN47U/fx79H4hUWe+7zPZSeLdinrf7FxTC5l DCqA== 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=CspZlzJqDX4n+FQlWUydSsHxa1zFcBr6atBSvK7Mo3I=; fh=YeJD2GpvHOy6Dnn6jmOnI36nuzD26wOtKozUCjN0lzE=; b=MJOTMiPmHlU1QtEa++FldBAmsWAjm8scTnLhU02X2HyrITA1Ec/yXWUTKSduOUIedW gcJxJLE/7W78fO7V68xL/6g3RYSgxbWk3wElTOC3GFVvP/IAaMEf9FGsd+SiHaqPZg0h E7ZFApoHdvOm6j86alnbjrCldmjtIZmiXW6RxKCDTs6ixWt7Vj6Y+DcTc2HC3wvkYes/ OIV1o2u652DJ050Z1JHomB90QiITjBH1h7rkcTSQhR7hJP9C263MayD3IGww1kO1N2U7 LHEQnNYMk/7cTzrhGBXWbDElPr9ggJP6xxuIltYeyFLgL4Ru74dL0WPaVmNC8Q91Q32B 3xyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Avv+xlY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id o11-20020a170902d4cb00b001c5c344a425si11472257plg.418.2023.11.15.13.06.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:06:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Avv+xlY+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id B7FE080A0574; Wed, 15 Nov 2023 13:06:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344934AbjKOVFs (ORCPT + 99 others); Wed, 15 Nov 2023 16:05:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235754AbjKOVF0 (ORCPT ); Wed, 15 Nov 2023 16:05:26 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8A80213F; Wed, 15 Nov 2023 13:05:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700082314; x=1731618314; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=HZaP63qR51WdI944Jzx+qswTuQEwasjcvHgL6QGSQhs=; b=Avv+xlY+k0ejGxsDCkzZmzDrHsmphujqtKqvMFSFYGHtg/hU5I3KpJ40 Bifl4LvvNUgEgZEJtvjETz3B5kHtQLWop6bqGTVUlFVuuqKxIZ/lc4rKz BOWR7QaR0IAimOKfS5oLgTHgO/mU5b6+YEEBMBw4fpTLCnFAEHQHK6HbZ CgYLS2FO2IBuRpAEDLhIGSNlvPgBVb4zC9I7YFz1+OxL01ImlOPEQNh0n pzc9zjK3gNgQmQedQ1ZtCYs3Y0FW/mjrB1O2LZB7y1oz0HZefA1UWq1zb gcoKgoTym8kE+o8iLs9ebOxvPSni2QMNZKml9hlzZXgwCL3QQLxfNQDcD g==; X-IronPort-AV: E=McAfee;i="6600,9927,10895"; a="4032594" X-IronPort-AV: E=Sophos;i="6.03,306,1694761200"; d="scan'208";a="4032594" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Nov 2023 13:05:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10895"; a="888699475" X-IronPort-AV: E=Sophos;i="6.03,306,1694761200"; d="scan'208";a="888699475" Received: from lkp-server02.sh.intel.com (HELO b8de5498638e) ([10.239.97.151]) by orsmga004.jf.intel.com with ESMTP; 15 Nov 2023 13:05:08 -0800 Received: from kbuild by b8de5498638e with local (Exim 4.96) (envelope-from ) id 1r3N4M-0000p6-1l; Wed, 15 Nov 2023 21:05:06 +0000 Date: Thu, 16 Nov 2023 05:04:43 +0800 From: kernel test robot To: Baoquan He , linux-kernel@vger.kernel.org Cc: 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, Baoquan He Subject: Re: [PATCH 2/7] kexec_file: print out debugging message if required Message-ID: <202311160431.BXPc7NO9-lkp@intel.com> References: <20231114153253.241262-3-bhe@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231114153253.241262-3-bhe@redhat.com> X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 15 Nov 2023 13:06:01 -0800 (PST) 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-rc1 next-20231115] [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/20231114-234003 base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core patch link: https://lore.kernel.org/r/20231114153253.241262-3-bhe%40redhat.com patch subject: [PATCH 2/7] kexec_file: print out debugging message if required config: hexagon-comet_defconfig (https://download.01.org/0day-ci/archive/20231116/202311160431.BXPc7NO9-lkp@intel.com/config) compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231116/202311160431.BXPc7NO9-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/202311160431.BXPc7NO9-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from kernel/crash_core.c:13: In file included from include/linux/kexec.h:19: In file included from arch/hexagon/include/asm/io.h:337: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __raw_readb(PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) ^ In file included from kernel/crash_core.c:13: In file included from include/linux/kexec.h:19: In file included from arch/hexagon/include/asm/io.h:337: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) ^ In file included from kernel/crash_core.c:13: In file included from include/linux/kexec.h:19: In file included from arch/hexagon/include/asm/io.h:337: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writeb(value, PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); ~~~~~~~~~~ ^ >> kernel/crash_core.c:412:3: error: call to undeclared function 'kexec_dprintk'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] kexec_dprintk("Crash PT_LOAD ELF header. phdr=%p vaddr=0x%llx, paddr=0x%llx, " ^ 6 warnings and 1 error generated. vim +/kexec_dprintk +412 kernel/crash_core.c 323 324 int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map, 325 void **addr, unsigned long *sz) 326 { 327 Elf64_Ehdr *ehdr; 328 Elf64_Phdr *phdr; 329 unsigned long nr_cpus = num_possible_cpus(), nr_phdr, elf_sz; 330 unsigned char *buf; 331 unsigned int cpu, i; 332 unsigned long long notes_addr; 333 unsigned long mstart, mend; 334 335 /* extra phdr for vmcoreinfo ELF note */ 336 nr_phdr = nr_cpus + 1; 337 nr_phdr += mem->nr_ranges; 338 339 /* 340 * kexec-tools creates an extra PT_LOAD phdr for kernel text mapping 341 * area (for example, ffffffff80000000 - ffffffffa0000000 on x86_64). 342 * I think this is required by tools like gdb. So same physical 343 * memory will be mapped in two ELF headers. One will contain kernel 344 * text virtual addresses and other will have __va(physical) addresses. 345 */ 346 347 nr_phdr++; 348 elf_sz = sizeof(Elf64_Ehdr) + nr_phdr * sizeof(Elf64_Phdr); 349 elf_sz = ALIGN(elf_sz, ELF_CORE_HEADER_ALIGN); 350 351 buf = vzalloc(elf_sz); 352 if (!buf) 353 return -ENOMEM; 354 355 ehdr = (Elf64_Ehdr *)buf; 356 phdr = (Elf64_Phdr *)(ehdr + 1); 357 memcpy(ehdr->e_ident, ELFMAG, SELFMAG); 358 ehdr->e_ident[EI_CLASS] = ELFCLASS64; 359 ehdr->e_ident[EI_DATA] = ELFDATA2LSB; 360 ehdr->e_ident[EI_VERSION] = EV_CURRENT; 361 ehdr->e_ident[EI_OSABI] = ELF_OSABI; 362 memset(ehdr->e_ident + EI_PAD, 0, EI_NIDENT - EI_PAD); 363 ehdr->e_type = ET_CORE; 364 ehdr->e_machine = ELF_ARCH; 365 ehdr->e_version = EV_CURRENT; 366 ehdr->e_phoff = sizeof(Elf64_Ehdr); 367 ehdr->e_ehsize = sizeof(Elf64_Ehdr); 368 ehdr->e_phentsize = sizeof(Elf64_Phdr); 369 370 /* Prepare one phdr of type PT_NOTE for each possible CPU */ 371 for_each_possible_cpu(cpu) { 372 phdr->p_type = PT_NOTE; 373 notes_addr = per_cpu_ptr_to_phys(per_cpu_ptr(crash_notes, cpu)); 374 phdr->p_offset = phdr->p_paddr = notes_addr; 375 phdr->p_filesz = phdr->p_memsz = sizeof(note_buf_t); 376 (ehdr->e_phnum)++; 377 phdr++; 378 } 379 380 /* Prepare one PT_NOTE header for vmcoreinfo */ 381 phdr->p_type = PT_NOTE; 382 phdr->p_offset = phdr->p_paddr = paddr_vmcoreinfo_note(); 383 phdr->p_filesz = phdr->p_memsz = VMCOREINFO_NOTE_SIZE; 384 (ehdr->e_phnum)++; 385 phdr++; 386 387 /* Prepare PT_LOAD type program header for kernel text region */ 388 if (need_kernel_map) { 389 phdr->p_type = PT_LOAD; 390 phdr->p_flags = PF_R|PF_W|PF_X; 391 phdr->p_vaddr = (unsigned long) _text; 392 phdr->p_filesz = phdr->p_memsz = _end - _text; 393 phdr->p_offset = phdr->p_paddr = __pa_symbol(_text); 394 ehdr->e_phnum++; 395 phdr++; 396 } 397 398 /* Go through all the ranges in mem->ranges[] and prepare phdr */ 399 for (i = 0; i < mem->nr_ranges; i++) { 400 mstart = mem->ranges[i].start; 401 mend = mem->ranges[i].end; 402 403 phdr->p_type = PT_LOAD; 404 phdr->p_flags = PF_R|PF_W|PF_X; 405 phdr->p_offset = mstart; 406 407 phdr->p_paddr = mstart; 408 phdr->p_vaddr = (unsigned long) __va(mstart); 409 phdr->p_filesz = phdr->p_memsz = mend - mstart + 1; 410 phdr->p_align = 0; 411 ehdr->e_phnum++; > 412 kexec_dprintk("Crash PT_LOAD ELF header. phdr=%p vaddr=0x%llx, paddr=0x%llx, " 413 "sz=0x%llx e_phnum=%d p_offset=0x%llx\n", 414 phdr, phdr->p_vaddr, phdr->p_paddr, phdr->p_filesz, 415 ehdr->e_phnum, phdr->p_offset); 416 phdr++; 417 } 418 419 *addr = buf; 420 *sz = elf_sz; 421 return 0; 422 } 423 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki