Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935302AbeAHQ5M (ORCPT + 1 other); Mon, 8 Jan 2018 11:57:12 -0500 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:38927 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934030AbeAHQ5K (ORCPT ); Mon, 8 Jan 2018 11:57:10 -0500 Date: Mon, 8 Jan 2018 17:56:51 +0100 From: Willy Tarreau To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de, gnomes@lxorguk.ukuu.org.uk, torvalds@linux-foundation.org Subject: Re: [PATCH RFC 2/4] x86/arch_prctl: add ARCH_GET_NOPTI and ARCH_SET_NOPTI to enable/disable PTI Message-ID: <20180108165651.GC10913@1wt.eu> References: <1515427939-10999-1-git-send-email-w@1wt.eu> <1515427939-10999-3-git-send-email-w@1wt.eu> <20180108164900.GO32035@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180108164900.GO32035@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, Jan 08, 2018 at 05:49:00PM +0100, Peter Zijlstra wrote: > On Mon, Jan 08, 2018 at 05:12:17PM +0100, Willy Tarreau wrote: > > + if (doit) { > > + if (arg2) > > + task_thread_info(task)->flags |= _TIF_NOPTI; > > + else > > + task_thread_info(task)->flags &= ~_TIF_NOPTI; > > {set,clear}_thread_flag() please, the above is not SMP safe. Oops, thank you. I initially thought about it initially but didn't know the names of the functions to use, and have left it there thinking I'd fix it later. Usual source of bugs :-/ Bah and I left my debugging printk() in the patch as well! I'll rework this a bit. Thanks, Willy