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=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS 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 515D8C43387 for ; Mon, 7 Jan 2019 18:17:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 166C22173C for ; Mon, 7 Jan 2019 18:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727918AbfAGSRE (ORCPT ); Mon, 7 Jan 2019 13:17:04 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43266 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726540AbfAGSRD (ORCPT ); Mon, 7 Jan 2019 13:17:03 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 63B2C7F3E8; Mon, 7 Jan 2019 18:16:57 +0000 (UTC) Received: from redhat.com (ovpn-122-143.rdu2.redhat.com [10.10.122.143]) by smtp.corp.redhat.com (Postfix) with SMTP id 968A084EA; Mon, 7 Jan 2019 18:16:50 +0000 (UTC) Date: Mon, 7 Jan 2019 13:16:50 -0500 From: "Michael S. Tsirkin" To: Will Deacon 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: <20190107131350-mutt-send-email-mst@kernel.org> References: <20190102205715.14054-1-mst@redhat.com> <20190102205715.14054-3-mst@redhat.com> <20190107175427.GB22911@fuggles.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190107175427.GB22911@fuggles.cambridge.arm.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 07 Jan 2019 18:17:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 07, 2019 at 05:54:27PM +0000, Will Deacon wrote: > 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 Thanks, I'll drop this patch. From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: [PATCH RFC 2/4] include/linux/compiler.h: allow memory operands Date: Mon, 7 Jan 2019 13:16:50 -0500 Message-ID: <20190107131350-mutt-send-email-mst@kernel.org> References: <20190102205715.14054-1-mst@redhat.com> <20190102205715.14054-3-mst@redhat.com> <20190107175427.GB22911@fuggles.cambridge.arm.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: Will Deacon Return-path: Content-Disposition: inline In-Reply-To: <20190107175427.GB22911@fuggles.cambridge.arm.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 Mon, Jan 07, 2019 at 05:54:27PM +0000, Will Deacon wrote: > 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 Thanks, I'll drop this patch.