[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200811075420.GA5637@worktop.programming.kicks-ass.net>
Date: Tue, 11 Aug 2020 09:54:20 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Peter Oskolkov <posk@...gle.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
"Paul E . McKenney" <paulmck@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
linux-kernel@...r.kernel.org, Paul Turner <pjt@...gle.com>,
Chris Kennelly <ckennelly@...gle.com>,
Peter Oskolkov <posk@...k.io>
Subject: Re: [PATCH 1/2 v3] rseq/membarrier: add
MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ
On Tue, Aug 11, 2020 at 08:27:33AM +0200, Peter Zijlstra wrote:
> SYSCALL_DEFINE2(membarrier, int, cmd, int, flags)
> {
> + int cflags = 0, int cpuid = -1;
> +
> if (unlikely(flags) && cmd != MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ)
> return -EINVAL;
> +
> + if (cmd & (MEMBARRIER_CMD_PRIVATE_EXPEDITED |
> + MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE |
> + MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ)) {
> +
> + if (cmd & MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ)
> + cflags |= MEMBARRIER_FLAG_RSEQ;
> +
> + if (cmd & MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE) {
> + cflags |= MEMBARRIER_FLAG_SYNC_CORE;
> + cpuid = flags;
> + }
> +
> + cmd = MEMBARRIER_CMD_PRIVATE_EXPEDITED;
> + }
This of course fails to check if other bits are set, and it goes really
'funny' if you use cpuid != -1.
That all needs a little more thought.
Powered by blists - more mailing lists