Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3230823pxb; Fri, 12 Feb 2021 12:40:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJztxYohv5/qmW6QGEp+Fd5pEaOyzCayOyealNMvTUJe+L0U5bsX1JXZa59QVlWvOuMuRQQl X-Received: by 2002:a17:907:7605:: with SMTP id jx5mr4858039ejc.340.1613162401915; Fri, 12 Feb 2021 12:40:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613162401; cv=none; d=google.com; s=arc-20160816; b=bUDdAtiPtRvf1GSgdTvz2HMsIvC4v5zacXpRuUoMroob2UTIkdP3hAzUjYmFEHsBiG b026+G3k1CnXqKqj45yh86OQecso0JTDHkd+UE1gKqAp5DdxieOzZmwVMxN0+QTuezSg X5Nvb+b/w8qEpz/D3Kt69mrsV69QKVOAplVR1Lme/qR25HVHuc0AWnTP5YUzh1C2XYTA YZWFe0kCEMaW+yy4nDa04bR4SXaH1d/X5esNlsi7wPS/8VvJVevJrHtOHJZ2iZ9eZn+L tflGtyPzPYOQZcvYAx/c9w8tMY7UYX585cCgDc2HM2/RBddWW20s8Iq3J1vknCAkLje2 BaMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=j66JtDHKSYYacXhJ57b4zqjxRlOZnEcxF+9VBlahFek=; b=sFIfh8Un+38Cueh8mGT5wN3thZcnX4N0ElT6HUpsEcUnpJzcx2Wv3OE32Nju6VGoT+ MBsCp3JoNWjsSMwF5kQiDD0SdvuSbjb3T4OdG2g74Br15v1FolsR1NiQB/Gu5SJBWS+8 4ewXUnzefHyBNzohxoEI7z96SR10UNTaJiunKc7tjqYL0wjaRy8f1q6zk4zR09SGsDjR hhFzGa/LDCaEmKYRq40tkGMhD5FZu8sNyYAo0XD5hk0e3/7E3VVgI1MKPsPvgmJGi1SZ aW6VJJL7UPtg6D2vh4H4Mw0nRGNFXds9CfRzc+dA0i+vk+VKxVMo6WwyQWq6yKMN5623 PjyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CqOjYfES; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kx25si6936970ejc.434.2021.02.12.12.39.39; Fri, 12 Feb 2021 12:40:01 -0800 (PST) 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=pass header.i=@google.com header.s=20161025 header.b=CqOjYfES; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231337AbhBLUiI (ORCPT + 99 others); Fri, 12 Feb 2021 15:38:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231289AbhBLUiH (ORCPT ); Fri, 12 Feb 2021 15:38:07 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5A7CC061756 for ; Fri, 12 Feb 2021 12:37:25 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id r2so441546plr.10 for ; Fri, 12 Feb 2021 12:37:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=j66JtDHKSYYacXhJ57b4zqjxRlOZnEcxF+9VBlahFek=; b=CqOjYfESwcESAZCqoaDy3zoo7YyZckVAYKVV/PK+2XaouNfrSmXWecHqTaiaHMe/a8 7p4eTSpcXiS1CtvHiwBduKYgH/R6g8rANcQSikbxLfDr6d4I6sDwqPSVFlV9IaOTEKyA 1rv3teKLA5/aYfs7Mw50AAJzwDrObXRdWE9YdmfmeQnTULAjALECsTjZ4L70ID/4wW4R 3wZEAGTMUQI69NmUcCbccTzzgKPcqIJQgZpfptixtWq2Q3g8JktG85JPUtYgoq8HMoJy qNnIirq1PauaPrhJxjfDlERNnIs6A0EY6smhgYMQ4/xG8nU0e0gCJB5dmqy+63S4bgfo nhsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=j66JtDHKSYYacXhJ57b4zqjxRlOZnEcxF+9VBlahFek=; b=slxoWPhSXJ9g1q8xd85jB8egXelK054lyMTYpkyQdzJQvbfRVHFclgi/6KrPuTbiSA D4/IcsGKBHFDcfRg878UjnpqwoaLL1/ZNPTF1muMDdkAY7kRf1jx9IwXMSCiM3NWoCEf BVytnDjtk8ddBCiDIpE7ua1i9jqdOcRlriDIVlmCFTAZ1Qg8Hs1QA2PxDI9q7LJTIiEd vh6It9gmuUGgZt8NQyAKFEVRve1+NHbF/tEJEhfN2/L6jfShbWwbMZflJqdNoqIyOyNq dcZB7YIIrakXGi0hIt7SZU/0JFGKuUPrBdD8yNeIOPadIOeE+GgLgJ0Puu7aLqZ4eiLY Gp5g== X-Gm-Message-State: AOAM531kSddZkG4WYgSCqikIZfsLijFWlYCbCKgdYc1tGYaWYmswEl7g xZMOojPKLQ6bYQiVOKSbj9Fhfw== X-Received: by 2002:a17:902:d886:b029:e1:7784:4db5 with SMTP id b6-20020a170902d886b02900e177844db5mr4407027plz.72.1613162245180; Fri, 12 Feb 2021 12:37:25 -0800 (PST) Received: from google.com ([2620:15c:f:10:b407:1780:13d2:b27]) by smtp.gmail.com with ESMTPSA id c15sm8572970pjc.46.2021.02.12.12.37.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Feb 2021 12:37:24 -0800 (PST) Date: Fri, 12 Feb 2021 12:37:18 -0800 From: Sean Christopherson To: Dave Hansen Cc: Andy Lutomirski , Kuppuswamy Sathyanarayanan , Peter Zijlstra , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Dan Williams , Raj Ashok , LKML , Sean Christopherson Subject: Re: [RFC v1 05/26] x86/traps: Add #VE support for TDX guest Message-ID: References: <48a702f536ccf953eee5778023ed6d1a452f6dcf.1612563142.git.sathyanarayanan.kuppuswamy@linux.intel.com> <8c23bbfd-e371-a7cf-7f77-ec744181547b@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8c23bbfd-e371-a7cf-7f77-ec744181547b@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 12, 2021, Dave Hansen wrote: > On 2/12/21 12:06 PM, Sean Christopherson wrote: > >> What happens if the guest attempts to access a secure GPA that is not > >> ACCEPTed? For example, suppose the VMM does THH.MEM.PAGE.REMOVE on a secure > >> address and the guest accesses it, via instruction fetch or data access. > >> What happens? > > Well, as currently written in the spec, it will generate an EPT violation and > > the host will have no choice but to kill the guest. > > That's actually perfect behavior from my perspective. Host does > something stupid. Host gets left holding the pieces. No enabling to do > in the guest. > > This doesn't *preclude* the possibility that the VMM and guest could > establish a protocol to remove guest pages. It just means that the host > can't go it alone and that if they guest and host get out of sync, the > guest dies. > > In other words, I think I'm rooting for the docs, as written. :) I tentatively agree that the host should not be able to remove pages without guest approval, but that's not the only use case for #VE on EPT violations. It's not even really an intended use case. There needs to be a mechanism for lazy/deferred/on-demand acceptance of pages. E.g. pre-accepting every page in a VM with hundreds of GB of memory will be ridiculously slow. #VE is the best option to do that: - Relatively sane re-entrancy semantics. - Hardware accelerated. - Doesn't require stealing an IRQ from the guest.