mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Youling Tang <youling.tang@linux.dev>,
	Huacai Chen <chenhuacai@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, WANG Xuerui <kernel@xen0n.name>,
	Baoquan He <bhe@redhat.com>, Yao Zi <ziyao@disroot.org>,
	kexec@lists.infradead.org, loongarch@lists.linux.dev,
	linux-kernel@vger.kernel.org, youling.tang@linux.dev,
	Youling Tang <tangyouling@kylinos.cn>
Subject: Re: [PATCH v2 2/5] LoongArch: Add kexec_file support
Date: Tue, 26 Aug 2025 09:55:13 +0800	[thread overview]
Message-ID: <202508260914.Bjz2YQwS-lkp@intel.com> (raw)
In-Reply-To: <20250820055700.24344-3-youling.tang@linux.dev>

Hi Youling,

kernel test robot noticed the following build warnings:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.17-rc3 next-20250825]
[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/Youling-Tang/LoongArch-Add-struct-loongarch_image_header-for-kernel-image/20250820-140025
base:   linus/master
patch link:    https://lore.kernel.org/r/20250820055700.24344-3-youling.tang%40linux.dev
patch subject: [PATCH v2 2/5] LoongArch: Add kexec_file support
config: loongarch-randconfig-r121-20250826 (https://download.01.org/0day-ci/archive/20250826/202508260914.Bjz2YQwS-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce: (https://download.01.org/0day-ci/archive/20250826/202508260914.Bjz2YQwS-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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508260914.Bjz2YQwS-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> arch/loongarch/kernel/kexec_efi.c:61:22: sparse: sparse: cast to restricted __le64
   arch/loongarch/kernel/kexec_efi.c:62:23: sparse: sparse: cast to restricted __le64

vim +61 arch/loongarch/kernel/kexec_efi.c

    37	
    38	static void *efi_kexec_load(struct kimage *image,
    39					char *kernel, unsigned long kernel_len,
    40					char *initrd, unsigned long initrd_len,
    41					char *cmdline, unsigned long cmdline_len)
    42	{
    43		struct loongarch_image_header *h;
    44		struct kexec_buf kbuf;
    45		unsigned long text_offset, kernel_segment_number;
    46		struct kexec_segment *kernel_segment;
    47		int ret;
    48	
    49		h = (struct loongarch_image_header *)kernel;
    50		if (!h->image_size)
    51			return ERR_PTR(-EINVAL);
    52	
    53		/* Load the kernel */
    54		kbuf.image = image;
    55		kbuf.buf_max = ULONG_MAX;
    56		kbuf.top_down = false;
    57	
    58		kbuf.buffer = kernel;
    59		kbuf.bufsz = kernel_len;
    60		kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
  > 61		kbuf.memsz = le64_to_cpu(h->image_size);
    62		text_offset = le64_to_cpu(h->text_offset);
    63		kbuf.buf_min = text_offset;
    64		kbuf.buf_align = SZ_2M;
    65	
    66		kernel_segment_number = image->nr_segments;
    67	
    68		/*
    69		 * The location of the kernel segment may make it impossible to satisfy
    70		 * the other segment requirements, so we try repeatedly to find a
    71		 * location that will work.
    72		 */
    73		while ((ret = kexec_add_buffer(&kbuf)) == 0) {
    74			/* Try to load additional data */
    75			kernel_segment = &image->segment[kernel_segment_number];
    76			ret = load_other_segments(image, kernel_segment->mem,
    77						  kernel_segment->memsz, initrd,
    78						  initrd_len, cmdline, cmdline_len);
    79			if (!ret)
    80				break;
    81	
    82			/*
    83			 * We couldn't find space for the other segments; erase the
    84			 * kernel segment and try the next available hole.
    85			 */
    86			image->nr_segments -= 1;
    87			kbuf.buf_min = kernel_segment->mem + kernel_segment->memsz;
    88			kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
    89		}
    90	
    91		if (ret) {
    92			pr_err("Could not find any suitable kernel location!");
    93			return ERR_PTR(ret);
    94		}
    95	
    96		kernel_segment = &image->segment[kernel_segment_number];
    97	
    98		/* Make sure the second kernel jumps to the correct "kernel_entry". */
    99		image->start = kernel_segment->mem + h->kernel_entry - text_offset;
   100	
   101		kexec_dprintk("Loaded kernel at 0x%lx bufsz=0x%lx memsz=0x%lx\n",
   102			      kernel_segment->mem, kbuf.bufsz,
   103			      kernel_segment->memsz);
   104	
   105		return NULL;
   106	}
   107	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2025-08-26  1:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20  5:56 [PATCH v2 0/5] Add kexec_file support for LoongArch Youling Tang
2025-08-20  5:56 ` [PATCH v2 1/5] LoongArch: Add struct loongarch_image_header for kernel image Youling Tang
2025-08-20  5:56 ` [PATCH v2 2/5] LoongArch: Add kexec_file support Youling Tang
2025-08-20  6:50   ` Yao Zi
2025-08-20  9:13     ` Youling Tang
2025-08-20 11:13       ` Yao Zi
2025-08-21  1:19         ` Youling Tang
2025-08-22  4:24           ` Huacai Chen
2025-08-22  2:56       ` Youling Tang
2025-08-22  4:19         ` Yao Zi
2025-08-22  6:40   ` Huacai Chen
2025-08-26  1:55   ` kernel test robot [this message]
2025-08-20  5:56 ` [PATCH v2 3/5] LoongArch/kexec_file: Support loading ELF binary file Youling Tang
2025-08-21  7:14   ` Youling Tang
2025-08-20  5:56 ` [PATCH v2 4/5] LoongArch/kexec_file: Add crash dump support Youling Tang
2025-08-20  5:57 ` [PATCH v2 5/5] LoongArch: Enable CONFIG_KEXEC_FILE Youling Tang
2025-08-22  4:13 ` [PATCH v2 0/5] Add kexec_file support for LoongArch Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202508260914.Bjz2YQwS-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bhe@redhat.com \
    --cc=chenhuacai@kernel.org \
    --cc=kernel@xen0n.name \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=tangyouling@kylinos.cn \
    --cc=youling.tang@linux.dev \
    --cc=ziyao@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®