Home
last modified time | relevance | path

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

1234

/linux/arch/arm64/kernel/
H A Dmachine_kexec_file.c97 struct kexec_buf kbuf; in load_other_segments() local
103 kbuf.image = image; in load_other_segments()
105 kbuf.buf_min = kernel_load_addr + kernel_size; in load_other_segments()
118 kbuf.buffer = headers; in load_other_segments()
119 kbuf.bufsz = headers_sz; in load_other_segments()
120 kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; in load_other_segments()
121 kbuf.memsz = headers_sz; in load_other_segments()
122 kbuf.buf_align = SZ_64K; /* largest supported page size */ in load_other_segments()
123 kbuf.buf_max = ULONG_MAX; in load_other_segments()
124 kbuf.top_down = true; in load_other_segments()
[all …]
H A 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/arch/parisc/kernel/
H A 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 kexec_dprintk("Loaded initrd at 0x%lx\n", kbuf.mem); in elf_load()
55 image->arch.initrd_start = kbuf.mem; in elf_load()
[all …]
/linux/arch/riscv/kernel/
H A Delf_kexec.c44 struct kexec_buf kbuf; in riscv_kexec_elf_load() local
47 kbuf.image = image; in riscv_kexec_elf_load()
58 kbuf.buffer = (void *) elf_info->buffer + phdr->p_offset; in riscv_kexec_elf_load()
59 kbuf.bufsz = size; in riscv_kexec_elf_load()
60 kbuf.buf_align = phdr->p_align; in riscv_kexec_elf_load()
61 kbuf.mem = phdr->p_paddr - old_pbase + new_pbase; in riscv_kexec_elf_load()
62 kbuf.memsz = phdr->p_memsz; in riscv_kexec_elf_load()
63 kbuf.top_down = false; in riscv_kexec_elf_load()
64 ret = kexec_add_buffer(&kbuf); in riscv_kexec_elf_load()
82 struct kexec_buf kbuf; in elf_find_pbase() local
[all …]
H A Dptrace.c47 const void *kbuf, const void __user *ubuf) in riscv_gpr_set() argument
52 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, regs, 0, -1); in riscv_gpr_set()
73 const void *kbuf, const void __user *ubuf) in riscv_fpr_set() argument
78 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, fstate, 0, in riscv_fpr_set()
81 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, fstate, 0, in riscv_fpr_set()
127 const void *kbuf, const void __user *ubuf) in riscv_vr_set() argument
137 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &ptrace_vstate, 0, in riscv_vr_set()
152 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, vstate->datap, in riscv_vr_set()
174 const void *kbuf, const void __user *ubuf) in tagged_addr_ctrl_set() argument
179 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &ctrl, 0, -1); in tagged_addr_ctrl_set()
[all …]
/linux/kernel/
H A Dkexec_file.c441 struct kexec_buf *kbuf) in locate_mem_hole_top_down() argument
443 struct kimage *image = kbuf->image; in locate_mem_hole_top_down()
446 temp_end = min(end, kbuf->buf_max); in locate_mem_hole_top_down()
447 temp_start = temp_end - kbuf->memsz + 1; in locate_mem_hole_top_down()
451 temp_start = ALIGN_DOWN(temp_start, kbuf->buf_align); in locate_mem_hole_top_down()
453 if (temp_start < start || temp_start < kbuf->buf_min) in locate_mem_hole_top_down()
456 temp_end = temp_start + kbuf->memsz - 1; in locate_mem_hole_top_down()
472 kbuf->mem = temp_start; in locate_mem_hole_top_down()
479 struct kexec_buf *kbuf) in locate_mem_hole_bottom_up() argument
481 struct kimage *image = kbuf->image; in locate_mem_hole_bottom_up()
[all …]
/linux/mm/damon/
H A Ddbgfs.c38 char *kbuf; in user_input_str() local
45 kbuf = kmalloc(count + 1, GFP_KERNEL | __GFP_NOWARN); in user_input_str()
46 if (!kbuf) in user_input_str()
49 ret = simple_write_to_buffer(kbuf, count + 1, ppos, buf, count); in user_input_str()
51 kfree(kbuf); in user_input_str()
54 kbuf[ret] = '\0'; in user_input_str()
56 return kbuf; in user_input_str()
63 char kbuf[128]; in dbgfs_attrs_read() local
67 ret = scnprintf(kbuf, ARRAY_SIZE(kbuf), "%lu %lu %lu %lu %lu\n", in dbgfs_attrs_read()
73 return simple_read_from_buffer(buf, count, ppos, kbuf, ret); in dbgfs_attrs_read()
[all …]
/linux/arch/powerpc/kexec/
H A Delf_64.c42 struct kexec_buf kbuf = { .image = image, .buf_min = 0, in elf64_load() local
54 kbuf.buf_min = pbuf.buf_min = crashk_res.start; in elf64_load()
55 kbuf.buf_max = pbuf.buf_max = in elf64_load()
60 ret = kexec_elf_load(image, &ehdr, &elf_info, &kbuf, &kernel_load_addr); in elf64_load()
76 ret = load_crashdump_segments_ppc64(image, &kbuf); in elf64_load()
94 kbuf.buffer = initrd; in elf64_load()
95 kbuf.bufsz = kbuf.memsz = initrd_len; in elf64_load()
96 kbuf.buf_align = PAGE_SIZE; in elf64_load()
97 kbuf.top_down = false; in elf64_load()
98 kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; in elf64_load()
[all …]
/linux/fs/
H A Dstatfs.c265 static int put_compat_statfs(struct compat_statfs __user *ubuf, struct kstatfs *kbuf) in put_compat_statfs() argument
269 if ((kbuf->f_blocks | kbuf->f_bfree | kbuf->f_bavail | in put_compat_statfs()
270 kbuf->f_bsize | kbuf->f_frsize) & 0xffffffff00000000ULL) in put_compat_statfs()
274 if (kbuf->f_files != 0xffffffffffffffffULL in put_compat_statfs()
275 && (kbuf->f_files & 0xffffffff00000000ULL)) in put_compat_statfs()
277 if (kbuf->f_ffree != 0xffffffffffffffffULL in put_compat_statfs()
278 && (kbuf->f_ffree & 0xffffffff00000000ULL)) in put_compat_statfs()
282 buf.f_type = kbuf->f_type; in put_compat_statfs()
283 buf.f_bsize = kbuf->f_bsize; in put_compat_statfs()
284 buf.f_blocks = kbuf->f_blocks; in put_compat_statfs()
[all …]
/linux/arch/x86/kernel/
H A Dkexec-bzimage64.c408 struct kexec_buf kbuf = { .image = image, .buf_max = ULONG_MAX, in bzImage64_load() local
472 kbuf.bufsz = params_cmdline_sz + ALIGN(efi_map_sz, 16) + in bzImage64_load()
479 kbuf.bufsz += sizeof(struct setup_data) + in bzImage64_load()
482 params = kzalloc(kbuf.bufsz, GFP_KERNEL); in bzImage64_load()
494 kbuf.buffer = params; in bzImage64_load()
495 kbuf.memsz = kbuf.bufsz; in bzImage64_load()
496 kbuf.buf_align = 16; in bzImage64_load()
497 kbuf.buf_min = MIN_BOOTPARAM_ADDR; in bzImage64_load()
498 ret = kexec_add_buffer(&kbuf); in bzImage64_load()
501 bootparam_load_addr = kbuf.mem; in bzImage64_load()
[all …]
H A Dcrash.c364 struct kexec_buf kbuf = { .image = image, .buf_min = 0, in crash_load_segments() local
368 ret = prepare_elf_headers(&kbuf.buffer, &kbuf.bufsz, &pnum); in crash_load_segments()
372 image->elf_headers = kbuf.buffer; in crash_load_segments()
373 image->elf_headers_sz = kbuf.bufsz; in crash_load_segments()
374 kbuf.memsz = kbuf.bufsz; in crash_load_segments()
387 kbuf.memsz = pnum * sizeof(Elf64_Phdr); in crash_load_segments()
388 kbuf.memsz += sizeof(Elf64_Ehdr); in crash_load_segments()
393 image->elf_headers_sz = kbuf.memsz; in crash_load_segments()
399 kbuf.buf_align = ELF_CORE_HEADER_ALIGN; in crash_load_segments()
400 kbuf.mem = KEXEC_BUF_MEM_UNKNOWN; in crash_load_segments()
[all …]
/linux/arch/powerpc/kernel/ptrace/
H A 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 …]
H A 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 …]
H A 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/arch/sparc/kernel/
H A 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 …]
H A 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 …]
/linux/arch/powerpc/platforms/pseries/
H A 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/arch/um/drivers/
H A Dhostaudio_kern.c76 void *kbuf; in hostaudio_read() local
83 kbuf = kmalloc(count, GFP_KERNEL); in hostaudio_read()
84 if (kbuf == NULL) in hostaudio_read()
87 err = os_read_file(state->fd, kbuf, count); in hostaudio_read()
91 if (copy_to_user(buffer, kbuf, err)) in hostaudio_read()
95 kfree(kbuf); in hostaudio_read()
103 void *kbuf; in hostaudio_write() local
110 kbuf = memdup_user(buffer, count); in hostaudio_write()
111 if (IS_ERR(kbuf)) in hostaudio_write()
112 return PTR_ERR(kbuf); in hostaudio_write()
[all …]
/linux/security/integrity/ima/
H A Dima_kexec.c85 struct kexec_buf kbuf = { .image = image, .buf_align = PAGE_SIZE, in ima_add_kexec_buffer() local
119 kbuf.buffer = kexec_buffer; in ima_add_kexec_buffer()
120 kbuf.bufsz = kexec_buffer_size; in ima_add_kexec_buffer()
121 kbuf.memsz = kexec_segment_size; in ima_add_kexec_buffer()
122 ret = kexec_add_buffer(&kbuf); in ima_add_kexec_buffer()
129 image->ima_buffer_addr = kbuf.mem; in ima_add_kexec_buffer()
134 kbuf.mem); in ima_add_kexec_buffer()
/linux/include/linux/
H A 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/arch/openrisc/kernel/
H A 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()
107 const void *kbuf, const void __user *ubuf) in fpregs_set() argument
110 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, in fpregs_set()
/linux/arch/loongarch/kernel/
H A Dptrace.c93 const void *kbuf, const void __user *ubuf) in gpr_set() argument
101 err = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in gpr_set()
104 err |= user_regset_copyin(&pos, &count, &kbuf, &ubuf, in gpr_set()
107 err |= user_regset_copyin(&pos, &count, &kbuf, &ubuf, in gpr_set()
110 err |= user_regset_copyin(&pos, &count, &kbuf, &ubuf, in gpr_set()
166 const void **kbuf, const void __user **ubuf) in gfpr_set() argument
168 return user_regset_copyin(pos, count, kbuf, ubuf, in gfpr_set()
175 const void **kbuf, const void __user **ubuf) in gfpr_set_simd() argument
182 err = user_regset_copyin(pos, count, kbuf, ubuf, in gfpr_set_simd()
200 const void *kbuf, const void __user *ubuf) in fpr_set() argument
[all …]
/linux/net/qrtr/
H A Dtun.c91 void *kbuf; in qrtr_tun_write_iter() local
99 kbuf = kzalloc(len, GFP_KERNEL); in qrtr_tun_write_iter()
100 if (!kbuf) in qrtr_tun_write_iter()
103 if (!copy_from_iter_full(kbuf, len, from)) { in qrtr_tun_write_iter()
104 kfree(kbuf); in qrtr_tun_write_iter()
108 ret = qrtr_endpoint_post(&tun->ep, kbuf, len); in qrtr_tun_write_iter()
110 kfree(kbuf); in qrtr_tun_write_iter()
/linux/drivers/fpga/
H A 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()
/linux/arch/sh/kernel/
H A Dptrace_32.c146 const void *kbuf, const void __user *ubuf) in genregs_set() argument
151 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs_set()
155 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, in genregs_set()
160 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, in genregs_set()
184 const void *kbuf, const void __user *ubuf) in fpregs_set() argument
195 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, in fpregs_set()
198 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, in fpregs_set()
223 const void *kbuf, const void __user *ubuf) in dspregs_set() argument
229 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, regs, in dspregs_set()
232 user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf, in dspregs_set()

1234