From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32169C04AB4 for ; Tue, 14 May 2019 07:07:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 053D8208C3 for ; Tue, 14 May 2019 07:07:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="fj8Pr4HG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726495AbfENHHm (ORCPT ); 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.