From patchwork Tue Mar 15 06:46:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Rothwell X-Patchwork-Id: 597370 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3qPQDB31k5z9sds for ; Tue, 15 Mar 2016 17:47:54 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=canb.auug.org.au header.i=@canb.auug.org.au header.b=Z5hYlGxw; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3qPQDB1mGBzDr1k for ; Tue, 15 Mar 2016 17:47:54 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=canb.auug.org.au header.i=@canb.auug.org.au header.b=Z5hYlGxw; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3qPQBf6PDTzDq5d for ; Tue, 15 Mar 2016 17:46:34 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=canb.auug.org.au header.i=@canb.auug.org.au header.b=Z5hYlGxw; dkim-atps=neutral Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 3qPQBf3MqNz9sds; Tue, 15 Mar 2016 17:46:34 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=canb.auug.org.au; s=201601; t=1458024394; bh=JHg20Bswfz0AHfYOQDd3eeoF5NfG3/oAT0a8J/W7Hxg=; h=Date:From:To:Cc:Subject:From; b=Z5hYlGxw5i6Zl1NHo5WF6eeGaElQCXZkiuq/2KCIGGT2BWhruf6a0CS2F2bjRuJoQ LM5JQN4k1RlijtsX55GNuls2Z8wYDQNIQ63o9YZdA4sYOOCMb9wSvtTo2j/swNzlDY 39iGH71fPMZ0Jn+AVUlkWOhM0kl0cnj/fIDJtF+g= Date: Tue, 15 Mar 2016 17:46:34 +1100 From: Stephen Rothwell To: Benjamin LaHaise Subject: linux-next: build failure after merge of the aio tree Message-ID: <20160315174634.6766cd88@canb.auug.org.au> MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-next@vger.kernel.org, Al Viro , linuxppc-dev@lists.ozlabs.org, Christoph Hellwig Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Benjamin, After merging the aio tree, today's linux-next build (powerpc ppc44x_defconfig) failed like this: fs/built-in.o: In function `aio_thread_op_foo_at': aio.c:(.text+0x4dab4): undefined reference to `__get_user_bad' aio.c:(.text+0x4daec): undefined reference to `__get_user_bad' Caused by commit 150a0b4905f1 ("aio: add support for async openat()") despite commit d2f7a973e11e ("aio: don't use __get_user() for 64 bit values") This is due to a bug in the powerpc __get_user_check() macro (the return value is defined to be "unsigned long" which is only 32 bits on a 32 bit platform). I applied the patch below which seems to help (Michael, what do you think?), but given Al's and Christoph's reactions, I am inclined to remove the aio tree from tomorrow and maybe it can be revisited after the merge window. From: Stephen Rothwell Date: Tue, 15 Mar 2016 16:36:06 +1100 Subject: [PATCH] powerpc: fix get_user for 64 bit typs on 32 bit platforms solution borrowed from the x86 uaccess.h Signed-off-by: Stephen Rothwell --- arch/powerpc/include/asm/uaccess.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index b7c20f0b8fbe..52262b2f37fc 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -261,10 +261,13 @@ do { \ } \ } while (0) +#define __inttype(x) \ + __typeof__(__builtin_choose_expr(sizeof(x) > sizeof(0UL), 0ULL, 0UL)) + #define __get_user_nocheck(x, ptr, size) \ ({ \ long __gu_err; \ - unsigned long __gu_val; \ + __inttype(*(ptr)) __gu_val; \ __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ __chk_user_ptr(ptr); \ if (!is_kernel_addr((unsigned long)__gu_addr)) \ @@ -277,7 +280,7 @@ do { \ #define __get_user_check(x, ptr, size) \ ({ \ long __gu_err = -EFAULT; \ - unsigned long __gu_val = 0; \ + __inttype(*(ptr)) __gu_val = 0; \ __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ might_fault(); \ if (access_ok(VERIFY_READ, __gu_addr, (size))) \ @@ -289,7 +292,7 @@ do { \ #define __get_user_nosleep(x, ptr, size) \ ({ \ long __gu_err; \ - unsigned long __gu_val; \ + __inttype(*(ptr)) __gu_val; \ __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ __chk_user_ptr(ptr); \ __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \