Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932114AbbFJPEW (ORCPT ); Wed, 10 Jun 2015 11:04:22 -0400 Received: from one.firstfloor.org ([193.170.194.197]:40026 "EHLO one.firstfloor.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750917AbbFJPEO (ORCPT ); Wed, 10 Jun 2015 11:04:14 -0400 Date: Wed, 10 Jun 2015 17:04:12 +0200 From: Andi Kleen To: Josh Poimboeuf Cc: Andi Kleen , 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: <20150610150412.GR19417@two.firstfloor.org> References: <20150610130814.GN19417@two.firstfloor.org> <20150610135203.GA19509@treble.redhat.com> <20150610141104.GQ19417@two.firstfloor.org> <20150610143209.GA28843@treble.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150610143209.GA28843@treble.redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1041 Lines: 34 > > > - duplicate the destination code inside the function > > > - convert the jump to a call > > > > That all won't work for a lot of cases. > > Hm, could you give an example? Just a standard *_user exception handler. > > Well, I don't see how that's really a logical conclusion. What's special about assembler code? > But we're > probably being too vague here... Do you have any examples where you > really need to jump outside of a callable function? 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. -Andi -- ak@linux.intel.com -- Speaking for myself only. -- 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/