Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934776AbeAKSPG (ORCPT + 1 other); Thu, 11 Jan 2018 13:15:06 -0500 Received: from mga11.intel.com ([192.55.52.93]:17654 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754328AbeAKSPF (ORCPT ); Thu, 11 Jan 2018 13:15:05 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,345,1511856000"; d="scan'208";a="10034727" Subject: Re: [RFC PATCH v2 6/6] x86/entry/pti: don't switch PGD on when pti_disable is set To: Willy Tarreau , Andy Lutomirski References: <20180110082207.GX29822@worktop.programming.kicks-ass.net> <20180110091102.GH14066@1wt.eu> <20180111064259.GC14920@1wt.eu> <0f08d89e-61e1-20e3-5c59-0b2f7b32bf0c@linux.intel.com> <20180111154412.GA15296@1wt.eu> <20180111174025.GB15344@1wt.eu> <20180111180502.GE15344@1wt.eu> Cc: Linus Torvalds , Peter Zijlstra , LKML , X86 ML , Borislav Petkov , Brian Gerst , Ingo Molnar , Thomas Gleixner , Josh Poimboeuf , "H. Peter Anvin" , Greg Kroah-Hartman , Kees Cook From: Dave Hansen Message-ID: <21a05bdd-bd9b-d522-1b23-61a1cdb56dbe@linux.intel.com> Date: Thu, 11 Jan 2018 10:15:03 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180111180502.GE15344@1wt.eu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/11/2018 10:05 AM, Willy Tarreau wrote: >> That's exactly what it does for now, but Linus doesn't like it at all. >> So I'll switch it back to per-mm + per-CPU variable. Well he has a valid >> point regarding the pgd and _PAGE_NX setting. point Now at least we know >> the change is minimal if we have a good reason for doing differently >> later. > Yuck, I hate this. Are you really going to wire it up complete with > all the IPIs needed to get the thing synced up right? Well, on the bright side, we don't need IPIs when _removing_ NX. We can just handle those like a spurious fault. But, when re-enabling it, we need all the TLB flushing for all the CPUs that have run with the un-NX'd page tables. I guess that's the one benefit if you come up with an API that only allows "disable PTI" while a task is running but leaves execve()/fork() as places that implicitly reenable PTI.