All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/riscv/kernel/kexec_image.c:55:17: sparse: sparse: cast to restricted __le64
@ 2025-12-15 17:37 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-12-15 17:37 UTC (permalink / raw)
  To: Song Shuai
  Cc: oe-kbuild-all, linux-kernel, Palmer Dabbelt,
	Björn Töpel, Alexandre Ghiti

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8f0b4cce4481fb22653697cced8d0d04027cb1e8
commit: 809a11eea8e8c80491e3ba3a286af25409c072d5 riscv: kexec_file: Support loading Image binary file
date:   6 months ago
config: riscv-randconfig-r111-20251215 (https://download.01.org/0day-ci/archive/20251216/202512160142.4NPjO76q-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251216/202512160142.4NPjO76q-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/202512160142.4NPjO76q-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   WARNING: invalid argument to '-march': '_zacas_zabha'
>> arch/riscv/kernel/kexec_image.c:55:17: sparse: sparse: cast to restricted __le64
   arch/riscv/kernel/kexec_image.c:72:22: sparse: sparse: cast to restricted __le64
   arch/riscv/kernel/kexec_image.c:73:26: sparse: sparse: cast to restricted __le64

vim +55 arch/riscv/kernel/kexec_image.c

    35	
    36	static void *image_load(struct kimage *image,
    37				char *kernel, unsigned long kernel_len,
    38				char *initrd, unsigned long initrd_len,
    39				char *cmdline, unsigned long cmdline_len)
    40	{
    41		struct riscv_image_header *h;
    42		u64 flags;
    43		bool be_image, be_kernel;
    44		struct kexec_buf kbuf;
    45		int ret;
    46	
    47		/* Check Image header */
    48		h = (struct riscv_image_header *)kernel;
    49		if (!h->image_size) {
    50			ret = -EINVAL;
    51			goto out;
    52		}
    53	
    54		/* Check endianness */
  > 55		flags = le64_to_cpu(h->flags);
    56		be_image = riscv_image_flag_field(flags, RISCV_IMAGE_FLAG_BE);
    57		be_kernel = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN);
    58		if (be_image != be_kernel) {
    59			ret = -EINVAL;
    60			goto out;
    61		}
    62	
    63		/* Load the kernel image */
    64		kbuf.image = image;
    65		kbuf.buf_min = 0;
    66		kbuf.buf_max = ULONG_MAX;
    67		kbuf.top_down = false;
    68	
    69		kbuf.buffer = kernel;
    70		kbuf.bufsz = kernel_len;
    71		kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
    72		kbuf.memsz = le64_to_cpu(h->image_size);
    73		kbuf.buf_align = le64_to_cpu(h->text_offset);
    74	
    75		ret = kexec_add_buffer(&kbuf);
    76		if (ret) {
    77			pr_err("Error add kernel image ret=%d\n", ret);
    78			goto out;
    79		}
    80	
    81		image->start = kbuf.mem;
    82	
    83		pr_info("Loaded kernel at 0x%lx bufsz=0x%lx memsz=0x%lx\n",
    84			kbuf.mem, kbuf.bufsz, kbuf.memsz);
    85	
    86		ret = load_extra_segments(image, kbuf.mem, kbuf.memsz,
    87					  initrd, initrd_len, cmdline, cmdline_len);
    88	
    89	out:
    90		return ret ? ERR_PTR(ret) : NULL;
    91	}
    92	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* arch/riscv/kernel/kexec_image.c:55:17: sparse: sparse: cast to restricted __le64
@ 2026-01-17 17:47 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-01-17 17:47 UTC (permalink / raw)
  To: Song Shuai
  Cc: oe-kbuild-all, linux-kernel, Palmer Dabbelt,
	 Björn Töpel , Alexandre Ghiti

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d3eeb99bbc99cc5eb94a4a75ed4415a0272254ef
commit: 809a11eea8e8c80491e3ba3a286af25409c072d5 riscv: kexec_file: Support loading Image binary file
date:   8 months ago
config: riscv-randconfig-r111-20260117 (https://download.01.org/0day-ci/archive/20260118/202601180149.7a0ePZCr-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260118/202601180149.7a0ePZCr-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/202601180149.7a0ePZCr-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   WARNING: invalid argument to '-march': '_zacas_zabha'
>> arch/riscv/kernel/kexec_image.c:55:17: sparse: sparse: cast to restricted __le64
   arch/riscv/kernel/kexec_image.c:72:22: sparse: sparse: cast to restricted __le64
   arch/riscv/kernel/kexec_image.c:73:26: sparse: sparse: cast to restricted __le64

vim +55 arch/riscv/kernel/kexec_image.c

    35	
    36	static void *image_load(struct kimage *image,
    37				char *kernel, unsigned long kernel_len,
    38				char *initrd, unsigned long initrd_len,
    39				char *cmdline, unsigned long cmdline_len)
    40	{
    41		struct riscv_image_header *h;
    42		u64 flags;
    43		bool be_image, be_kernel;
    44		struct kexec_buf kbuf;
    45		int ret;
    46	
    47		/* Check Image header */
    48		h = (struct riscv_image_header *)kernel;
    49		if (!h->image_size) {
    50			ret = -EINVAL;
    51			goto out;
    52		}
    53	
    54		/* Check endianness */
  > 55		flags = le64_to_cpu(h->flags);
    56		be_image = riscv_image_flag_field(flags, RISCV_IMAGE_FLAG_BE);
    57		be_kernel = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN);
    58		if (be_image != be_kernel) {
    59			ret = -EINVAL;
    60			goto out;
    61		}
    62	
    63		/* Load the kernel image */
    64		kbuf.image = image;
    65		kbuf.buf_min = 0;
    66		kbuf.buf_max = ULONG_MAX;
    67		kbuf.top_down = false;
    68	
    69		kbuf.buffer = kernel;
    70		kbuf.bufsz = kernel_len;
    71		kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
    72		kbuf.memsz = le64_to_cpu(h->image_size);
    73		kbuf.buf_align = le64_to_cpu(h->text_offset);
    74	
    75		ret = kexec_add_buffer(&kbuf);
    76		if (ret) {
    77			pr_err("Error add kernel image ret=%d\n", ret);
    78			goto out;
    79		}
    80	
    81		image->start = kbuf.mem;
    82	
    83		pr_info("Loaded kernel at 0x%lx bufsz=0x%lx memsz=0x%lx\n",
    84			kbuf.mem, kbuf.bufsz, kbuf.memsz);
    85	
    86		ret = load_extra_segments(image, kbuf.mem, kbuf.memsz,
    87					  initrd, initrd_len, cmdline, cmdline_len);
    88	
    89	out:
    90		return ret ? ERR_PTR(ret) : NULL;
    91	}
    92	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* arch/riscv/kernel/kexec_image.c:55:17: sparse: sparse: cast to restricted __le64
@ 2026-06-11 22:05 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2026-06-11 22:05 UTC (permalink / raw)
  To: Song Shuai
  Cc: oe-kbuild-all, linux-kernel, Palmer Dabbelt,
	 Björn Töpel , Alexandre Ghiti

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9716c086c8e8b141d35aa61f2e96a2e83de212a7
commit: 809a11eea8e8c80491e3ba3a286af25409c072d5 riscv: kexec_file: Support loading Image binary file
date:   1 year ago
config: riscv-randconfig-r132-20260611 (https://download.01.org/0day-ci/archive/20260612/202606120608.xftxlgJl-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 15.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260612/202606120608.xftxlgJl-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
| Fixes: 809a11eea8e8 ("riscv: kexec_file: Support loading Image binary file")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606120608.xftxlgJl-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   WARNING: invalid argument to '-march': '_zacas_zabha'
>> arch/riscv/kernel/kexec_image.c:55:17: sparse: sparse: cast to restricted __le64
   arch/riscv/kernel/kexec_image.c:72:22: sparse: sparse: cast to restricted __le64
   arch/riscv/kernel/kexec_image.c:73:26: sparse: sparse: cast to restricted __le64

vim +55 arch/riscv/kernel/kexec_image.c

    35	
    36	static void *image_load(struct kimage *image,
    37				char *kernel, unsigned long kernel_len,
    38				char *initrd, unsigned long initrd_len,
    39				char *cmdline, unsigned long cmdline_len)
    40	{
    41		struct riscv_image_header *h;
    42		u64 flags;
    43		bool be_image, be_kernel;
    44		struct kexec_buf kbuf;
    45		int ret;
    46	
    47		/* Check Image header */
    48		h = (struct riscv_image_header *)kernel;
    49		if (!h->image_size) {
    50			ret = -EINVAL;
    51			goto out;
    52		}
    53	
    54		/* Check endianness */
  > 55		flags = le64_to_cpu(h->flags);
    56		be_image = riscv_image_flag_field(flags, RISCV_IMAGE_FLAG_BE);
    57		be_kernel = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN);
    58		if (be_image != be_kernel) {
    59			ret = -EINVAL;
    60			goto out;
    61		}
    62	
    63		/* Load the kernel image */
    64		kbuf.image = image;
    65		kbuf.buf_min = 0;
    66		kbuf.buf_max = ULONG_MAX;
    67		kbuf.top_down = false;
    68	
    69		kbuf.buffer = kernel;
    70		kbuf.bufsz = kernel_len;
    71		kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
    72		kbuf.memsz = le64_to_cpu(h->image_size);
    73		kbuf.buf_align = le64_to_cpu(h->text_offset);
    74	
    75		ret = kexec_add_buffer(&kbuf);
    76		if (ret) {
    77			pr_err("Error add kernel image ret=%d\n", ret);
    78			goto out;
    79		}
    80	
    81		image->start = kbuf.mem;
    82	
    83		pr_info("Loaded kernel at 0x%lx bufsz=0x%lx memsz=0x%lx\n",
    84			kbuf.mem, kbuf.bufsz, kbuf.memsz);
    85	
    86		ret = load_extra_segments(image, kbuf.mem, kbuf.memsz,
    87					  initrd, initrd_len, cmdline, cmdline_len);
    88	
    89	out:
    90		return ret ? ERR_PTR(ret) : NULL;
    91	}
    92	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-11 22:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-15 17:37 arch/riscv/kernel/kexec_image.c:55:17: sparse: sparse: cast to restricted __le64 kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-01-17 17:47 kernel test robot
2026-06-11 22:05 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.