[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180110090019.GG14066@1wt.eu>
Date: Wed, 10 Jan 2018 10:00:19 +0100
From: Willy Tarreau <w@....eu>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
Andy Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Brian Gerst <brgerst@...il.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Josh Poimboeuf <jpoimboe@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Kees Cook <keescook@...omium.org>
Subject: Re: [RFC PATCH v2 3/6] x86/pti: add a per-cpu variable pti_disable
On Wed, Jan 10, 2018 at 09:59:01AM +0100, Ingo Molnar wrote:
>
> * Willy Tarreau <w@....eu> wrote:
>
> > On Wed, Jan 10, 2018 at 09:01:02AM +0100, Ingo Molnar wrote:
> > >
> > > * Willy Tarreau <w@....eu> wrote:
> > >
> > > > [...] If we had "pit_enabled", something like this could be confusing because
> > > > it's not obvious whether this pti_enabled *enforces* PTI or if its absence
> > > > disables it :
> > > >
> > > > cmpb $0, PER_CPU_VAR(pti_enabled)
> > > > jz .Lend\@
> > >
> > > The natural sequence would be:
> > >
> > > cmpb $1, PER_CPU_VAR(pti_enabled)
> > > jne .Lend\@
> > >
> > > which is not confusing to me at all.
> >
> > In fact I think I know now why it still poses me a problem : this
> > pti_enabled flag alone is not sufficient to enable PTI, it's just part
> > of the condition, as another part comes from the X86_FEATURE_PTI flag.
> > However, pti_disabled is sufficient to disable PTI so actually its
> > effect matches its name (note BTW that I called it "pti_disable" as a
> > verb indicating an action -- "I want to disable pti", and not as a past
> > form "pti is disabled").
>
> If it's a verb then please name it in the proper order, i.e. 'disable_pti'.
>
> I'm fine with that approach.
OK thanks.
Willy
Powered by blists - more mailing lists