Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp849594ybl; Fri, 9 Aug 2019 15:03:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqxf+TxGLopeyGBGvjRZjVqaChJQtZkfdNusOzM98Zhp2eZZ68i9ba51rJoOLi8dsaQ8osPN X-Received: by 2002:a65:5082:: with SMTP id r2mr5691726pgp.170.1565388188925; Fri, 09 Aug 2019 15:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565388188; cv=none; d=google.com; s=arc-20160816; b=SfVrJMQKNNFx8UbRVrxCBMMfoHlrV1jFug+MBZ75f3YEBspdVRyB2ydYQ9VX7iMUXE KgQmL1iOvaa9qkrxHUAf3FWm73ogaejChyDWFTDWce2eRha5UpBxwe1p5Y79vVugC+d9 yqhH2MIIAi0m9/CbVltnHeYVT8jQH2DsHZSiCDfEII//T6JGaWV8JkP9Ufgd9H4OArAf 4wNBTGSc6CvhSDHk5ZI6n6KwssztHgpEh8xU1sPokMDi7BfHld/neK1pdOxS1P3GzadW dbNQFfUnoDUVpGbnpn7K41NLjdRGOYEbKf/SdZEV2onEXQwxCPKM4NH8tvlMZVE1KZ9/ 9r6A== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=eoD+bOpw3+JGZDnZC0/b6xtRtmXnyftAFdMJwcKUM9o=; b=cUXeoxnEz46rVzaDPR7KP01Sxtqp9RrJ+b04jksoF0zfacsd1dpBFTxjEYzRs0ubnU x3M5+gH/EhAFfumvmRO3AigDKtR4XY2xyH/QYuGxvntsU/r8azhkw3uCitPuyzV9Dzrm 1kEH3QUGjH7Vr8bB1wy3mA7mBuk+jJjnMuxK36At3k4C/NwCRSO6X4gGBBRGg/yWH24k 23r0nII2VLUopHqjQ0/h7+sB5tNMBST7fdUWlBbQQbjGp12mp25g9kve/gPPvUQPGI22 6MLmSBwkfuDhh81uhPn8lSN0ZEqyJYGgaG1hZF1VEZ9zyDcAzj11f8YqWtpyG/l6UqP2 V8Jw== 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 b22si5260615pjb.82.2019.08.09.15.02.53; Fri, 09 Aug 2019 15:03:08 -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 S1728492AbfHIWBv (ORCPT + 99 others); Fri, 9 Aug 2019 18:01:51 -0400 Received: from gate.crashing.org ([63.228.1.57]:43934 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726157AbfHIWBu (ORCPT ); Fri, 9 Aug 2019 18:01:50 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x79M0hxV029775; Fri, 9 Aug 2019 17:00:43 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x79M0gEs029774; Fri, 9 Aug 2019 17:00:42 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 9 Aug 2019 17:00:41 -0500 From: Segher Boessenkool To: Christophe Leroy Cc: Arnd Bergmann , clang-built-linux , Linux Kernel Mailing List , linuxppc-dev , Paul Mackerras , Benjamin Herrenschmidt , kbuild test robot , Nathan Chancellor , Michael Ellerman , Nick Desaulniers Subject: Re: [PATCH] powerpc: fix inline asm constraints for dcbz Message-ID: <20190809220041.GO31406@gate.crashing.org> References: <87h873zs88.fsf@concordia.ellerman.id.au> <20190809182106.62130-1-ndesaulniers@google.com> <20190809220301.Horde.AR6y4Bx4WGIq58V9K0En9g4@messagerie.si.c-s.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190809220301.Horde.AR6y4Bx4WGIq58V9K0En9g4@messagerie.si.c-s.fr> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 09, 2019 at 10:03:01PM +0200, Christophe Leroy wrote: > Arnd Bergmann a ?crit?: > > >On Fri, Aug 9, 2019 at 8:21 PM 'Nick Desaulniers' via Clang Built > >Linux wrote: > > > >> static inline void dcbz(void *addr) > >> { > >>- __asm__ __volatile__ ("dcbz %y0" : : "Z"(*(u8 *)addr) : "memory"); > >>+ __asm__ __volatile__ ("dcbz %y0" : "=Z"(*(u8 *)addr) :: "memory"); > >> } > >> > >> static inline void dcbi(void *addr) > >> { > >>- __asm__ __volatile__ ("dcbi %y0" : : "Z"(*(u8 *)addr) : "memory"); > >>+ __asm__ __volatile__ ("dcbi %y0" : "=Z"(*(u8 *)addr) :: "memory"); > >> } > > > >I think the result of the discussion was that an output argument only > >kind-of > >makes sense for dcbz, but for the others it's really an input, and clang is > >wrong in the way it handles the "Z" constraint by making a copy, which it > >doesn't do for "m". > > > >I'm not sure whether it's correct to use "m" instead of "Z" here, which > >would be a better workaround if that works. More importantly though, > >clang really needs to be fixed to handle "Z" correctly. > > As the benefit is null, I think the best is probably to reverse my > original commit until at least CLang is fixed, as initialy suggested > by mpe And what about the other uses of "Z"? Also, if you use C routines (instead of assembler code) for the basic "clear a block" and the like routines, as there have been patches for recently, the benefit is not zero. Segher