Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4879485pxj; Tue, 25 May 2021 19:52:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5EDJuub35RmtCPw27Rq0z9mvnTcZzXyRdcDsE/3hZtWmOn+HiJsELhtu4j0tF9I0DWWax X-Received: by 2002:a17:906:a88c:: with SMTP id ha12mr31756848ejb.129.1621997553449; Tue, 25 May 2021 19:52:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621997553; cv=none; d=google.com; s=arc-20160816; b=jCb5s64GKuc60dlSrcMGV0J/9m98bzi1yRld5EiTHDInfXy/UN3ERBYB2xqLVvtBMR OYntfGiPExm7MuOZlAwzSt2hSoHqMtD3otHjQxfirwcslwQ3IHYhB4LjenhWJ/SYg4kE M73bnW/BfMwVVcn9eUg3fM4uWG3pimlg3j/U9QZVhdQGf/cdt5qtiNCq3JTqDPxnYfNQ G3YeQAe5ikaPsFb3K/D9IHxpluEaRJy82o0Eul/HLFWwpUDx6D0IQ0fgBMLN/KzGF75w VOEMJ549vRISzzg5LE0ZFAn/vjgkoFHGxNBgZj2Oj+wu8mciOZDL7o5HO0JTJMCdyuve uLyg== 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=4P3xzpQQm/xo/DMhuv/QjGaRN+0t1hgv5/a3pOXVjJ4=; b=AYrODlMiWiCp9skfXkPE6p4obe8zGtaJyXnA5Lwfes9om6uK4M0MxSmztFYiZ3SWMZ X+SPS03Q74mzq78fZ4Ct9J3meGDHy0VkM9JOoZ17BFy4nv2wwlyBvcRYBc+rBSo9+wiJ LkCm8EtNwFT/SfwDw0CKcurzEy7UFWAHNpAb0yOeizExZjR9Ng3shvNNqtvyQ6p6hOyC FbyBoRKM0Twr938uK/gystC8gwDQUk8ROafvWYH2syhlXnyIKiYjKBir+qXUr4pobcKH uMblNwssNpD1guRvOkHFLPs/KT5K8RSiWAVSH9QouUk4xSfgflkO+gJog6ANYqLRcINN +uZw== 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 i9si17562892edr.246.2021.05.25.19.52.06; Tue, 25 May 2021 19:52:33 -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 S232818AbhEZBKz (ORCPT + 99 others); Tue, 25 May 2021 21:10:55 -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