Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755554Ab3HEWIm (ORCPT ); Mon, 5 Aug 2013 18:08:42 -0400 Received: from mail.openrapids.net ([64.15.138.104]:33693 "EHLO blackscsi.openrapids.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755106Ab3HEWIk (ORCPT ); Mon, 5 Aug 2013 18:08:40 -0400 Date: Mon, 5 Aug 2013 18:08:37 -0400 From: Mathieu Desnoyers To: Steven Rostedt Cc: Linus Torvalds , "H. Peter Anvin" , LKML , gcc , Ingo Molnar , Thomas Gleixner , David Daney , Behan Webster , Peter Zijlstra , Herbert Xu Subject: Re: [RFC] gcc feature request: Moving blocks into sections Message-ID: <20130805220836.GA24145@Krystal> References: <51FFEC56.6040206@linux.intel.com> <1375727010.22073.110.camel@gandalf.local.home> <51FFEEEC.5060902@linux.intel.com> <1375728583.22073.118.camel@gandalf.local.home> <51FFF430.1060701@linux.intel.com> <20130805195446.GA22359@Krystal> <20130805212855.GA23044@Krystal> <1375739051.22073.158.camel@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1375739051.22073.158.camel@gandalf.local.home> X-Editor: vi X-Info: http://www.efficios.com User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1857 Lines: 62 * Steven Rostedt (rostedt@goodmis.org) wrote: > On Mon, 2013-08-05 at 17:28 -0400, Mathieu Desnoyers wrote: > [...] > > My though is that the code above does not cover all jump encodings that > > can be generated by past, current and future x86 assemblers. > > > > Another way around this issue might be to keep the instruction size > > within a non-allocated section: > > > > static __always_inline bool arch_static_branch(struct static_key *key) > > { > > asm goto("1:" > > "jmp %l[l_yes]\n\t" > > "2:" > > > > ".pushsection __jump_table, \"aw\" \n\t" > > _ASM_ALIGN "\n\t" > > _ASM_PTR "1b, %l[l_yes], %c0 \n\t" > > ".popsection \n\t" > > > > ".pushsection __jump_table_ilen \n\t" > > _ASM_PTR "1b \n\t" /* Address of the jmp */ > > ".byte 2b - 1b \n\t" /* Size of the jmp instruction */ > > ".popsection \n\t" > > > > : : "i" (key) : : l_yes); > > return false; > > l_yes: > > return true; > > } > > > > And use (2b - 1b) to know what size of no-op should be used rather than > > to rely on instruction decoding. > > > > Thoughts ? > > > > Then we need to add yet another table of information to the kernel that > needs to hang around. This goes with another kernel-discuss request > talking about kernel data bloat. Perhaps this section could be simply removed by the post-link stage ? Thanks, Mathieu > > -- Steve > > -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com -- 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/