Received: by 10.223.164.202 with SMTP id h10csp320621wrb; Thu, 30 Nov 2017 10:51:38 -0800 (PST) X-Google-Smtp-Source: AGs4zMbqca1QMU1IIQaDsQIUZbP3YuyHD9IjfcrwglF8DDstGUUyrwSoUqd7QsJEWv37dsvqS3+O X-Received: by 10.84.210.105 with SMTP id z96mr3612826plh.5.1512067898876; Thu, 30 Nov 2017 10:51:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512067898; cv=none; d=google.com; s=arc-20160816; b=Ws7LIU316sc7o+Ibrics9kS0yAReapdI5dUb3R4h+HeUWgcypcp3a+5EXpEaELE6Eo n/DF1AgZS1RqDEy/rjXGJN4rsu0fb7NeeVT78d/4brrN+dgoxjBNzgyc0oH1YVVYI2dQ 4M8Ly1YmhySyifUTOhJ4lX9dHeenmeWakEr8oIoPVFMJddUuukqA5FasimkpxBrx6kQG Nt2l2M7xc4thk7cLqCtHr6ycigMICywZ54Kb7swaQCO3HY8HHB8+rhpOaxP6zIIHvy8t uJcgN4mkONyrn6J3CM+bJ72FPdcbU2uW2Sx2vgTQU4emAPJOGRwYTJyj3eiSiVij9kPV JqYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=S1dfsihjgCWGxmSFGeCbjXNQkhOs2adjb8qH796oZDI=; b=F9SaX+fWh1ZbnDz1kjMy729tMOOU5UdPKNadozVKWGnXr9NO4uuVoKwfAp3+H0Ywc9 RSxgR7JbqUEHLGlJiV8/YsEb5Zb1iXuH+yD64WWsO0ntpktBcNzzAhvzFtdzMRlo8uwg uVaL6NuyVq0VtJqGxNL7Kfp305eFK+9MLrN+xCPgaDHLwvVZRHquPTfmdypXWDMct+iC Bd5nOm14C4U0TDEws9xPHUarUHx3biC8/CM5PAliQdrntUiRqxIGigMPifxDrYYMq4oQ E0JVugFe1HHMFIcQCpFUOHSJuX77J0pDJeokfhB+1hTqELbiFRjrVwB57U5ubyMsWUaK SgJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=FReVqqVb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si3645009pfg.163.2017.11.30.10.51.24; Thu, 30 Nov 2017 10:51:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=FReVqqVb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752189AbdK3StS (ORCPT + 99 others); Thu, 30 Nov 2017 13:49:18 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:34074 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752073AbdK3StR (ORCPT ); Thu, 30 Nov 2017 13:49:17 -0500 Received: by mail-io0-f193.google.com with SMTP id s19so8632751ioa.1 for ; Thu, 30 Nov 2017 10:49:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=S1dfsihjgCWGxmSFGeCbjXNQkhOs2adjb8qH796oZDI=; b=FReVqqVbbhzIBI6gOFHdEpsMg+4CMq1syZMRyGId0yGSOwIVjmTqINXi812RoQGnUv ZccFe71KJZ5Mqk99LahyXb0RcsFIBxbHH7rqeVRhMhqKUR5pQ7IWrK6qwoPlaBJzR/eX kNMhyPm7hOt0UMUPIs0OEHNO7COPxlLPDyFZFbG3Q0mB82Udg+MBQTOAllCPhICXrxeU /YShARUTIu66pspGj+AHyVv5rVov8dAxDhPfyquClGGWIG6orxziuZu20R7+OyhT1Mtw 1q8GkpAmsLVjfYVu4Bd/X901elSm4PDMOxZVEeZya/Tr2F6hYtXtkxGh/MAib0orlKDc 1RxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=S1dfsihjgCWGxmSFGeCbjXNQkhOs2adjb8qH796oZDI=; b=I7PsMQypHEC0OKMSM9JfWYd3anC5dghJGarB6s3fZKk3w1TAS5mEqV1b3zdvTqa4p2 QivFIeBv4nlfYYPCKqKw+HOptfpyvLNN+Jbw2SVlTU3jRfbq6ObCSamDrHksAZ3yUAD4 FvpLfYAdfQeMKd13yLQSbWMwWHP9QmErk/z+3rjn8tlASlwZuQRoYn5U6o2ziyD1dYNw XZIX7x9nU43WbGJM9oytFjS7VFak11bV7Zd0ISV9wSgUTMLHYjg+VeW0S3CH4gl7cawe hlYg12fYHnnCG5vqRPjPyrNJdU7ZjNdBpqNjTvkR22oenC1etDVVR9G9kxm85Jj20ITE z4ag== X-Gm-Message-State: AJaThX5H+ldreKFkyIGJSyR/WtdcYxl+gLqzTNxxtwZiGj0peNOQ2uel UFhytcuHGPiSboL6L1Q65cTMUDKCeIRGI+pz5UBWVk/B X-Received: by 10.107.183.1 with SMTP id h1mr8539122iof.183.1512067756623; Thu, 30 Nov 2017 10:49:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.133.35 with HTTP; Thu, 30 Nov 2017 10:48:56 -0800 (PST) In-Reply-To: References: <20171127104923.14378-1-mingo@kernel.org> <20171127104923.14378-16-mingo@kernel.org> <20171130154414.aekkjd26p3hxyqwa@hirez.programming.kicks-ass.net> <3ca0bea7-932a-6d91-a9b4-d07045d444f5@linux.intel.com> <20171130161844.v7ynfdggo6g7j5l5@hirez.programming.kicks-ass.net> From: Andy Lutomirski Date: Thu, 30 Nov 2017 10:48:56 -0800 Message-ID: Subject: Re: [PATCH 15/24] x86/mm: Allow flushing for future ASID switches To: Dave Hansen Cc: Peter Zijlstra , Ingo Molnar , "linux-kernel@vger.kernel.org" , Thomas Gleixner , "H . Peter Anvin" , Borislav Petkov , Linus Torvalds Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 30, 2017 at 10:44 AM, Dave Hansen wrote: > On 11/30/2017 08:18 AM, Peter Zijlstra wrote: >> On Thu, Nov 30, 2017 at 07:51:17AM -0800, Dave Hansen wrote: >>> On 11/30/2017 07:44 AM, Peter Zijlstra wrote: >>>> On Mon, Nov 27, 2017 at 11:49:14AM +0100, Ingo Molnar wrote: >>>>> @@ -338,24 +366,23 @@ static inline void __native_flush_tlb_single(unsigned long addr) >>>>> >>>>> static inline void __flush_tlb_all(void) >>>>> { >>>>> + if (boot_cpu_has(X86_FEATURE_PGE)) { >>>>> __flush_tlb_global(); >>>>> + } else { >>>>> __flush_tlb(); >>>>> + tlb_flush_shared_nonglobals(); >>>> I do however think this one is superfluous; if we do not have PGE we >>>> also do not have PCID and every CR3 switch flushes everything. >>> >>> I tried to sprinkle these around at all the sites that did non-global >>> kernel flushes. In the case that it's superfluous !KAISER, it's a noop >>> anyway. In the (currently unsupported) case that we *do* need it, well, >>> we need it. >> >> I'm confused. When would we need it there? > > __flush_tlb() does a flushing CR3 write that flushes the current PCID. > If we need other PCIDs flushed, we have to do it via the > tlb_flush_shared_nonglobals() mechanism. > > Does it matter today in practice? Nope, we never have that situation. > But, it also doesn't _hurt_ to have that line there in any way. Should it be tlb_flush_shared_nonglobals_if_kernel_and_user_pagetables_are_separate()? The whole idea that we can get away with ambiguous functions like __flush_tlb() seems to be much less true with KAISER. I think we should maybe start getting rid of overly vague functions like this. From 1585517813842071600@xxx Thu Nov 30 18:46:57 +0000 2017 X-GM-THRID: 1585216393710549190 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread