> * Steven Rostedt (
rostedt@goodmis.org) wrote:
> >
> > On Fri, 8 Aug 2008, Mathieu Desnoyers wrote:
> > > * Steven Rostedt (
rostedt@goodmis.org) wrote:
> > > >
> > > > I originally used jumps instead of nops, but unfortunately, they actually
> > > > hurt performance more than adding nops. Ingo told me it was probably due
> > > > to using up the jump predictions of the CPU.
> > > >
> > >
> > > Hrm, are you sure you use a single 5-bytes nop instruction then, or do
> > > you use a mix of various nop sizes (add_nops) on some architectures ?
> >
> > I use (for x86) what is in include/asm-x86/nops.h depending on what the
> > cpuid gives us.
> >
>
> That's bad :
>
> #define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4
>
> #define K8_NOP5 K8_NOP3 K8_NOP2
>
> #define K7_NOP5 K7_NOP4 ASM_NOP1
>
> So, when you try, later, to replace these instructions with a single
> 5-bytes instruction, a preempted thread could iret in the middle of your
> 5-bytes insn and cause an illegal instruction ?