Re: [PATCH v2] uapi: futex: Add a futex syscall
by kernel test robot
Hi Alistair,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linux/master]
[also build test ERROR on soc/for-next linus/master v5.15-rc6 next-20211021]
[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]
url: https://github.com/0day-ci/linux/commits/Alistair-Francis/uapi-futex-Add-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2f111a6fd5b5297b4e92f53798ca086f7c7d33a4
config: i386-randconfig-a004-20211021 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 3cea2505fd8d99a9ba0cb625aecfe28a47c4e3f8)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/6dcb960761dacb92295496cefad0a38e1...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alistair-Francis/uapi-futex-Add-a-futex-syscall/20211021-135527
git checkout 6dcb960761dacb92295496cefad0a38e19d4c8ba
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from <built-in>:1:
./usr/include/linux/futex_syscall.h:21:45: error: unknown type name 'u_int32_t'
__kernel_futex_syscall_timeout(__volatile__ u_int32_t *uaddr, int op, u_int32_t val,
^
./usr/include/linux/futex_syscall.h:21:71: error: unknown type name 'u_int32_t'
__kernel_futex_syscall_timeout(__volatile__ u_int32_t *uaddr, int op, u_int32_t val,
^
./usr/include/linux/futex_syscall.h:22:16: warning: declaration of 'struct timespec' will not be visible outside of this function [-Wvisibility]
struct timespec *timeout, __volatile__ u_int32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:22:48: error: unknown type name 'u_int32_t'
struct timespec *timeout, __volatile__ u_int32_t *uaddr2, int val3)
^
>> ./usr/include/linux/futex_syscall.h:25:12: error: invalid application of 'sizeof' to an incomplete type 'struct timespec'
if (sizeof(*timeout) != sizeof(struct __kernel_old_timespec)) {
^~~~~~~~~~
./usr/include/linux/futex_syscall.h:22:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ u_int32_t *uaddr2, int val3)
^
>> ./usr/include/linux/futex_syscall.h:26:14: error: implicit declaration of function 'syscall' [-Werror,-Wimplicit-function-declaration]
int ret = syscall(__NR_futex_time64, uaddr, op, val, timeout, uaddr2, val3);
^
./usr/include/linux/futex_syscall.h:34:12: error: invalid application of 'sizeof' to an incomplete type 'struct timespec'
if (sizeof(*timeout) == sizeof(struct __kernel_old_timespec))
^~~~~~~~~~
./usr/include/linux/futex_syscall.h:22:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ u_int32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:35:10: error: implicit declaration of function 'syscall' [-Werror,-Wimplicit-function-declaration]
return syscall(__NR_futex, uaddr, op, val, timeout, uaddr2, val3);
^
>> ./usr/include/linux/futex_syscall.h:37:24: error: incomplete definition of type 'struct timespec'
if (timeout && timeout->tv_sec == (long)timeout->tv_sec) {
~~~~~~~^
./usr/include/linux/futex_syscall.h:22:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ u_int32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:37:49: error: incomplete definition of type 'struct timespec'
if (timeout && timeout->tv_sec == (long)timeout->tv_sec) {
~~~~~~~^
./usr/include/linux/futex_syscall.h:22:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ u_int32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:40:42: error: incomplete definition of type 'struct timespec'
ts32.tv_sec = (__kernel_long_t) timeout->tv_sec;
~~~~~~~^
./usr/include/linux/futex_syscall.h:22:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ u_int32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:41:43: error: incomplete definition of type 'struct timespec'
ts32.tv_nsec = (__kernel_long_t) timeout->tv_nsec;
~~~~~~~^
./usr/include/linux/futex_syscall.h:22:16: note: forward declaration of 'struct timespec'
struct timespec *timeout, __volatile__ u_int32_t *uaddr2, int val3)
^
>> ./usr/include/linux/futex_syscall.h:45:46: error: use of undeclared identifier 'NULL'
return syscall(__NR_futex, uaddr, op, val, NULL, uaddr2, val3);
^
./usr/include/linux/futex_syscall.h:63:48: error: unknown type name 'u_int32_t'
__kernel_futex_syscall_nr_requeue(__volatile__ u_int32_t *uaddr, int op, u_int32_t val,
^
./usr/include/linux/futex_syscall.h:63:74: error: unknown type name 'u_int32_t'
__kernel_futex_syscall_nr_requeue(__volatile__ u_int32_t *uaddr, int op, u_int32_t val,
^
./usr/include/linux/futex_syscall.h:64:5: error: unknown type name 'u_int32_t'
u_int32_t nr_requeue, __volatile__ u_int32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:64:40: error: unknown type name 'u_int32_t'
u_int32_t nr_requeue, __volatile__ u_int32_t *uaddr2, int val3)
^
./usr/include/linux/futex_syscall.h:67:13: error: implicit declaration of function 'syscall' [-Werror,-Wimplicit-function-declaration]
int ret = syscall(__NR_futex_time64, uaddr, op, val, nr_requeue, uaddr2, val3);
^
1 warning and 17 errors generated.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months
[drm-intel:drm-intel-gt-next 5/10] drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:248:3: error: implicit declaration of function 'wbinvd_on_all_cpus'
by kernel test robot
tree: git://anongit.freedesktop.org/drm-intel drm-intel-gt-next
head: ab5d964c001b9efffcbfa4d67a30186b67d79771
commit: a035154da45d19e09dc68454673ff257a660aece [5/10] drm/i915/dmabuf: add paranoid flush-on-acquire
config: x86_64-randconfig-a004-20211021 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 3cea2505fd8d99a9ba0cb625aecfe28a47c4e3f8)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add drm-intel git://anongit.freedesktop.org/drm-intel
git fetch --no-tags drm-intel drm-intel-gt-next
git checkout a035154da45d19e09dc68454673ff257a660aece
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:248:3: error: implicit declaration of function 'wbinvd_on_all_cpus' [-Werror,-Wimplicit-function-declaration]
wbinvd_on_all_cpus();
^
1 error generated.
vim +/wbinvd_on_all_cpus +248 drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c
232
233 static int i915_gem_object_get_pages_dmabuf(struct drm_i915_gem_object *obj)
234 {
235 struct drm_i915_private *i915 = to_i915(obj->base.dev);
236 struct sg_table *pages;
237 unsigned int sg_page_sizes;
238
239 assert_object_held(obj);
240
241 pages = dma_buf_map_attachment(obj->base.import_attach,
242 DMA_BIDIRECTIONAL);
243 if (IS_ERR(pages))
244 return PTR_ERR(pages);
245
246 /* XXX: consider doing a vmap flush or something */
247 if (!HAS_LLC(i915) || i915_gem_object_can_bypass_llc(obj))
> 248 wbinvd_on_all_cpus();
249
250 sg_page_sizes = i915_sg_dma_sizes(pages->sgl);
251 __i915_gem_object_set_pages(obj, pages, sg_page_sizes);
252
253 return 0;
254 }
255
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months
Re: [PATCH 3/3] bpf: Implement prealloc for task_local_storage
by kernel test robot
Hi Tejun,
I love your patch! Yet something to improve:
[auto build test ERROR on tj-cgroup/for-next]
[also build test ERROR on bpf-next/master bpf/master v5.15-rc6 next-20211021]
[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]
url: https://github.com/0day-ci/linux/commits/Tejun-Heo/cgroup-Drop-cgroup_-pr...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup.git for-next
config: arm-randconfig-c002-20211021 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 3cea2505fd8d99a9ba0cb625aecfe28a47c4e3f8)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/fc6c3a4ef8dde2e304e1b4eee47b71956...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tejun-Heo/cgroup-Drop-cgroup_-prefix-from-cgroup_threadgroup_rwsem-and-friends/20211021-051806
git checkout fc6c3a4ef8dde2e304e1b4eee47b7195638c1224
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> kernel/bpf/bpf_task_storage.c:371:20: error: use of undeclared identifier 'task_storage_map_ops'
smap->map.ops = &task_storage_map_ops;
^
1 error generated.
vim +/task_storage_map_ops +371 kernel/bpf/bpf_task_storage.c
355
356 static struct bpf_map *task_storage_map_alloc(union bpf_attr *attr)
357 {
358 struct bpf_local_storage_map *smap;
359 int err;
360
361 smap = bpf_local_storage_map_alloc(attr);
362 if (IS_ERR(smap))
363 return ERR_CAST(smap);
364
365 if (!(attr->map_flags & BPF_F_NO_PREALLOC)) {
366 /* We're going to exercise the regular update path to populate
367 * the map for the existing tasks, which will call into map ops
368 * which is normally initialized after this function returns.
369 * Initialize it early here.
370 */
> 371 smap->map.ops = &task_storage_map_ops;
372
373 percpu_down_write(&threadgroup_rwsem);
374 list_add_tail(&smap->prealloc_node, &prealloc_smaps);
375 err = task_storage_map_populate(smap);
376 percpu_up_write(&threadgroup_rwsem);
377 if (err) {
378 bpf_local_storage_map_free(smap,
379 &bpf_task_storage_busy);
380 return ERR_PTR(err);
381 }
382 }
383
384 smap->cache_idx = bpf_local_storage_cache_idx_get(&task_cache);
385 return &smap->map;
386 }
387
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months
[linux-next:master 4870/10297] ld.lld: error: section .dynamic file range overlaps with .text
by kernel test robot
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Tong Tiangen <tongtiangen(a)huawei.com>
CC: Palmer Dabbelt <palmerdabbelt(a)google.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 3196a52aff93186897f15f1a6c03220ce6523d82
commit: dffe11e280a42c2501e5b0cdebd85a77f539bb05 [4870/10297] riscv/vdso: Add support for time namespaces
config: riscv-randconfig-c006-20211021 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 3cea2505fd8d99a9ba0cb625aecfe28a47c4e3f8)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout dffe11e280a42c2501e5b0cdebd85a77f539bb05
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv prepare
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> ld.lld: error: section .dynamic file range overlaps with .text
>>> .dynamic range is [0x710, 0x83F]
>>> .text range is [0x800, 0x120F]
--
>> ld.lld: error: section .text file range overlaps with _ftrace_annotated_branch
>>> .text range is [0x800, 0x120F]
>>> _ftrace_annotated_branch range is [0x840, 0xB9F]
--
>> ld.lld: error: section .dynamic virtual address range overlaps with .text
>>> .dynamic range is [0x710, 0x83F]
>>> .text range is [0x800, 0x120F]
--
>> ld.lld: error: section .text virtual address range overlaps with _ftrace_annotated_branch
>>> .text range is [0x800, 0x120F]
>>> _ftrace_annotated_branch range is [0x840, 0xB9F]
--
>> ld.lld: error: section .dynamic load address range overlaps with .text
>>> .dynamic range is [0x710, 0x83F]
>>> .text range is [0x800, 0x120F]
--
>> ld.lld: error: section .text load address range overlaps with _ftrace_annotated_branch
>>> .text range is [0x800, 0x120F]
>>> _ftrace_annotated_branch range is [0x840, 0xB9F]
--
>> ld.lld: error: section .text load address range overlaps with _ftrace_annotated_branch
>>> .text range is [0x800, 0x120F]
>>> _ftrace_annotated_branch range is [0x840, 0xB9F]
llvm-nm: error: arch/riscv/kernel/vdso/vdso.so.dbg: No such file or directory
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months
[ardb:arm-vmap-stacks 5/20] arch/arm/mm/context.c:112:28: error: no member named 'task' in 'struct thread_info'
by kernel test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git arm-vmap-stacks
head: 9f4b28a772c8a5fb46362418b45a779c7b8c0bc5
commit: 12e3ad2cad7748f0816216192d7554be2eca2655 [5/20] ARM: smp: Enable THREAD_INFO_IN_TASK
config: arm-randconfig-r012-20211004 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dec2257f354d39dbd8232e6bd1a417d91c4f14a2)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id...
git remote add ardb git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git
git fetch --no-tags ardb arm-vmap-stacks
git checkout 12e3ad2cad7748f0816216192d7554be2eca2655
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash arch/arm/kernel/ arch/arm/mm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> arch/arm/mm/context.c:112:28: error: no member named 'task' in 'struct thread_info'
pid = task_pid_nr(thread->task) << ASID_BITS;
~~~~~~ ^
1 error generated.
vim +112 arch/arm/mm/context.c
14d8c9512aef5b Catalin Marinas 2011-11-22 100
575320d625d5b5 Will Deacon 2012-07-06 101 #ifdef CONFIG_PID_IN_CONTEXTIDR
575320d625d5b5 Will Deacon 2012-07-06 102 static int contextidr_notifier(struct notifier_block *unused, unsigned long cmd,
575320d625d5b5 Will Deacon 2012-07-06 103 void *t)
575320d625d5b5 Will Deacon 2012-07-06 104 {
575320d625d5b5 Will Deacon 2012-07-06 105 u32 contextidr;
575320d625d5b5 Will Deacon 2012-07-06 106 pid_t pid;
575320d625d5b5 Will Deacon 2012-07-06 107 struct thread_info *thread = t;
575320d625d5b5 Will Deacon 2012-07-06 108
575320d625d5b5 Will Deacon 2012-07-06 109 if (cmd != THREAD_NOTIFY_SWITCH)
575320d625d5b5 Will Deacon 2012-07-06 110 return NOTIFY_DONE;
575320d625d5b5 Will Deacon 2012-07-06 111
575320d625d5b5 Will Deacon 2012-07-06 @112 pid = task_pid_nr(thread->task) << ASID_BITS;
575320d625d5b5 Will Deacon 2012-07-06 113 asm volatile(
575320d625d5b5 Will Deacon 2012-07-06 114 " mrc p15, 0, %0, c13, c0, 1\n"
ae3790b8a91642 Will Deacon 2012-08-24 115 " and %0, %0, %2\n"
ae3790b8a91642 Will Deacon 2012-08-24 116 " orr %0, %0, %1\n"
ae3790b8a91642 Will Deacon 2012-08-24 117 " mcr p15, 0, %0, c13, c0, 1\n"
575320d625d5b5 Will Deacon 2012-07-06 118 : "=r" (contextidr), "+r" (pid)
ae3790b8a91642 Will Deacon 2012-08-24 119 : "I" (~ASID_MASK));
575320d625d5b5 Will Deacon 2012-07-06 120 isb();
575320d625d5b5 Will Deacon 2012-07-06 121
575320d625d5b5 Will Deacon 2012-07-06 122 return NOTIFY_OK;
575320d625d5b5 Will Deacon 2012-07-06 123 }
575320d625d5b5 Will Deacon 2012-07-06 124
:::::: The code at line 112 was first introduced by commit
:::::: 575320d625d5b5eb115575a1f5e17af456e69577 ARM: 7445/1: mm: update CONTEXTIDR register to contain PID of current process
:::::: TO: Will Deacon <will.deacon(a)arm.com>
:::::: CC: Russell King <rmk+kernel(a)arm.linux.org.uk>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months
Re: [PATCH v4 3/4] drivers/acpi: Introduce Platform Firmware Runtime Update Telemetry
by kernel test robot
Hi Chen,
I love your patch! Perhaps something to improve:
[auto build test WARNING on rafael-pm/linux-next]
[also build test WARNING on efi/next linus/master v5.15-rc6 next-20211020]
[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]
url: https://github.com/0day-ci/linux/commits/Chen-Yu/Introduce-Platform-Firmw...
base: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-randconfig-c007-20211021 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 3cea2505fd8d99a9ba0cb625aecfe28a47c4e3f8)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/93acf331ef196b860f6b34a5e9f8b3a24...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Chen-Yu/Introduce-Platform-Firmware-Runtime-Update-and-Telemetry-drivers/20211016-184349
git checkout 93acf331ef196b860f6b34a5e9f8b3a249f1a0ce
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/acpi/pfru/pfru_update.c:280:6: warning: no previous prototype for function 'pfru_log_ioctl' [-Wmissing-prototypes]
long pfru_log_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
^
drivers/acpi/pfru/pfru_update.c:280:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
long pfru_log_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
^
static
>> drivers/acpi/pfru/pfru_update.c:338:9: warning: no previous prototype for function 'pfru_log_read' [-Wmissing-prototypes]
ssize_t pfru_log_read(struct file *filp, char __user *ubuf,
^
drivers/acpi/pfru/pfru_update.c:338:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
ssize_t pfru_log_read(struct file *filp, char __user *ubuf,
^
static
2 warnings generated.
vim +/pfru_log_ioctl +280 drivers/acpi/pfru/pfru_update.c
279
> 280 long pfru_log_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
281 {
282 struct pfru_log_data_info data_info;
283 struct pfru_log_info info;
284 void __user *p;
285 int ret = 0;
286
287 if (!pfru_log_dev)
288 return -ENODEV;
289
290 p = (void __user *)arg;
291
292 switch (cmd) {
293 case PFRU_LOG_IOC_SET_INFO:
294 if (copy_from_user(&info, p, sizeof(info)))
295 return -EFAULT;
296
297 if (pfru_valid_revid(info.log_revid))
298 pfru_log_dev->info.log_revid = info.log_revid;
299
300 if (valid_log_level(info.log_level)) {
301 ret = set_pfru_log_level(info.log_level);
302 if (ret)
303 return ret;
304 pfru_log_dev->info.log_level = info.log_level;
305 }
306
307 if (valid_log_type(info.log_type))
308 pfru_log_dev->info.log_type = info.log_type;
309
310 break;
311 case PFRU_LOG_IOC_GET_INFO:
312 ret = get_pfru_log_level(&info.log_level);
313 if (ret)
314 return ret;
315
316 info.log_type = pfru_log_dev->info.log_type;
317 info.log_revid = pfru_log_dev->info.log_revid;
318 if (copy_to_user(p, &info, sizeof(info)))
319 ret = -EFAULT;
320
321 break;
322 case PFRU_LOG_IOC_GET_DATA_INFO:
323 ret = get_pfru_log_data_info(&data_info, pfru_log_dev->info.log_type);
324 if (ret)
325 return ret;
326
327 if (copy_to_user(p, &data_info, sizeof(struct pfru_log_data_info)))
328 ret = -EFAULT;
329
330 break;
331 default:
332 ret = -ENOTTY;
333 break;
334 }
335 return ret;
336 }
337
> 338 ssize_t pfru_log_read(struct file *filp, char __user *ubuf,
339 size_t size, loff_t *off)
340 {
341 struct pfru_log_data_info info;
342 phys_addr_t base_addr;
343 int buf_size, ret;
344 char *buf_ptr;
345
346 if (!pfru_log_dev)
347 return -ENODEV;
348
349 if (*off < 0)
350 return -EINVAL;
351
352 ret = get_pfru_log_data_info(&info, pfru_log_dev->info.log_type);
353 if (ret)
354 return ret;
355
356 base_addr = (phys_addr_t)(info.chunk2_addr_lo | (info.chunk2_addr_hi << 32));
357 /* pfru update has not been launched yet.*/
358 if (!base_addr)
359 return -EBUSY;
360
361 buf_size = info.max_data_size;
362 if (*off >= buf_size)
363 return 0;
364
365 buf_ptr = memremap(base_addr, buf_size, MEMREMAP_WB);
366 if (IS_ERR(buf_ptr))
367 return PTR_ERR(buf_ptr);
368
369 size = min_t(size_t, size, buf_size - *off);
370 if (copy_to_user(ubuf, buf_ptr + *off, size))
371 ret = -EFAULT;
372 else
373 ret = 0;
374
375 memunmap(buf_ptr);
376
377 return ret ? ret : size;
378 }
379
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months