Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6061994yba; Tue, 14 May 2019 00:39:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyETpGOb3p3RFqX0PXTJ2iJjWF3SYXdIezqVvn31xjaOKKjul4IPUpVFQP/Y9cOnKPbcRt2 X-Received: by 2002:a63:4045:: with SMTP id n66mr22009266pga.386.1557819546554; Tue, 14 May 2019 00:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557819546; cv=none; d=google.com; s=arc-20160816; b=0lrXrDmlyfHYiVnRzEtEUpKSXMZjK/9Li4vGY0ssM+x78/dX+8JK6bHuPPs/7r5a/0 Mra5DrfBg5eQgCV4hLkbb3IwfulIpSGXiMHUQXFfv8+2cWWM3t/bHKsjI9ycrP29sFGS kwfxY2VfdjK/tngy3Js4QIV/G6FfpfvR0pYEDN3dnDODggGuvJjEoAXObnMBciEP/sXs ekK+i1nNBSklTX6cwzre9WcSl0K0HaU51zBVD22sd8TYGEFNXyJ3ZtYR/nwhICZGx+CQ FSdO6FEZ8OwiqbxOAYQIHu2oc9CcRShgV+O25z9QntYHrISbKRn47ZhbjQHE3tIhyMNr QjfQ== 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=6IoQ7/a9IdkQHn1Z/AXbPyDzwjbmRx3DkVjFwe9CEr4=; b=LmsV2qK1sE6PdPxGvk8o7kDjyyHH9MBEaQJ3yR9kzmbvOdrn+Irz0Mr3hCAlYO66j4 a6UMD/DWKEdXCJgaDJX0Xlk7O6ONy/q3AoKCX5nln3wm2YNPq716X5RDdLlwtzfnbzWn D8vIZz0W1gtXfh+QnlralBQ3FHTDuFaXeASRQpuVbu5WMnBb5CvI9uL+iv/eMHErQnXt AL22ZpjbIIfvp56/0POEBs2n77SpwWWbcgQ/t/mDvsq3LZwMn2wMgnhSFoFiFfLZSYnD KvvXZYGdd/TwT2XYSNjmDA5DcfZDn52YXc1SoTXLUlb9Lg1sFXXpEt6q08n6CncFFyPs vRjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=TyVPLD0S; 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 191si957041pfa.100.2019.05.14.00.38.51; Tue, 14 May 2019 00:39:06 -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=TyVPLD0S; 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 S1726656AbfENHhw (ORCPT + 99 others); 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.