Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2399772ybl; Thu, 29 Aug 2019 07:42:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/TGenOrOE8Vc78/1TEBwy6xIGvbu1sf9CeivbTM81dCs0RK47/ldSW6tk39E390YKOUqw X-Received: by 2002:a17:902:1c7:: with SMTP id b65mr10101663plb.313.1567089728516; Thu, 29 Aug 2019 07:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567089728; cv=none; d=google.com; s=arc-20160816; b=dSJ5TKo2dFYRC76F89tnWAHNB9/JQaCunwfGGKTS7t5ftDfeARIQT2dXZqZgZsKNqO DUcKW3tjZCqWDY2mRBsx9WGMMuQlfZr9RNpr7sYz95JeWqcZX1GSrXSeqkkMViuqq3wU AzpjcHDDvp+AfccIumSuN6j0AF073CEM+9kgclH+VoLA13x9PJ0upSaa/O78/QEzlYnA GrfRfZT17D2k0pkp1l3vwTS1jsN/6qUd7bfGJRhI09zgNfugzW7EUAgEYmcHDmFwLJvt GEiDLGjUC1yfS4DkSKTXvzgP+yy9b2sO/+K8tAPlUyffkBS9XN6K9HD0b0B0EB49Ds8k l/tg== 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=ox4TpDVV8qRbeaPwwUMz7SCc5tRwz9+n1dU1L+APswQ=; b=cxi30FXx6U5VjbmINVWCJxBRRRTbP0/n5hytWVg5C3tgNKFthG5QhdloI8q4JDeXQ/ 7MQlIQVo3QGINeALul/PIC6mXZoCxMoTm1P8NCRZFrsiKM2Rd7AMb7g4IkCUjaBc+kEG QdkMh5+cfvcDzmuHndNJEx84Fl9uiA+aMX2+Z4Z/ZC5DJ5U96oX8p65mO6FvHOKf3mIk hBVf9CqwSK+8+l43xH54lHlaUUqCMIplQAYlaS+HudR2OFdOyy6AoyaxOrJKs2B2WYVG OVAL5H3KMWLRicBli3RL/fP+drJdOrB8uLNPDyPHKJTxF24eZzcoa0EqnUqbunFLaB47 KkxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fyV4taM3; 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 br18si2305350pjb.52.2019.08.29.07.41.51; Thu, 29 Aug 2019 07:42:08 -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=fyV4taM3; 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 S1728195AbfH2Oi4 (ORCPT + 99 others); Thu, 29 Aug 2019 10:38:56 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:47836 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727976AbfH2Oiy (ORCPT ); Thu, 29 Aug 2019 10:38:54 -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=ox4TpDVV8qRbeaPwwUMz7SCc5tRwz9+n1dU1L+APswQ=; b=fyV4taM3dif6HaciKx9pLvvSI MU/I8meBwuQ81JsRtjD8jd3jelNcdVSx2M3F8E9BW1ZxzvAVGNaC0KUyK1ee3ZJzLPqXusgOnumQy FZoGwuIkBZFtZcYFiWgcl53GF8yya6AVFVdqUtq1TVrJvmRNyfLQsVBjY9Xd2waCrEF3RgHX3GYMi eNNSaxDv2CTxLdxfEFYN2/t0ZpQzAQJdKuwQ/fn3fAPK/7PRDhK8NdCBChEEyBLGMgXXm3gbDM8wG XtjDSmNMEQDA+Jo7p4898WPJuz2KHGXiRcrGUBxBeZDoTIM0Zo86ChdsA0TYoRVZx9IU7auLfTk2w I/j7badlg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i3LZ9-0007xw-RZ; Thu, 29 Aug 2019 14:38:24 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id EDEC53013A2; Thu, 29 Aug 2019 16:37:46 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 33AF1202411BF; Thu, 29 Aug 2019 16:38:21 +0200 (CEST) Date: Thu, 29 Aug 2019 16:38:21 +0200 From: Peter Zijlstra To: Phil Auld Cc: Matthew Garrett , Vineeth Remanan Pillai , Nishanth Aravamudan , Julien Desfossez , Tim Chen , mingo@kernel.org, tglx@linutronix.de, pjt@google.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, subhra.mazumdar@oracle.com, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Aaron Lu , Aubrey Li , Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Subject: Re: [RFC PATCH v3 00/16] Core scheduling v3 Message-ID: <20190829143821.GX2369@hirez.programming.kicks-ass.net> References: <20190827211417.snpwgnhsu5t6u52y@srcf.ucam.org> <20190827215035.GH2332@hirez.programming.kicks-ass.net> <20190828153033.GA15512@pauld.bos.csb> <20190828160114.GE17205@worktop.programming.kicks-ass.net> <20190829143050.GA7262@pauld.bos.csb> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829143050.GA7262@pauld.bos.csb> 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 Thu, Aug 29, 2019 at 10:30:51AM -0400, Phil Auld wrote: > On Wed, Aug 28, 2019 at 06:01:14PM +0200 Peter Zijlstra wrote: > > On Wed, Aug 28, 2019 at 11:30:34AM -0400, Phil Auld wrote: > > > On Tue, Aug 27, 2019 at 11:50:35PM +0200 Peter Zijlstra wrote: > > > > > > And given MDS, I'm still not entirely convinced it all makes sense. If > > > > it were just L1TF, then yes, but now... > > > > > > I was thinking MDS is really the reason for this. L1TF has mitigations but > > > the only current mitigation for MDS for smt is ... nosmt. > > > > L1TF has no known mitigation that is SMT safe. The moment you have > > something in your L1, the other sibling can read it using L1TF. > > > > The nice thing about L1TF is that only (malicious) guests can exploit > > it, and therefore the synchronizatin context is VMM. And it so happens > > that VMEXITs are 'rare' (and already expensive and thus lots of effort > > has already gone into avoiding them). > > > > If you don't use VMs, you're good and SMT is not a problem. > > > > If you do use VMs (and do/can not trust them), _then_ you need > > core-scheduling; and in that case, the implementation under discussion > > misses things like synchronization on VMEXITs due to interrupts and > > things like that. > > > > But under the assumption that VMs don't generate high scheduling rates, > > it can work. > > > > > The current core scheduler implementation, I believe, still has (theoretical?) > > > holes involving interrupts, once/if those are closed it may be even less > > > attractive. > > > > No; so MDS leaks anything the other sibling (currently) does, this makes > > _any_ privilidge boundary a synchronization context. > > > > Worse still, the exploit doesn't require a VM at all, any other task can > > get to it. > > > > That means you get to sync the siblings on lovely things like system > > call entry and exit, along with VMM and anything else that one would > > consider a privilidge boundary. Now, system calls are not rare, they > > are really quite common in fact. Trying to sync up siblings at the rate > > of system calls is utter madness. > > > > So under MDS, SMT is completely hosed. If you use VMs exclusively, then > > it _might_ work because a 'pure' host doesn't schedule that often > > (maybe, same assumption as for L1TF). > > > > Now, there have been proposals of moving the privilidge boundary further > > into the kernel. Just like PTI exposes the entry stack and code to > > Meltdown, the thinking is, lets expose more. By moving the priv boundary > > the hope is that we can do lots of common system calls without having to > > sync up -- lots of details are 'pending'. > > > Thanks for clarifying. My understanding is (somewhat) less fuzzy now. :) > > I think, though, that you were basically agreeing with me that the current > core scheduler does not close the holes, or am I reading that wrong. Agreed; the missing bits for L1TF are ugly but doable (I've actually done them before, Tim has that _somewhere_), but I've not seen a 'workable' solution for MDS yet.