Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1641259ybj; Wed, 6 May 2020 02:27:45 -0700 (PDT) X-Google-Smtp-Source: APiQypJ8coCIX3G22PlN0FUw3CyFa3J9kYSrSAsaODOgUEf3t4yLBVPgYXRqEPyo6EVvJyHy8xmk X-Received: by 2002:a17:906:3713:: with SMTP id d19mr6210792ejc.111.1588757265202; Wed, 06 May 2020 02:27:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588757265; cv=none; d=google.com; s=arc-20160816; b=NDQQ+bpiB6FNGsyF+s6R+z6opdCxqsgKKqb02WMFeIQOFF2RaulkYbr+0O5HVrw8By niP2GyAOkl5KkENvi4V+q13eQddYYn9OIouHRBtJI3QeGG21abV1W5yNnB7OKkXJpzcs LeyXyscOCXBhvU/eiDisclhkx6WO/J7qrGQhPOxW+DK6mkx7tHgxVA7JDRvI5Knbzlnj kxbjrqr75ytsuyUmRTWbMNMlZ5fS/+rRp5Uao57TmVEn91WBtTUdhaGvIQ8WsVB+fFho xXw9F1IvW4+s+JibAi5eN2gF+Yx783yuEv/xGOpSZRtlav7ZrUnos66jXfaxhPy3l+Wa IZig== 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 :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=oa3P1hvJ9JWgjoriWyaE6QqHlQBf9qEx9mp41zilS0I=; b=mL0tjaj3TXDa7xpEltx3oxSri2P/tNU9ztIHuhKDc9ixtglf4PZGD1LQbzuucztPAq c1ifKZRID1Nv5/9HwTtdOwWhvu8BfGRcMTZj784ePC9jI/73IRLbObYsAvS6iT8BvF/3 YznJr+Si3QPPDQVXO8yFRDJuwCVX1cfE67rK/GVf6XO838mF8PtPl44UJiurp2W4+Ctb 1el2OKEHkia3VQlowuYgH6PYEIMTCLRBXYz2Zu5aeD+IiRumm1xjYaEVpUlMjI0VqHvJ bXS8sfOrA6lvO+6jEWU6apLh2gS60+M5hFufInx5IVy30zn8eVJ8az4aHQ6vM6prFz/y JVYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eLBC11Zt; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si673735edw.278.2020.05.06.02.27.22; Wed, 06 May 2020 02:27:45 -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=pass header.i=@gmail.com header.s=20161025 header.b=eLBC11Zt; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729028AbgEFJWh (ORCPT + 99 others); Wed, 6 May 2020 05:22:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728559AbgEFJWf (ORCPT ); Wed, 6 May 2020 05:22:35 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAF93C061A0F; Wed, 6 May 2020 02:22:34 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id a21so1553791ljb.9; Wed, 06 May 2020 02:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=oa3P1hvJ9JWgjoriWyaE6QqHlQBf9qEx9mp41zilS0I=; b=eLBC11ZtPyd8FTayDY0uqooiZnpRr1qiuZ76CPLefg1fOLwOcQQm+i7+Japb0mAdLI zyhuxC+Hkjbr1VmR1XYu8l4rsh8a1IC5mMK1LEHxyi+Gma0VJtQqJ7l9dmAjtXaoS6AC 1v58SBlH+3SoD+gTp+bTIdL2G/FKmTd/tnQRi8dOxFmOD2HdPC+YsbttMkciqn7vHXEL 3uPAAwiBWk6iFBAoWpc2hal7KpcYhLZqZMkQwOPXxncwC6SL6TrSjXoFP1DEcwa+TptN s7x+sQWyd7iyDCyyGhz0Y7BMHxKIXtOBlVWgo74WNAO9fyJz/wIRgph3NnIk+9NtfX3R aLBg== 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:reply-to :from:date:message-id:subject:to:cc; bh=oa3P1hvJ9JWgjoriWyaE6QqHlQBf9qEx9mp41zilS0I=; b=jtfYur0bhPhx3bspTLJCINDxYa5qFp2ujJNjZjxFDiB36xOo4b4bbwDJoIZE04zhEE ognCC225+y91ow6VBNHQjdfg6da+RnVjwDW21S/6cMhFsS67T6F9xme59ICqFZCOxcph ouOS9OT1wcS3jRzlJP2Vg951p4lhi+UU9Ez+wTlvv7NJ/fNQcUfo+G0gUTBnSAma3Jb0 w8rN+YtWZ79wg9mq+sgAvM+N+BKx9Q5uwJbpwWxVL08uK5r+ckXzFABZzmrpEL6EIJhI gPIsgPSOvjjtBhDV+JqoD9mvFY2h7LZ0+y6GnWnaydH9sOgLm8d8WrNZvZlh5cBVtIsR IYIQ== X-Gm-Message-State: AGi0PuYnqLS17+bEVSpj0n4MaO3NRD01REiedgzxmxt9Q5S2j6SQOiU9 7n1vBjAYfxXbJ4RWVwx9TvjdPWyoAvjF+jmAKD4= X-Received: by 2002:a05:651c:385:: with SMTP id e5mr4345047ljp.208.1588756952993; Wed, 06 May 2020 02:22:32 -0700 (PDT) MIME-Version: 1.0 References: <20200505174423.199985-1-ndesaulniers@google.com> <20200506043028.GA663805@ubuntu-s3-xlarge-x86> In-Reply-To: <20200506043028.GA663805@ubuntu-s3-xlarge-x86> Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Wed, 6 May 2020 11:22:34 +0200 Message-ID: Subject: Re: [PATCH] x86: bitops: fix build regression To: Nathan Chancellor Cc: Nick Desaulniers , Thomas Gleixner , Ingo Molnar , Borislav Petkov , stable@vger.kernel.org, Jesse Brandeburg , "kernelci . org bot" , Andy Shevchenko , Ilie Halip , x86@kernel.org, "H. Peter Anvin" , Marco Elver , "Paul E. McKenney" , "Peter Zijlstra (Intel)" , Daniel Axtens , Masahiro Yamada , Luc Van Oostenryck , linux-kernel@vger.kernel.org, Clang-Built-Linux ML 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 Wed, May 6, 2020 at 6:30 AM Nathan Chancellor wrote: > > On Tue, May 05, 2020 at 10:44:22AM -0700, 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.c > > long a(long b, long c) { > > asm("orb\t%1, %0" : "+q"(c): "r"(b)); > > return c; > > } > > $ gcc foo.c > > foo.c: Assembler messages: > > foo.c:2: Error: `%rax' not allowed with `orb' > > > > The "q" constraint only has meanting on -m32 otherwise is treated as > > "r". > > > > This is easily reproducible via Clang+CONFIG_STAGING=y+CONFIG_VT6656=m, > > or Clang+allyesconfig. > > For what it's worth, I don't see this with allyesconfig. > > > Keep the masking operation to appease sparse (`make C=1`), add back the > > cast in order to properly select the proper 8b register alias. > > > > [Nick: reworded] > > > > Cc: stable@vger.kernel.org > > The offending commit was added in 5.7-rc1; we shouldn't need to > Cc stable since this should be picked up as an -rc fix. > > > Cc: Jesse Brandeburg > > Link: https://github.com/ClangBuiltLinux/linux/issues/961 > > Link: https://lore.kernel.org/lkml/20200504193524.GA221287@google.com/ > > Fixes: 1651e700664b4 ("x86: Fix bitops.h warning with a moved cast") > > Reported-by: Sedat Dilek > > Reported-by: kernelci.org bot > > Suggested-by: Andy Shevchenko > > Suggested-by: Ilie Halip > > Not to split hairs but this is Ilie's diff, he should probably be the > author with Sedat's Reported-by/Tested-by. > > https://github.com/ClangBuiltLinux/linux/issues/961#issuecomment-608239458 > > But eh, it's all a team effort plus that can only happen with Ilie's > explicit consent for a Signed-off-by. > Digital dementia... Looking 3 weeks back I have put all relevant informations into the patches in [1], mentionning the diff is from Ilie. Ilie for what reason did not react on any response for 3 weeks in the CBL issue-tracker. I think Nick wants to quickly fix the Kernel-CI-Bot issue seen with Clang. Personally, I hope this patch will be upstreamed in (one of) the next RC release. I agree on CC:stable can be dropped. Check causing commit-id: $ git describe --contains 1651e700664b4 v5.7-rc1~122^2 Thanks. Regards, - Sedat - [1] https://github.com/ClangBuiltLinux/linux/issues/961#issuecomment-613207374 > I am currently doing a set of builds with clang-11 with this patch on > top of 5.7-rc4 to make sure that all of the cases I have found work. > Once that is done, I'll comment back with a tag. > > > Tested-by: Sedat Dilek > > Signed-off-by: Sedat Dilek > > Signed-off-by: Nick Desaulniers > > --- > > arch/x86/include/asm/bitops.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h > > index b392571c1f1d..139122e5b25b 100644 > > --- a/arch/x86/include/asm/bitops.h > > +++ b/arch/x86/include/asm/bitops.h > > @@ -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"); > > -- > > 2.26.2.526.g744177e7f7-goog > > > > Cheers, > Nathan