Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3981983pxj; Mon, 24 May 2021 20:30:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIBmZa90IO67RBGcBP/GT/M9ZHwU9YVWidbLs+sPqMR3UUkfnxyIG3c/vmUyR67rdHu4O5 X-Received: by 2002:a17:906:1b57:: with SMTP id p23mr26974051ejg.176.1621913453419; Mon, 24 May 2021 20:30:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621913453; cv=none; d=google.com; s=arc-20160816; b=zkUmF9bWtaPKbZQbL1dZJ8vpsFMyY4bUvM1kEJF6I19KQ1/jVZkDVZtQErc2B6BTkZ CE74rJBiYbftwCoWuD8loopVsyHjrhHP/DAVDKqUNBriNthXHlDcyPyIcvh6C7HvhYHl ZZLzLHRaMS25QnUUxH7ZObJAYhD0rkStjzdu2uSTIn9iDSL2zyiDF4UnrbMHO6MgKbbt g1SR6XdUfCNszW5sDNSVI/UdmNMHxTmt2H3fklRCaKyieHuavBeNgInDpiOx8ARyVoe4 awe2lkalmK8PTqZIpzmsp+AVGNn8GNGR8s5lmVyTR7XvPQrq4ezyjmnedpejKNpZV0uO p6Tw== 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=dJ26DGqo7X1Cn6NLmjU9DQ3Pgqq/ZJJxfxeIk8Yo17o=; b=c7v3pzuyBa5ocpOwaou8Tznx9BcF5E6f4P27amsTDJNQNS2mzavI6+yOVJp+mzfXQr 73ptZJ2t1WnR3UHHou0qcJotiitAZLSABlco95fNcBf5KXQdf7Oh4eFRGZPHOvhQvod7 rcOOaBLnxwCLY8dxpNzGw7Vh6yjI1sRNnXhLEcAl6rU/UAOGv3HoAMRAkR3n5lq1T1X4 IUDEjV1fF7h3ShXq30ZrG7DfqmifBnKmHJ2vWPwRoHRBwq2smcGJ4jwkG4LbsS9sTnk4 g9OPmd3fza/2A1hkRLRbrPHx+/4MfENRRKe/Te9ARIj78LzOwxozFJtwSSFczzRLBums ci3Q== 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 gb35si13390866ejc.209.2021.05.24.20.30.30; Mon, 24 May 2021 20:30: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 S230026AbhEYD2h (ORCPT + 99 others); Mon, 24 May 2021 23:28:37 -0400 Received: from mga12.intel.com ([192.55.52.136]:38160 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229837AbhEYD2h (ORCPT ); Mon, 24 May 2021 23:28:37 -0400 IronPort-SDR: 1bIe6Ap6B8NHIRkgg5Gfq4X4+4lg+tuu3bfBduDkS8MQC2A/4O4Mg3A0oCqltAUOKf+Sb7BWvz negNEd71rq/A== X-IronPort-AV: E=McAfee;i="6200,9189,9994"; a="181729283" X-IronPort-AV: E=Sophos;i="5.82,327,1613462400"; d="scan'208";a="181729283" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 20:27:07 -0700 IronPort-SDR: bDO7nvJWaEgi8pYE1m5vIndBvhH6MzW+uxUJdfWYznKKDGjNtd8GoHgoctlM048DHrleVCOXeI yaJoHL+Ys7OA== X-IronPort-AV: E=Sophos;i="5.82,327,1613462400"; d="scan'208";a="546330008" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.212.195.214]) ([10.212.195.214]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 20:27:06 -0700 Subject: Re: [RFC v2-fix-v2 2/2] x86/tdx: Ignore WBINVD instruction for TDX guest To: Dan Williams Cc: "Kuppuswamy, Sathyanarayanan" , Peter Zijlstra , Andy Lutomirski , Dave Hansen , Tony Luck , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , Linux Kernel Mailing List References: <37ad50ca-f568-4c62-56e2-9e9b1f34084c@linux.intel.com> <20210524233211.802033-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210524233211.802033-2-sathyanarayanan.kuppuswamy@linux.intel.com> <125f8362-b1e3-d304-f943-3fc2f07b5d79@linux.intel.com> From: Andi Kleen Message-ID: <6f44fbeb-a8be-d2e4-5161-d46ddf09482e@linux.intel.com> Date: Mon, 24 May 2021 20:27:05 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/24/2021 7:49 PM, Dan Williams wrote: > On Mon, May 24, 2021 at 7:13 PM Andi Kleen wrote: > [..] >>> ...to explicitly error out a wbinvd use case before data is altered >>> and wbinvd is needed. >> I don't see any point of all of this. We really just want to be the same >> as KVM. Not get into the business of patching a bazillion sub systems >> that cannot be used in TDX anyways. > Please let's not start this patch off with dubious claims of safety > afforded by IgnorePAT. Instead make the true argument that wbinvd is > known to be problematic in guests That's just another reason to not support WBINVD, but I don't think it's the main reason. The main reason is that it is simply not needed, unless you do DMA in some form. (and yes I consider direct mapping of persistent memory with a complex setup procedure a form of DMA -- my guess is that the reason that it works in KVM is that it somehow activates the DMA code paths in KVM) IMNSHO that's the true reason. > and for that reason many bare metal > use cases that require wbinvd have not been ported to guests (like > PMEM unlock), and others that only use wbinvd to opportunistically > enforce a cache state (like ACPI sleep states) ACPI sleep states are not supported or needed in virtualization. They are mostly obsolete on real hardware too. > do not see ill effects > from missing wbinvd. Given KVM ships with a policy to elide wbinvd in > many scenarios adopt the same policy for TDX guests.