Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp756516pxj; Thu, 13 May 2021 16:34:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTkUmCcmOysqu7e2cOm88AKT0cWtRjguqeHoveqctt7pUFmOjzGZPdDem1rmbZAGyhXdma X-Received: by 2002:a05:6602:229a:: with SMTP id d26mr32074520iod.201.1620948893883; Thu, 13 May 2021 16:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620948893; cv=none; d=google.com; s=arc-20160816; b=T07CoANGTEo3mlRmrpKC+0tgpgxU60ukWZdZXXeS+CCj13FxTq3+2JhV/obaEF+R0o uj4/sL42KfmUjVVuF4KixNFE3zHc/5VMPpSERs9sv57ggmtOoJhIhUNv/Z2mR0cyut4D n7yYtSdTaJyCQu3naDkAUhHdQcJEwqLT6Bv8kNbPDJHAKudUSbJO0ohvwkcNgomv9NW6 qqwezYrRNgz81tmiQXVZShvnU4+udwEhRuMpKVDYySxjgItnjDZ1TIPPO0Mjhl9EfuHx SD73WN05Vhings6aWBKT05jxzjd2/VM8XUJwdbBisFDAjMvonWpz4QtYdZNdCEDCtu2e bJ5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=6ofJnvE7WyBWgzUhDjvGySgun1Ilu3Dq17UD6T2tna0=; b=b7KJWUn5c/a2w0g0HAsBiANHvrh1SufTFXFUbwBcsbPGXEdFEKvyK6xSVXZ2YJkrMg Xv3zc/OGOBeNT+CccSUnREubXnUSJ9cp/TJW8KSyfehAnYtYm/EaDHi1uSaXplTeTbJJ MCFpfmUXvDot8RycLyhgHV7FtZDFvc9nR4yZT/ohfwiWjFsnkGpzC88D72T6YwbY2pzr 8gfadLD/SS9/8dk3xoPJ4ZOtd5CN1VOwkAiCc4xxLweyaJzCzx4HzE7VGq4fKWpsphic qt6E0cr3NmZ5v1UJphqysEef52b0vfuHPofmfCpisn26Fct/nvxBoXXuXXdJTthieRU/ TPlw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d13si5602013ion.63.2021.05.13.16.34.39; Thu, 13 May 2021 16:34:53 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231993AbhEMTsW (ORCPT + 99 others); Thu, 13 May 2021 15:48:22 -0400 Received: from mga11.intel.com ([192.55.52.93]:22210 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230135AbhEMTsV (ORCPT ); Thu, 13 May 2021 15:48:21 -0400 IronPort-SDR: a8p0Q93fM7+saD7DqJHH6aAOp4fwej2SiBZhdGU8uEM0St36q5k08RUDWwyPL0zQZBRIl/lX5z pqroI+gt3FpQ== X-IronPort-AV: E=McAfee;i="6200,9189,9983"; a="196945757" X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="196945757" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 12:47:08 -0700 IronPort-SDR: QoPSEtLyEdfA5ldwortAGAZIgBcR+jfn/KWI6NOSaBDydTI8du9EOGMEutVJzt2hGozj+4xD+r Ll8gFYU73vXg== X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="401145820" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.209.17.244]) ([10.209.17.244]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 12:47:05 -0700 Subject: Re: [RFC v2 08/32] x86/traps: Add #VE support for TDX guest To: Dave Hansen , Kuppuswamy Sathyanarayanan , Peter Zijlstra , Andy Lutomirski , Dan Williams , Tony Luck Cc: Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , linux-kernel@vger.kernel.org, Sean Christopherson References: <8a1d6930f784cb57c957cf20cea870947db91e05.1619458733.git.sathyanarayanan.kuppuswamy@linux.intel.com> From: Andi Kleen Message-ID: <73752227-6eaf-2de6-3ac6-5ee280980c18@linux.intel.com> Date: Thu, 13 May 2021 12:47:04 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/7/2021 2:36 PM, Dave Hansen wrote: > On 4/26/21 11:01 AM, Kuppuswamy Sathyanarayanan wrote: > ... >> The #VE cannot be nested before TDGETVEINFO is called, if there is any >> reason for it to nest the TD would shut down. The TDX module guarantees >> that no NMIs (or #MC or similar) can happen in this window. After >> TDGETVEINFO the #VE handler can nest if needed, although we don’t expect >> it to happen normally. > I think this description really needs some work. Does "The #VE cannot > be nested" mean that "hardware guarantees that #VE will not be > generated", or "the #VE must not be nested"? The next half sentence answers this question.. "if there is any reason for it to nest the TD would shut down." So it cannot nest. > > What does "the TD would shut down" mean? I think you mean that instead > of delivering a nested #VE the hardware would actually exit to the host > and TDX would prevent the guest from being reentered. Right? Yes that's a shutdown. I Suppose we could add your sentence. > I find that description a bit unsatisfying. Could we make this a bit > more concrete? I don't see what could be added. If you have concrete suggestions please just propose something. > By the way, what about *normal* interrupts? Normal interrupts are blocked of course like in every other exception or interrupt entry. > > Maybe we should talk about this in terms of *rules* that folks need to > follow. Maybe: > > NMIs and machine checks are suppressed. Before this point any > #VE is fatal. After this point, NMIs and additional #VEs are > permitted. Okay that's fine for me. -Andi