Port-amd64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: x86_64 and CX8

On Tue, Apr 14, 2020 at 09:55:45AM -0700, Jason Thorpe wrote:
> > On Apr 14, 2020, at 9:34 AM, Manuel Bouyer <bouyer%antioche.eu.org@localhost> wrote:
> > 
> > hello,
> > is someone aware of a x86_64 CPU which does *not* support cmpxchg8b ?
> > The instruction seems mandatory since i686-class CPUs, and it seems that
> > since windows XP cmpxchg8b is not optional.
> > 
> > in amd64/amd64/spl.S we have 2 implementations of spllower(), which seems
> > overkill if all x86-64 CPUs supports cmpxchg8b ...
> I would certainly be surprised if cmpxchg8b was missing from any x86_64 CPUs, but you never know.
> Maybe the best thing to do is rewrite the amd64 flavors of that code to use cmpxchgq, which is guaranteed to always there on all x86_64 CPUs (and upon which we make assumptions about its presence all over the place)?

Actually, it may make sense for spllower(), when I'll implement
the change I have in mind.
Note that I just noticed that, on amd64, mutex_spin_exit() is
using cmpxchg8b unconditionally when !DIAGNOSTIC.
So there's no reason to not use it for spllower() too.

Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference

Home | Main Index | Thread Index | Old Index