Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp562496ybz; Fri, 17 Apr 2020 06:13:45 -0700 (PDT) X-Google-Smtp-Source: APiQypLGC9yxQMMg0JbQlfo08QDPc8zKGSoxGWz1LHaJETiWHcslK1RgMq4zNC88ch0rNV2PJRl6 X-Received: by 2002:a17:907:118b:: with SMTP id uz11mr2829227ejb.89.1587129225294; Fri, 17 Apr 2020 06:13:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587129225; cv=none; d=google.com; s=arc-20160816; b=Og7dBxY3SPV2WAtDTQzH1ZNgEIln99wTFopjJYTAHeRUxU9MtHJX5dH+Kp8sKzkCSV mNIk8Sxu7qSrYefAxPdXPZD2RrlFgLpD4nlTyqVaepYWqhUqSD4mm5NYbeMU23aA3ORf ptUwCFbb4qHIGOL1n+wbl2JAqrPZsVwHGmG+R8GBmrFAanQW39lat5bT53ETE18rNtMu Nex37XPpA0v2w1aLKpPFFDl/4yWuYUaFCLRVmSlTFi6Q+Sv+wmNS6q+nXeKtaqvbiFRX wEG0Ual4PpyiAYTavn/CLdywL/i0iVPt/kG9Je+TuvdopaVv+GiGOBx20f0oYxQL3zCr v2Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=tQqJmxt0Xkc0cudnjKOkdSBVqtWLrH6kV1595ZGPmO4=; b=MqniPRtRAHE41/Mmwms3I/PgrWY7Eoy8EVlNZc8yVs2tpkZpJebSsEWHsdXQsq254C m2T5d/Jtkax/v9K+jIjzcZc1cSxyqdMPmcCHE+DXa4o2Iu2SRDsF/DX4RjDtsCRjEsCc +CSyQh+ICVie9DDzNjr0AaBYjewVp+bqsUA561XTbXFeXfTylVWvpOHJL+dLQddLsqGB wsQIQ//D5CdWrhSV9IOZcWaFfDzADq1ouQ9vjw1m2QxH58EKYSM+iowAqbGhUitoh5cN ouyWaFP04uw1riTWaMBeoDqK3/yg3BGbqmins0yKb9vIB+oXCcoWVMD3LSA00MO4QZmp tCxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="c/2Q29xy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di17si3221083edb.593.2020.04.17.06.13.21; Fri, 17 Apr 2020 06:13:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="c/2Q29xy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730263AbgDQNJC (ORCPT + 99 others); Fri, 17 Apr 2020 09:09:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729799AbgDQNJC (ORCPT ); Fri, 17 Apr 2020 09:09:02 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFF2EC061A0C for ; Fri, 17 Apr 2020 06:09:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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; bh=tQqJmxt0Xkc0cudnjKOkdSBVqtWLrH6kV1595ZGPmO4=; b=c/2Q29xyFdDG9GHCFwZpEAEW+n XFk5vl+9GagW3S8OUS2QGwu0AS+C38bxBgqAUxZMPPFBMOir59Fs0PNwPFI/BcsZjbXUALajwugsc PdLQUQ9NFSIz4PClpj9nVkLIl1PSzyzfU5z1IRvu1OFMRGVrRp+fqWnLYgR3VG49YcZYu+80TBbDt d3pL9O6NzAYohPx5OzNeTeywp0GcZYtwHID3X0SmWO0VxdREUtuOdZKYRc6erk2KMoWFWUWRwvbeL 6vqo0d9o6zpZST7j7HG0ynDd2uFHFXLsfGy5hnhdSiqCL6wXPYAvsFaMyvo0g5Q+TZrYs05JrEl/t g4S5URPg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jPQjL-000092-Pq; Fri, 17 Apr 2020 13:08:28 +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 D54BE3015D0; Fri, 17 Apr 2020 15:08:25 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 647DF2B121688; Fri, 17 Apr 2020 15:08:25 +0200 (CEST) Date: Fri, 17 Apr 2020 15:08:25 +0200 From: Peter Zijlstra To: Alexander Graf Cc: Joel Fernandes , vpillai , Nishanth Aravamudan , Julien Desfossez , Tim Chen , mingo@kernel.org, tglx@linutronix.de, pjt@google.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, keescook@chromium.org, kerrnel@google.com, Phil Auld , Aaron Lu , Aubrey Li , aubrey.li@linux.intel.com, Valentin Schneider , Mel Gorman , Pawan Gupta , Paolo Bonzini Subject: Re: [RFC PATCH 00/13] Core scheduling v5 Message-ID: <20200417130825.GE20730@hirez.programming.kicks-ass.net> References: <20200414142152.GV20730@hirez.programming.kicks-ass.net> <20200415163220.GA180518@google.com> <20200417111255.GZ20730@hirez.programming.kicks-ass.net> <79529592-5d60-2a41-fbb6-4a5f8279f998@amazon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79529592-5d60-2a41-fbb6-4a5f8279f998@amazon.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 17, 2020 at 02:35:38PM +0200, Alexander Graf wrote: > On 17.04.20 13:12, Peter Zijlstra wrote: > If we first kick out the sibling HT for every #VMEXIT, performance will be > abysmal, no? I've been given to understand that people serious about virt try really hard to avoid VMEXIT. > > That doesn't completely solve things I think. Even if you run all > > untrusted tasks as core exclusive, you still have a problem of them vs > > interrupts on the other sibling. > > > > You need to somehow arrange all interrupts to the core happen on the > > same sibling that runs your untrusted task, such that the VERW on > > return-to-userspace works as intended. > > > > I suppose you can try and play funny games with interrupt routing tied > > to the force-idle state, but I'm dreading what that'll look like. Or > > were you going to handle this from your irq_enter() thing too? > > I'm not sure I follow. We have thread local interrupts (timers, IPIs) and > device interrupts (network, block, etc). > > Thread local ones shouldn't transfer too much knowledge, so I'd be inclined > to say we can just ignore that attack vector. > > Device interrupts we can easily route to HT0. If we now make "core > exclusive" a synonym for "always run on HT0", we can guarantee that they > always land on the same CPU, no? > > Then you don't need to hook into any idle state tracking, because you always > know which CPU the "safe" one to both schedule tasks and route interrupts to > is. That would come apart most mighty when someone does an explicit sched_setaffinity() for !HT0. While that might work for some relatively contained systems like chromeos, it will not work in general I think.