Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6039453yba; Tue, 14 May 2019 00:08:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvJNx8NyW7LNGpm5NcQks4/CqNk9Ij087+oO/LusHTPT3MZu7X4TfAdSbmrpgxFuASGPXC X-Received: by 2002:a17:902:e48e:: with SMTP id cj14mr32839586plb.299.1557817729124; Tue, 14 May 2019 00:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557817729; cv=none; d=google.com; s=arc-20160816; b=CAsHRe7YcYikiivWsIxEwxqvWHhs+mMd5xnay/bndnBifkeoXGjb4aBYuL9f2PcGrs l9J+krv083EZahYaGFLfRh2uHXfkcDeYZNAGz25cLcTDaj0EW1x999Ou1+GFF4lIOPc/ EsmFg1BLKMptp0vp46dbarsXwmx+NJNSN5gkq7QQDi4bdGZNqLaHz1XdRbBNnz+MkCWi AjwlUkbi2JR3RMvqOYlSnz4riIjfzAfSBNW4/atRq1scpSAI1DQ23IEIVDmkZ+n+dHMo Wd2Q1xMMOCgfgKMfGTEIl8mSUDpC42NSWV225eklVZsoOywY27mOwv8xOEKGpTKk916+ +lpg== 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=bnleR30QPIQpq+EFwBkF6XZjkSnpThngrZ0Pg3kgcGM=; b=LNNkVfEjyZgYWya9LVmlRBoot7kDfyo6+e7mrNGOaiI93t3tJgR0QIiMajuE8IP4x5 Ry1xEZMDJsMlA2iPhlhU+I65Tsn4E4OjShndLNtWLed6y+KGwdcsmpnNGT/2QjiGrI3J z8KhsP+oMLOvp3MPwQv+e0LjUy8ewDEoqrJtSnDN/Es8nyOk4+YHUcIMk1o2NHwH64eM /bLKd9lRGckEI/V8Hy3nZRUoE9CvL/qJCO/ogrwSJzuRjjuRElL1btE5b2X3e2bPTPPW kWtw7TCl9qNJtDxCNZ5Rh8AGUH+3PBQIunmtG1qBjFj+05aGx2xx8kYt0tAd4nwVdkRu pPWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=fj8Pr4HG; 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 c193si19902786pga.6.2019.05.14.00.08.33; Tue, 14 May 2019 00:08:49 -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=merlin.20170209 header.b=fj8Pr4HG; 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 S1726429AbfENHHm (ORCPT + 99 others); Tue, 14 May 2019 03:07:42 -0400 Received: from merlin.infradead.org ([205.233.59.134]:34236 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725946AbfENHHl (ORCPT ); Tue, 14 May 2019 03:07:41 -0400 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: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=bnleR30QPIQpq+EFwBkF6XZjkSnpThngrZ0Pg3kgcGM=; b=fj8Pr4HGZz0EffcR3mMIilbKU fw2M4dJTleSkNrTFwvh8Xs0jEjW3csUzM6UlbkmE+h4NJSbyN1qXkhAjKCTsO61cTx+t8imqrXN8S 0rQ6trjzcgY+Ek1FpZg4xVOto/iAuNkyo2qkztLhyrNP7BQdtcOmzL0dqS9biIpCkVAZyFIF27KIq i59RJMm8ZVxQAWKjZk0Egm7j5WlaJRcSVPUVls0HDAmaHtOJzuXORnbslZy/3esomWW5W3XaQ5fMa kgMziZKLho0llyMphjzIedWd+CVfi8S5JmkjDx1A4voaVaOPz2muFlfyL9z/18kaC3Y9VpXA9rT9k KABV+JT4Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hQRX0-00063G-SZ; Tue, 14 May 2019 07:07:23 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E3F802029F87A; Tue, 14 May 2019 09:07:19 +0200 (CEST) Date: Tue, 14 May 2019 09:07:19 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: Alexandre Chartre , Paolo Bonzini , Radim Krcmar , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Dave Hansen , kvm list , X86 ML , Linux-MM , LKML , Konrad Rzeszutek Wilk , jan.setjeeilers@oracle.com, Liran Alon , Jonathan Adams Subject: Re: [RFC KVM 06/27] KVM: x86: Exit KVM isolation on IRQ entry Message-ID: <20190514070719.GD2589@hirez.programming.kicks-ass.net> References: <1557758315-12667-1-git-send-email-alexandre.chartre@oracle.com> <1557758315-12667-7-git-send-email-alexandre.chartre@oracle.com> <64c49aa6-e7f2-4400-9254-d280585b4067@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon, May 13, 2019 at 11:13:34AM -0700, Andy Lutomirski wrote: > On Mon, May 13, 2019 at 9:28 AM Alexandre Chartre > wrote: > > Actually, I am not sure this is effectively useful because the IRQ > > handler is probably faulting before it tries to exit isolation, so > > the isolation exit will be done by the kvm page fault handler. I need > > to check that. > > > > The whole idea of having #PF exit with a different CR3 than was loaded > on entry seems questionable to me. I'd be a lot more comfortable with > the whole idea if a page fault due to accessing the wrong data was an > OOPS and the code instead just did the right thing directly. So I've ran into this idea before; it basically allows a lazy approach to things. I'm somewhat conflicted on things, on the one hand, changing CR3 from #PF is a natural extention in that #PF already changes page-tables (for userspace / vmalloc etc..), on the other hand, there's a thin line between being lazy and being sloppy. If we're going down this route; I think we need a very coherent design and strong rules.