From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C969C47087 for ; Wed, 26 May 2021 01:09:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE694613F1 for ; Wed, 26 May 2021 01:09:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232825AbhEZBK4 (ORCPT ); Tue, 25 May 2021 21:10:56 -0400 Received: from mga07.intel.com ([134.134.136.100]:56085 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232667AbhEZBKy (ORCPT ); Tue, 25 May 2021 21:10:54 -0400 IronPort-SDR: gjszMN445M2fAcN47O93NWpSBB24MKOjn3higP87zRWGUWt9zNE6kXhVV++3HRD7O5maBoc+kp eCfiF9ZFWWXQ== X-IronPort-AV: E=McAfee;i="6200,9189,9995"; a="266244528" X-IronPort-AV: E=Sophos;i="5.82,330,1613462400"; d="scan'208";a="266244528" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2021 18:09:23 -0700 IronPort-SDR: oPNdmylFX/LiEGmJITXHiwohwZQ7lw+a0k7+iy+RhafimeY4OU3ka/Iufjc0FtKcG5T9aVPiCC UYhXJAuTF1Bg== X-IronPort-AV: E=Sophos;i="5.82,330,1613462400"; d="scan'208";a="546919036" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.209.20.22]) ([10.209.20.22]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2021 18:09:22 -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> <6f44fbeb-a8be-d2e4-5161-d46ddf09482e@linux.intel.com> From: Andi Kleen Message-ID: Date: Tue, 25 May 2021 18:09:21 -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 8:40 PM, Dan Williams wrote: > On Mon, May 24, 2021 at 8:27 PM Andi Kleen wrote: >> >> 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) > No, it doesn't. Simply no one has tried to pass through the security > interface of bare metal nvdimm to a guest, or enabled the security > commands in a virtualized nvdimm. Maybe a better term would be "external side effects". If you have something in IO domain which can notice a difference. > If a guest supports a memory map it supports PMEM I struggle to see DMA anywhere in that equation. Okay if that's happen to a TDX guest we have to start emulate WBINVD. But right now we don't need it. I guess we can add a comment that says "if someone wants to implement NVDIMM secure delete they would also need to implement this new hypercall" > >> IMNSHO that's the true reason. > I do see why it would be attractive if IgnorePAT was a solid signal to > ditch wbinvd support. However, it simply isn't, and to date nothing > has cared trip over that gap. I think we're getting into angels on a pinhead here. The key point is that current TDX does not need WBINVD. I believe we agree on that. -Andi