Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964896AbeAJI7H (ORCPT + 1 other); Wed, 10 Jan 2018 03:59:07 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:40019 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964862AbeAJI7F (ORCPT ); Wed, 10 Jan 2018 03:59:05 -0500 X-Google-Smtp-Source: ACJfBoujV7L27ZlDzkBHUBIlMeShopb6XELZsXNMaI5BmaiQBbqtYMEJVsxjCQjX/ORnKi8FhXzJyw== Date: Wed, 10 Jan 2018 09:59:01 +0100 From: Ingo Molnar To: Willy Tarreau Cc: linux-kernel@vger.kernel.org, x86@kernel.org, Andy Lutomirski , Borislav Petkov , Brian Gerst , Dave Hansen , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Josh Poimboeuf , "H. Peter Anvin" , Kees Cook Subject: Re: [RFC PATCH v2 3/6] x86/pti: add a per-cpu variable pti_disable Message-ID: <20180110085901.h73wesipwtdftewz@gmail.com> References: <1515502580-12261-1-git-send-email-w@1wt.eu> <1515502580-12261-4-git-send-email-w@1wt.eu> <20180110071951.t4vbwlnlw2qycnpm@gmail.com> <20180110072900.GC14066@1wt.eu> <20180110080102.7ggggtruidb53yfu@gmail.com> <20180110085016.GE14066@1wt.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180110085016.GE14066@1wt.eu> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: * Willy Tarreau wrote: > On Wed, Jan 10, 2018 at 09:01:02AM +0100, Ingo Molnar wrote: > > > > * Willy Tarreau 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. Thanks, Ingo