From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3944BC38A2A for ; Thu, 7 May 2020 11:35:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 10ED2208CA for ; Thu, 7 May 2020 11:35:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ZRgcchoy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726774AbgEGLfJ (ORCPT ); Thu, 7 May 2020 07:35:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbgEGLfJ (ORCPT ); Thu, 7 May 2020 07:35:09 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E60D3C05BD43; Thu, 7 May 2020 04:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=S7/JCtjp/SFUzAPa+/rhOyd9q2ucCeuwYbzZwtk3H3w=; b=ZRgcchoyg6EsthP9pkro1DG0Nd f7Gtmf+9Shucas54O6gS/KuQTS8EQrU7opCy8i9yZDOyQ5up59Z3yP3cPxL6RA/IAtfmMlWfEFoZd B1jCZIJeAvtsrjFuujNO7MnhzQk8K32l+XVvRyYTm/Nq3YEAdxn3P9831zP5Eh/2Zaoq+4QS5fbNJ gKlxe5KsI/vJkstVx81c0RwvkLGjSeHAfwuGDRYCTwD5NfR0LRuNtOHrogJO9c/UG/s4MHI4GZaqc zc8wy5g95ZFNJUWneDKJdBKq6FLcGr5Uyl8OkwCcJ+5zuVdLlMrbl+v+9Ma0xZabnob/hU6+VHHzU 8CBkhYTQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jWenK-0007kR-AC; Thu, 07 May 2020 11:34:26 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 22976303DA8; Thu, 7 May 2020 13:34:23 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 00BCA2B51366A; Thu, 7 May 2020 13:34:22 +0200 (CEST) Date: Thu, 7 May 2020 13:34:22 +0200 From: Peter Zijlstra To: hpa@zytor.com Cc: Nick Desaulniers , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Sedat Dilek , stable@vger.kernel.org, Jesse Brandeburg , "kernelci . org bot" , Andy Shevchenko , Ilie Halip , x86@kernel.org, Marco Elver , "Paul E. McKenney" , Daniel Axtens , Masahiro Yamada , Luc Van Oostenryck , linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] x86: bitops: fix build regression Message-ID: <20200507113422.GA3762@hirez.programming.kicks-ass.net> References: <20200505174423.199985-1-ndesaulniers@google.com> <8A776DBC-03AF-485B-9AA6-5920E3C4ACB2@zytor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <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 Tue, May 05, 2020 at 11:07:24AM -0700, hpa@zytor.com wrote: > On May 5, 2020 10:44:22 AM PDT, Nick Desaulniers wrote: > >@@ -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 ~. But then we're back to sparse being unhappy, no? The thing with ~ is that it will set high bits which will be truncated, which makes sparse sad.