All of lore.kernel.org
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] arm: Added support for getcpu() vDSO using TPIDRURW
Date: Wed, 5 Oct 2016 22:47:40 +0100	[thread overview]
Message-ID: <20161005214729.GA27121@remoulade> (raw)
In-Reply-To: <20161005210137.GS1041@n2100.armlinux.org.uk>

On Wed, Oct 05, 2016 at 10:01:38PM +0100, Russell King - ARM Linux wrote:
> On Wed, Oct 05, 2016 at 09:44:53PM +0100, Mark Rutland wrote:
> > The zeroing case is similar to the restartable sequences design. So that's
> > probably worth looking into.
> 
> You're sending mixed messages: in your previous message, you said:
> 
>   Arguably, someone could have (ab)used TPIDRURW between commits 6a1c531
>   and a4780ad to detect context switches, but in practice they don't
>   appear to have, and we know of an established user relying on the
>   current behaviour.
> 
>   For better or worse, the current behaviour is ABI.
> 
> Now you're suggesting that we could go back to the case where the
> register is zeroed.

Sorry; clumsy wording on my behalf.

I meant that functionality-wise, restartable sequences had similar behaviour to
the zeroing case (without touching TPIDRURW at all) and were probably worth
looking at. I did not intend to suggest that we should go pack to case where
TPIDRURW was zeroed.

> Well, the fact is that we _can_ change the TPIDRURW behaviour - we just
> need to be careful about how we change it.  Eg, we _could_ introduce a
> per-process flag which indicates that we want some other behaviour from
> TPIDRURW such as zeroing it on context switches.  The default would be
> to preserve the existing behaviour as doing anything else breaks
> existing programs.  The problem there is finding an acceptable way to
> control such a flag from userspace (eg, prctl, syscall, etc).

Sure. Something like that could work.

Thanks,
Mark.

WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: Russell King - ARM Linux <linux@armlinux.org.uk>
Cc: "Fredrik Markström" <fredrik.markstrom@gmail.com>,
	"Robin Murphy" <robin.murphy@arm.com>,
	"Kees Cook" <keescook@chromium.org>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Ard Biesheuvel" <ard.biesheuvel@linaro.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Nicolas Pitre" <nico@linaro.org>,
	"Will Deacon" <will.deacon@arm.com>,
	kristina.martsenko@arm.com, linux-kernel@vger.kernel.org,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	"Chris Brandt" <chris.brandt@renesas.com>,
	"Michal Marek" <mmarek@suse.com>,
	"Zhaoxiu Zeng" <zhaoxiu.zeng@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	"Jonathan Austin" <jonathan.austin@arm.com>
Subject: Re: [PATCH v2] arm: Added support for getcpu() vDSO using TPIDRURW
Date: Wed, 5 Oct 2016 22:47:40 +0100	[thread overview]
Message-ID: <20161005214729.GA27121@remoulade> (raw)
In-Reply-To: <20161005210137.GS1041@n2100.armlinux.org.uk>

On Wed, Oct 05, 2016 at 10:01:38PM +0100, Russell King - ARM Linux wrote:
> On Wed, Oct 05, 2016 at 09:44:53PM +0100, Mark Rutland wrote:
> > The zeroing case is similar to the restartable sequences design. So that's
> > probably worth looking into.
> 
> You're sending mixed messages: in your previous message, you said:
> 
>   Arguably, someone could have (ab)used TPIDRURW between commits 6a1c531
>   and a4780ad to detect context switches, but in practice they don't
>   appear to have, and we know of an established user relying on the
>   current behaviour.
> 
>   For better or worse, the current behaviour is ABI.
> 
> Now you're suggesting that we could go back to the case where the
> register is zeroed.

Sorry; clumsy wording on my behalf.

I meant that functionality-wise, restartable sequences had similar behaviour to
the zeroing case (without touching TPIDRURW at all) and were probably worth
looking at. I did not intend to suggest that we should go pack to case where
TPIDRURW was zeroed.

> Well, the fact is that we _can_ change the TPIDRURW behaviour - we just
> need to be careful about how we change it.  Eg, we _could_ introduce a
> per-process flag which indicates that we want some other behaviour from
> TPIDRURW such as zeroing it on context switches.  The default would be
> to preserve the existing behaviour as doing anything else breaks
> existing programs.  The problem there is finding an acceptable way to
> control such a flag from userspace (eg, prctl, syscall, etc).

Sure. Something like that could work.

Thanks,
Mark.

  reply	other threads:[~2016-10-05 21:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-04 13:49 [PATCH] arm: Added support for getcpu() vDSO using TPIDRURW Fredrik Markstrom
2016-10-04 15:35 ` [PATCH v2] " Fredrik Markstrom
2016-10-04 15:35   ` Fredrik Markstrom
2016-10-04 17:07   ` Mark Rutland
2016-10-04 17:07     ` Mark Rutland
2016-10-05 12:25     ` Fredrik Markström
2016-10-05 12:25       ` Fredrik Markström
2016-10-05 16:39       ` Fredrik Markström
2016-10-05 16:39         ` Fredrik Markström
2016-10-05 17:48         ` Robin Murphy
2016-10-05 17:48           ` Robin Murphy
2016-10-05 19:53           ` Russell King - ARM Linux
2016-10-05 19:53             ` Russell King - ARM Linux
     [not found]             ` <CAKdL+dSt+cBCpwW5q+VCQh+7XeKrnyJgfTsEsuo2nKoUr9ytxw@mail.gmail.com>
2016-10-10 15:29               ` Will Deacon
2016-10-10 15:29                 ` Will Deacon
2016-10-10 16:15                 ` Restartable Sequences benchmarks (was: Re: [PATCH v2] arm: Added support for getcpu() vDSO using TPIDRURW) Mathieu Desnoyers
2016-10-10 16:15                   ` Mathieu Desnoyers
     [not found]           ` <CAKdL+dQH=9C2aGf7ys5-vXM7pkdPYUQ8xYWLipwVbABOz09f1g@mail.gmail.com>
2016-10-05 20:44             ` [PATCH v2] arm: Added support for getcpu() vDSO using TPIDRURW Mark Rutland
2016-10-05 20:44               ` Mark Rutland
2016-10-05 21:01               ` Russell King - ARM Linux
2016-10-05 21:01                 ` Russell King - ARM Linux
2016-10-05 21:47                 ` Mark Rutland [this message]
2016-10-05 21:47                   ` Mark Rutland
2016-10-05 21:37               ` Fredrik Markström
2016-10-05 21:37                 ` Fredrik Markström
2016-10-05 20:12       ` Mark Rutland
2016-10-05 20:12         ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161005214729.GA27121@remoulade \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.