Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754124AbbGWRSs (ORCPT ); Thu, 23 Jul 2015 13:18:48 -0400 Received: from smtprelay0091.hostedemail.com ([216.40.44.91]:37021 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753712AbbGWRSo (ORCPT ); Thu, 23 Jul 2015 13:18:44 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2693:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3870:3872:3874:4321:5007:6117:6119:6261:6742:7875:7903:9010:10004:10400:10848:10967:11026:11232:11658:11914:12043:12296:12438:12517:12519:12740:13069:13161:13229:13311:13357:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: tin63_8626abd092b15 X-Filterd-Recvd-Size: 3290 Date: Thu, 23 Jul 2015 13:18:40 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Jason Baron , Borislav Petkov , Andy Lutomirski , Thomas Gleixner , Mikulas Patocka , Paul Mackerras , Arnaldo Carvalho de Melo , Kees Cook , Andrea Arcangeli , Vince Weaver , "hillf.zj" , Valdis Kletnieks , "linux-kernel@vger.kernel.org" Subject: Re: Kernel broken on processors without performance counters Message-ID: <20150723131840.2a6691f4@gandalf.local.home> In-Reply-To: <20150723170811.GJ25159@twins.programming.kicks-ass.net> References: <20150721154959.GS19282@twins.programming.kicks-ass.net> <20150721161215.GU19282@twins.programming.kicks-ass.net> <20150721181553.GA3378@nazgul.tnic> <55AE9471.1000601@gmail.com> <20150722042403.GA6345@nazgul.tnic> <55AFCDA4.5010406@gmail.com> <20150723104215.GH25159@twins.programming.kicks-ass.net> <20150723113450.67db0152@gandalf.local.home> <20150723170811.GJ25159@twins.programming.kicks-ass.net> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1701 Lines: 42 On Thu, 23 Jul 2015 19:08:11 +0200 Peter Zijlstra wrote: > On Thu, Jul 23, 2015 at 11:34:50AM -0400, Steven Rostedt wrote: > > On Thu, 23 Jul 2015 12:42:15 +0200 > > Peter Zijlstra wrote: > > > > > static __always_inline bool arch_static_branch_jump(struct static_key *key, bool inv) > > > { > > > if (!inv) { > > > asm_volatile_goto("1:" > > > "jmp %l[l_yes]\n\t" > > > > And what happens when this gets converted to a two byte jump? > > > > That would be bad, how can we force it to emit 5 bytes? No idea, but I could pull out that old code that converted them :-) The complexity was in the elf parser that was run at kernel compile time. It was based on the same code that does the work with record-mcount.c to find all the mcount callers and made the sections for them. In fact, it wasn't much different, as record-mcount.c will convert the black listed sections into nops, so they do not bother calling mcount at all. But those sections were not recorded, as they were blacklisted anyway (not whitelisted really, as to be a blacklisted section, it just had to not be in the whitelisted list). If we got the jmp conversion in, I was going to clean up the code such that both record-mcount.c and the jmp conversions used the same code where applicable. I would probably still convert every jmp to a nop (2 or 5 byte), and then at boot up convert those back to jmps that are needed. -- Steve -- 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/