Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3831902ybz; Tue, 28 Apr 2020 00:59:10 -0700 (PDT) X-Google-Smtp-Source: APiQypK8OpwvN06VNFJb1/jzNqX7B5f3fIEJBQTqxK3oGs7Rd1e+AsqItS1UkGrNG3CyN7r+Uss+ X-Received: by 2002:a17:906:f295:: with SMTP id gu21mr24173300ejb.83.1588060750306; Tue, 28 Apr 2020 00:59:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588060750; cv=none; d=google.com; s=arc-20160816; b=IovAtnZGKU0y4kPtkV9T6qg81KweaMVOKFCxsqo+uBXXFiG60cYd6M4mb43+fy1YQJ Qk9bfKQ5BT4n34F+rD2Ox2jTOrmdmSWwf4P1DIHcDKsT8serSsEl6NkKxseftlrgMQem btD48dsROQo3GFoARjtxwDES94oDKovZbmjcwGEn58tPh+C0m1n5d+RV7HrrVitPsnIc AHkrAZAOe89QugKzyAY1YgYxIgeo9cgd0X++PzAm15kSKJMcg/HN02j7FZBFVkGSN/Yl bHvtkCKdDIMBK4lFgHtarRGgSDWx1MGy/+jnBZ22yGOHz4yBE5zMnNwoOIinXKRBcMSn 8shw== 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; bh=o9VhRhlVApW+bEtb1R8E9jrAXy1l7bizYDA20bQQKbo=; b=EO7OyR3a63dgxInjvK3fhOGwQDsIpbR1JIyLz5PMcgbrCGY6pWXir/kFf+yokabdXy iXHGM9bZCxJMDZLgX8tndUP5KDlu6rQIJ1bAfH9Xwk6uT6uwcoQGAIRp99McLiZ6egOk +PkMbbWtj7TVw9V93fLFGFb76wiHYQvJ85G9VJ50ebvobenKO7d8VEA/0+txdTtXyTyI +CU5wuVaUQjujltASEOQagNMK2g/bmOiTLgeN6QW2sm/gnv92cIXLoILyiLxH9mvg/1/ vPV+cTQ1huCuC4ZuvJdxE9JXR6bMsR/U75KbqNL3Um3kWqH/H2NAg0qNxpor8ZWMUTLS io3g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b61si1049149edf.322.2020.04.28.00.58.46; Tue, 28 Apr 2020 00:59:10 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726838AbgD1HzT (ORCPT + 99 others); Tue, 28 Apr 2020 03:55:19 -0400 Received: from mx2.suse.de ([195.135.220.15]:42794 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbgD1HzT (ORCPT ); Tue, 28 Apr 2020 03:55:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 9F186ABCF; Tue, 28 Apr 2020 07:55:15 +0000 (UTC) Date: Tue, 28 Apr 2020 09:55:12 +0200 From: Joerg Roedel To: Andy Lutomirski Cc: Joerg Roedel , Dave Hansen , Tom Lendacky , Mike Stunes , Dan Williams , Dave Hansen , "H. Peter Anvin" , Juergen Gross , Jiri Slaby , Kees Cook , kvm list , LKML , Peter Zijlstra , 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: <20200428075512.GP30814@suse.de> References: <20200425191032.GK21900@8bytes.org> <910AE5B4-4522-4133-99F7-64850181FBF9@amacapital.net> <20200425202316.GL21900@8bytes.org> 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, Apr 27, 2020 at 10:37:41AM -0700, Andy Lutomirski wrote: > I have a somewhat serious question: should we use IST for #VC at all? > As I understand it, Rome and Naples make it mandatory for hypervisors > to intercept #DB, which means that, due to the MOV SS mess, it's sort > of mandatory to use IST for #VC. But Milan fixes the #DB issue, so, > if we're running under a sufficiently sensible hypervisor, we don't > need IST for #VC. The reason for #VC being IST is not only #DB, but also SEV-SNP. SNP adds page ownership tracking between guest and host, so that the hypervisor can't remap guest pages without the guest noticing. If there is a violation of ownership, which can happen at any memory access, there will be a #VC exception to notify the guest. And as this can happen anywhere, for example on a carefully crafted stack page set by userspace before doing SYSCALL, the only robust choice for #VC is to use IST. Regards, Joerg