Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp650455ybl; Fri, 9 Aug 2019 11:29:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1t5Rf53/2lV8ygnb+joi+Bn4dwgiuEFa15hFXaHraDOR2Zl81k8oidd2BpnK84xp5HdMV X-Received: by 2002:a63:125c:: with SMTP id 28mr18643408pgs.255.1565375395139; Fri, 09 Aug 2019 11:29:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565375395; cv=none; d=google.com; s=arc-20160816; b=CQIliO67Vqj6ctr/iyJdFtDQf9nZ61HV8qiGgGacA/o6gBA4K/4mPNFZRA7+wHQZXy iddAmZ2IVfJEspN3oiXwQ11/oC6pOrmJ1Rcda+7AEuWb6CfIhMf3DMeXx09hIHaRcCMV pA+rbO3iakcGoHxOwV5TnhFlti3W0AS9tTWmpMOQ1iGNGTct7CDcI1GvFfLg4k0zSsEh f8Lb+ZyAFh4kH2/HYsxLil+FfVzLziGoNCXN03U7JzeqL8I/2VGL6lXT/CLjmOczQZNB JeNGidYRJLhu9m0p2OvYYk93l4iwxqBQ9LIrMy74z8fu9KCHuqWFvhIFsICKDmg+pUTW pBkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=meYZAOaqZ5KaoPmXpKdQX8BQbEOPXVSFqQOk/Zs8rsA=; b=FEetubZvVQ8/mLLJXpcpaC0haMaIN4DazPYMOQLNmFX7LSZxc9tKLkkljgGLlWQadn 0Lyvh1grbA+7LXfj8spVy57qFqAnpCPGXnfzXpzzPKNwqV/hGv6i9rHLW8YzXki8R5Lh wsLbw+SE1SJx9N5Dam6QbT4wYvjqd7ezMChJk4/6Ym16TJmXgwozPvaWim2xVZlUx43K NOlL0mU4aMblDt96hNzE0Eb4B00iS441wCpkDtcFGYMZPyN2Ux41WAGeQwXfTfP5XPWa MqODgXSfvlMowUu4FwihKkX0pMREPNuYvIWlBWtLbtzb8tWlehY8hrsdIWukE8HSQQ57 d9Gw== 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 j185si55222643pge.91.2019.08.09.11.29.39; Fri, 09 Aug 2019 11:29:55 -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 S2407217AbfHIS2g (ORCPT + 99 others); Fri, 9 Aug 2019 14:28:36 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:38803 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfHIS2f (ORCPT ); Fri, 9 Aug 2019 14:28:35 -0400 Received: by mail-qk1-f193.google.com with SMTP id u190so8730064qkh.5 for ; Fri, 09 Aug 2019 11:28:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=meYZAOaqZ5KaoPmXpKdQX8BQbEOPXVSFqQOk/Zs8rsA=; b=ce7Y8J51F91Wbnr69zfjOY6ncKZCfRi/gCZIPbQ97bT65NFIuYIkz0iibeXJQcKiGk rKS2TUIfZn8VOk8PHNSDKFqsb4iGeKhTqn396ib6Y+ZblxVNLxjE550+hqwbSuLXpzP4 FxIhS/rXFwkj+C+8stHE7lARA8aIpsxqto5TG6UA45FGkeTccTbNK3KAA7OaI66/iwXw b07cbNMGulJvlgDVmCq1PsD9nmT8yRmqZzivPA5LTq3CAfqyRwo7R2KqLvi5TLAEpfw7 3n8RKHDSODsQ6dEjQl+6ZYbJqO3lPjshGipQq+X2StUYyPnHdPTX5Iq5NfsSRRF/JAL4 hiBg== X-Gm-Message-State: APjAAAXjyHOtN3zvzAA+8ao4Zru7J7yAUjpUs5puBoxxWl2etukbKczX ZeJNYonIazxbFcsqgMMjwO4ijx/WatzFOKsxswOKxJcn X-Received: by 2002:a37:4ac3:: with SMTP id x186mr18866428qka.138.1565375314918; Fri, 09 Aug 2019 11:28:34 -0700 (PDT) MIME-Version: 1.0 References: <87h873zs88.fsf@concordia.ellerman.id.au> <20190809182106.62130-1-ndesaulniers@google.com> In-Reply-To: <20190809182106.62130-1-ndesaulniers@google.com> From: Arnd Bergmann Date: Fri, 9 Aug 2019 20:28:19 +0200 Message-ID: Subject: Re: [PATCH] powerpc: fix inline asm constraints for dcbz To: Nick Desaulniers Cc: Michael Ellerman , christophe leroy , Segher Boessenkool , Nathan Chancellor , kbuild test robot , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev , Linux Kernel Mailing List , clang-built-linux Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Arnd