Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935316AbeAHQ5P (ORCPT + 1 other); Mon, 8 Jan 2018 11:57:15 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:50263 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934030AbeAHQ5N (ORCPT ); Mon, 8 Jan 2018 11:57:13 -0500 Date: Mon, 8 Jan 2018 17:57:11 +0100 (CET) From: Thomas Gleixner To: Willy Tarreau cc: linux-kernel@vger.kernel.org, x86@kernel.org, gnomes@lxorguk.ukuu.org.uk, torvalds@linux-foundation.org Subject: Re: [PATCH RFC 1/4] x86/thread_info: add TIF_NOPTI to disable PTI per task In-Reply-To: <1515427939-10999-2-git-send-email-w@1wt.eu> Message-ID: References: <1515427939-10999-1-git-send-email-w@1wt.eu> <1515427939-10999-2-git-send-email-w@1wt.eu> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, 8 Jan 2018, Willy Tarreau wrote: > This flag indicates that the task will not use isolated page tables. > > Signed-off-by: Willy Tarreau > --- > arch/x86/include/asm/thread_info.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h > index 0022333..2f92cf1 100644 > --- a/arch/x86/include/asm/thread_info.h > +++ b/arch/x86/include/asm/thread_info.h > @@ -126,6 +126,14 @@ struct thread_info { > #define _TIF_X32 (1 << TIF_X32) > #define _TIF_FSCHECK (1 << TIF_FSCHECK) > > +/* The following flags only exist on x86-64. We can't use the shift anymore Please do not use this horrible comment syle And what's wrong with (1UL << 32)? > + * due to C using signed ints by default and asm using unsigned longs. > + */ > +#ifdef CONFIG_X86_64 > +# define TIF_NOPTI 32 /* disable PTI for this task */ No tail comments please. > +# define _TIF_NOPTI 0x0000000100000000 > +#endif > + Thanks, tglx