Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5144437pxj; Wed, 9 Jun 2021 10:07:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/+8ykf22Yb2LoUuChpla9CUdPCauZUjmBWuerxefEBLKZj0vbYw9TGI3IphwpdnvEKq+R X-Received: by 2002:a17:907:628a:: with SMTP id nd10mr876278ejc.326.1623258442200; Wed, 09 Jun 2021 10:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623258442; cv=none; d=google.com; s=arc-20160816; b=ltKRXGAnPqBo55hfEIJotyy2CAXRKSqGcRJ4ReohfdDI+B7doVcY3O1wnxsIKeVySj hh70n+92752Jg8cpNuSKaUgs0d3tSBm6rVLUbZTsNfM4dTbfA/IQzamNfnvPojqJ5pyO Z+f0ltix9IqTiwtCONZm9+XzAobbv+7Pdb2w4k6dU0nRY0VVBVtR2eGNqNjDG2U5oJvc SxOLJjSYH9ZcKivZn+B1tJSKM4u/kJLHFIBDhhLiF1zV4tmK441UooDEwT2EcJeik10z Xm81AHnEUN0Bd4+uX8ocCgZ7NSrbIahjoLvzcBQh5SUqUx2Wk3c9en/F6VbGIoQe9P0w B9gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=0bU09cb9/SBQpP94XiRDRHZE8W7cY7KPx+ux2H6J2ek=; b=BSpzhfDxDgrWX4UECvu88A3EObNSjD4505jCMg3XwpRF/L90pwVvX52j8bx4yeo5BY DjVjRKsPkI9qY0dnmjOWo1owWIzNba1dgBKgq/IysuccLJbUVtp4bbydIUiHGmfJi6E6 JhIJbbsFpNR/ISQ2ecb3VYHbFIlLAWrKPhBB9V1lExmP1JEHSTGKJQcOY6PuAwvILgnM HzHhECJFfboJbtdRNbNJRQ2DaWswl14OeV4lAPgm6SXhprIQx6rFvrnpjG2m564p3HVW QWFEMnUfkaWzUUPs0UaHwoYwbVT6SNo7AfAWjh54mA1gf5yF/tXHG46mdDTzElw/5aGp 2Csw== 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 d6si284395ejz.127.2021.06.09.10.06.58; Wed, 09 Jun 2021 10:07:22 -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 S233508AbhFID6h (ORCPT + 99 others); Tue, 8 Jun 2021 23:58:37 -0400 Received: from mga02.intel.com ([134.134.136.20]:39375 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233410AbhFID6g (ORCPT ); Tue, 8 Jun 2021 23:58:36 -0400 IronPort-SDR: FhLlkfVlCuI1wXzfbXdCYVXcsUGya9JK/1q/kG2cf8KwaiCzcQMhe8+pLMEXEFZzqJBq3u3uRs Yjrnw8BfJdCw== X-IronPort-AV: E=McAfee;i="6200,9189,10009"; a="192106095" X-IronPort-AV: E=Sophos;i="5.83,260,1616482800"; d="scan'208";a="192106095" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 20:56:29 -0700 IronPort-SDR: Cd9eow8wzx6HxWE1eLyLNLGaIVsFrH6TLHLwvmmEx4RY6oglqGQyRV0NeYU/zrui9KIp5lJ1XR 9qJwBrISgSnA== X-IronPort-AV: E=Sophos;i="5.83,260,1616482800"; d="scan'208";a="402305187" Received: from dabarred-mobl1.amr.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.254.185.80]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 20:56:28 -0700 Subject: Re: [RFC v2-fix-v4 1/1] x86/tdx: Skip WBINVD instruction for TDX guest To: Dan Williams Cc: Peter Zijlstra , Andy Lutomirski , Dave Hansen , Tony Luck , Andi Kleen , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , Linux Kernel Mailing List References: <20210609011030.751451-1-sathyanarayanan.kuppuswamy@linux.intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: <682f0239-8da0-3702-0f14-99b6244af499@linux.intel.com> Date: Tue, 8 Jun 2021 20:56:27 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/8/21 8:40 PM, Dan Williams wrote: > ..."KVM gets away with it" is not a justification that TDX can stand > on otherwise we would not be here fixing up ACPICA properly. > > How about: > > "TDX guests use standard ACPI mechanisms to signal sleep state entry > (including reboot) to the host. The ACPI specification mandates WBINVD > on any sleep state entry with the expectation that the platform is > only responsible for maintaining the state of memory over sleep > states, not preserving dirty data in any CPU caches. ACPI cache > flushing requirements pre-date the advent of virtualization. Given TDX > guest sleep state entry does not affect any host power rails it is not > required to flush caches. The host is responsible for maintaining > cache state over its own bare metal sleep state transitions that > power-off the cache. If the host fails to manage caches over its sleep > state transitions the guest..." > > I don't know how to finish the last sentence. What does TDX do if it > is resumed after host suspend and the host somehow arranged for dirty > TDX lines to be lost. TDX guest does not support S3. It will be disabled in ACPI tables. It is a TDX firmware spec requirement. Please check the following spec, sec 2.1 https://software.intel.com/content/dam/develop/external/us/en/documents/tdx-virtual-firmware-design-guide-rev-1.pdf In TDX guest, we encounter cache flushes only in shutdown and reboot path. So there is no resume path. Will that be noticed by TDX integrity > mechanisms? I did not immediately find an answer to this with a brief > look at the specs. -- Sathyanarayanan Kuppuswamy Linux Kernel Developer