From mboxrd@z Thu Jan 1 00:00:00 1970 From: mark.rutland@arm.com (Mark Rutland) Date: Tue, 2 May 2017 18:29:48 +0100 Subject: [PATCH] arm64: Fix multiple 'asm-operand-widths' warnings In-Reply-To: <20170501212622.153720-1-mka@chromium.org> References: <20170501212622.153720-1-mka@chromium.org> Message-ID: <20170502172948.GE28132@leverpostej> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi, On Mon, May 01, 2017 at 02:26:22PM -0700, Matthias Kaehlcke wrote: > diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h > index 5308d696311b..7db143689694 100644 > --- a/arch/arm64/include/asm/uaccess.h > +++ b/arch/arm64/include/asm/uaccess.h > @@ -302,7 +302,7 @@ do { \ > " .previous\n" \ > _ASM_EXTABLE(1b, 3b) \ > : "+r" (err) \ > - : "r" (x), "r" (addr), "i" (-EFAULT)) > + : "r" ((__u64)x), "r" (addr), "i" (-EFAULT)) > For reference, do you have the warning for this case to hand? In __put_user_err() we make __pu_val the same type as *ptr, then we switch on sizeof(*ptr), and pass __pu_val to __put_user_asm(), as x. For cases 1, 2, and 4, we use "%w" as the register template. So I can't see why we'd need this cast in __put_user_err(). I must be missing something. Thanks, Mark. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751480AbdEBRaX (ORCPT ); Tue, 2 May 2017 13:30:23 -0400 Received: from foss.arm.com ([217.140.101.70]:47522 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750896AbdEBRaT (ORCPT ); Tue, 2 May 2017 13:30:19 -0400 Date: Tue, 2 May 2017 18:29:48 +0100 From: Mark Rutland To: Matthias Kaehlcke Cc: Catalin Marinas , Will Deacon , Ard Biesheuvel , Christoffer Dall , Marc Zyngier , Vladimir Murzin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Grant Grundler , Greg Hackmann , Michael Davidson Subject: Re: [PATCH] arm64: Fix multiple 'asm-operand-widths' warnings Message-ID: <20170502172948.GE28132@leverpostej> References: <20170501212622.153720-1-mka@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170501212622.153720-1-mka@chromium.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, May 01, 2017 at 02:26:22PM -0700, Matthias Kaehlcke wrote: > diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h > index 5308d696311b..7db143689694 100644 > --- a/arch/arm64/include/asm/uaccess.h > +++ b/arch/arm64/include/asm/uaccess.h > @@ -302,7 +302,7 @@ do { \ > " .previous\n" \ > _ASM_EXTABLE(1b, 3b) \ > : "+r" (err) \ > - : "r" (x), "r" (addr), "i" (-EFAULT)) > + : "r" ((__u64)x), "r" (addr), "i" (-EFAULT)) > For reference, do you have the warning for this case to hand? In __put_user_err() we make __pu_val the same type as *ptr, then we switch on sizeof(*ptr), and pass __pu_val to __put_user_asm(), as x. For cases 1, 2, and 4, we use "%w" as the register template. So I can't see why we'd need this cast in __put_user_err(). I must be missing something. Thanks, Mark.