Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751075AbdL3TDf (ORCPT ); Sat, 30 Dec 2017 14:03:35 -0500 Received: from mga14.intel.com ([192.55.52.115]:29865 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbdL3TDe (ORCPT ); Sat, 30 Dec 2017 14:03:34 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,482,1508828400"; d="scan'208";a="16217018" Subject: Re: x86/pti: smp_processor_id() called while preemptible in resume-from-sleep To: Linus Torvalds , Thomas Gleixner References: <20171230132927.GA2731@light.dominikbrodowski.net> <20171230153054.GA1604@light.dominikbrodowski.net> Cc: Dominik Brodowski , Andy Lutomirski , LKML , the arch/x86 maintainers From: Dave Hansen Message-ID: Date: Sat, 30 Dec 2017 11:03:30 -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: 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 Content-Length: 809 Lines: 21 On 12/30/2017 10:40 AM, Linus Torvalds wrote: > The __native_flush_tlb() function looks _very_ broken. ... > So I'd suggest moving the preempt_disable() up to the top of that > function, regardless of whether we could then remove that seemingly > stale TLB flush in that crazy > smpboot_setup/restore_warm_reset_vector() dance... If someone is calling __native_flush_tlb(), shouldn't they already be in a state where they can't be preempted? It's fundamentally a one-cpu thing, both the actual CPU TLB flush _and_ the per-cpu variables. It seems like we might want to _remove_ the explicit preempt_dis/enable() from here: preempt_disable(); native_write_cr3(__native_read_cr3()); preempt_enable(); and add some warnings to ensure it's disabled when we enter __native_flush_tlb().