Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966248AbbFJQvJ (ORCPT ); Wed, 10 Jun 2015 12:51:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50761 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965473AbbFJQu6 (ORCPT ); Wed, 10 Jun 2015 12:50:58 -0400 Date: Wed, 10 Jun 2015 11:50:56 -0500 From: Josh Poimboeuf To: Andi Kleen Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Michal Marek , Peter Zijlstra , Andy Lutomirski , Borislav Petkov , Linus Torvalds , x86@kernel.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation Message-ID: <20150610165056.GC29724@treble.redhat.com> References: <20150610130814.GN19417@two.firstfloor.org> <20150610135203.GA19509@treble.redhat.com> <20150610141104.GQ19417@two.firstfloor.org> <20150610143209.GA28843@treble.redhat.com> <20150610150412.GR19417@two.firstfloor.org> <20150610153155.GB29724@treble.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150610153155.GB29724@treble.redhat.com> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1169 Lines: 31 On Wed, Jun 10, 2015 at 10:31:55AM -0500, Josh Poimboeuf wrote: > On Wed, Jun 10, 2015 at 05:04:12PM +0200, Andi Kleen wrote: > > It's not needed, but it's an optimization to optimize icache usage. > > It is optional (-freorder-blocks-and-partition) > > > > In this case gcc splits the function into two (hot and cold) > > > > It's actually a nice optimization and it would be sad from stopping > > the kernel from using it. > > Sorry if I wasn't clear, I was trying to ask for examples in kernel asm > code. > > Are you suggesting that we implement this gcc optimization in kernel asm > code? If you're wanting something like -freorder-blocks-and-partition for asm code, maybe we could implement something analagous to the likely()/unlikely() macros, to allow the hot and cold portions to be placed into different sections. (I could then teach asmvalidate how to validate such code.) Would that be useful? -- Josh -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/