From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A28CC43387 for ; Mon, 7 Jan 2019 17:54:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EFBFD2070B for ; Mon, 7 Jan 2019 17:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728729AbfAGRye (ORCPT ); Mon, 7 Jan 2019 12:54:34 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:35890 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727367AbfAGRyd (ORCPT ); Mon, 7 Jan 2019 12:54:33 -0500 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 A929C80D; Mon, 7 Jan 2019 09:54:32 -0800 (PST) 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 8E2533F5A0; Mon, 7 Jan 2019 09:54:29 -0800 (PST) Date: Mon, 7 Jan 2019 17:54:27 +0000 From: Will Deacon To: "Michael S. Tsirkin" Cc: linux-kernel@vger.kernel.org, Jason Wang , Alan Stern , Andrea Parri , Peter Zijlstra , Boqun Feng , Nicholas Piggin , David Howells , Jade Alglave , Luc Maranget , "Paul E. McKenney" , Akira Yokosawa , Daniel Lustig , linux-arch@vger.kernel.org, netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, Luc Van Oostenryck , linux-sparse@vger.kernel.org Subject: Re: [PATCH RFC 2/4] include/linux/compiler.h: allow memory operands Message-ID: <20190107175427.GB22911@fuggles.cambridge.arm.com> References: <20190102205715.14054-1-mst@redhat.com> <20190102205715.14054-3-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190102205715.14054-3-mst@redhat.com> 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 Wed, Jan 02, 2019 at 03:57:54PM -0500, Michael S. Tsirkin wrote: > We don't really care whether the variable is in-register > or in-memory. Relax the constraint accordingly. > > Signed-off-by: Michael S. Tsirkin > --- > include/linux/compiler.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/compiler.h b/include/linux/compiler.h > index 1ad367b4cd8d..6601d39e8c48 100644 > --- a/include/linux/compiler.h > +++ b/include/linux/compiler.h > @@ -154,7 +154,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, > #ifndef OPTIMIZER_HIDE_VAR > /* Make the optimizer believe the variable can be manipulated arbitrarily. */ > #define OPTIMIZER_HIDE_VAR(var) \ > - __asm__ ("" : "=r" (var) : "0" (var)) > + __asm__ ("" : "=rm" (var) : "0" (var)) > #endif I think this can break for architectures with write-back addressing modes such as arm, where the "m" constraint is assumed to be evaluated precisely once in the asm block. Will From mboxrd@z Thu Jan 1 00:00:00 1970 From: Will Deacon Subject: Re: [PATCH RFC 2/4] include/linux/compiler.h: allow memory operands Date: Mon, 7 Jan 2019 17:54:27 +0000 Message-ID: <20190107175427.GB22911@fuggles.cambridge.arm.com> References: <20190102205715.14054-1-mst@redhat.com> <20190102205715.14054-3-mst@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Andrea Parri , linux-arch@vger.kernel.org, "Paul E. McKenney" , Peter Zijlstra , Daniel Lustig , Akira Yokosawa , linux-kernel@vger.kernel.org, Nicholas Piggin , virtualization@lists.linux-foundation.org, David Howells , linux-sparse@vger.kernel.org, Alan Stern , netdev@vger.kernel.org, Luc Maranget , Jade Alglave , Boqun Feng , Luc Van Oostenryck To: "Michael S. Tsirkin" Return-path: Content-Disposition: inline In-Reply-To: <20190102205715.14054-3-mst@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: netdev.vger.kernel.org On Wed, Jan 02, 2019 at 03:57:54PM -0500, Michael S. Tsirkin wrote: > We don't really care whether the variable is in-register > or in-memory. Relax the constraint accordingly. > > Signed-off-by: Michael S. Tsirkin > --- > include/linux/compiler.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/compiler.h b/include/linux/compiler.h > index 1ad367b4cd8d..6601d39e8c48 100644 > --- a/include/linux/compiler.h > +++ b/include/linux/compiler.h > @@ -154,7 +154,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val, > #ifndef OPTIMIZER_HIDE_VAR > /* Make the optimizer believe the variable can be manipulated arbitrarily. */ > #define OPTIMIZER_HIDE_VAR(var) \ > - __asm__ ("" : "=r" (var) : "0" (var)) > + __asm__ ("" : "=rm" (var) : "0" (var)) > #endif I think this can break for architectures with write-back addressing modes such as arm, where the "m" constraint is assumed to be evaluated precisely once in the asm block. Will