From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755243AbcFHVbk (ORCPT ); Wed, 8 Jun 2016 17:31:40 -0400 Received: from terminus.zytor.com ([198.137.202.10]:43214 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751645AbcFHVbj (ORCPT ); Wed, 8 Jun 2016 17:31:39 -0400 User-Agent: K-9 Mail for Android In-Reply-To: <1465414726-197858-1-git-send-email-hpa@linux.intel.com> References: <1465414726-197858-1-git-send-email-hpa@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH v2 00/10] x86: use gcc 6+ asm flag output feature From: "H. Peter Anvin" Date: Wed, 08 Jun 2016 14:30:51 -0700 To: "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , Linux Kernel Mailing List CC: Andy Lutomirski , Borislav Petkov Message-ID: <6E2F7200-63F0-4F32-8A82-9AE8BA1DC425@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On June 8, 2016 12:38:36 PM PDT, "H. Peter Anvin" wrote: >From: "H. Peter Anvin" > >gcc 6+ has the ability to let flags (actually, conditions, which are >specific combinations of flags) to be used directly as asm() outputs. >The syntax for that is "=@cc" where is the same set of >letters that would be used in a j or set instruction >(e.g. "=@ccz" to test the ZF flag.) > >This patchset by itself reduces the size of the x86-64 kernel by >0.12%, from a baseline of 4.7-rc2 built with gcc 6.1 (first line is >with the patchset, the second one is without): > > text data bss dec hex filename > >68245656 41004339 20533248 129783243 7bc55cb >o.i386-allconfig/vmlinux >68355716 41008499 20533248 129897463 7be13f7 >o.i386-allconfig/vmlinux > >127384005 129742359 38150144 295276508 11998fdc >o.x86_64-allconfig/vmlinux >127538765 129742295 38150144 295431204 119bec24 >o.x86_64-allconfig/vmlinux > >v2: fix a conflict between and > discovered by Ingo Molnar. There are a few places in x86-specific > code where we need all of even when > xCONFIG_ARCH_RANDOM is disabled, so does not > suffice. Only the patch has been changed; > since it is a little bit different from the others I have moved it > to the end. I should probably clarify one thing: the output type *must* be bool for the flags output. Fortunately, not only does it also work for the older compilers, but it sometimes allows GCC to generate better code, which is why I have made the change unconditionally. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.