Re: [RFC PATCH v7 7/7] Restartable sequences: self-tests

From: Boqun Feng
Date: Fri Aug 12 2016 - 12:36:18 EST


On Fri, Aug 12, 2016 at 01:30:15PM +0800, Boqun Feng wrote:
[snip]
> > > Besides, do we allow userspace programs do read-only access to the
> > > memory objects modified by do_rseq(). If so, we have a problem when
> > > there are two writes in a do_rseq()(either in the rseq critical section
> > > or in the asm block), because in current implemetation, these two writes
> > > are unordered, which makes the readers outside a do_rseq() could observe
> > > the ordering of writes differently.
> > >
> > > For rseq_finish2(), a simple solution would be making the "final" write
> > > a RELEASE.
> >
> > Indeed, we would need a release semantic for the final store here if this
> > is the common use. Or we could duplicate the "flavors" of rseq_finish2 and
> > add a rseq_finish2_release. We should find a way to eliminate code duplication
>
> I'm in favor of a separate rseq_finish2_release().
>
> > there. I suspect we'll end up doing macros.
> >
>
> Me too. Lemme have a try ;-)
>

How about this? Although a little messy, I separated the asm block into
several parts and implemented each part in a arch-diagnose way.

Compiled successfully on x86 and ppc64le, no more further tests.

Regards,
Boqun

-------------------->8