Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp735322ybl; Fri, 9 Aug 2019 13:03:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqw5lx9vWCZKXm+2DRYGHhwSq19qkyTnb1c6NwyI6GL96PJjGzHqXb0o+SXTTJRtXKhraHH2 X-Received: by 2002:a17:90a:36e4:: with SMTP id t91mr10733131pjb.22.1565381014197; Fri, 09 Aug 2019 13:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565381014; cv=none; d=google.com; s=arc-20160816; b=VdVkd61TTr+yzpLyCEd5QCZo1qn4ibHtc1zD+h2NKEyETNLgJoVmqThCDiQPoGkeDr sOsQQjM27/6WXOIZEAS1wzHAGAiZDP/NVI23r6PXu5uq54W/cOSuBIwV3Wl187af/lBR RMjal7dAj3Btp193XP2uOEhbNQI994ngM7ZOxacSGCsTkWngUUQQ5owd94f6ZBgB439M WD56sw8iL/UKO5CyZkmz4of3XE9pSnDiFcvlKgFvo5tgcAKwXa05ePtdP7O3upsuot0k 0sdyKUy1xhpqGJKxnEJJFc1xLHV0v5oqUDUk3L5dokcNgjKwhHc/MLTBSTRrSRTv8KgJ AD7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-disposition:mime-version:user-agent:in-reply-to:references :subject:cc:to:from:message-id:date; bh=OzI26GOMEk8/t7K6VqugpHIlptnazDnIWHTazNYEnLI=; b=WAAs9kIKtAxFIfUImU3jUCBvMkCu4jsM5Mu1iQ95QVtEJR6+VMpkqep6rUV9kTFFRM 4ZlIwbiKEtC00rPqAmlFgpar4Aq1Mf3ov+1TdlJYj6Pjz/7sdiNTbO3H6gM5CrXpEOgI qOtW9fN79OSpdkj+D/SRveiWtvXqiFau/PeGtE8yL6L12Qbw6jRu9KD4NnPS2j1tZolY RLnOfGNRSbwt6eH3EOGycNH0M3cK4nE2seMBViOCG6hYpB4T1s87U/v9wudM53Rkutjw CCE8lP0skd8tDaRh/1lWdL4jEkUrFIg8EL/CUgJOx9WM1QuT3aACk/ptJyZY2TvnWXHI 7+7w== 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 b5si46803015pgc.396.2019.08.09.13.03.18; Fri, 09 Aug 2019 13:03:34 -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 S1726219AbfHIUCl convert rfc822-to-8bit (ORCPT + 99 others); Fri, 9 Aug 2019 16:02:41 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:51731 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbfHIUCk (ORCPT ); Fri, 9 Aug 2019 16:02:40 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 464x3z4F4Tz9vBnX; Fri, 9 Aug 2019 22:02:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id YXoWW-H0Xvcu; Fri, 9 Aug 2019 22:02:39 +0200 (CEST) Received: from vm-hermes.si.c-s.fr (vm-hermes.si.c-s.fr [192.168.25.253]) by pegase1.c-s.fr (Postfix) with ESMTP id 464x3z37Mgz9vBnS; Fri, 9 Aug 2019 22:02:39 +0200 (CEST) Received: by vm-hermes.si.c-s.fr (Postfix, from userid 33) id 855AB98C; Fri, 9 Aug 2019 22:03:01 +0200 (CEST) Received: from mry91-4-88-160-8-182.fbx.proxad.net (mry91-4-88-160-8-182.fbx.proxad.net [88.160.8.182]) by messagerie.si.c-s.fr (Horde Framework) with HTTP; Fri, 09 Aug 2019 22:03:01 +0200 Date: Fri, 09 Aug 2019 22:03:01 +0200 Message-ID: <20190809220301.Horde.AR6y4Bx4WGIq58V9K0En9g4@messagerie.si.c-s.fr> From: Christophe Leroy To: Arnd Bergmann Cc: clang-built-linux , Linux Kernel Mailing List , linuxppc-dev , Paul Mackerras , Benjamin Herrenschmidt , kbuild test robot , Nathan Chancellor , Segher Boessenkool , Michael Ellerman , Nick Desaulniers Subject: Re: [PATCH] powerpc: fix inline asm constraints for dcbz References: <87h873zs88.fsf@concordia.ellerman.id.au> <20190809182106.62130-1-ndesaulniers@google.com> In-Reply-To: User-Agent: Internet Messaging Program (IMP) H5 (6.2.3) Content-Type: text/plain; charset=UTF-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Christophe