* [akpm-mm:mm-unstable 23/220] arch/arm64/kernel/kexec_image.c:79:6: error: 'struct kexec_buf' has no member named 'random'
@ 2025-08-26 17:06 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-08-26 17:06 UTC (permalink / raw)
To: Breno Leitao; +Cc: oe-kbuild-all, Andrew Morton, Linux Memory Management List
tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
head: f279bb633c0aace9bb737f2cfcd7e91deef13356
commit: d2567dc490b0051381940a31f95c98d76ea0e5c1 [23/220] kexec/arm64: initialize the random field of kbuf to zero in the image loader
config: arm64-randconfig-004-20250826 (https://download.01.org/0day-ci/archive/20250827/202508270141.fyzLcWqi-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250827/202508270141.fyzLcWqi-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/202508270141.fyzLcWqi-lkp@intel.com/
All errors (new ones prefixed by >>):
arch/arm64/kernel/kexec_image.c: In function 'image_load':
>> arch/arm64/kernel/kexec_image.c:79:6: error: 'struct kexec_buf' has no member named 'random'
kbuf.random = 0;
^
vim +79 arch/arm64/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 arm64_image_header *h;
42 u64 flags, value;
43 bool be_image, be_kernel;
44 struct kexec_buf kbuf;
45 unsigned long text_offset, kernel_segment_number;
46 struct kexec_segment *kernel_segment;
47 int ret;
48
49 /*
50 * We require a kernel with an unambiguous Image header. Per
51 * Documentation/arch/arm64/booting.rst, this is the case when image_size
52 * is non-zero (practically speaking, since v3.17).
53 */
54 h = (struct arm64_image_header *)kernel;
55 if (!h->image_size)
56 return ERR_PTR(-EINVAL);
57
58 /* Check cpu features */
59 flags = le64_to_cpu(h->flags);
60 be_image = arm64_image_flag_field(flags, ARM64_IMAGE_FLAG_BE);
61 be_kernel = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN);
62 if ((be_image != be_kernel) && !system_supports_mixed_endian())
63 return ERR_PTR(-EINVAL);
64
65 value = arm64_image_flag_field(flags, ARM64_IMAGE_FLAG_PAGE_SIZE);
66 if (((value == ARM64_IMAGE_FLAG_PAGE_SIZE_4K) &&
67 !system_supports_4kb_granule()) ||
68 ((value == ARM64_IMAGE_FLAG_PAGE_SIZE_64K) &&
69 !system_supports_64kb_granule()) ||
70 ((value == ARM64_IMAGE_FLAG_PAGE_SIZE_16K) &&
71 !system_supports_16kb_granule()))
72 return ERR_PTR(-EINVAL);
73
74 /* Load the kernel */
75 kbuf.image = image;
76 kbuf.buf_min = 0;
77 kbuf.buf_max = ULONG_MAX;
78 kbuf.top_down = false;
> 79 kbuf.random = 0;
80
81 kbuf.buffer = kernel;
82 kbuf.bufsz = kernel_len;
83 kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
84 kbuf.memsz = le64_to_cpu(h->image_size);
85 text_offset = le64_to_cpu(h->text_offset);
86 kbuf.buf_align = MIN_KIMG_ALIGN;
87
88 /* Adjust kernel segment with TEXT_OFFSET */
89 kbuf.memsz += text_offset;
90
91 kernel_segment_number = image->nr_segments;
92
93 /*
94 * The location of the kernel segment may make it impossible to satisfy
95 * the other segment requirements, so we try repeatedly to find a
96 * location that will work.
97 */
98 while ((ret = kexec_add_buffer(&kbuf)) == 0) {
99 /* Try to load additional data */
100 kernel_segment = &image->segment[kernel_segment_number];
101 ret = load_other_segments(image, kernel_segment->mem,
102 kernel_segment->memsz, initrd,
103 initrd_len, cmdline);
104 if (!ret)
105 break;
106
107 /*
108 * We couldn't find space for the other segments; erase the
109 * kernel segment and try the next available hole.
110 */
111 image->nr_segments -= 1;
112 kbuf.buf_min = kernel_segment->mem + kernel_segment->memsz;
113 kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
114 }
115
116 if (ret) {
117 pr_err("Could not find any suitable kernel location!");
118 return ERR_PTR(ret);
119 }
120
121 kernel_segment = &image->segment[kernel_segment_number];
122 kernel_segment->mem += text_offset;
123 kernel_segment->memsz -= text_offset;
124 image->start = kernel_segment->mem;
125
126 kexec_dprintk("Loaded kernel at 0x%lx bufsz=0x%lx memsz=0x%lx\n",
127 kernel_segment->mem, kbuf.bufsz,
128 kernel_segment->memsz);
129
130 return NULL;
131 }
132
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-08-26 17:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-26 17:06 [akpm-mm:mm-unstable 23/220] arch/arm64/kernel/kexec_image.c:79:6: error: 'struct kexec_buf' has no member named 'random' kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).