From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754755AbdKAOR4 (ORCPT ); Wed, 1 Nov 2017 10:17:56 -0400 Received: from mga14.intel.com ([192.55.52.115]:40834 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754727AbdKAORr (ORCPT ); Wed, 1 Nov 2017 10:17:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,329,1505804400"; d="scan'208";a="169967167" Subject: Re: [PATCH 21/23] x86, pcid, kaiser: allow flushing for future ASID switches To: Andy Lutomirski References: <20171031223146.6B47C861@viggo.jf.intel.com> <20171031223224.B9F5D5CA@viggo.jf.intel.com> Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , moritz.lipp@iaik.tugraz.at, daniel.gruss@iaik.tugraz.at, michael.schwarz@iaik.tugraz.at, Linus Torvalds , Kees Cook , Hugh Dickins , X86 ML From: Dave Hansen Message-ID: <38b34f81-3adb-98c5-c482-0d53b9155d3b@linux.intel.com> Date: Wed, 1 Nov 2017 07:17:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.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 On 11/01/2017 01:03 AM, Andy Lutomirski wrote: >> This ensures that any futuee context switches will do a full flush >> of the TLB so they pick up the changes. > I'm convuced. What was wrong with the old code? I guess I just don't > see what the problem is that is solved by this patch. Instead of flushing *now* with INVPCID, this lets us flush *later* with CR3. It just hijacks the code that you already have that flushes CR3 when loading a new ASID by making all ASIDs look new in the future. We have to load CR3 anyway, so we might as well just do this flush then.