Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1000539ybj; Tue, 5 May 2020 11:10:23 -0700 (PDT) X-Google-Smtp-Source: APiQypKw0kbFIXkojnx6YZVi3VGZtbpYkQb3XQMbCbWD/kMW/nS3fLqEHMz5Lhq79m1Gsjleu46u X-Received: by 2002:a17:906:b217:: with SMTP id p23mr3878585ejz.136.1588702223292; Tue, 05 May 2020 11:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588702223; cv=none; d=google.com; s=arc-20160816; b=P2ZGSCS92qX1iJuJfcScoe+btMGgC6O/WIYJVDWtKO5E1J1+yYb1ehaR8YAsw9V9pQ Tg+0xV8sFs2JCGPWT+4hqdS/TLnVe3tmV7MHcubS80vKQN09uSLFrN9IvCT9bqFSNODV OLpEfHs/n7B1EnvxhNbElZlxfr0SFfh7AEfmu3uAOrYaTF35Nd1+qLO0igkrP24SOlJQ LXuu3qUIDBM/acLjqdtzgwQX+GEsCP4MseWjjfCJ7eF0z6iPE8bPbZiME3BUdA7DXWjs EX3xHhjIsC5/U4dzeh2T/IJvknQJXBBupgnn6IrJnx+4gdpLl97MKE3McsMZ3IKaNMrq yZ4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature:dkim-filter; bh=4cVMSAo5+1hI6OdDCminTspOqusfTES7OMmVmqp4XjQ=; b=K697p0lZaWb4Q+1OLz45Ig6Zi1XwZww4U2wqfxqKZsZYo1ip4Z+VFFwGUG7ky3U+KM 5up69c9iqg8qBrG7/c2Q1EZ0LQHaeZQfaBfEyCgNq2eJ+TNSLLb1s7hckxBBPRwOQRKn qktN3bpQSNA9sWuHH1ag01eywVu4S9UDE07cgrKtCaD8oJiDAMpPCtcaLygJa0Me7y8m 19+A8YKMhkU9c0LqJmhiYPxfROZf2oe/46A6R4MQVbccWKH04tO1S17JYlyzn8iYt9sr uE5naUT7erz7NULjmA/8bSeBHYuP16M8ZO7oydwHvVX4uzAw6P1urAIzBucMSjKmIihd uYOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@zytor.com header.s=2020042201 header.b=Nhf5+JWv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si1729199edx.62.2020.05.05.11.09.59; Tue, 05 May 2020 11:10:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@zytor.com header.s=2020042201 header.b=Nhf5+JWv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730726AbgEESIM (ORCPT + 99 others); Tue, 5 May 2020 14:08:12 -0400 Received: from terminus.zytor.com ([198.137.202.136]:57697 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729315AbgEESIL (ORCPT ); Tue, 5 May 2020 14:08:11 -0400 Received: from [172.27.9.0] (c-73-231-201-241.hsd1.ca.comcast.net [73.231.201.241]) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id 045I7QkG2666886 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Tue, 5 May 2020 11:07:27 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 045I7QkG2666886 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2020042201; t=1588702047; bh=4cVMSAo5+1hI6OdDCminTspOqusfTES7OMmVmqp4XjQ=; h=Date:In-Reply-To:References:Subject:To:CC:From:From; b=Nhf5+JWvcVJBl3eGfQramD8sznodcvqRcLHWQ0zVAir5IoZp+WIZPnToDoDHsX//n SsX499ThiXg4yy82lq+kfDM5g/TOw+rMstw1/3So72et/eB1Y698rxsg85FJ8Xt+KA 0rmUPKiYleJp4G4EUCJq0EbQbYQtjnioah8uauPjrrhCy1lw53QU9NFgpvA5aOGcqc o7r6z6jh9H49TzsFT1P7VRnDP/5aBzkcu7CCAwWcZPGCAc56Fc54R8AlHYtq/QhA+h SnPob6TTm7PQsUen9kZJSMVkhc8mMlnpz89ymMzf0xc5zPGrNOkuueiQLhobKEPiMD B15Jhs20yU7AA== Date: Tue, 05 May 2020 11:07:24 -0700 User-Agent: K-9 Mail for Android In-Reply-To: <20200505174423.199985-1-ndesaulniers@google.com> References: <20200505174423.199985-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] x86: bitops: fix build regression To: Nick Desaulniers , Thomas Gleixner , Ingo Molnar , Borislav Petkov CC: Sedat Dilek , stable@vger.kernel.org, Jesse Brandeburg , "kernelci . org bot" , Andy Shevchenko , Ilie Halip , x86@kernel.org, Marco Elver , "Paul E. McKenney" , "Peter Zijlstra (Intel)" , Daniel Axtens , Masahiro Yamada , Luc Van Oostenryck , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com From: hpa@zytor.com Message-ID: <8A776DBC-03AF-485B-9AA6-5920E3C4ACB2@zytor.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On May 5, 2020 10:44:22 AM PDT, Nick Desaulniers wrote: >From: Sedat Dilek > >It turns out that if your config tickles __builtin_constant_p via >differences in choices to inline or not, this now produces invalid >assembly: > >$ cat foo=2Ec >long a(long b, long c) { > asm("orb\t%1, %0" : "+q"(c): "r"(b)); > return c; >} >$ gcc foo=2Ec >foo=2Ec: Assembler messages: >foo=2Ec:2: Error: `%rax' not allowed with `orb' > >The "q" constraint only has meanting on -m32 otherwise is treated as >"r"=2E > >This is easily reproducible via Clang+CONFIG_STAGING=3Dy+CONFIG_VT6656=3D= m, >or Clang+allyesconfig=2E > >Keep the masking operation to appease sparse (`make C=3D1`), add back the >cast in order to properly select the proper 8b register alias=2E > > [Nick: reworded] > >Cc: stable@vger=2Ekernel=2Eorg >Cc: Jesse Brandeburg >Link: https://github=2Ecom/ClangBuiltLinux/linux/issues/961 >Link: https://lore=2Ekernel=2Eorg/lkml/20200504193524=2EGA221287@google= =2Ecom/ >Fixes: 1651e700664b4 ("x86: Fix bitops=2Eh warning with a moved cast") >Reported-by: Sedat Dilek >Reported-by: kernelci=2Eorg bot >Suggested-by: Andy Shevchenko >Suggested-by: Ilie Halip >Tested-by: Sedat Dilek >Signed-off-by: Sedat Dilek >Signed-off-by: Nick Desaulniers >--- > arch/x86/include/asm/bitops=2Eh | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/arch/x86/include/asm/bitops=2Eh >b/arch/x86/include/asm/bitops=2Eh >index b392571c1f1d=2E=2E139122e5b25b 100644 >--- a/arch/x86/include/asm/bitops=2Eh >+++ b/arch/x86/include/asm/bitops=2Eh >@@ -54,7 +54,7 @@ arch_set_bit(long nr, volatile unsigned long *addr) > if (__builtin_constant_p(nr)) { > asm volatile(LOCK_PREFIX "orb %1,%0" > : CONST_MASK_ADDR(nr, addr) >- : "iq" (CONST_MASK(nr) & 0xff) >+ : "iq" ((u8)(CONST_MASK(nr) & 0xff)) > : "memory"); > } else { > asm volatile(LOCK_PREFIX __ASM_SIZE(bts) " %1,%0" >@@ -74,7 +74,7 @@ arch_clear_bit(long nr, volatile unsigned long *addr) > if (__builtin_constant_p(nr)) { > asm volatile(LOCK_PREFIX "andb %1,%0" > : CONST_MASK_ADDR(nr, addr) >- : "iq" (CONST_MASK(nr) ^ 0xff)); >+ : "iq" ((u8)(CONST_MASK(nr) ^ 0xff))); > } else { > asm volatile(LOCK_PREFIX __ASM_SIZE(btr) " %1,%0" > : : RLONG_ADDR(addr), "Ir" (nr) : "memory"); Drop & 0xff and change ^ 0xff to ~=2E The redundancy is confusing=2E --=20 Sent from my Android device with K-9 Mail=2E Please excuse my brevity=2E