Home
last modified time | relevance | path

Searched refs:kbuf (Results 1 – 25 of 107) sorted by relevance

12345

/linux-6.6.21/arch/arm64/kernel/
Dmachine_kexec_file.c95 struct kexec_buf kbuf; in load_other_segments() local
101 kbuf.image = image; in load_other_segments()
103 kbuf.buf_min = kernel_load_addr + kernel_size; in load_other_segments()
113 kbuf.buffer = headers; in load_other_segments()
114 kbuf.bufsz = headers_sz; in load_other_segments()
115 kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; in load_other_segments()
116 kbuf.memsz = headers_sz; in load_other_segments()
117 kbuf.buf_align = SZ_64K; /* largest supported page size */ in load_other_segments()
118 kbuf.buf_max = ULONG_MAX; in load_other_segments()
119 kbuf.top_down = true; in load_other_segments()
[all …]
Dkexec_image.c44 struct kexec_buf kbuf; in image_load() local
75 kbuf.image = image; in image_load()
76 kbuf.buf_min = 0; in image_load()
77 kbuf.buf_max = ULONG_MAX; in image_load()
78 kbuf.top_down = false; in image_load()
80 kbuf.buffer = kernel; in image_load()
81 kbuf.bufsz = kernel_len; in image_load()
82 kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; in image_load()
83 kbuf.memsz = le64_to_cpu(h->image_size); in image_load()
85 kbuf.buf_align = MIN_KIMG_ALIGN; in image_load()
[all …]
/linux-6.6.21/arch/parisc/kernel/
Dkexec_file.c25 struct kexec_buf kbuf = { .image = image, .buf_min = 0, in elf_load() local
32 ret = kexec_elf_load(image, &ehdr, &elf_info, &kbuf, &kernel_load_addr); in elf_load()
45 kbuf.buffer = initrd; in elf_load()
46 kbuf.bufsz = kbuf.memsz = initrd_len; in elf_load()
47 kbuf.buf_align = PAGE_SIZE; in elf_load()
48 kbuf.top_down = false; in elf_load()
49 kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; in elf_load()
50 ret = kexec_add_buffer(&kbuf); in elf_load()
54 pr_debug("Loaded initrd at 0x%lx\n", kbuf.mem); in elf_load()
55 image->arch.initrd_start = kbuf.mem; in elf_load()
[all …]
/linux-6.6.21/kernel/
Dkexec_file.c423 struct kexec_buf *kbuf) in locate_mem_hole_top_down() argument
425 struct kimage *image = kbuf->image; in locate_mem_hole_top_down()
428 temp_end = min(end, kbuf->buf_max); in locate_mem_hole_top_down()
429 temp_start = temp_end - kbuf->memsz; in locate_mem_hole_top_down()
433 temp_start = temp_start & (~(kbuf->buf_align - 1)); in locate_mem_hole_top_down()
435 if (temp_start < start || temp_start < kbuf->buf_min) in locate_mem_hole_top_down()
438 temp_end = temp_start + kbuf->memsz - 1; in locate_mem_hole_top_down()
454 kbuf->mem = temp_start; in locate_mem_hole_top_down()
461 struct kexec_buf *kbuf) in locate_mem_hole_bottom_up() argument
463 struct kimage *image = kbuf->image; in locate_mem_hole_bottom_up()
[all …]
/linux-6.6.21/arch/riscv/kernel/
Delf_kexec.c43 struct kexec_buf kbuf; in riscv_kexec_elf_load() local
46 kbuf.image = image; in riscv_kexec_elf_load()
57 kbuf.buffer = (void *) elf_info->buffer + phdr->p_offset; in riscv_kexec_elf_load()
58 kbuf.bufsz = size; in riscv_kexec_elf_load()
59 kbuf.buf_align = phdr->p_align; in riscv_kexec_elf_load()
60 kbuf.mem = phdr->p_paddr - old_pbase + new_pbase; in riscv_kexec_elf_load()
61 kbuf.memsz = phdr->p_memsz; in riscv_kexec_elf_load()
62 kbuf.top_down = false; in riscv_kexec_elf_load()
63 ret = kexec_add_buffer(&kbuf); in riscv_kexec_elf_load()
81 struct kexec_buf kbuf; in elf_find_pbase() local
[all …]
/linux-6.6.21/arch/powerpc/kexec/
Delf_64.c40 struct kexec_buf kbuf = { .image = image, .buf_min = 0, in elf64_load() local
52 kbuf.buf_min = pbuf.buf_min = crashk_res.start; in elf64_load()
53 kbuf.buf_max = pbuf.buf_max = in elf64_load()
58 ret = kexec_elf_load(image, &ehdr, &elf_info, &kbuf, &kernel_load_addr); in elf64_load()
74 ret = load_crashdump_segments_ppc64(image, &kbuf); in elf64_load()
92 kbuf.buffer = initrd; in elf64_load()
93 kbuf.bufsz = kbuf.memsz = initrd_len; in elf64_load()
94 kbuf.buf_align = PAGE_SIZE; in elf64_load()
95 kbuf.top_down = false; in elf64_load()
96 kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; in elf64_load()
[all …]
Dfile_load_64.c250 static int __locate_mem_hole_top_down(struct kexec_buf *kbuf, in __locate_mem_hole_top_down() argument
278 start = ALIGN(start, kbuf->buf_align); in __locate_mem_hole_top_down()
279 if (start < end && (end - start + 1) >= kbuf->memsz) { in __locate_mem_hole_top_down()
281 kbuf->mem = ALIGN_DOWN(end - kbuf->memsz + 1, in __locate_mem_hole_top_down()
282 kbuf->buf_align); in __locate_mem_hole_top_down()
301 static int locate_mem_hole_top_down_ppc64(struct kexec_buf *kbuf, in locate_mem_hole_top_down_ppc64() argument
318 ret = __locate_mem_hole_top_down(kbuf, tmin, tmax); in locate_mem_hole_top_down_ppc64()
334 ret = __locate_mem_hole_top_down(kbuf, tmin, tmax); in locate_mem_hole_top_down_ppc64()
349 static int __locate_mem_hole_bottom_up(struct kexec_buf *kbuf, in __locate_mem_hole_bottom_up() argument
377 start = ALIGN(start, kbuf->buf_align); in __locate_mem_hole_bottom_up()
[all …]
/linux-6.6.21/mm/damon/
Ddbgfs.c36 char *kbuf; in user_input_str() local
43 kbuf = kmalloc(count + 1, GFP_KERNEL | __GFP_NOWARN); in user_input_str()
44 if (!kbuf) in user_input_str()
47 ret = simple_write_to_buffer(kbuf, count + 1, ppos, buf, count); in user_input_str()
49 kfree(kbuf); in user_input_str()
52 kbuf[ret] = '\0'; in user_input_str()
54 return kbuf; in user_input_str()
61 char kbuf[128]; in dbgfs_attrs_read() local
65 ret = scnprintf(kbuf, ARRAY_SIZE(kbuf), "%lu %lu %lu %lu %lu\n", in dbgfs_attrs_read()
71 return simple_read_from_buffer(buf, count, ppos, kbuf, ret); in dbgfs_attrs_read()
[all …]
/linux-6.6.21/fs/
Dstatfs.c267 static int put_compat_statfs(struct compat_statfs __user *ubuf, struct kstatfs *kbuf) in put_compat_statfs() argument
271 if ((kbuf->f_blocks | kbuf->f_bfree | kbuf->f_bavail | in put_compat_statfs()
272 kbuf->f_bsize | kbuf->f_frsize) & 0xffffffff00000000ULL) in put_compat_statfs()
276 if (kbuf->f_files != 0xffffffffffffffffULL in put_compat_statfs()
277 && (kbuf->f_files & 0xffffffff00000000ULL)) in put_compat_statfs()
279 if (kbuf->f_ffree != 0xffffffffffffffffULL in put_compat_statfs()
280 && (kbuf->f_ffree & 0xffffffff00000000ULL)) in put_compat_statfs()
284 buf.f_type = kbuf->f_type; in put_compat_statfs()
285 buf.f_bsize = kbuf->f_bsize; in put_compat_statfs()
286 buf.f_blocks = kbuf->f_blocks; in put_compat_statfs()
[all …]
/linux-6.6.21/arch/x86/kernel/
Dkexec-bzimage64.c401 struct kexec_buf kbuf = { .image = image, .buf_max = ULONG_MAX, in bzImage64_load() local
463 kbuf.bufsz = params_cmdline_sz + ALIGN(efi_map_sz, 16) + in bzImage64_load()
470 kbuf.bufsz += sizeof(struct setup_data) + in bzImage64_load()
473 params = kzalloc(kbuf.bufsz, GFP_KERNEL); in bzImage64_load()
485 kbuf.buffer = params; in bzImage64_load()
486 kbuf.memsz = kbuf.bufsz; in bzImage64_load()
487 kbuf.buf_align = 16; in bzImage64_load()
488 kbuf.buf_min = MIN_BOOTPARAM_ADDR; in bzImage64_load()
489 ret = kexec_add_buffer(&kbuf); in bzImage64_load()
492 bootparam_load_addr = kbuf.mem; in bzImage64_load()
[all …]
Dcrash.c348 struct kexec_buf kbuf = { .image = image, .buf_min = 0, in crash_load_segments() local
352 ret = prepare_elf_headers(image, &kbuf.buffer, &kbuf.bufsz, &pnum); in crash_load_segments()
356 image->elf_headers = kbuf.buffer; in crash_load_segments()
357 image->elf_headers_sz = kbuf.bufsz; in crash_load_segments()
358 kbuf.memsz = kbuf.bufsz; in crash_load_segments()
371 kbuf.memsz = pnum * sizeof(Elf64_Phdr); in crash_load_segments()
372 kbuf.memsz += sizeof(Elf64_Ehdr); in crash_load_segments()
377 image->elf_headers_sz = kbuf.memsz; in crash_load_segments()
383 kbuf.buf_align = ELF_CORE_HEADER_ALIGN; in crash_load_segments()
384 kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; in crash_load_segments()
[all …]
/linux-6.6.21/arch/powerpc/kernel/ptrace/
Dptrace-decl.h75 const void *kbuf, const void __user *ubuf);
83 const void *kbuf, const void __user *ubuf);
91 const void *kbuf, const void __user *ubuf);
99 const void *kbuf, const void __user *ubuf);
110 const void *kbuf, const void __user *ubuf,
125 const void *kbuf, const void __user *ubuf);
130 const void *kbuf, const void __user *ubuf);
135 const void *kbuf, const void __user *ubuf);
140 const void *kbuf, const void __user *ubuf);
145 const void *kbuf, const void __user *ubuf);
[all …]
Dptrace-tm.c136 const void *kbuf, const void __user *ubuf) in tm_cgpr_set() argument
151 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in tm_cgpr_set()
156 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &reg, in tm_cgpr_set()
167 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in tm_cgpr_set()
173 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, in tm_cgpr_set()
178 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &reg, in tm_cgpr_set()
186 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, in tm_cgpr_set()
275 const void *kbuf, const void __user *ubuf) in tm_cfpr_set() argument
295 i = user_regset_copyin(&pos, &count, &kbuf, &ubuf, buf, 0, -1); in tm_cfpr_set()
395 const void *kbuf, const void __user *ubuf) in tm_cvmx_set() argument
[all …]
Dptrace-view.c239 unsigned int pos, unsigned int count, const void *kbuf, in gpr_set() argument
248 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in gpr_set()
253 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &reg, in gpr_set()
264 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in gpr_set()
270 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, in gpr_set()
275 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &reg, in gpr_set()
283 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, in gpr_set()
300 unsigned int pos, unsigned int count, const void *kbuf, in ppr_set() argument
306 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, in ppr_set()
316 unsigned int pos, unsigned int count, const void *kbuf, in dscr_set() argument
[all …]
/linux-6.6.21/arch/sparc/kernel/
Dptrace_32.c109 const void *kbuf, const void __user *ubuf) in genregs32_set() argument
119 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs32_set()
127 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs32_set()
137 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs32_set()
146 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs32_set()
151 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs32_set()
156 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs32_set()
161 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 36 * sizeof(u32), in genregs32_set()
185 const void *kbuf, const void __user *ubuf) in fpregs32_set() argument
194 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in fpregs32_set()
[all …]
Dptrace_64.c161 void *kbuf, int len) in get_from_target() argument
164 if (copy_from_user(kbuf, (void __user *) uaddr, len)) in get_from_target()
167 int len2 = access_process_vm(target, uaddr, kbuf, len, in get_from_target()
176 void *kbuf, int len) in set_to_target() argument
179 if (copy_to_user((void __user *) uaddr, kbuf, len)) in set_to_target()
182 int len2 = access_process_vm(target, uaddr, kbuf, len, in set_to_target()
270 const void *kbuf, const void __user *ubuf) in genregs64_set() argument
278 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs64_set()
287 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs64_set()
301 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs64_set()
[all …]
/linux-6.6.21/arch/powerpc/platforms/pseries/
Dreconfig.c362 char *kbuf; in ofdt_write() local
369 kbuf = memdup_user_nul(buf, count); in ofdt_write()
370 if (IS_ERR(kbuf)) in ofdt_write()
371 return PTR_ERR(kbuf); in ofdt_write()
373 tmp = strchr(kbuf, ' '); in ofdt_write()
381 if (!strcmp(kbuf, "add_node")) in ofdt_write()
382 rv = do_add_node(tmp, count - (tmp - kbuf)); in ofdt_write()
383 else if (!strcmp(kbuf, "remove_node")) in ofdt_write()
385 else if (!strcmp(kbuf, "add_property")) in ofdt_write()
386 rv = do_add_property(tmp, count - (tmp - kbuf)); in ofdt_write()
[all …]
/linux-6.6.21/arch/um/drivers/
Dhostaudio_kern.c74 void *kbuf; in hostaudio_read() local
81 kbuf = kmalloc(count, GFP_KERNEL); in hostaudio_read()
82 if (kbuf == NULL) in hostaudio_read()
85 err = os_read_file(state->fd, kbuf, count); in hostaudio_read()
89 if (copy_to_user(buffer, kbuf, err)) in hostaudio_read()
93 kfree(kbuf); in hostaudio_read()
101 void *kbuf; in hostaudio_write() local
108 kbuf = memdup_user(buffer, count); in hostaudio_write()
109 if (IS_ERR(kbuf)) in hostaudio_write()
110 return PTR_ERR(kbuf); in hostaudio_write()
[all …]
/linux-6.6.21/security/integrity/ima/
Dima_kexec.c84 struct kexec_buf kbuf = { .image = image, .buf_align = PAGE_SIZE, in ima_add_kexec_buffer() local
118 kbuf.buffer = kexec_buffer; in ima_add_kexec_buffer()
119 kbuf.bufsz = kexec_buffer_size; in ima_add_kexec_buffer()
120 kbuf.memsz = kexec_segment_size; in ima_add_kexec_buffer()
121 ret = kexec_add_buffer(&kbuf); in ima_add_kexec_buffer()
128 image->ima_buffer_addr = kbuf.mem; in ima_add_kexec_buffer()
133 kbuf.mem); in ima_add_kexec_buffer()
/linux-6.6.21/kernel/bpf/
Dlog.c63 n = vscnprintf(log->kbuf, BPF_VERIFIER_TMP_LOG_SIZE, fmt, args); in bpf_verifier_vlog()
66 bool newline = n > 0 && log->kbuf[n - 1] == '\n'; in bpf_verifier_vlog()
68 pr_err("BPF: %s%s", log->kbuf, newline ? "" : "\n"); in bpf_verifier_vlog()
80 log->kbuf[new_n - 1] = '\0'; in bpf_verifier_vlog()
87 copy_to_user(log->ubuf + cur_pos, log->kbuf, new_n)) in bpf_verifier_vlog()
125 log->kbuf + n - new_n, in bpf_verifier_vlog()
131 log->kbuf + n - new_n, in bpf_verifier_vlog()
135 log->kbuf + n - buf_end, in bpf_verifier_vlog()
188 int n = sizeof(log->kbuf) / 2, nn; in bpf_vlog_reverse_ubuf()
189 char *lbuf = log->kbuf, *rbuf = log->kbuf + n; in bpf_vlog_reverse_ubuf()
/linux-6.6.21/arch/openrisc/kernel/
Dptrace.c67 const void *kbuf, const void __user * ubuf) in genregs_set() argument
73 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 0, 4); in genregs_set()
75 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs_set()
79 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs_set()
86 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, 4*33, -1); in genregs_set()
108 const void *kbuf, const void __user *ubuf) in fpregs_set() argument
114 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in fpregs_set()
/linux-6.6.21/include/linux/
Dregset.h120 const void *kbuf, const void __user *ubuf);
254 const void **kbuf, in user_regset_copyin() argument
265 if (*kbuf) { in user_regset_copyin()
266 memcpy(data, *kbuf, copy); in user_regset_copyin()
267 *kbuf += copy; in user_regset_copyin()
280 const void **kbuf, in user_regset_copyin_ignore() argument
291 if (*kbuf) in user_regset_copyin_ignore()
292 *kbuf += copy; in user_regset_copyin_ignore()
/linux-6.6.21/drivers/staging/vc04_services/interface/vchiq_arm/
Dvchiq_debugfs.c77 char kbuf[DEBUGFS_WRITE_BUF_SIZE + 1]; in debugfs_log_write() local
79 memset(kbuf, 0, DEBUGFS_WRITE_BUF_SIZE + 1); in debugfs_log_write()
83 if (copy_from_user(kbuf, buffer, count)) in debugfs_log_write()
85 kbuf[count - 1] = 0; in debugfs_log_write()
87 if (strncmp("error", kbuf, strlen("error")) == 0) in debugfs_log_write()
89 else if (strncmp("warning", kbuf, strlen("warning")) == 0) in debugfs_log_write()
91 else if (strncmp("info", kbuf, strlen("info")) == 0) in debugfs_log_write()
93 else if (strncmp("trace", kbuf, strlen("trace")) == 0) in debugfs_log_write()
/linux-6.6.21/drivers/char/xilinx_hwicap/
Dxilinx_hwicap.c362 u32 *kbuf; in hwicap_read() local
390 kbuf = (u32 *) get_zeroed_page(GFP_KERNEL); in hwicap_read()
391 if (!kbuf) { in hwicap_read()
416 kbuf, words); in hwicap_read()
420 free_page((unsigned long)kbuf); in hwicap_read()
425 if (copy_to_user(buf, kbuf, bytes_to_read)) { in hwicap_read()
426 free_page((unsigned long)kbuf); in hwicap_read()
431 kbuf, in hwicap_read()
434 free_page((unsigned long)kbuf); in hwicap_read()
449 u32 *kbuf; in hwicap_write() local
[all …]
/linux-6.6.21/drivers/fpga/
Dversal-fpga.c26 char *kbuf; in versal_fpga_ops_write() local
29 kbuf = dma_alloc_coherent(mgr->dev.parent, size, &dma_addr, GFP_KERNEL); in versal_fpga_ops_write()
30 if (!kbuf) in versal_fpga_ops_write()
33 memcpy(kbuf, buf, size); in versal_fpga_ops_write()
35 dma_free_coherent(mgr->dev.parent, size, kbuf, dma_addr); in versal_fpga_ops_write()

12345