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=unavailable 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 E4502C04AB4 for ; Tue, 14 May 2019 07:37:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3E74208CA for ; Tue, 14 May 2019 07:37:53 +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="TyVPLD0S" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726663AbfENHhw (ORCPT ); Tue, 14 May 2019 03:37:52 -0400 Received: from merlin.infradead.org ([205.233.59.134]:34442 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbfENHhv (ORCPT ); Tue, 14 May 2019 03:37:51 -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=6IoQ7/a9IdkQHn1Z/AXbPyDzwjbmRx3DkVjFwe9CEr4=; b=TyVPLD0SuH8xFWcuuRZSwo1sP 8NH2oliCz6k+CkUA52kcYMXTQ7tI1VjhC7hYfxAFEAH2MZYgF66I00OTKLwbnA9zwoeDr5xf9yTAp EB8PrSa5tGh8JoV74QlruaIt827d4iHtIW8J6WUsCK0Js9irNEkaPSitW+rKhkYW7Ph6gqY84ach0 IYB0PN/E40HNVyTr7RZAcMu6LsLDAvaMI0S7UEbZPM9hfVJA6z8GKpaAineuy0Mt32gHv13QBjAAC 4kegUb2GuuJ6eO898xWcEwLFAS+STD4il34l65Pi3sp3p3fydhRKrA1qfUa83YvW9MSN5VVbJiTzN humsLFLew==; 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 1hQS0K-0006Br-11; Tue, 14 May 2019 07:37:40 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 8818D2029F87A; Tue, 14 May 2019 09:37:38 +0200 (CEST) Date: Tue, 14 May 2019 09:37:38 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: Liran Alon , 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, Jonathan Adams Subject: Re: [RFC KVM 00/27] KVM Address Space Isolation Message-ID: <20190514073738.GH2589@hirez.programming.kicks-ass.net> References: <1557758315-12667-1-git-send-email-alexandre.chartre@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 07:07:36PM -0700, Andy Lutomirski wrote: > On Mon, May 13, 2019 at 2:09 PM Liran Alon wrote: > > The hope is that the very vast majority of #VMExit handlers will be > > able to completely run without requiring to switch to full address > > space. Therefore, avoiding the performance hit of (2). > > However, for the very few #VMExits that does require to run in full > > kernel address space, we must first kick the sibling hyperthread > > outside of guest and only then switch to full kernel address space > > and only once all hyperthreads return to KVM address space, then > > allow then to enter into guest. > > What exactly does "kick" mean in this context? It sounds like you're > going to need to be able to kick sibling VMs from extremely atomic > contexts like NMI and MCE. Yeah, doing the full synchronous thing from NMI/MCE context sounds exceedingly dodgy, howver.. Realistically they only need to send an IPI to the other sibling; they don't need to wait for the VMExit to complete or anything else. And that is something we can do from NMI context -- with a bit of care. See also arch_irq_work_raise(); specifically we need to ensure we leave the APIC in an idle state, such that if we interrupted an APIC sequence it will not suddenly fail/violate the APIC write/state etc.