arch/x86/include/asm/special_insns.h:289:41: sparse: sparse: incorrect type in initializer (different address spaces)
From: kernel test robot
Date: Sat Jan 02 2021 - 14:52:37 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: eda809aef53426d044b519405d25d9da55319b76
commit: 8e50d392652f20616a136165dff516b86baf5e49 dmaengine: idxd: Add shared workqueue support
date: 9 weeks ago
config: x86_64-randconfig-s031-20210103 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-184-g1b896707-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8e50d392652f20616a136165dff516b86baf5e49
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8e50d392652f20616a136165dff516b86baf5e49
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
"sparse warnings: (new ones prefixed by >>)"
drivers/dma/idxd/submit.c: note: in included file (through include/linux/io.h, include/linux/pci.h):
arch/x86/include/asm/io.h:422:27: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *dst @@ got void [noderef] __iomem *dst @@
arch/x86/include/asm/io.h:422:27: sparse: expected void *dst
arch/x86/include/asm/io.h:422:27: sparse: got void [noderef] __iomem *dst
drivers/dma/idxd/submit.c: note: in included file (through arch/x86/include/asm/processor.h, arch/x86/include/asm/timex.h, include/linux/timex.h, ...):
>> arch/x86/include/asm/special_insns.h:289:41: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected struct <noident> *__dst @@ got void [noderef] __iomem *dst @@
arch/x86/include/asm/special_insns.h:289:41: sparse: expected struct <noident> *__dst
arch/x86/include/asm/special_insns.h:289:41: sparse: got void [noderef] __iomem *dst
vim +289 arch/x86/include/asm/special_insns.h
0888e1030d3e3e Dave Jiang 2020-10-05 266
7f5933f81bd85a Dave Jiang 2020-10-05 267 /**
7f5933f81bd85a Dave Jiang 2020-10-05 268 * enqcmds - Enqueue a command in supervisor (CPL0) mode
7f5933f81bd85a Dave Jiang 2020-10-05 269 * @dst: destination, in MMIO space (must be 512-bit aligned)
7f5933f81bd85a Dave Jiang 2020-10-05 270 * @src: 512 bits memory operand
7f5933f81bd85a Dave Jiang 2020-10-05 271 *
7f5933f81bd85a Dave Jiang 2020-10-05 272 * The ENQCMDS instruction allows software to write a 512-bit command to
7f5933f81bd85a Dave Jiang 2020-10-05 273 * a 512-bit-aligned special MMIO region that supports the instruction.
7f5933f81bd85a Dave Jiang 2020-10-05 274 * A return status is loaded into the ZF flag in the RFLAGS register.
7f5933f81bd85a Dave Jiang 2020-10-05 275 * ZF = 0 equates to success, and ZF = 1 indicates retry or error.
7f5933f81bd85a Dave Jiang 2020-10-05 276 *
7f5933f81bd85a Dave Jiang 2020-10-05 277 * This function issues the ENQCMDS instruction to submit data from
7f5933f81bd85a Dave Jiang 2020-10-05 278 * kernel space to MMIO space, in a unit of 512 bits. Order of data access
7f5933f81bd85a Dave Jiang 2020-10-05 279 * is not guaranteed, nor is a memory barrier performed afterwards. It
7f5933f81bd85a Dave Jiang 2020-10-05 280 * returns 0 on success and -EAGAIN on failure.
7f5933f81bd85a Dave Jiang 2020-10-05 281 *
7f5933f81bd85a Dave Jiang 2020-10-05 282 * Warning: Do not use this helper unless your driver has checked that the
7f5933f81bd85a Dave Jiang 2020-10-05 283 * ENQCMDS instruction is supported on the platform and the device accepts
7f5933f81bd85a Dave Jiang 2020-10-05 284 * ENQCMDS.
7f5933f81bd85a Dave Jiang 2020-10-05 285 */
7f5933f81bd85a Dave Jiang 2020-10-05 286 static inline int enqcmds(void __iomem *dst, const void *src)
7f5933f81bd85a Dave Jiang 2020-10-05 287 {
7f5933f81bd85a Dave Jiang 2020-10-05 288 const struct { char _[64]; } *__src = src;
7f5933f81bd85a Dave Jiang 2020-10-05 @289 struct { char _[64]; } *__dst = dst;
7f5933f81bd85a Dave Jiang 2020-10-05 290 int zf;
7f5933f81bd85a Dave Jiang 2020-10-05 291
7f5933f81bd85a Dave Jiang 2020-10-05 292 /*
7f5933f81bd85a Dave Jiang 2020-10-05 293 * ENQCMDS %(rdx), rax
7f5933f81bd85a Dave Jiang 2020-10-05 294 *
7f5933f81bd85a Dave Jiang 2020-10-05 295 * See movdir64b()'s comment on operand specification.
7f5933f81bd85a Dave Jiang 2020-10-05 296 */
7f5933f81bd85a Dave Jiang 2020-10-05 297 asm volatile(".byte 0xf3, 0x0f, 0x38, 0xf8, 0x02, 0x66, 0x90"
7f5933f81bd85a Dave Jiang 2020-10-05 298 CC_SET(z)
7f5933f81bd85a Dave Jiang 2020-10-05 299 : CC_OUT(z) (zf), "+m" (*__dst)
7f5933f81bd85a Dave Jiang 2020-10-05 300 : "m" (*__src), "a" (__dst), "d" (__src));
7f5933f81bd85a Dave Jiang 2020-10-05 301
7f5933f81bd85a Dave Jiang 2020-10-05 302 /* Submission failure is indicated via EFLAGS.ZF=1 */
7f5933f81bd85a Dave Jiang 2020-10-05 303 if (zf)
7f5933f81bd85a Dave Jiang 2020-10-05 304 return -EAGAIN;
7f5933f81bd85a Dave Jiang 2020-10-05 305
7f5933f81bd85a Dave Jiang 2020-10-05 306 return 0;
7f5933f81bd85a Dave Jiang 2020-10-05 307 }
7f5933f81bd85a Dave Jiang 2020-10-05 308
:::::: The code at line 289 was first introduced by commit
:::::: 7f5933f81bd85a0bf6a87d65c7327ea048a75e54 x86/asm: Add an enqcmds() wrapper for the ENQCMDS instruction
:::::: TO: Dave Jiang <dave.jiang@xxxxxxxxx>
:::::: CC: Borislav Petkov <bp@xxxxxxx>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip