Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4478878pxj; Tue, 8 Jun 2021 15:39:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycyTT5RY33FTphkW5ukaoIZPrOqcDSRBMG7Rj0SLz8NK2f2yDb5pLGNqPRgsuBZmfKYWVR X-Received: by 2002:a05:6402:31eb:: with SMTP id dy11mr15439707edb.165.1623191946061; Tue, 08 Jun 2021 15:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623191946; cv=none; d=google.com; s=arc-20160816; b=v7oV2fYtmi1uuEv0U/daIC3+QbTK5ezAgcgZKiWWIBHUtfsLyS24mlsFxFkl1QEZOW 8/wANni8NL3Wu4D2fOkXrIqIaxtVANxjOAhhSGETnYMBVglFH86Z58qPPUDlIQiRKSWD LC8ek/Zj+N8+uHt4TMHWij0wq7p/3ttF2GYIUGK6sWdZYeNnpfHCX7J5fO79a3epISBE j6+s91MgU83ysWnhMdDSboeBzfd8/CcXXaWzEedVc6WAo5FgrWs6qTb1Tu04lqQey3HF 962kQZpNVkmb0vK6aShtDdorAufWbrPmKndZjOnKWeoT9bl7vbr5f7amcn9/RN97pHRb BVbg== 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=vlXD0HuJYLdcJv5TcwCTmhepOiQBuzqSOsZSjU5UloU=; b=VVJsti/ZU7x61PN+o2I1R3GHwVm5nx1uVZNFYjIs5AiPL4+9lBYi3Vivu3LTrU7TcJ QWnFEChkg+Tnsa7EqO4/E3Ho9urwhgZGGbGnbQxfuHX1sNB67nWKNHTl0ICBGjuMUwUN H6JGzwjCzmtcC3hKr+oTrd4pZulikjiiEqshhJ+9iRRqGh6ZQRg4rc+De7mBZy4XdSI8 p9C1Ww+ab6xdsSBmmA4Q4KTXbFX7McLdaVB8fsgIHwQjhNddCSDT4OmH4o3gzTRYXBjf nhIIx52bhnyafbj9L6aaSPA5mJMlCG2GRqsGs0L6olMhUF2cESxs029DFr5J5289+xPq P+pg== 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 p17si792095edq.63.2021.06.08.15.38.41; Tue, 08 Jun 2021 15:39:06 -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 S234613AbhFHWgr (ORCPT + 99 others); Tue, 8 Jun 2021 18:36:47 -0400 Received: from mga07.intel.com ([134.134.136.100]:1751 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234272AbhFHWgq (ORCPT ); Tue, 8 Jun 2021 18:36:46 -0400 IronPort-SDR: oYJVC8KdRCaVFQEleT7WA2ZUhe9hp3+8JRwCOjZP0Vb7oP454IwSQNrWsIqSYdgkq8eKbe7N+s qu9lqnw2yZww== X-IronPort-AV: E=McAfee;i="6200,9189,10009"; a="268812997" X-IronPort-AV: E=Sophos;i="5.83,259,1616482800"; d="scan'208";a="268812997" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 15:34:43 -0700 IronPort-SDR: Wrvik8NFw14CecQlAqjF4ZA5fCwvLAoz27I/Ywf5+KmzUYD57kDv+neKfUH2KTV1G+1+X5xkhf AVdDj2Z7RASg== X-IronPort-AV: E=Sophos;i="5.83,259,1616482800"; d="scan'208";a="551767047" Received: from akleen-mobl1.amr.corp.intel.com (HELO [10.209.24.11]) ([10.209.24.11]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 15:34:42 -0700 Subject: Re: [RFC v2-fix-v3 1/1] x86/tdx: Skip WBINVD instruction for TDX guest To: Dave Hansen , Kuppuswamy Sathyanarayanan , Peter Zijlstra , Andy Lutomirski , Tony Luck , Dan Williams Cc: Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , linux-kernel@vger.kernel.org References: <20210608213527.739474-1-sathyanarayanan.kuppuswamy@linux.intel.com> From: Andi Kleen Message-ID: <987b88f7-fb65-7725-89ff-b1f0fa2787e3@linux.intel.com> Date: Tue, 8 Jun 2021 15:34:42 -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 6/8/2021 3:17 PM, Dave Hansen wrote: > On 6/8/21 2:35 PM, Kuppuswamy Sathyanarayanan wrote: >> Persistent memory is also currently not supported. Another code >> path that uses WBINVD is the MTRR driver, but EPT/virtualization >> always disables MTRRs so those are not needed. This all implies >> WBINVD is not needed with current TDX. > It's one thing to declare something unsupported. It's quite another to > declare it unsupported and then back it up with code to ensure that any > attempted use is thwarted. > > This patch certainly shows us half of the solution. But, to be > complete, we also need to see the other half: where is the patch We had multiple patches to handle it earlier (by ignoring it which is the right way and deployed successfully everywhere in KVM), but you guys all didn't like them. So they got removed. You can't have your cake and eat it. Either you have the ignore or warn on patches or you have panic. In this iteration now you have panic (through the exception handler) except we explicitely ignore it for the cases we know that can happen (which is reboot) > or > documentation for why it is not *possible* to encounter persistent > memory in a TDX guest? I thought we already went over this ad nauseam. The current TDX VMMs don't support anything else than plain DRAM. If there is support for anything else in the future we'll need to add a new GHCI call that implements WBINVD through the host, but right now we don't need it. -Andi.