[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <201603100333.YF09BvSw%fengguang.wu@intel.com>
Date: Thu, 10 Mar 2016 03:41:45 +0800
From: kbuild test robot <lkp@...el.com>
To: Benjamin LaHaise <bcrl@...ck.org>
Cc: kbuild-all@...org, "H. Peter Anvin" <hpa@...or.com>,
Ingo Molnar <mingo@...hat.com>,
Russell King <rmk@....linux.org.uk>,
Thomas Gleixner <tglx@...utronix.de>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86_32: add support for 64 bit __get_user() v2
Hi Benjamin,
[auto build test WARNING on tip/x86/core]
[also build test WARNING on v4.5-rc7 next-20160309]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Benjamin-LaHaise/x86_32-add-support-for-64-bit-__get_user-v2/20160310-033507
config: i386-tinyconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
In file included from arch/x86/include/asm/sections.h:5:0,
from arch/x86/include/asm/hw_irq.h:26,
from include/linux/irq.h:418,
from arch/x86/include/asm/hardirq.h:5,
from include/linux/hardirq.h:8,
from include/linux/memcontrol.h:24,
from include/linux/tracehook.h:53,
from arch/x86/kernel/ptrace.c:14:
arch/x86/kernel/ptrace.c: In function 'genregs_set':
>> arch/x86/kernel/ptrace.c:530:28: warning: operation on 'u' may be undefined [-Wsequence-point]
ret = __get_user(word, u++);
^
arch/x86/include/asm/uaccess.h:451:51: note: in definition of macro '__m'
#define __m(x) (*(struct __large_struct __user *)(x))
^
>> arch/x86/include/asm/uaccess.h:378:3: note: in expansion of macro '__get_user_asm_u64'
__get_user_asm_u64(x, ptr, retval, errret); \
^
>> arch/x86/include/asm/uaccess.h:443:2: note: in expansion of macro '__get_user_size'
__get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT); \
^
>> arch/x86/include/asm/uaccess.h:512:2: note: in expansion of macro '__get_user_nocheck'
__get_user_nocheck((x), (ptr), sizeof(*(ptr)))
^
>> arch/x86/kernel/ptrace.c:530:10: note: in expansion of macro '__get_user'
ret = __get_user(word, u++);
^
--
In file included from lib/bitmap.c:17:0:
lib/bitmap.c: In function '__bitmap_parse':
>> lib/bitmap.c:377:27: warning: operation on 'ubuf' may be undefined [-Wsequence-point]
if (__get_user(c, ubuf++))
^
arch/x86/include/asm/uaccess.h:451:51: note: in definition of macro '__m'
#define __m(x) (*(struct __large_struct __user *)(x))
^
>> arch/x86/include/asm/uaccess.h:378:3: note: in expansion of macro '__get_user_asm_u64'
__get_user_asm_u64(x, ptr, retval, errret); \
^
>> arch/x86/include/asm/uaccess.h:443:2: note: in expansion of macro '__get_user_size'
__get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT); \
^
>> arch/x86/include/asm/uaccess.h:512:2: note: in expansion of macro '__get_user_nocheck'
__get_user_nocheck((x), (ptr), sizeof(*(ptr)))
^
>> lib/bitmap.c:377:9: note: in expansion of macro '__get_user'
if (__get_user(c, ubuf++))
^
lib/bitmap.c: In function '__bitmap_parselist':
lib/bitmap.c:525:27: warning: operation on 'ubuf' may be undefined [-Wsequence-point]
if (__get_user(c, ubuf++))
^
arch/x86/include/asm/uaccess.h:451:51: note: in definition of macro '__m'
#define __m(x) (*(struct __large_struct __user *)(x))
^
>> arch/x86/include/asm/uaccess.h:378:3: note: in expansion of macro '__get_user_asm_u64'
__get_user_asm_u64(x, ptr, retval, errret); \
^
>> arch/x86/include/asm/uaccess.h:443:2: note: in expansion of macro '__get_user_size'
__get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT); \
^
>> arch/x86/include/asm/uaccess.h:512:2: note: in expansion of macro '__get_user_nocheck'
__get_user_nocheck((x), (ptr), sizeof(*(ptr)))
^
lib/bitmap.c:525:9: note: in expansion of macro '__get_user'
if (__get_user(c, ubuf++))
^
vim +/__get_user_asm_u64 +378 arch/x86/include/asm/uaccess.h
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 372 __get_user_asm(x, ptr, retval, "w", "w", "=r", errret); \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 373 break; \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 374 case 4: \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 375 __get_user_asm(x, ptr, retval, "l", "k", "=r", errret); \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 376 break; \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 377 case 8: \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 @378 __get_user_asm_u64(x, ptr, retval, errret); \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 379 break; \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 380 default: \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 381 (x) = __get_user_bad(); \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 382 } \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 383 } while (0)
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 384
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 385 #define __get_user_asm(x, addr, err, itype, rtype, ltype, errret) \
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 386 asm volatile("\n" \
63bcff2a arch/x86/include/asm/uaccess.h H. Peter Anvin 2012-09-21 387 "1: mov"itype" %2,%"rtype"1\n" \
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 388 "2:\n" \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 389 ".section .fixup,\"ax\"\n" \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 390 "3: mov %3,%0\n" \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 391 " xor"itype" %"rtype"1,%"rtype"1\n" \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 392 " jmp 2b\n" \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 393 ".previous\n" \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 394 _ASM_EXTABLE(1b, 3b) \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 395 : "=r" (err), ltype(x) \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 396 : "m" (__m(addr)), "i" (errret), "0" (err))
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 397
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 398 /*
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 399 * This doesn't do __uaccess_begin/end - the exception handling
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 400 * around it must do that.
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 401 */
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 402 #define __get_user_size_ex(x, ptr, size) \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 403 do { \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 404 __chk_user_ptr(ptr); \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 405 switch (size) { \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 406 case 1: \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 407 __get_user_asm_ex(x, ptr, "b", "b", "=q"); \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 408 break; \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 409 case 2: \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 410 __get_user_asm_ex(x, ptr, "w", "w", "=r"); \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 411 break; \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 412 case 4: \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 413 __get_user_asm_ex(x, ptr, "l", "k", "=r"); \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 414 break; \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 415 case 8: \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 416 __get_user_asm_ex_u64(x, ptr); \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 417 break; \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 418 default: \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 419 (x) = __get_user_bad(); \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 420 } \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 421 } while (0)
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 422
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 423 #define __get_user_asm_ex(x, addr, itype, rtype, ltype) \
5e88353d arch/x86/include/asm/uaccess.h H. Peter Anvin 2012-09-21 424 asm volatile("1: mov"itype" %1,%"rtype"0\n" \
5e88353d arch/x86/include/asm/uaccess.h H. Peter Anvin 2012-09-21 425 "2:\n" \
535c0c34 arch/x86/include/asm/uaccess.h H. Peter Anvin 2012-04-20 426 _ASM_EXTABLE_EX(1b, 2b) \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 427 : ltype(x) : "m" (__m(addr)))
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 428
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 429 #define __put_user_nocheck(x, ptr, size) \
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 430 ({ \
16855f87 arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2008-12-08 431 int __pu_err; \
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 432 __uaccess_begin(); \
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 433 __put_user_size((x), (ptr), (size), __pu_err, -EFAULT); \
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 434 __uaccess_end(); \
a76cf66e arch/x86/include/asm/uaccess.h Andy Lutomirski 2015-10-05 435 __builtin_expect(__pu_err, 0); \
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 436 })
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 437
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 438 #define __get_user_nocheck(x, ptr, size) \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 439 ({ \
16855f87 arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2008-12-08 440 int __gu_err; \
7dd119d0 arch/x86/include/asm/uaccess.h Benjamin LaHaise 2016-03-09 441 __inttype(*(ptr)) __gu_val; \
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 442 __uaccess_begin(); \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 @443 __get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT); \
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 444 __uaccess_end(); \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 445 (x) = (__force __typeof__(*(ptr)))__gu_val; \
a76cf66e arch/x86/include/asm/uaccess.h Andy Lutomirski 2015-10-05 446 __builtin_expect(__gu_err, 0); \
3f168221 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 447 })
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 448
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 449 /* FIXME: this hack is definitely wrong -AK */
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 450 struct __large_struct { unsigned long buf[100]; };
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 @451 #define __m(x) (*(struct __large_struct __user *)(x))
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 452
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 453 /*
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 454 * Tell gcc we read from memory instead of writing: this is because
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 455 * we do not write to any memory gcc knows about, so there are no
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 456 * aliasing issues.
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 457 */
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 458 #define __put_user_asm(x, addr, err, itype, rtype, ltype, errret) \
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 459 asm volatile("\n" \
63bcff2a arch/x86/include/asm/uaccess.h H. Peter Anvin 2012-09-21 460 "1: mov"itype" %"rtype"1,%2\n" \
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 461 "2:\n" \
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 462 ".section .fixup,\"ax\"\n" \
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 463 "3: mov %3,%0\n" \
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 464 " jmp 2b\n" \
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 465 ".previous\n" \
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 466 _ASM_EXTABLE(1b, 3b) \
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 467 : "=r"(err) \
dc70ddf4 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 468 : ltype(x), "m" (__m(addr)), "i" (errret), "0" (err))
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 469
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 470 #define __put_user_asm_ex(x, addr, itype, rtype, ltype) \
5e88353d arch/x86/include/asm/uaccess.h H. Peter Anvin 2012-09-21 471 asm volatile("1: mov"itype" %"rtype"0,%1\n" \
5e88353d arch/x86/include/asm/uaccess.h H. Peter Anvin 2012-09-21 472 "2:\n" \
535c0c34 arch/x86/include/asm/uaccess.h H. Peter Anvin 2012-04-20 473 _ASM_EXTABLE_EX(1b, 2b) \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 474 : : ltype(x), "m" (__m(addr)))
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 475
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 476 /*
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 477 * uaccess_try and catch
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 478 */
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 479 #define uaccess_try do { \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 480 current_thread_info()->uaccess_err = 0; \
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 481 __uaccess_begin(); \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 482 barrier();
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 483
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 484 #define uaccess_catch(err) \
11f1a4b9 arch/x86/include/asm/uaccess.h Linus Torvalds 2015-12-17 485 __uaccess_end(); \
4fc34901 arch/x86/include/asm/uaccess.h Andy Lutomirski 2011-11-07 486 (err) |= (current_thread_info()->uaccess_err ? -EFAULT : 0); \
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 487 } while (0)
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 488
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 489 /**
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 490 * __get_user: - Get a simple variable from user space, with less checking.
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 491 * @x: Variable to store result.
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 492 * @ptr: Source address, in user space.
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 493 *
b3c395ef arch/x86/include/asm/uaccess.h David Hildenbrand 2015-05-11 494 * Context: User context only. This function may sleep if pagefaults are
b3c395ef arch/x86/include/asm/uaccess.h David Hildenbrand 2015-05-11 495 * enabled.
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 496 *
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 497 * This macro copies a single simple variable from user space to kernel
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 498 * space. It supports simple types like char and int, but not larger
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 499 * data types like structures or arrays.
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 500 *
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 501 * @ptr must have pointer-to-simple-variable type, and the result of
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 502 * dereferencing @ptr must be assignable to @x without a cast.
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 503 *
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 504 * Caller must check the pointer with access_ok() before calling this
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 505 * function.
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 506 *
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 507 * Returns zero on success, or -EFAULT on error.
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 508 * On error, the variable @x is set to zero.
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 509 */
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 510
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 511 #define __get_user(x, ptr) \
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 @512 __get_user_nocheck((x), (ptr), sizeof(*(ptr)))
fe40c0af arch/x86/include/asm/uaccess.h Hiroshi Shimamoto 2009-01-23 513
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 514 /**
8cb834e9 include/asm-x86/uaccess.h Glauber Costa 2008-06-25 515 * __put_user: - Write a simple value into user space, with less checking.
:::::: The code at line 378 was first introduced by commit
:::::: 3f168221167ca7a844fde3bf58e1c7ca0bf9741e x86: merge __get_user_asm and its users.
:::::: TO: Glauber Costa <gcosta@...hat.com>
:::::: CC: Ingo Molnar <mingo@...e.hu>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Download attachment ".config.gz" of type "application/octet-stream" (6205 bytes)
Powered by blists - more mailing lists