Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1191704

Re: Kernel broken on processors without performance counters

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: Kernel broken on processors without performance counters
Date 2015-07-24 12:40 +0200
Message-ID <pPIyu-3am-41@gated-at.bofh.it> (permalink)
References (5 earlier) <pPqLg-2oy-19@gated-at.bofh.it> <pPsam-4z3-25@gated-at.bofh.it> <pPsWL-5tO-21@gated-at.bofh.it> <pPu2t-7g6-19@gated-at.bofh.it> <pPDIt-4AB-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jul 24, 2015 at 07:29:05AM +0200, Borislav Petkov wrote:
> On Thu, Jul 23, 2015 at 09:02:14PM +0200, Peter Zijlstra wrote:
> > On Thu, Jul 23, 2015 at 07:54:36PM +0200, Borislav Petkov wrote:
> > > On Thu, Jul 23, 2015 at 07:08:11PM +0200, Peter Zijlstra wrote:
> > > > That would be bad, how can we force it to emit 5 bytes?
> > > 
> > > .byte 0xe9 like we used to do in static_cpu_has_safe().
> > 
> > Like so then?
> > 
> > static __always_inline bool arch_static_branch_jump(struct static_key *key, bool inv)
> > {
> > 	unsigned long kval = (unsigned long)key + inv;
> > 
> > 	asm_volatile_goto("1:"
> > 		".byte 0xe9\n\t .long %l[l_yes]\n\t"
> > 		".pushsection __jump_table,  \"aw\" \n\t"
> > 		_ASM_ALIGN "\n\t"
> > 		_ASM_PTR "1b, %l[l_yes], %c0 \n\t"
> > 		".popsection \n\t"
> > 		: :  "i" (kval) : : l_yes);
> > 
> > 	return false;
> > l_yes:
> > 	return true;
> > }
> 
> Yap.
> 
> But, we can do even better and note down what kind of JMP the compiler
> generated and teach __jump_label_transform() to generate the right one.
> Maybe this struct jump_entry would get a flags member or so. This way
> we're optimal.
> 
> Methinks...

Yes, Jason and Steve already have patches to go do that, but I'd really
like to keep that separate for now, this thing is big enough as is.
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Kernel broken on processors without performance counters Jason Baron <jasonbaron0@gmail.com> - 2015-07-22 19:10 +0200
  Re: Kernel broken on processors without performance counters Peter Zijlstra <peterz@infradead.org> - 2015-07-23 19:10 +0200
    Re: Kernel broken on processors without performance counters Steven Rostedt <rostedt@goodmis.org> - 2015-07-23 19:20 +0200
    Re: Kernel broken on processors without performance counters Jason Baron <jasonbaron0@gmail.com> - 2015-07-23 19:40 +0200
      Re: Kernel broken on processors without performance counters Steven Rostedt <rostedt@goodmis.org> - 2015-07-23 20:20 +0200
      Re: Kernel broken on processors without performance counters Peter Zijlstra <peterz@infradead.org> - 2015-07-23 21:10 +0200
    Re: Kernel broken on processors without performance counters Andy Lutomirski <luto@amacapital.net> - 2015-07-23 19:40 +0200
    Re: Kernel broken on processors without performance counters Borislav Petkov <bp@alien8.de> - 2015-07-23 20:00 +0200
      Re: Kernel broken on processors without performance counters Peter Zijlstra <peterz@infradead.org> - 2015-07-23 21:10 +0200
        Re: Kernel broken on processors without performance counters Peter Zijlstra <peterz@infradead.org> - 2015-07-24 12:40 +0200
  Re: Kernel broken on processors without performance counters Peter Zijlstra <peterz@infradead.org> - 2015-07-24 13:00 +0200
    Re: Kernel broken on processors without performance counters Peter Zijlstra <peterz@infradead.org> - 2015-07-24 14:40 +0200
      Re: Kernel broken on processors without performance counters Jason Baron <jasonbaron0@gmail.com> - 2015-07-24 16:20 +0200

csiph-web