Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2990962yba; Tue, 16 Apr 2019 02:14:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrGwXrvLQ3c4qVLJ2AbtrvCwR2bgavJIOhkJPZ9wyJuoblUryImVEbbxZiDNP4nD70zaL9 X-Received: by 2002:a17:902:e20e:: with SMTP id ce14mr81874014plb.193.1555406079471; Tue, 16 Apr 2019 02:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555406079; cv=none; d=google.com; s=arc-20160816; b=TnDWqxzGFiilNfcmGLWebh1KW7ScOTHgKmblQlPLsxFJKAAle51T9ppFGbTVgh1Gs3 cntjLnl9CiIfXVuYmcKHOKnl+RAqb7bOssVt3NIiozqyNRRQx4zk9Xp5Evs6/1wAq8db +asnveSq3uMXeW5LR/aDi8wBPjrfgLJSrfS6viRq/+8c50QNU1rAu61jyUf8420E3GMy GTjNyYRuu3i2tOIPJVk8d7VXPp9t0cVvUk5Wd2nKji1JGJjmjjB2n480rJL8HFLvU+6L sKuvPANiW+cN4lWZK7ouM5xmKCIE/QfsXpiNdn1d/KJueXo5dhhZCWQe2JvF3oTmKsaS fOeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/it18GaVL0sGz99oxFYW39Fcn5K7LHe4pzLjz4fxQ5k=; b=rpzchokOrLoGRS8ivyc7veifazZ7VlJCIP1/eDfK3XZYfRbb7j0jm+Q6DkvGbyEW+R eHfocDiqO9uTNegO3pHd1nWMkheXaDn9ime1+Rtly4MFF61DJG1TZ1gFBli/6UhG8z4Q p9d9bi4HGQGjRoZJjLRVIfm66r3Wgi93kkeZEam9WyMDvl1aOClXagAvYoExViSBHjPX hYyEGwgYJ+Aki0xh+2x7DpBGSH2CYMzAVyQhGNwSlKXKa9gXJD5CIhJlEeWHqf3gqLIs 4c8EbEdYmbprzbXrdRRf2Z7Qt1iixUGuJpcEdi+I7efdFFeYrgWfDOEbXKWf+QTS9Jv9 Vchw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r16si37999431pfh.13.2019.04.16.02.14.23; Tue, 16 Apr 2019 02:14:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728556AbfDPJNr (ORCPT + 99 others); Tue, 16 Apr 2019 05:13:47 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50106 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726160AbfDPJNq (ORCPT ); Tue, 16 Apr 2019 05:13:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1FE8AEBD; Tue, 16 Apr 2019 02:13:46 -0700 (PDT) Received: from fuggles.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0F62C3F68F; Tue, 16 Apr 2019 02:13:44 -0700 (PDT) Date: Tue, 16 Apr 2019 10:13:40 +0100 From: Will Deacon To: Nathan Chancellor Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, stable@kernel.org Subject: Re: [PATCH 4.9 72/76] arm64: futex: Fix FUTEX_WAKE_OP atomic ops with non-zero result value Message-ID: <20190416091340.GA31579@fuggles.cambridge.arm.com> References: <20190415183707.712011689@linuxfoundation.org> <20190415183729.170980546@linuxfoundation.org> <20190415220151.GA23056@archlinux-i9> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190415220151.GA23056@archlinux-i9> User-Agent: Mutt/1.11.1+86 (6f28e57d73f2) () Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 15, 2019 at 03:01:51PM -0700, Nathan Chancellor wrote: > On Mon, Apr 15, 2019 at 08:44:36PM +0200, Greg Kroah-Hartman wrote: > > From: Will Deacon [...] > > @@ -53,29 +53,29 @@ > > static inline int > > arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *uaddr) > > { > > - int oldval = 0, ret, tmp; > > + int oldval, ret, tmp; > > > > pagefault_disable(); > > > > switch (op) { > > case FUTEX_OP_SET: > > - __futex_atomic_op("mov %w0, %w4", > > + __futex_atomic_op("mov %w3, %w4", > > ret, oldval, uaddr, tmp, oparg); > > break; > > case FUTEX_OP_ADD: > > - __futex_atomic_op("add %w0, %w1, %w4", > > + __futex_atomic_op("add %w3, %w1, %w4", > > ret, oldval, uaddr, tmp, oparg); > > break; > > case FUTEX_OP_OR: > > - __futex_atomic_op("orr %w0, %w1, %w4", > > + __futex_atomic_op("orr %w3, %w1, %w4", > > ret, oldval, uaddr, tmp, oparg); > > break; > > case FUTEX_OP_ANDN: > > - __futex_atomic_op("and %w0, %w1, %w4", > > + __futex_atomic_op("and %w3, %w1, %w4", > > ret, oldval, uaddr, tmp, ~oparg); > > break; > > case FUTEX_OP_XOR: > > - __futex_atomic_op("eor %w0, %w1, %w4", > > + __futex_atomic_op("eor %w3, %w1, %w4", > > ret, oldval, uaddr, tmp, oparg); > > break; > > default: > > > > > > This causes a (false) build warning with AOSP's GCC 4.9.4 (which is > used to build nearly all arm64 Android kernels before 4.14): > > CC kernel/futex.o > ../kernel/futex.c: In function 'do_futex': > ../kernel/futex.c:1492:17: warning: 'oldval' may be used uninitialized in this function [-Wmaybe-uninitialized] > return oldval == cmparg; > ^ > In file included from ../kernel/futex.c:69:0: > ../arch/arm64/include/asm/futex.h:56:6: note: 'oldval' was declared here > int oldval, ret, tmp; > ^ > > The only reason I bring this up is Qualcomm based kernels have a Python > script that emulates -Werror, meaning this will be fatal for a large > number of kernels, when this eventually gets merged into them. Thanks. Does restoring the initial assignment of 0 suppress the bogus warning? If so, please could you send a patch on top for stable (assuming Greg is ok with the simple change for this)? Will