Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp859789ybi; Fri, 12 Jul 2019 05:51:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8Lo7F9JonQjlDwVi7u4CAPvKzeFMnz+2m224m7MxF4M32G9KzpnkA37StCQh4Bp5U4JUT X-Received: by 2002:a17:90b:28f:: with SMTP id az15mr11496157pjb.18.1562935912038; Fri, 12 Jul 2019 05:51:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935912; cv=none; d=google.com; s=arc-20160816; b=q6o7YMd/u6NsDULtcMdg6QSDkQ2b5YCh3aGowHlo05kpaVZ1qeflkW7tHcwmO3jM9S 2vsMOvO8pGhSQH+i+CNNiQDAlIHV42xxsbO8ufc877oAGgiRz65qjEG+njrlIk5wGpmE GHhndmHVKtxoGo+oEZAEz9rpE9J9Wy8Zot0VguWjazykwOB3CwaHHUWwpOwblAP94uZY Aa6JMKe6oYsboeFkCBILYDwKtYrqSgF/69h9nqrW1ovBhPwHLvSXONO4RrMugLCmjZIe UFATdjn0b7c2sGzLSYiCqyqnKv72/dnoHWnjLjtn0kbkhdXIcumdm7aGmvSBlbD30dzO 6z+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rwpolTjZGqbTjwkLH0mAAIVI9rPZBe7E59f4u4dvndk=; b=n0+oSc2b+Ng86nM6o7YWSDTOwcYFbKlvNIQHmvcnYJ46UMAKuXjqPckzLJOul8FXp5 1qdZ0ho1nOXSXqgWk1CIddnQf15Dk2N/2/tVKAvCqbKz2PURb9EDLNZGei0gvlmEV99z F2unJO9dSJyyfVtazPHXz1VzUdyhYjWdarUy00riwRywNXXY1ac7Gv9ETuBAc5hORM6h 9g0OanVVR8QCdeDRanrMnBP6u7as1qAskOh5GTYf9eeM1Qc1BY3Q5cunHTl33Iwn4ufP 27SdBPuadoIZYK170kd9A/cpr1oop3n/BkApVjBJxF1IEZ0PUvMNp3RAyNH/QMw4nKYJ ksYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=M2dP09VM; 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 u12si8201064pfm.6.2019.07.12.05.51.36; Fri, 12 Jul 2019 05:51:52 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=M2dP09VM; 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 S1727290AbfGLMvK (ORCPT + 99 others); Fri, 12 Jul 2019 08:51:10 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54928 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727074AbfGLMvK (ORCPT ); Fri, 12 Jul 2019 08:51:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rwpolTjZGqbTjwkLH0mAAIVI9rPZBe7E59f4u4dvndk=; b=M2dP09VMp056HkHzjt4KD8h0P pj6x6MKN2KDyASTibms8pAubzJ1mr3Q41T5d9AbtwAdaZ7h5k8x3fIJL+eT7wXHVf4JC6fk9HXPkd Dl+vY4CxPI7HGeG5FRxCOoZOf+vS0SugPI9EnN3u5EEH+KgIrWyeM9oITXrkmbUl2JrcbiL8X0hip zWBcCskL2lMgRkYMZhT0e0cE6dgndhjznxtrzxudGf5lkhjjHKJGRS2R9TnhQ7woa9LpARKBL13k+ 6O5AuHeVjb4+jADAERfPyUCDygpN1T1I9gL6OaxZnhW7VPjq1virgpae/SjTED2hovlyYB1GQPs3X GHeANTbMQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hlv0v-0000Mt-GX; Fri, 12 Jul 2019 12:51:01 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BC3D4209772EE; Fri, 12 Jul 2019 14:50:59 +0200 (CEST) Date: Fri, 12 Jul 2019 14:50:59 +0200 From: Peter Zijlstra To: Alexandre Chartre Cc: Thomas Gleixner , Dave Hansen , pbonzini@redhat.com, rkrcmar@redhat.com, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, kvm@vger.kernel.org, x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, konrad.wilk@oracle.com, jan.setjeeilers@oracle.com, liran.alon@oracle.com, jwadams@google.com, graf@amazon.de, rppt@linux.vnet.ibm.com, Paul Turner Subject: Re: [RFC v2 00/27] Kernel Address Space Isolation Message-ID: <20190712125059.GP3419@hirez.programming.kicks-ass.net> References: <1562855138-19507-1-git-send-email-alexandre.chartre@oracle.com> <5cab2a0e-1034-8748-fcbe-a17cf4fa2cd4@intel.com> <61d5851e-a8bf-e25c-e673-b71c8b83042c@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <61d5851e-a8bf-e25c-e673-b71c8b83042c@oracle.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 12, 2019 at 01:56:44PM +0200, Alexandre Chartre wrote: > I think that's precisely what makes ASI and PTI different and independent. > PTI is just about switching between userland and kernel page-tables, while > ASI is about switching page-table inside the kernel. You can have ASI without > having PTI. You can also use ASI for kernel threads so for code that won't > be triggered from userland and so which won't involve PTI. PTI is not mapping kernel space to avoid speculation crap (meltdown). ASI is not mapping part of kernel space to avoid (different) speculation crap (MDS). See how very similar they are? Furthermore, to recover SMT for userspace (under MDS) we not only need core-scheduling but core-scheduling per address space. And ASI was specifically designed to help mitigate the trainwreck just described. By explicitly exposing (hopefully harmless) part of the kernel to MDS, we reduce the part that needs core-scheduling and thus reduce the rate the SMT siblngs need to sync up/schedule. But looking at it that way, it makes no sense to retain 3 address spaces, namely: user / kernel exposed / kernel private. Specifically, it makes no sense to expose part of the kernel through MDS but not through Meltdow. Therefore we can merge the user and kernel exposed address spaces. And then we've fully replaced PTI. So no, they're not orthogonal.