Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-15 Thread Mark Kettenis
> From: Miod Vallat > Date: Mon, 15 May 2017 06:06:22 + (UTC) > > > So I implemented a new function called > > copyin_futex(9), which is all we really need. > > But it is not specific to futex - in fact, it could be used in syscall() > as well. > >

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-15 Thread Visa Hankala
On Sun, May 14, 2017 at 10:05:28PM +0200, Mark Kettenis wrote: > I tried to convert a few more architectures, and things get a bit > messier than I envisioned on architectures that have an optimized copy > function and care about alignment. Especially when copyin(9) is > implemented in assembly.

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-15 Thread Martin Pieuchot
On 14/05/17(Sun) 22:05, Mark Kettenis wrote: > > Date: Fri, 12 May 2017 13:34:38 + > > From: Visa Hankala > > > > On Mon, May 01, 2017 at 06:02:24PM +0200, Mark Kettenis wrote: > > > The futex(2) syscall needs to be able to atomically copy the futex in > > > and out of

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-15 Thread Miod Vallat
> So I implemented a new function called > copyin_futex(9), which is all we really need. But it is not specific to futex - in fact, it could be used in syscall() as well. Better call it fuword() or aligned_fuword() since it has the extra alignment requirement that

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-14 Thread Mark Kettenis
> Date: Fri, 12 May 2017 13:34:38 + > From: Visa Hankala > > On Mon, May 01, 2017 at 06:02:24PM +0200, Mark Kettenis wrote: > > The futex(2) syscall needs to be able to atomically copy the futex in > > and out of userland. The current implementation uses copyin(9) and > >

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-12 Thread Visa Hankala
On Mon, May 01, 2017 at 06:02:24PM +0200, Mark Kettenis wrote: > The futex(2) syscall needs to be able to atomically copy the futex in > and out of userland. The current implementation uses copyin(9) and > copyout(9) for that. The futex is a 32-bit integer, and currently our > copyin(9) and

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-12 Thread Martin Pieuchot
On 01/05/17(Mon) 18:02, Mark Kettenis wrote: > The futex(2) syscall needs to be able to atomically copy the futex in > and out of userland. The current implementation uses copyin(9) and > copyout(9) for that. The futex is a 32-bit integer, and currently our > copyin(9) and copyout(9) don't

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-11 Thread Mark Kettenis
> Date: Tue, 2 May 2017 15:52:56 + > From: Visa Hankala > > On Mon, May 01, 2017 at 06:02:24PM +0200, Mark Kettenis wrote: > > The futex(2) syscall needs to be able to atomically copy the futex in > > and out of userland. The current implementation uses copyin(9) and > >

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-02 Thread Visa Hankala
On Mon, May 01, 2017 at 06:02:24PM +0200, Mark Kettenis wrote: > The futex(2) syscall needs to be able to atomically copy the futex in > and out of userland. The current implementation uses copyin(9) and > copyout(9) for that. The futex is a 32-bit integer, and currently our > copyin(9) and

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-01 Thread Ted Unangst
Mark Kettenis wrote: > The futex(2) syscall needs to be able to atomically copy the futex in > and out of userland. The current implementation uses copyin(9) and > copyout(9) for that. The futex is a 32-bit integer, and currently our > copyin(9) and copyout(9) don't guarantee an atomic 32-bit

Atomic copyin(9)/copyout(9) for amd64

2017-05-01 Thread Mark Kettenis
The futex(2) syscall needs to be able to atomically copy the futex in and out of userland. The current implementation uses copyin(9) and copyout(9) for that. The futex is a 32-bit integer, and currently our copyin(9) and copyout(9) don't guarantee an atomic 32-bit access. Previously mpi@ and I