Re: [PATCH] c/r: prctl: Remove PR_SET_MM_EXE_FILE old file mapping restriction
by kernel test robot
Hi Keno,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on hnaz-mm/master linus/master v5.16-rc5 next-20211214]
[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/Keno-Fischer/c-r-prctl-Remove-PR...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 136057256686de39cc3a07c2e39ef6bc43003ff6
config: i386-randconfig-s002-20211214 (https://download.01.org/0day-ci/archive/20211216/202112160333.IwCSbqoM-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/08f30df401c936e27733e3b37765c2b7d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Keno-Fischer/c-r-prctl-Remove-PR_SET_MM_EXE_FILE-old-file-mapping-restriction/20211215-142515
git checkout 08f30df401c936e27733e3b37765c2b7d35fe0e7
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' 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>
sparse warnings: (new ones prefixed by >>)
kernel/fork.c:1215:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct file [noderef] __rcu *__ret @@ got struct file *new_exe_file @@
kernel/fork.c:1215:24: sparse: expected struct file [noderef] __rcu *__ret
kernel/fork.c:1215:24: sparse: got struct file *new_exe_file
>> kernel/fork.c:1215:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file *old_exe_file @@ got struct file [noderef] __rcu *[assigned] __ret @@
kernel/fork.c:1215:22: sparse: expected struct file *old_exe_file
kernel/fork.c:1215:22: sparse: got struct file [noderef] __rcu *[assigned] __ret
kernel/fork.c:1572:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct refcount_struct [usertype] *r @@ got struct refcount_struct [noderef] __rcu * @@
kernel/fork.c:1572:38: sparse: expected struct refcount_struct [usertype] *r
kernel/fork.c:1572:38: sparse: got struct refcount_struct [noderef] __rcu *
kernel/fork.c:1581:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:1581:31: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:1581:31: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:1582:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *q @@ got struct k_sigaction [noderef] __rcu * @@
kernel/fork.c:1582:36: sparse: expected void const *q
kernel/fork.c:1582:36: sparse: got struct k_sigaction [noderef] __rcu *
kernel/fork.c:1583:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:1583:33: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:1583:33: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:1995:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:1995:31: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:1995:31: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:1999:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:1999:33: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:1999:33: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2304:32: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct [noderef] __rcu *real_parent @@ got struct task_struct * @@
kernel/fork.c:2304:32: sparse: expected struct task_struct [noderef] __rcu *real_parent
kernel/fork.c:2304:32: sparse: got struct task_struct *
kernel/fork.c:2313:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:2313:27: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:2313:27: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2362:54: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct list_head *head @@ got struct list_head [noderef] __rcu * @@
kernel/fork.c:2362:54: sparse: expected struct list_head *head
kernel/fork.c:2362:54: sparse: got struct list_head [noderef] __rcu *
kernel/fork.c:2383:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:2383:29: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:2383:29: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2401:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:2401:29: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:2401:29: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2428:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sighand_struct *sighand @@ got struct sighand_struct [noderef] __rcu *sighand @@
kernel/fork.c:2428:28: sparse: expected struct sighand_struct *sighand
kernel/fork.c:2428:28: sparse: got struct sighand_struct [noderef] __rcu *sighand
kernel/fork.c:2456:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:2456:31: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:2456:31: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2458:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:2458:33: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:2458:33: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2867:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct *[assigned] parent @@ got struct task_struct [noderef] __rcu *real_parent @@
kernel/fork.c:2867:24: sparse: expected struct task_struct *[assigned] parent
kernel/fork.c:2867:24: sparse: got struct task_struct [noderef] __rcu *real_parent
kernel/fork.c:2948:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct refcount_struct const [usertype] *r @@ got struct refcount_struct [noderef] __rcu * @@
kernel/fork.c:2948:43: sparse: expected struct refcount_struct const [usertype] *r
kernel/fork.c:2948:43: sparse: got struct refcount_struct [noderef] __rcu *
kernel/fork.c:2039:22: sparse: sparse: dereference of noderef expression
kernel/fork.c: note: in included file (through include/uapi/asm-generic/bpf_perf_event.h, arch/x86/include/generated/uapi/asm/bpf_perf_event.h, ...):
include/linux/ptrace.h:218:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct task_struct *new_parent @@ got struct task_struct [noderef] __rcu *parent @@
include/linux/ptrace.h:218:45: sparse: expected struct task_struct *new_parent
include/linux/ptrace.h:218:45: sparse: got struct task_struct [noderef] __rcu *parent
include/linux/ptrace.h:218:62: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct cred const *ptracer_cred @@ got struct cred const [noderef] __rcu *ptracer_cred @@
include/linux/ptrace.h:218:62: sparse: expected struct cred const *ptracer_cred
include/linux/ptrace.h:218:62: sparse: got struct cred const [noderef] __rcu *ptracer_cred
kernel/fork.c:2360:59: sparse: sparse: dereference of noderef expression
kernel/fork.c:2361:59: sparse: sparse: dereference of noderef expression
vim +1215 kernel/fork.c
3864601387cf41 Jiri Slaby 2011-05-26 1194
35d7bdc86031a2 David Hildenbrand 2021-04-23 1195 /**
35d7bdc86031a2 David Hildenbrand 2021-04-23 1196 * replace_mm_exe_file - replace a reference to the mm's executable file
35d7bdc86031a2 David Hildenbrand 2021-04-23 1197 *
35d7bdc86031a2 David Hildenbrand 2021-04-23 1198 * This changes mm's executable file (shown as symlink /proc/[pid]/exe),
35d7bdc86031a2 David Hildenbrand 2021-04-23 1199 * dealing with concurrent invocation and without grabbing the mmap lock in
35d7bdc86031a2 David Hildenbrand 2021-04-23 1200 * write mode.
35d7bdc86031a2 David Hildenbrand 2021-04-23 1201 *
35d7bdc86031a2 David Hildenbrand 2021-04-23 1202 * Main user is sys_prctl(PR_SET_MM_MAP/EXE_FILE).
35d7bdc86031a2 David Hildenbrand 2021-04-23 1203 */
35d7bdc86031a2 David Hildenbrand 2021-04-23 1204 int replace_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file)
35d7bdc86031a2 David Hildenbrand 2021-04-23 1205 {
35d7bdc86031a2 David Hildenbrand 2021-04-23 1206 struct file *old_exe_file;
35d7bdc86031a2 David Hildenbrand 2021-04-23 1207 int ret = 0;
35d7bdc86031a2 David Hildenbrand 2021-04-23 1208
35d7bdc86031a2 David Hildenbrand 2021-04-23 1209 /* set the new file, lockless */
fe69d560b5bd9e David Hildenbrand 2021-04-23 1210 ret = deny_write_access(new_exe_file);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1211 if (ret)
fe69d560b5bd9e David Hildenbrand 2021-04-23 1212 return -EACCES;
35d7bdc86031a2 David Hildenbrand 2021-04-23 1213 get_file(new_exe_file);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1214
35d7bdc86031a2 David Hildenbrand 2021-04-23 @1215 old_exe_file = xchg(&mm->exe_file, new_exe_file);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1216 if (old_exe_file) {
fe69d560b5bd9e David Hildenbrand 2021-04-23 1217 /*
fe69d560b5bd9e David Hildenbrand 2021-04-23 1218 * Don't race with dup_mmap() getting the file and disallowing
fe69d560b5bd9e David Hildenbrand 2021-04-23 1219 * write access while someone might open the file writable.
fe69d560b5bd9e David Hildenbrand 2021-04-23 1220 */
fe69d560b5bd9e David Hildenbrand 2021-04-23 1221 mmap_read_lock(mm);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1222 allow_write_access(old_exe_file);
35d7bdc86031a2 David Hildenbrand 2021-04-23 1223 fput(old_exe_file);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1224 mmap_read_unlock(mm);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1225 }
35d7bdc86031a2 David Hildenbrand 2021-04-23 1226 return 0;
35d7bdc86031a2 David Hildenbrand 2021-04-23 1227 }
3864601387cf41 Jiri Slaby 2011-05-26 1228
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
[linux-next:master 6352/6993] drivers/remoteproc/rcar_rproc.c:45:20: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 0bafb8f3ebc84525d0ae0fcea22d12151b99312f
commit: 285892a74f1370a12249f765c6a4e3b16194852e [6352/6993] remoteproc: Add Renesas rcar driver
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20211216/202112160216.GyrrKWHL-lk...)
compiler: mips-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# 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 285892a74f1370a12249f765c6a4e3b16194852e
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=mips SHELL=/bin/bash drivers/remoteproc/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
drivers/remoteproc/rcar_rproc.c:28:12: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *va @@ got void [noderef] __iomem * @@
drivers/remoteproc/rcar_rproc.c:28:12: sparse: expected void *va
drivers/remoteproc/rcar_rproc.c:28:12: sparse: got void [noderef] __iomem *
>> drivers/remoteproc/rcar_rproc.c:45:20: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __iomem *addr @@ got void *va @@
drivers/remoteproc/rcar_rproc.c:45:20: sparse: expected void const volatile [noderef] __iomem *addr
drivers/remoteproc/rcar_rproc.c:45:20: sparse: got void *va
vim +45 drivers/remoteproc/rcar_rproc.c
40
41 static int rcar_rproc_mem_release(struct rproc *rproc,
42 struct rproc_mem_entry *mem)
43 {
44 dev_dbg(&rproc->dev, "unmap memory: %pa\n", &mem->dma);
> 45 iounmap(mem->va);
46
47 return 0;
48 }
49
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
Re: [PATCH 7/7] drm/i915: Use struct vma_resource instead of struct vma_snapshot
by kernel test robot
Hi "Thomas,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-tip/drm-tip]
[also build test WARNING on next-20211214]
[cannot apply to drm-exynos/exynos-drm-next drm/drm-next drm-intel/for-linux-next v5.16-rc5]
[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/Thomas-Hellstr-m/drm-i915-Asynch...
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: i386-randconfig-a003-20211214 (https://download.01.org/0day-ci/archive/20211216/202112160255.Kmo6u2NC-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/ede025870be746e37b5bcde123cdf741a...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Thomas-Hellstr-m/drm-i915-Asynchronous-vma-unbinding/20211215-183859
git checkout ede025870be746e37b5bcde123cdf741aa685fab
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/
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 >>):
In file included from drivers/gpu/drm/i915/i915_request.h:43,
from drivers/gpu/drm/i915/i915_active.h:13,
from drivers/gpu/drm/i915/gt/intel_ggtt_fencing.h:12,
from drivers/gpu/drm/i915/i915_vma.h:33,
from drivers/gpu/drm/i915/display/intel_display_types.h:50,
from drivers/gpu/drm/i915/i915_driver.c:51:
>> drivers/gpu/drm/i915/i915_vma_resource.h:176:15: warning: 'struct intel_memory_region' declared inside parameter list will not be visible outside of this definition or declaration
176 | struct intel_memory_region *mr,
| ^~~~~~~~~~~~~~~~~~~
--
In file included from drivers/gpu/drm/i915/i915_request.h:43,
from drivers/gpu/drm/i915/i915_active.h:13,
from drivers/gpu/drm/i915/gem/i915_gem_object_types.h:16,
from drivers/gpu/drm/i915/display/intel_frontbuffer.h:30,
from drivers/gpu/drm/i915/i915_drv.h:74,
from drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c:9:
>> drivers/gpu/drm/i915/i915_vma_resource.h:176:15: warning: 'struct intel_memory_region' declared inside parameter list will not be visible outside of this definition or declaration
176 | struct intel_memory_region *mr,
| ^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c:464:5: warning: no previous prototype for 'prev_deps' [-Wmissing-prototypes]
464 | int prev_deps(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
| ^~~~~~~~~
--
In file included from drivers/gpu/drm/i915/i915_request.h:43,
from drivers/gpu/drm/i915/i915_active.h:13,
from drivers/gpu/drm/i915/gem/i915_gem_object_types.h:16,
from drivers/gpu/drm/i915/display/intel_frontbuffer.h:30,
from drivers/gpu/drm/i915/i915_vma.c:28:
>> drivers/gpu/drm/i915/i915_vma_resource.h:176:15: warning: 'struct intel_memory_region' declared inside parameter list will not be visible outside of this definition or declaration
176 | struct intel_memory_region *mr,
| ^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_vma.c: In function 'i915_vma_resource_init_from_vma':
drivers/gpu/drm/i915/i915_vma.c:394:48: error: passing argument 8 of 'i915_vma_resource_init' from incompatible pointer type [-Werror=incompatible-pointer-types]
394 | i915_gem_object_is_lmem(obj), obj->mm.region,
| ~~~~~~~^~~~~~~
| |
| struct intel_memory_region *
In file included from drivers/gpu/drm/i915/i915_request.h:43,
from drivers/gpu/drm/i915/i915_active.h:13,
from drivers/gpu/drm/i915/gem/i915_gem_object_types.h:16,
from drivers/gpu/drm/i915/display/intel_frontbuffer.h:30,
from drivers/gpu/drm/i915/i915_vma.c:28:
drivers/gpu/drm/i915/i915_vma_resource.h:176:36: note: expected 'struct intel_memory_region *' but argument is of type 'struct intel_memory_region *'
176 | struct intel_memory_region *mr,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
cc1: some warnings being treated as errors
--
In file included from drivers/gpu/drm/i915/i915_request.h:43,
from drivers/gpu/drm/i915/i915_active.h:13,
from drivers/gpu/drm/i915/gem/i915_gem_object_types.h:16,
from drivers/gpu/drm/i915/display/intel_frontbuffer.h:30,
from drivers/gpu/drm/i915/i915_drv.h:74,
from drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:12:
>> drivers/gpu/drm/i915/i915_vma_resource.h:176:15: warning: 'struct intel_memory_region' declared inside parameter list will not be visible outside of this definition or declaration
176 | struct intel_memory_region *mr,
| ^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c:59:6: warning: no previous prototype for 'intel_pxp_debugfs_register' [-Wmissing-prototypes]
59 | void intel_pxp_debugfs_register(struct intel_pxp *pxp, struct dentry *gt_root)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
vim +176 drivers/gpu/drm/i915/i915_vma_resource.h
146
147 /**
148 * i915_vma_resource_init - Initialize a vma resource.
149 * @vma_res: The vma resource to initialize
150 * @vm: Pointer to the vm.
151 * @pages: The pages sg-table.
152 * @page_sizes: Page sizes of the pages.
153 * @pages_rsgt: Pointer to a struct i915_refct_sgt of an object with
154 * delayed destruction.
155 * @readonly: Whether the vma should be bound read-only.
156 * @lmem: Whether the vma points to lmem.
157 * @mr: The memory region of the object the vma points to.
158 * @ops: The backend ops.
159 * @private: Bind backend private info.
160 * @start: Offset into the address space of bind range start.
161 * @node_size: Size of the allocated range manager node.
162 * @size: Bind size.
163 *
164 * Initializes a vma resource allocated using i915_vma_resource_alloc().
165 * The reason for having separate allocate and initialize function is that
166 * initialization may need to be performed from under a lock where
167 * allocation is not allowed.
168 */
169 static inline void i915_vma_resource_init(struct i915_vma_resource *vma_res,
170 struct i915_address_space *vm,
171 struct sg_table *pages,
172 const struct i915_page_sizes *page_sizes,
173 struct i915_refct_sgt *pages_rsgt,
174 bool readonly,
175 bool lmem,
> 176 struct intel_memory_region *mr,
177 const struct i915_vma_ops *ops,
178 void *private,
179 unsigned long start,
180 unsigned long node_size,
181 unsigned long size)
182 {
183 __i915_vma_resource_init(vma_res);
184 vma_res->vm = vm;
185 vma_res->bi.pages = pages;
186 vma_res->bi.page_sizes = *page_sizes;
187 if (pages_rsgt)
188 vma_res->bi.pages_rsgt = i915_refct_sgt_get(pages_rsgt);
189 vma_res->bi.readonly = readonly;
190 vma_res->bi.lmem = lmem;
191 #if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
192 vma_res->mr = mr;
193 #endif
194 vma_res->ops = ops;
195 vma_res->private = private;
196 vma_res->start = start;
197 vma_res->node_size = node_size;
198 vma_res->vma_size = size;
199 }
200
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
[plbossart-sound:fix/sof-es8336-quirk 48/48] sound/soc/sof/intel/hda.c:701:63: error: 'NHLT_DEVICE_I2S' undeclared
by kernel test robot
tree: https://github.com/plbossart/sound fix/sof-es8336-quirk
head: 96625939a8f1099dff79e7acd81bec23773c72bf
commit: 96625939a8f1099dff79e7acd81bec23773c72bf [48/48] ASoC: SOF: Intel: hda: retrieve SSP mask for analog audio devices
config: arc-allyesconfig (https://download.01.org/0day-ci/archive/20211216/202112160223.h4rvzLus-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.0
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/plbossart/sound/commit/96625939a8f1099dff79e7acd81bec2...
git remote add plbossart-sound https://github.com/plbossart/sound
git fetch --no-tags plbossart-sound fix/sof-es8336-quirk
git checkout 96625939a8f1099dff79e7acd81bec23773c72bf
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc 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 >>):
sound/soc/sof/intel/hda.c: In function 'check_nhlt_ssp_mask':
>> sound/soc/sof/intel/hda.c:701:63: error: 'NHLT_DEVICE_I2S' undeclared (first use in this function)
701 | ssp_mask = intel_nhlt_ssp_endpoint_mask(nhlt, NHLT_DEVICE_I2S);
| ^~~~~~~~~~~~~~~
sound/soc/sof/intel/hda.c:701:63: note: each undeclared identifier is reported only once for each function it appears in
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_AMD_ACP_CONFIG
Depends on SOUND && !UML && SND && SND_SOC && SND_SOC_ACPI
Selected by
- SND_SOC_SOF_AMD_COMMON && SOUND && !UML && SND && SND_SOC && SND_SOC_SOF_TOPLEVEL && SND_SOC_SOF_AMD_TOPLEVEL
vim +/NHLT_DEVICE_I2S +701 sound/soc/sof/intel/hda.c
692
693 static int check_nhlt_ssp_mask(struct snd_sof_dev *sdev)
694 {
695 struct nhlt_acpi_table *nhlt;
696 int ssp_mask = 0;
697
698 nhlt = intel_nhlt_init(sdev->dev);
699 if (nhlt && intel_nhlt_has_endpoint_type(nhlt, NHLT_LINK_SSP)) {
700
> 701 ssp_mask = intel_nhlt_ssp_endpoint_mask(nhlt, NHLT_DEVICE_I2S);
702
703 dev_dbg(sdev->dev, "NHLT_LINK_SSP detected, ssp_mask %#x\n", ssp_mask);
704
705 intel_nhlt_free(nhlt);
706 }
707
708 return ssp_mask;
709 }
710
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
[asahilinux:touchpad/wip 63/82] drivers/dma/apple-admac.c:125:5: warning: no previous prototype for 'admac_alloc_chan_resources'
by kernel test robot
tree: https://github.com/AsahiLinux/linux touchpad/wip
head: a2281d64fdbcbab0dae68c6ea75bd5b548332e06
commit: ebaeac45289171e9e6a775d13f2bf34bfec4d104 [63/82] dmaengine: apple-admac: Add Apple ADMAC driver
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20211216/202112160214.4Ffd17JG-lk...)
compiler: s390-linux-gcc (GCC) 11.2.0
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/AsahiLinux/linux/commit/ebaeac45289171e9e6a775d13f2bf3...
git remote add asahilinux https://github.com/AsahiLinux/linux
git fetch --no-tags asahilinux touchpad/wip
git checkout ebaeac45289171e9e6a775d13f2bf34bfec4d104
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=s390 SHELL=/bin/bash drivers/clk/ drivers/dma/ sound/soc/
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/dma/apple-admac.c:125:5: warning: no previous prototype for 'admac_alloc_chan_resources' [-Wmissing-prototypes]
125 | int admac_alloc_chan_resources(struct dma_chan *chan)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/dma/apple-admac.c:130:6: warning: no previous prototype for 'admac_free_chan_resources' [-Wmissing-prototypes]
130 | void admac_free_chan_resources(struct dma_chan *chan)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/dma/apple-admac.c:135:5: warning: no previous prototype for 'admac_ring_noccupied_slots' [-Wmissing-prototypes]
135 | int admac_ring_noccupied_slots(int ringval)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dma/apple-admac.c: In function 'admac_ring_noccupied_slots':
drivers/dma/apple-admac.c:137:22: error: implicit declaration of function 'FIELD_GET'; did you mean 'FOLL_GET'? [-Werror=implicit-function-declaration]
137 | int wrslot = FIELD_GET(RING_WRITE_SLOT, ringval);
| ^~~~~~~~~
| FOLL_GET
drivers/dma/apple-admac.c: At top level:
>> drivers/dma/apple-admac.c:155:5: warning: no previous prototype for 'admac_cyclic_read_residue' [-Wmissing-prototypes]
155 | u32 admac_cyclic_read_residue(struct admac_data *ad, int channo, struct admac_tx *adtx)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/dma/apple-admac.c:181:17: warning: no previous prototype for 'admac_tx_status' [-Wmissing-prototypes]
181 | enum dma_status admac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
| ^~~~~~~~~~~~~~~
>> drivers/dma/apple-admac.c:228:6: warning: no previous prototype for 'admac_start' [-Wmissing-prototypes]
228 | void admac_start(struct admac_chan *adchan)
| ^~~~~~~~~~~
>> drivers/dma/apple-admac.c:244:6: warning: no previous prototype for 'admac_issue_pending' [-Wmissing-prototypes]
244 | void admac_issue_pending(struct dma_chan *chan)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/dma/apple-admac.c:263:5: warning: no previous prototype for 'admac_pause' [-Wmissing-prototypes]
263 | int admac_pause(struct dma_chan *chan)
| ^~~~~~~~~~~
>> drivers/dma/apple-admac.c:272:5: warning: no previous prototype for 'admac_resume' [-Wmissing-prototypes]
272 | int admac_resume(struct dma_chan *chan)
| ^~~~~~~~~~~~
>> drivers/dma/apple-admac.c:281:5: warning: no previous prototype for 'admac_terminate_all' [-Wmissing-prototypes]
281 | int admac_terminate_all(struct dma_chan *chan)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/dma/apple-admac.c:303:14: warning: no previous prototype for 'admac_tx_submit' [-Wmissing-prototypes]
303 | dma_cookie_t admac_tx_submit(struct dma_async_tx_descriptor *tx)
| ^~~~~~~~~~~~~~~
>> drivers/dma/apple-admac.c:325:33: warning: no previous prototype for 'admac_prep_dma_cyclic' [-Wmissing-prototypes]
325 | struct dma_async_tx_descriptor *admac_prep_dma_cyclic(
| ^~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/admac_alloc_chan_resources +125 drivers/dma/apple-admac.c
124
> 125 int admac_alloc_chan_resources(struct dma_chan *chan)
126 {
127 return 0;
128 }
129
> 130 void admac_free_chan_resources(struct dma_chan *chan)
131 {
132 // TODO
133 }
134
> 135 int admac_ring_noccupied_slots(int ringval)
136 {
137 int wrslot = FIELD_GET(RING_WRITE_SLOT, ringval);
138 int rdslot = FIELD_GET(RING_READ_SLOT, ringval);
139
140 if (wrslot != rdslot) {
141 return (wrslot + 4 - rdslot) % 4;
142 } else {
143 WARN_ON((ringval & (RING_FULL | RING_EMPTY)) == 0);
144
145 if (ringval & RING_FULL)
146 return 4;
147 else
148 return 0;
149 }
150 }
151
152 /*
153 * Read from hardware the residue of a cyclic dmaengine transaction.
154 */
> 155 u32 admac_cyclic_read_residue(struct admac_data *ad, int channo, struct admac_tx *adtx)
156 {
157 u32 ring1, ring2;
158 u32 residue1, residue2;
159 int nreports;
160 size_t pos;
161
162 ring1 = admac_peek(ad, REG_TX_REPORT_RING(channo));
163 residue1 = admac_peek(ad, REG_TX_RESIDUE(channo));
164 ring2 = admac_peek(ad, REG_TX_REPORT_RING(channo));
165 residue2 = admac_peek(ad, REG_TX_RESIDUE(channo));
166
167 if (residue2 > residue1) {
168 // engine must have loaded next descriptor between the two residue reads
169 nreports = admac_ring_noccupied_slots(ring1) + 1;
170 } else {
171 // no descriptor load between the two reads, ring2 is safe to use
172 nreports = admac_ring_noccupied_slots(ring2);
173 }
174
175 pos = adtx->reclaimed_pos + adtx->period_len * (nreports + 1) \
176 - residue2;
177
178 return adtx->buf_len - pos % adtx->buf_len;
179 }
180
> 181 enum dma_status admac_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
182 struct dma_tx_state *txstate)
183 {
184 struct admac_chan *adchan = to_admac_chan(chan);
185 struct admac_data *ad = adchan->host;
186 struct admac_tx *adtx;
187
188 enum dma_status ret;
189 size_t residue;
190 unsigned long flags;
191
192 ret = dma_cookie_status(chan, cookie, txstate);
193 if (ret == DMA_COMPLETE || !txstate)
194 return ret;
195
196 /*
197 * Presumably ALSA code will query residue to know if an overrun occured,
198 * this seems a proper place to insert a write barrier.
199 */
200 wmb();
201
202 spin_lock_irqsave(&adchan->lock, flags);
203 adtx = adchan->current_tx;
204
205 if (adtx && adtx->tx.cookie == cookie) {
206 ret = DMA_IN_PROGRESS;
207 residue = admac_cyclic_read_residue(ad, adchan->no, adtx);
208 } else {
209 ret = DMA_IN_PROGRESS;
210 residue = 0;
211 list_for_each_entry(adtx, &adchan->issued, node) {
212 if (adtx->tx.cookie == cookie) {
213 residue = adtx->buf_len;
214 break;
215 }
216 }
217 }
218 spin_unlock_irqrestore(&adchan->lock, flags);
219
220 if (adtx)
221 dev_dbg(ad->dev, "ch%d residue: %lx, (%ld%%)\n", adchan->no,
222 residue, residue*100/adtx->buf_len);
223
224 dma_set_residue(txstate, residue);
225 return ret;
226 }
227
> 228 void admac_start(struct admac_chan *adchan)
229 {
230 struct admac_data *ad = adchan->host;
231 int ch = adchan->no;
232
233 admac_poke(ad, REG_TX_STATUS1(ch), STATUS_DESC_DONE | STATUS_ERR);
234 admac_poke(ad, REG_TX_CTL(ch), REG_TX_CTL_RESET_RINGS);
235 admac_poke(ad, REG_TX_CTL(ch), 0);
236 admac_cyclic_write_one_desc(ad, ch, adchan->current_tx);
237 admac_poke(ad, REG_TX_EN, 1 << ch);
238
239 admac_cyclic_write_desc(ad, ch, adchan->current_tx);
240
241 dev_dbg(ad->dev, "ch%d start\n", ch);
242 }
243
> 244 void admac_issue_pending(struct dma_chan *chan)
245 {
246 struct admac_chan *adchan = to_admac_chan(chan);
247 struct admac_tx *tx;
248 unsigned long flags;
249
250 spin_lock_irqsave(&adchan->lock, flags);
251 list_splice_tail_init(&adchan->submitted, &adchan->issued);
252 if (!list_empty(&adchan->issued) && !adchan->current_tx) {
253 tx = list_first_entry(&adchan->issued, struct admac_tx, node);
254 list_del(&tx->node);
255
256 adchan->current_tx = tx;
257 adchan->nperiod_acks = 0;
258 admac_start(adchan);
259 }
260 spin_unlock_irqrestore(&adchan->lock, flags);
261 }
262
> 263 int admac_pause(struct dma_chan *chan)
264 {
265 struct admac_chan *adchan = to_admac_chan(chan);
266
267 admac_poke(adchan->host, REG_TX_EN_CLR, 1 << adchan->no);
268
269 return 0;
270 }
271
> 272 int admac_resume(struct dma_chan *chan)
273 {
274 struct admac_chan *adchan = to_admac_chan(chan);
275
276 admac_poke(adchan->host, REG_TX_EN, 1 << adchan->no);
277
278 return 0;
279 }
280
> 281 int admac_terminate_all(struct dma_chan *chan)
282 {
283 struct admac_chan *adchan = to_admac_chan(chan);
284 struct admac_tx *adtx, *_adtx;
285 unsigned long flags;
286 LIST_HEAD(head);
287
288 spin_lock_irqsave(&adchan->lock, flags);
289 admac_poke(adchan->host, REG_TX_EN_CLR, 1 << adchan->no);
290 adchan->current_tx = NULL;
291 list_splice_tail_init(&adchan->submitted, &head);
292 list_splice_tail_init(&adchan->issued, &head);
293 spin_unlock_irqrestore(&adchan->lock, flags);
294
295 list_for_each_entry_safe(adtx, _adtx, &head, node) {
296 list_del(&adtx->node);
297 admac_desc_free(&adtx->tx);
298 }
299
300 return 0;
301 }
302
> 303 dma_cookie_t admac_tx_submit(struct dma_async_tx_descriptor *tx)
304 {
305 struct admac_tx *adtx = to_admac_tx(tx);
306 struct admac_chan *adchan = to_admac_chan(tx->chan);
307 unsigned long flags;
308 dma_cookie_t cookie;
309
310 spin_lock_irqsave(&adchan->lock, flags);
311 cookie = dma_cookie_assign(tx);
312 list_add_tail(&adtx->node, &adchan->submitted);
313 spin_unlock_irqrestore(&adchan->lock, flags);
314
315 return cookie;
316 }
317
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
[hch-misc:um-set_fs 1/2] arch/x86/kvm/mmu/spte.c:85:6: error: implicit declaration of function 'pat_enabled'; did you mean 'kasan_enabled'?
by kernel test robot
tree: git://git.infradead.org/users/hch/misc.git um-set_fs
head: 10f824225a08987e764b65f12a1a6e276fbd9b95
commit: e4ae0f9a217d88fea3da7a08cedf32b4d9a84896 [1/2] x86/mtrr: remove the mtrr_bp_init stub
config: x86_64-rhel-8.3 (https://download.01.org/0day-ci/archive/20211216/202112160131.vnaM5zs6-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
git remote add hch-misc git://git.infradead.org/users/hch/misc.git
git fetch --no-tags hch-misc um-set_fs
git checkout e4ae0f9a217d88fea3da7a08cedf32b4d9a84896
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/kvm/
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/x86/kvm/mmu/spte.c: In function 'kvm_is_mmio_pfn':
>> arch/x86/kvm/mmu/spte.c:85:6: error: implicit declaration of function 'pat_enabled'; did you mean 'kasan_enabled'? [-Werror=implicit-function-declaration]
85 | (!pat_enabled() || pat_pfn_immune_to_uc_mtrr(pfn));
| ^~~~~~~~~~~
| kasan_enabled
>> arch/x86/kvm/mmu/spte.c:85:23: error: implicit declaration of function 'pat_pfn_immune_to_uc_mtrr' [-Werror=implicit-function-declaration]
85 | (!pat_enabled() || pat_pfn_immune_to_uc_mtrr(pfn));
| ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +85 arch/x86/kvm/mmu/spte.c
5a9624affe7c749 Paolo Bonzini 2020-10-16 70
5a9624affe7c749 Paolo Bonzini 2020-10-16 71 static bool kvm_is_mmio_pfn(kvm_pfn_t pfn)
5a9624affe7c749 Paolo Bonzini 2020-10-16 72 {
5a9624affe7c749 Paolo Bonzini 2020-10-16 73 if (pfn_valid(pfn))
5a9624affe7c749 Paolo Bonzini 2020-10-16 74 return !is_zero_pfn(pfn) && PageReserved(pfn_to_page(pfn)) &&
5a9624affe7c749 Paolo Bonzini 2020-10-16 75 /*
5a9624affe7c749 Paolo Bonzini 2020-10-16 76 * Some reserved pages, such as those from NVDIMM
5a9624affe7c749 Paolo Bonzini 2020-10-16 77 * DAX devices, are not for MMIO, and can be mapped
5a9624affe7c749 Paolo Bonzini 2020-10-16 78 * with cached memory type for better performance.
5a9624affe7c749 Paolo Bonzini 2020-10-16 79 * However, the above check misconceives those pages
5a9624affe7c749 Paolo Bonzini 2020-10-16 80 * as MMIO, and results in KVM mapping them with UC
5a9624affe7c749 Paolo Bonzini 2020-10-16 81 * memory type, which would hurt the performance.
5a9624affe7c749 Paolo Bonzini 2020-10-16 82 * Therefore, we check the host memory type in addition
5a9624affe7c749 Paolo Bonzini 2020-10-16 83 * and only treat UC/UC-/WC pages as MMIO.
5a9624affe7c749 Paolo Bonzini 2020-10-16 84 */
5a9624affe7c749 Paolo Bonzini 2020-10-16 @85 (!pat_enabled() || pat_pfn_immune_to_uc_mtrr(pfn));
5a9624affe7c749 Paolo Bonzini 2020-10-16 86
5a9624affe7c749 Paolo Bonzini 2020-10-16 87 return !e820__mapped_raw_any(pfn_to_hpa(pfn),
5a9624affe7c749 Paolo Bonzini 2020-10-16 88 pfn_to_hpa(pfn + 1) - 1,
5a9624affe7c749 Paolo Bonzini 2020-10-16 89 E820_TYPE_RAM);
5a9624affe7c749 Paolo Bonzini 2020-10-16 90 }
5a9624affe7c749 Paolo Bonzini 2020-10-16 91
:::::: The code at line 85 was first introduced by commit
:::::: 5a9624affe7c7498fb395879d9bb613628e89e60 KVM: mmu: extract spte.h and spte.c
:::::: TO: Paolo Bonzini <pbonzini(a)redhat.com>
:::::: CC: Paolo Bonzini <pbonzini(a)redhat.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
Re: [PATCH 1/7] drm/i915: Avoid using the i915_fence_array when collecting dependencies
by kernel test robot
Hi "Thomas,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on drm-tip/drm-tip]
[also build test WARNING on drm-exynos/exynos-drm-next drm/drm-next next-20211214]
[cannot apply to drm-intel/for-linux-next tegra-drm/drm/tegra/for-next airlied/drm-next v5.16-rc5]
[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/Thomas-Hellstr-m/drm-i915-Asynch...
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: x86_64-randconfig-a013-20211214 (https://download.01.org/0day-ci/archive/20211216/202112160101.AqbkqxoO-lk...)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dd245bab9fbb364faa1581e4f92ba3119a872fba)
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/0f61eb08a6b9d7fa9f19eaa071ad5591d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Thomas-Hellstr-m/drm-i915-Asynchronous-vma-unbinding/20211215-183859
git checkout 0f61eb08a6b9d7fa9f19eaa071ad5591de123633
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/gpu/
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/gpu/drm/i915/gem/i915_gem_ttm_move.c:634:5: warning: no previous prototype for function 'prev_deps' [-Wmissing-prototypes]
int prev_deps(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
^
drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c:634:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int prev_deps(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
^
static
1 warning generated.
vim +/prev_deps +634 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
633
> 634 int prev_deps(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
635 struct i915_deps *deps)
636 {
637 int ret;
638
639 ret = i915_deps_add_dependency(deps, bo->moving, ctx);
640 if (!ret)
641 /*
642 * TODO: Only await excl fence here, and shared fences before
643 * signaling the migration fence.
644 */
645 ret = i915_deps_add_resv(deps, bo->base.resv, true, false, ctx);
646
647 return ret;
648 }
649
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week
Re: [PATCH] c/r: prctl: Remove PR_SET_MM_EXE_FILE old file mapping restriction
by kernel test robot
Hi Keno,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.16-rc5 next-20211214]
[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/Keno-Fischer/c-r-prctl-Remove-PR...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 136057256686de39cc3a07c2e39ef6bc43003ff6
config: arc-randconfig-s031-20211214 (https://download.01.org/0day-ci/archive/20211216/202112160112.oIvovVSv-lk...)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://github.com/0day-ci/linux/commit/08f30df401c936e27733e3b37765c2b7d...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Keno-Fischer/c-r-prctl-Remove-PR_SET_MM_EXE_FILE-old-file-mapping-restriction/20211215-142515
git checkout 08f30df401c936e27733e3b37765c2b7d35fe0e7
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
kernel/fork.c:1215:24: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct file [noderef] __rcu *_val_ @@ got struct file *new_exe_file @@
kernel/fork.c:1215:24: sparse: expected struct file [noderef] __rcu *_val_
kernel/fork.c:1215:24: sparse: got struct file *new_exe_file
>> kernel/fork.c:1215:22: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct file *old_exe_file @@ got struct file [noderef] __rcu *[assigned] _val_ @@
kernel/fork.c:1215:22: sparse: expected struct file *old_exe_file
kernel/fork.c:1215:22: sparse: got struct file [noderef] __rcu *[assigned] _val_
kernel/fork.c:1572:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct refcount_struct [usertype] *r @@ got struct refcount_struct [noderef] __rcu * @@
kernel/fork.c:1572:38: sparse: expected struct refcount_struct [usertype] *r
kernel/fork.c:1572:38: sparse: got struct refcount_struct [noderef] __rcu *
kernel/fork.c:1581:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:1581:31: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:1581:31: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:1582:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const * @@ got struct k_sigaction [noderef] __rcu * @@
kernel/fork.c:1582:36: sparse: expected void const *
kernel/fork.c:1582:36: sparse: got struct k_sigaction [noderef] __rcu *
kernel/fork.c:1583:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:1583:33: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:1583:33: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:1995:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:1995:31: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:1995:31: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:1999:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:1999:33: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:1999:33: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2304:32: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct [noderef] __rcu *real_parent @@ got struct task_struct *task @@
kernel/fork.c:2304:32: sparse: expected struct task_struct [noderef] __rcu *real_parent
kernel/fork.c:2304:32: sparse: got struct task_struct *task
kernel/fork.c:2313:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:2313:27: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:2313:27: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2362:54: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct list_head *head @@ got struct list_head [noderef] __rcu * @@
kernel/fork.c:2362:54: sparse: expected struct list_head *head
kernel/fork.c:2362:54: sparse: got struct list_head [noderef] __rcu *
kernel/fork.c:2383:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:2383:29: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:2383:29: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2401:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:2401:29: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:2401:29: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2428:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct sighand_struct *sighand @@ got struct sighand_struct [noderef] __rcu *sighand @@
kernel/fork.c:2428:28: sparse: expected struct sighand_struct *sighand
kernel/fork.c:2428:28: sparse: got struct sighand_struct [noderef] __rcu *sighand
kernel/fork.c:2456:31: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:2456:31: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:2456:31: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2458:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct spinlock [usertype] *lock @@ got struct spinlock [noderef] __rcu * @@
kernel/fork.c:2458:33: sparse: expected struct spinlock [usertype] *lock
kernel/fork.c:2458:33: sparse: got struct spinlock [noderef] __rcu *
kernel/fork.c:2867:24: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct task_struct *[assigned] parent @@ got struct task_struct [noderef] __rcu *real_parent @@
kernel/fork.c:2867:24: sparse: expected struct task_struct *[assigned] parent
kernel/fork.c:2867:24: sparse: got struct task_struct [noderef] __rcu *real_parent
kernel/fork.c:2948:43: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct refcount_struct const [usertype] *r @@ got struct refcount_struct [noderef] __rcu * @@
kernel/fork.c:2948:43: sparse: expected struct refcount_struct const [usertype] *r
kernel/fork.c:2948:43: sparse: got struct refcount_struct [noderef] __rcu *
kernel/fork.c:2039:22: sparse: sparse: dereference of noderef expression
kernel/fork.c: note: in included file (through include/uapi/asm-generic/bpf_perf_event.h, arch/arc/include/generated/uapi/asm/bpf_perf_event.h, ...):
include/linux/ptrace.h:218:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected struct task_struct *new_parent @@ got struct task_struct [noderef] __rcu *parent @@
include/linux/ptrace.h:218:45: sparse: expected struct task_struct *new_parent
include/linux/ptrace.h:218:45: sparse: got struct task_struct [noderef] __rcu *parent
include/linux/ptrace.h:218:62: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct cred const *ptracer_cred @@ got struct cred const [noderef] __rcu *ptracer_cred @@
include/linux/ptrace.h:218:62: sparse: expected struct cred const *ptracer_cred
include/linux/ptrace.h:218:62: sparse: got struct cred const [noderef] __rcu *ptracer_cred
kernel/fork.c:2360:59: sparse: sparse: dereference of noderef expression
kernel/fork.c:2361:59: sparse: sparse: dereference of noderef expression
vim +1215 kernel/fork.c
3864601387cf41 Jiri Slaby 2011-05-26 1194
35d7bdc86031a2 David Hildenbrand 2021-04-23 1195 /**
35d7bdc86031a2 David Hildenbrand 2021-04-23 1196 * replace_mm_exe_file - replace a reference to the mm's executable file
35d7bdc86031a2 David Hildenbrand 2021-04-23 1197 *
35d7bdc86031a2 David Hildenbrand 2021-04-23 1198 * This changes mm's executable file (shown as symlink /proc/[pid]/exe),
35d7bdc86031a2 David Hildenbrand 2021-04-23 1199 * dealing with concurrent invocation and without grabbing the mmap lock in
35d7bdc86031a2 David Hildenbrand 2021-04-23 1200 * write mode.
35d7bdc86031a2 David Hildenbrand 2021-04-23 1201 *
35d7bdc86031a2 David Hildenbrand 2021-04-23 1202 * Main user is sys_prctl(PR_SET_MM_MAP/EXE_FILE).
35d7bdc86031a2 David Hildenbrand 2021-04-23 1203 */
35d7bdc86031a2 David Hildenbrand 2021-04-23 1204 int replace_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file)
35d7bdc86031a2 David Hildenbrand 2021-04-23 1205 {
35d7bdc86031a2 David Hildenbrand 2021-04-23 1206 struct file *old_exe_file;
35d7bdc86031a2 David Hildenbrand 2021-04-23 1207 int ret = 0;
35d7bdc86031a2 David Hildenbrand 2021-04-23 1208
35d7bdc86031a2 David Hildenbrand 2021-04-23 1209 /* set the new file, lockless */
fe69d560b5bd9e David Hildenbrand 2021-04-23 1210 ret = deny_write_access(new_exe_file);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1211 if (ret)
fe69d560b5bd9e David Hildenbrand 2021-04-23 1212 return -EACCES;
35d7bdc86031a2 David Hildenbrand 2021-04-23 1213 get_file(new_exe_file);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1214
35d7bdc86031a2 David Hildenbrand 2021-04-23 @1215 old_exe_file = xchg(&mm->exe_file, new_exe_file);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1216 if (old_exe_file) {
fe69d560b5bd9e David Hildenbrand 2021-04-23 1217 /*
fe69d560b5bd9e David Hildenbrand 2021-04-23 1218 * Don't race with dup_mmap() getting the file and disallowing
fe69d560b5bd9e David Hildenbrand 2021-04-23 1219 * write access while someone might open the file writable.
fe69d560b5bd9e David Hildenbrand 2021-04-23 1220 */
fe69d560b5bd9e David Hildenbrand 2021-04-23 1221 mmap_read_lock(mm);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1222 allow_write_access(old_exe_file);
35d7bdc86031a2 David Hildenbrand 2021-04-23 1223 fput(old_exe_file);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1224 mmap_read_unlock(mm);
fe69d560b5bd9e David Hildenbrand 2021-04-23 1225 }
35d7bdc86031a2 David Hildenbrand 2021-04-23 1226 return 0;
35d7bdc86031a2 David Hildenbrand 2021-04-23 1227 }
3864601387cf41 Jiri Slaby 2011-05-26 1228
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
9 months, 1 week