Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3623497ybt; Tue, 23 Jun 2020 07:01:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeoq9/qq+abKG8ep9eY2d38/SbwqHFF4uKhbC+ly4HeB35JJCfUUMFh3M8Riir62DhWMaQ X-Received: by 2002:a17:906:af6b:: with SMTP id os11mr21434927ejb.291.1592920894208; Tue, 23 Jun 2020 07:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592920894; cv=none; d=google.com; s=arc-20160816; b=VRLR0bxEkcriTZTHyM3GYmYoZSUuMpoDC9n7yaQnHe0WY/f90Ev6nV+sGUlfG/A26b MC48Y7k9Q2+4Jf25gnk/B1ueT0Ur/U/GPmjH/JtyV/+0xMgR+lSFQeSItC6VfS2KHo6k f/ggNNyLwB0x6140Bxr02Sls6w53TahzkUMIMCQTuqCdqqyoYda6kN1hkli1KrNlpRwF qE5tgY4MXQFVPYtJk0jcs9/vCCKleEojVUwYyDADWielEmkH9CIp1jxYxO5Z/CHJAIY3 VLQx0mo8wggnTheZTzwjWSsKOeW55cI3WEpw7JIkzsvLzZFLDhYFmpp3yBUoLowSouye W+yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:ironport-sdr; bh=F7LIYp0nzyI+kNN99fPVnwRjb2qlQMUAa10QNBJheG0=; b=U1pnbkZipAmJDEIKtZxDEN9KlgQcoc8+nT4jsTdWXVCWpKa6WyFN9M8C5z44gdl+D+ 2RxFL5p0ZOY5m7FJHadyy8Za8Mu9xXsxpC5SnL7eiGD/Sq/0xF48KbWgiruXfQ9wMIR+ RWLa1ElJEYgmuU8jyQjTSaqa9EfXpV0+x3qCmZuBRCsHcS6P3lYygvP+xE2kFCB+gQln hq/2dK46m9UnpzLIvjKeKEpubpO8by2jGJrdkwCFxaFrvPHv2lcqf/xY+6u70xYdzpcU fpPUjAJeyKf/1XuCecZG+3hscHM9fnOkJ89MxvzIUQa77E+nBxbr4f1L7xFmftQjPi2q h29A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=citrix.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h16si6731958edr.393.2020.06.23.07.01.09; Tue, 23 Jun 2020 07:01:34 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=citrix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732726AbgFWN51 (ORCPT + 99 others); Tue, 23 Jun 2020 09:57:27 -0400 Received: from esa1.hc3370-68.iphmx.com ([216.71.145.142]:50852 "EHLO esa1.hc3370-68.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732657AbgFWN50 (ORCPT ); Tue, 23 Jun 2020 09:57:26 -0400 Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: RxHCBkGn6WCYmKI8uhwqpDzWq9+T02hGLgx/4StGqp26rXVL/9EHUTW4ZgZWcdrwy973h8+FL1 vuqOMF+AEy3R03F6tyzjQrt2Z04lpSzdTjGVedKmE+8goFjOSXq8bTLW7X1REC5Cfa0KZuLHu2 2qD6s/B/VzsFyM3jt90pG1SIBE4FZqvelWngm1YJyUG8/pNVPZt+4klXSO5TluydnT49CwDygG limi5Xh2jdtnNS/3Y5BWVO88o78s3uWHLpkzsF9dVK1dQ3NXHK8JVP176FwTkg1lAJtb/ohx2C C6Y= X-SBRS: 2.7 X-MesageID: 21024354 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.75,271,1589256000"; d="scan'208";a="21024354" Subject: Re: Should SEV-ES #VC use IST? (Re: [PATCH] Allow RDTSC and RDTSCP from userspace) To: Peter Zijlstra 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" 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> <20200623124712.GF4817@hirez.programming.kicks-ass.net> From: Andrew Cooper Message-ID: <4113e368-6bc8-51b7-9412-3b4df2633ad6@citrix.com> Date: Tue, 23 Jun 2020 14:57:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200623124712.GF4817@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-GB X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL02.citrite.net (10.69.22.126) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/06/2020 13:47, Peter Zijlstra wrote: > 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. I presume you mean any #VC caused by RMP faults (i.e. something went wrong with the memory owner/etc metadata) ? If so, then yes.  Any failure here is a bug in the kernel or hypervisor (and needs fixing) or a malicious hypervisor and the guest should terminate for its own safety. ~Andrew