Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3573379ybt; Tue, 23 Jun 2020 05:52:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7mqH3VdGzP4IcHd3oBnC8ZSRT46lvS1Z6TdOVAszHpk8T356TOrNdsl3to5QKHq3vefv2 X-Received: by 2002:a17:906:fa13:: with SMTP id lo19mr11581797ejb.213.1592916744413; Tue, 23 Jun 2020 05:52:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592916744; cv=none; d=google.com; s=arc-20160816; b=xYDloXtAmpZSX4SKKwooQzi9pHZTjc1yLUcIvk6Fw+x8HXK3q/nIiXdyaJJL56KLXP lPkY8O7aoRnwP98hWx+Q8BI/0HJkcKuJCdLbMDk4tNIyQwQkPOIW6WuC14BaxJDFW8g5 Fqm0DIQ5LJPW4TqfBvpMTQMQg1lHMICheustY0KlaokekF4Tju0tPy2kcF0RR696/Zsm 7idTT3NG4H5YroROsWH7hIhkFBr6Uw0vvYp/4KQW7pCgZll0ViE28qT+dbNGmIDiWPf0 yTnCUaKoFUb8yv0n9q1a5il8RrT+RE6YrVV5g5n3hXuWYph3Hl3sFVG+Vg9EW9YjbXsf VpnA== 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=jkxt7OeaBk/EwjAl7ixAPt2rC0deom9YDh1Xj9i6T3I=; b=vv0Hor9WG0tgl7DuzrOQGLU/eYh8A6QTI+GMXoS54k7mQ7wDasD/JsAlesDswS+Rk6 G++6X7+AVUxPAjFj4cGsBGQuOs6kG8nitkR+fvzb88pjCUO2kKT6lUQ4/4D6GAr/qy/y JDtvGNIQNIba85lIGruknApGx/U4FnLNert/MZVs5mRxMn82gDpVabKsZ1bvpTi7nUfF CzENSZZihrkAxbN2iwL8bWtu7jaP8F326zMiApUKP6iOsmjOOLLDU5R3yPb83w2hxBaD Ku8Bo+MPtXoTkonWL1nIP+MG2/+iTmieCokRgsZ0FeR9v+vLB/mQ55EztiFHqaswi6Dn Qlxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=fwRVdhQd; 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 m1si10414183ejj.160.2020.06.23.05.52.00; Tue, 23 Jun 2020 05:52:24 -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=casper.20170209 header.b=fwRVdhQd; 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 S1732672AbgFWMrw (ORCPT + 99 others); Tue, 23 Jun 2020 08:47:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732604AbgFWMrv (ORCPT ); Tue, 23 Jun 2020 08:47:51 -0400 Received: from casper.infradead.org (unknown [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88E21C061573; Tue, 23 Jun 2020 05:47:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=jkxt7OeaBk/EwjAl7ixAPt2rC0deom9YDh1Xj9i6T3I=; b=fwRVdhQduSHsV4mqq0/FXOiPMS s0dHtMx1repRu6um7Uv/eCz+/1x0FzPev4WyvUhJe2f3EWmihYfJtP+kzCbDMxjWU8sDYGdhaBGiu H4LPSJdLsH6YIRcWVt9wom1Naz+buOKFzMeygtvDVDTo18unOPSJsTmuINEFYLM3ZHkQ244xmgUFb g13p8m+y9d8/1oB8QdUUaNGQfGCxekVXA56UtzDP4LK7l3UdgC6nZof0yg61zT3j6y5OmAUbpfIw5 sAiDHVxix5EYCPoRuvxjNyyYzMVVyY+S+9w9jqXuIWMGEzx7wLRqtdSdp7mLTil5iMfPBpignDOEC IaJTvNgQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jniKX-0002Qr-RG; Tue, 23 Jun 2020 12:47:13 +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 964B6300F28; Tue, 23 Jun 2020 14:47:12 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7ACB52370FA3D; Tue, 23 Jun 2020 14:47:12 +0200 (CEST) Date: Tue, 23 Jun 2020 14:47:12 +0200 From: Peter Zijlstra To: Andrew Cooper Cc: Joerg Roedel , Andy Lutomirski , Joerg Roedel , Dave Hansen , Tom Lendacky , Mike Stunes , Dan Williams , Dave Hansen , "H. Peter Anvin" , Juergen Gross , Jiri Slaby , Kees Cook , kvm list , LKML , Thomas Hellstrom , Linux Virtualization , X86 ML , Sean Christopherson Subject: Re: Should SEV-ES #VC use IST? (Re: [PATCH] Allow RDTSC and RDTSCP from userspace) Message-ID: <20200623124712.GF4817@hirez.programming.kicks-ass.net> References: <20200425191032.GK21900@8bytes.org> <910AE5B4-4522-4133-99F7-64850181FBF9@amacapital.net> <20200425202316.GL21900@8bytes.org> <20200428075512.GP30814@suse.de> <20200623110706.GB4817@hirez.programming.kicks-ass.net> <20200623113007.GH31822@suse.de> <8413fe52-04ee-f4e1-873c-17595110856a@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8413fe52-04ee-f4e1-873c-17595110856a@citrix.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 23, 2020 at 12:51:03PM +0100, Andrew Cooper wrote: > There are cases which are definitely non-recoverable. > > For both ES and SNP, a malicious hypervisor can mess with the guest > physmap to make the the NMI, #VC and #DF stacks all alias. > > For ES, this had better result in the #DF handler deciding that crashing > is the way out, whereas for SNP, this had better escalate to Shutdown. > Crashing out hard if the hypervisor is misbehaving is acceptable. Then I'm thinking the only sensible option is to crash hard for any SNP #VC from kernel mode. Sadly that doesn't help with #VC needing to be IST :-( IST is such a frigging nightmare.