Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754208AbbGWRdn (ORCPT ); Thu, 23 Jul 2015 13:33:43 -0400 Received: from mail-qk0-f182.google.com ([209.85.220.182]:35687 "EHLO mail-qk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752577AbbGWRdk (ORCPT ); Thu, 23 Jul 2015 13:33:40 -0400 Message-ID: <55B12570.4070709@gmail.com> Date: Thu, 23 Jul 2015 13:33:36 -0400 From: Jason Baron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Peter Zijlstra , Steven Rostedt CC: 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 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> In-Reply-To: <20150723170811.GJ25159@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1057 Lines: 28 On 07/23/2015 01:08 PM, 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? hmm....I don't think that's an issue, the patching code can detect if its a 2-byte jump - 0xeb, or 5-byte: 0xe9, and do the correct no-op. Same going the other way. See the code I posted a few mails back. In fact, this gets us to the smaller 2-byte no-ops in cases where we are initialized to jump. Thanks, -Jason -- 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/