Re: Linux 2.6.32-rc1

From: Arjan van de Ven
Date: Wed Sep 30 2009 - 11:07:49 EST


On Tue, 29 Sep 2009 14:56:28 -0700 (PDT)
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

>
>
> On Tue, 29 Sep 2009, Arjan van de Ven wrote:
> >
> > can't we use alternatives() for this, to patch cmpxchg64 in ?
> > I mean.. it'll be commonly supported nowadays.. the fallback to it
> > not being supported could be a bit slower by now...
>
> Yes, we could. It would limit us to some fixed address format,
> probably
>
> cmpxchg8b (%esi)
>
> or something. Use something like this as a starting point, perhaps?
>
> NOTE! Totally untested! And you'd actually need to implement the
> "cmpxchg8b_emu" function that takes it's arguments in %eax:%edx,
> %ebx:%ecx and %esi and doesn't trash any other registers..

so I debugged this guy (had a few bugs ;-)

patch, including a new cmpxchg8b_emu below: