arch/sh/include/asm/uaccess_32.h:204:1: error: impossible constraint in 'asm'

From: kernel test robot

Date: Sun Nov 15 2026 - 13:44:38 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 23c62304dde29abe92013d85910d03a77dada35d
commit: 8b5dba9ea4a3f5ed994f03d6ca7686c49491b426 sh: uaccess: Require offsettable operands for 64-bit user access
date: 6 weeks ago
config: sh-randconfig-r2311-20261115 (https://download.01.org/0day-ci/archive/20261115/202611151925.SgXid5Fj-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 9.5.0
sparse: v0.6.5-rc1-21-g84ec0658
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261115/202611151925.SgXid5Fj-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: 8b5dba9ea4a3 ("sh: uaccess: Require offsettable operands for 64-bit user access")
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202611151925.SgXid5Fj-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from include/linux/export.h:5,
from drivers/gpu/drm/drm_property.c:23:
drivers/gpu/drm/drm_property.c: In function 'drm_mode_getproperty_ioctl':
>> arch/sh/include/asm/uaccess_32.h:204:1: error: impossible constraint in 'asm'
203 | ({ \
| ~~~~
204 | __asm__ __volatile__( \
| ^~~~~~~~~~~~~~~~~~~~~~~
205 | "1:\n\t" \
| ~~~~~~~~~~
206 | "mov.l %S1,%2\n\t" \
| ~~~~~~~~~~~~~~~~~~~~
207 | "mov.l %R1,%T2\n\t" \
| ~~~~~~~~~~~~~~~~~~~~~
208 | "2:\n" \
| ~~~~~~~~
209 | ".section .fixup,\"ax\"\n" \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
210 | "3:\n\t" \
| ~~~~~~~~~~
211 | "mov.l 4f,%0\n\t" \
| ~~~~~~~~~~~~~~~~~~~
212 | "jmp @%0\n\t" \
| ~~~~~~~~~~~~~~~
213 | " mov %3,%0\n\t" \
| ~~~~~~~~~~~~~~~~~~
214 | ".balign 4\n" \
| ~~~~~~~~~~~~~~~
215 | "4: .long 2b\n\t" \
| ~~~~~~~~~~~~~~~~~~~
216 | ".previous\n" \
| ~~~~~~~~~~~~~~~
217 | ".section __ex_table,\"a\"\n\t" \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
218 | ".long 1b, 3b\n\t" \
| ~~~~~~~~~~~~~~~~~~~~
219 | ".previous" \
| ~~~~~~~~~~~~~
220 | : "=r" (retval) \
| ~~~~~~~~~~~~~~~~~
221 | : "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
222 | : "memory"); })
| ~~~~~~~~~~~~~~~
include/linux/compiler.h:68:3: note: in definition of macro '__trace_if_value'
68 | (cond) ? \
| ^~~~
include/linux/compiler.h:55:28: note: in expansion of macro '__trace_if_var'
55 | #define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
| ^~~~~~~~~~~~~~
drivers/gpu/drm/drm_property.c:484:3: note: in expansion of macro 'if'
484 | if (i < out_resp->count_values &&
| ^~
arch/sh/include/asm/uaccess_32.h:136:3: note: in expansion of macro '__put_user_u64'
136 | __put_user_u64(x, ptr, retval); \
| ^~~~~~~~~~~~~~
arch/sh/include/asm/uaccess.h:72:3: note: in expansion of macro '__put_user_size'
72 | __put_user_size(__pu_val, __pu_addr, (size), \
| ^~~~~~~~~~~~~~~
arch/sh/include/asm/uaccess.h:20:26: note: in expansion of macro '__put_user_check'
20 | #define put_user(x,ptr) __put_user_check((x), (ptr), sizeof(*(ptr)))
| ^~~~~~~~~~~~~~~~
drivers/gpu/drm/drm_property.c:485:7: note: in expansion of macro 'put_user'
485 | put_user(property->values[i], values_ptr + i)) {
| ^~~~~~~~


vim +/asm +204 arch/sh/include/asm/uaccess_32.h

9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 178
0fb19dcb64ec4b include/asm-sh/uaccess_32.h Stuart Menefy 2007-11-30 179 #if defined(CONFIG_CPU_LITTLE_ENDIAN)
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 180 #define __put_user_u64(val,addr,retval) \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 181 ({ \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 182 __asm__ __volatile__( \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 183 "1:\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 184 "mov.l %R1,%2\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 185 "mov.l %S1,%T2\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 186 "2:\n" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 187 ".section .fixup,\"ax\"\n" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 188 "3:\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 189 "mov.l 4f,%0\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 190 "jmp @%0\n\t" \
0fb19dcb64ec4b include/asm-sh/uaccess_32.h Stuart Menefy 2007-11-30 191 " mov %3,%0\n\t" \
0fb19dcb64ec4b include/asm-sh/uaccess_32.h Stuart Menefy 2007-11-30 192 ".balign 4\n" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 193 "4: .long 2b\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 194 ".previous\n" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 195 ".section __ex_table,\"a\"\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 196 ".long 1b, 3b\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 197 ".previous" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 198 : "=r" (retval) \
8b5dba9ea4a3f5 arch/sh/include/asm/uaccess_32.h Florian Fuchs 2026-07-16 199 : "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 200 : "memory"); })
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 201 #else
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 202 #define __put_user_u64(val,addr,retval) \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 203 ({ \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 @204 __asm__ __volatile__( \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 205 "1:\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 206 "mov.l %S1,%2\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 207 "mov.l %R1,%T2\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 208 "2:\n" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 209 ".section .fixup,\"ax\"\n" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 210 "3:\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 211 "mov.l 4f,%0\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 212 "jmp @%0\n\t" \
0fb19dcb64ec4b include/asm-sh/uaccess_32.h Stuart Menefy 2007-11-30 213 " mov %3,%0\n\t" \
0fb19dcb64ec4b include/asm-sh/uaccess_32.h Stuart Menefy 2007-11-30 214 ".balign 4\n" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 215 "4: .long 2b\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 216 ".previous\n" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 217 ".section __ex_table,\"a\"\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 218 ".long 1b, 3b\n\t" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 219 ".previous" \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 220 : "=r" (retval) \
8b5dba9ea4a3f5 arch/sh/include/asm/uaccess_32.h Florian Fuchs 2026-07-16 221 : "r" (val), "o" (__m(addr)), "i" (-EFAULT), "0" (retval) \
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 222 : "memory"); })
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 223 #endif
9b01bd9ee64088 include/asm-sh/uaccess_32.h Paul Mundt 2007-11-10 224

:::::: The code at line 204 was first introduced by commit
:::::: 9b01bd9ee6408846c0553c03fb4b864353a845c9 sh: Split out uaccess.h in to _32 and _64 variants.

:::::: TO: Paul Mundt <lethal@xxxxxxxxxxxx>
:::::: CC: Paul Mundt <lethal@xxxxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki