Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3534289ybt; Tue, 23 Jun 2020 04:51:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzr7D17PTvVJHeGoYalki+StdnbnyOwfZnpQU8ZPnitBAOto3yG7y55zQPIDPuy99fUDabJ X-Received: by 2002:a17:906:af76:: with SMTP id os22mr18985408ejb.191.1592913095717; Tue, 23 Jun 2020 04:51:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592913095; cv=none; d=google.com; s=arc-20160816; b=B7Nf5yZgMjT7k0rJ4m1pT5coQPR2X3tEW6wJL8WzM4J9cEWRxADLaI4VkXj7ySEMQC twzOPHP5dG9qsdxjQT3DTKibK+MorUVqliObevt8iULtpc7oeUQvSJkh0Y/PlsIyHWks Xzu5FhqyPnsupSVzixNUO2eGGjOxB8ycp5TyuPPYYGLfwjs17DigPGhIjEc78xBq7Xx8 trqRj/cM7bFy32YWbf39JHKpWik+sTbWsmrd0PKsqExK3+zN3WUcV2OuiNva30GHieEW 99OJZPsalysxctSfoDFP+tXPOLLAhFXKE7XwMiTSVSr9xa4FbQ4HZVk++GVOEt3E6Ta1 HCIw== 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=jDPd8VkI8efCBcrOsnIHTnPuv2t1otNb8V/eq4wKFwo=; b=yDqerJdPy//O/oyoqzU4fIlE2E9KLASXNnJSW2vjiEvjjqrhdAZ4tFCJ//4b8lJ3UG +BltNoV/YSFTgZMuJeiM1kDWEYW7f/87opye3yMbqBOF8G7/onGexVUFH+TocgkVaYXo Stv6wuc2DnGuqjNh4D/zHb9GWTwB9ctZgCXQmRnAR8rwMLeEMvxvJ2aO2P9P87Nz8HTj qTS+3nWQQ0y+eyLHL1BSrVCfI0Cd3f6KGVbjjlsqn47SrnYG+eGmi0JfBAH/akxT5TJk uoVW43YBTpqSHSdTUTIkGWgwjCrXlQ5w6HfK1yH8art4SQ7WYsVkYTo7FOp/EbfWdlq2 u4iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=YZPRv33A; 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 h15si11360440ejc.125.2020.06.23.04.51.12; Tue, 23 Jun 2020 04:51:35 -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=YZPRv33A; 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 S1732554AbgFWLsy (ORCPT + 99 others); Tue, 23 Jun 2020 07:48:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732393AbgFWLsw (ORCPT ); Tue, 23 Jun 2020 07:48:52 -0400 Received: from casper.infradead.org (unknown [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E567C061573; Tue, 23 Jun 2020 04:48:52 -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=jDPd8VkI8efCBcrOsnIHTnPuv2t1otNb8V/eq4wKFwo=; b=YZPRv33A9sygKFDGs9Y3X0oRsV vmYCaQC9/Kvjb6UQCZbskfYgSjkfL5ugrXGLpOXC+8OUdEV+XucaC3EHCUJ3BFUItgxiMgd+WaYso n10PDALn2CiVFgXkQ29oaZeXF9QqcC2ueTT/fPIitlLBsf8EITO9OTrIZgnx8koACzNASxCLk2aF5 4agvl2fBbWKp/npms27JBSbSUpCEqLE5XhWYsGO+7kTvz2VB/3Tvgf8Rr7K+0gggkPNlkxmiw8AOf F05IE/gKqYYe62LnniblDoyzqm0phobGbKZNM3Fp09sWJxuJXMf2asDF2J7Dq/Zdvof8nFPNflCJ+ ievLNt7g==; 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 1jnhPY-00082L-3n; Tue, 23 Jun 2020 11:48:20 +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 E2E77303DA0; Tue, 23 Jun 2020 13:48:18 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id D65CB2370FA3D; Tue, 23 Jun 2020 13:48:18 +0200 (CEST) Date: Tue, 23 Jun 2020 13:48:18 +0200 From: Peter Zijlstra To: Joerg Roedel Cc: 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 , Andrew Cooper Subject: Re: Should SEV-ES #VC use IST? (Re: [PATCH] Allow RDTSC and RDTSCP from userspace) Message-ID: <20200623114818.GD4817@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200623113007.GH31822@suse.de> 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 01:30:07PM +0200, Joerg Roedel wrote: > Note that this is an issue only with secure nested paging (SNP), which > is not enabled yet with this patch-set. When it gets enabled a stack > recursion check in the #VC handler is needed which panics the VM. That > also fixes the #VC-in-early-NMI problem. But you cannot do a recursion check in #VC, because the NMI can happen on the first instruction of #VC, before we can increment our counter, and then the #VC can happen on NMI because the IST stack is a goner, and we're fscked again (or on a per-cpu variable we touch in our elaborate NMI setup, etc..). There is no way I can see SNP-#VC 'work'. The best I can come up with is 'mostly', but do you like your bridges/dikes/etc.. to be mostly ok? Or do you want a guarantee they'll actually work? I'll keep repeating this, x86_64 exceptions are a trainwreck, and IST in specific is utter crap.