From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422827AbcFHI2p (ORCPT ); Wed, 8 Jun 2016 04:28:45 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35330 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161337AbcFHI2k (ORCPT ); Wed, 8 Jun 2016 04:28:40 -0400 Date: Wed, 8 Jun 2016 10:28:36 +0200 From: Ingo Molnar To: Peter Zijlstra Cc: "H. Peter Anvin" , Thomas Gleixner , "H. Peter Anvin" , Linux Kernel Mailing List , Andy Lutomirski , Borislav Petkov Subject: Re: [PATCH 02/10] x86, asm: use bool for bitops and other assembly outputs Message-ID: <20160608082835.GB9645@gmail.com> References: <1465342269-492350-1-git-send-email-hpa@linux.intel.com> <1465342269-492350-3-git-send-email-hpa@linux.intel.com> <20160608074956.GO30154@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160608074956.GO30154@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra wrote: > On Tue, Jun 07, 2016 at 04:31:01PM -0700, H. Peter Anvin wrote: > > From: "H. Peter Anvin" > > > > The gcc people have confirmed that using "bool" when combined with > > inline assembly always is treated as a byte-sized operand that can be > > assumed to be 0 or 1, which is exactly what the SET instruction > > emits. Change the output types and intermediate variables of as many > > operations as practical to "bool". > > > > Signed-off-by: H. Peter Anvin > > --- > > arch/x86/boot/bitops.h | 8 +++++--- > > arch/x86/boot/boot.h | 8 ++++---- > > arch/x86/boot/string.c | 2 +- > > arch/x86/include/asm/apm.h | 6 +++--- > > arch/x86/include/asm/archrandom.h | 16 ++++++++-------- > > arch/x86/include/asm/atomic.h | 8 ++++---- > > arch/x86/include/asm/atomic64_64.h | 10 +++++----- > > arch/x86/include/asm/bitops.h | 28 ++++++++++++++-------------- > > arch/x86/include/asm/local.h | 8 ++++---- > > arch/x86/include/asm/percpu.h | 8 ++++---- > > arch/x86/include/asm/rmwcc.h | 4 ++-- > > arch/x86/include/asm/rwsem.h | 17 +++++++++-------- > > include/linux/random.h | 12 ++++++------ > > 13 files changed, 69 insertions(+), 66 deletions(-) > > So the only concern I have with this is that the x86 function signatures > are now different from the other architectures. > > Not sure how much if anything that matters.. It does matter: In file included from arch/x86/kernel/cpu/common.c:21:0: ./arch/x86/include/asm/archrandom.h:95:20: error: redefinition of ‘arch_get_random_long’ static inline bool arch_get_random_long(unsigned long *v) In file included from ./arch/x86/include/asm/stackprotector.h:43:0, include/linux/random.h:98:20: note: previous definition of ‘arch_get_random_long’ was here Thanks, Ingo