Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3874992pxj; Mon, 24 May 2021 17:31:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsbWP8hIMnPAd42vxuVA4LZDKG1AWolAvVZIotHEaPg/CGVJqP0ylIBlhKLJCDKpEanIWK X-Received: by 2002:a17:906:26db:: with SMTP id u27mr1038991ejc.532.1621902690127; Mon, 24 May 2021 17:31:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621902690; cv=none; d=google.com; s=arc-20160816; b=ikgULZurhX6JCEVk2axqcJpp2w/2zhabdGVfHPlOBfZSlrvvTEc2B0EcsvOYyuYTnm Pr5sWTNqw3j+VpIIBnQ1in/SYCigDK0hg/CfcwiDv3PHEWjf4N+E4x5E5y3aGqzJ3cZT L0NOj93MHSPVZruOkIc1GwjSq0I887s7SM/pJLuNkjRUkiQfvFZmL3iFBcSR9lxAsNDT /xmEnPO39GKf1eAMRFdCR4LaNoAF4To0N+JWq6rcbNn+1Jl25NXh+CcNfTe4Bxn0vzJp J+NmIhlwk6l+zjIsdSHQGPFc2tQoWFlUVsmuBfBQ4xkM/g3cXrfYxXdA7wIzn+lIMD7m S8TQ== 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=o2EiyrESEloaJXrz5k67y418vVcXy1Kdp86qF56vLu0=; b=EoV46xudooHbNwfAiuzfusoNrh0ukH0La0RlBgkV4TSGqjV6oZjhoGg+xuhCveZQeW S/Ztg2f5NnyRPf/kkVz45GNCQ+5SDGdFId2/FhI7EPRdhUdBI2KLzqmZD17vGe2+FOnb YUQDu3y54gFDcfmvakFYbmd6GB+9myMdQFl2sAs/Xdodwxgp5jyPvXnWAbDugBSl2osf RTNPpeGO3q4qs//rJQctO1p12h2zgYOFz5bbF6LJ1cHB9V25KmBpEDzt59W8UdAUUqul bDVlj0maS5kX3GYzjx86HFmc7RhdzOUB6m5Otk8oJSo9kfCgxuxufiyMws9bJ8eBCuyk HDyA== 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 kl10si4619595ejc.361.2021.05.24.17.31.07; Mon, 24 May 2021 17:31:30 -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 S229550AbhEYAbZ (ORCPT + 99 others); Mon, 24 May 2021 20:31:25 -0400 Received: from mga01.intel.com ([192.55.52.88]:23242 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbhEYAbW (ORCPT ); Mon, 24 May 2021 20:31:22 -0400 IronPort-SDR: nJPTPfkrsan9OevJceyiionwN2rO6qMyXuXreTnplJwHdRlCbiwoCs8aSIobsH6r57AvfeUqG0 2pDQkv6lLcIQ== X-IronPort-AV: E=McAfee;i="6200,9189,9994"; a="223225906" X-IronPort-AV: E=Sophos;i="5.82,327,1613462400"; d="scan'208";a="223225906" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 17:29:51 -0700 IronPort-SDR: 9mSnlww6VoH7H7Iq/bSBAc877sWZX1OCE5sTDwndxDkuOCI5WYiTvlRC+hlt3Fzx/SuNQYH15w jHggnMT3e0mA== X-IronPort-AV: E=Sophos;i="5.82,327,1613462400"; d="scan'208";a="396607630" Received: from akatzin-mobl4.ger.corp.intel.com (HELO skuppusw-mobl5.amr.corp.intel.com) ([10.212.71.138]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 May 2021 17:29:50 -0700 Subject: Re: [RFC v2-fix-v2 2/2] x86/tdx: Ignore 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: <37ad50ca-f568-4c62-56e2-9e9b1f34084c@linux.intel.com> <20210524233211.802033-1-sathyanarayanan.kuppuswamy@linux.intel.com> <20210524233211.802033-2-sathyanarayanan.kuppuswamy@linux.intel.com> From: "Kuppuswamy, Sathyanarayanan" Message-ID: Date: Mon, 24 May 2021 17:29:48 -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 5/24/21 4:39 PM, Dan Williams wrote: >> Functionally only DMA devices can notice a side effect from >> WBINVD's cache flushing. But, TDX does not support DMA, >> because DMA typically needs uncached access for MMIO, and >> the current TDX module always sets the IgnorePAT bit, which >> prevents that. > I thought we discussed that there are other considerations for wbinvd > besides DMA? In any event this paragraph is actively misleading > because it disregards ACPI and Persistent Memory secure-erase whose > usages of wbinvd have nothing to do with DMA. I would much prefer a > patch to shutdown all the known wbinvd users as a precursor to this > patch rather than assuming it's ok to simply ignore it. You have > mentioned that TDX does not need to use those paths, but rather than > assume they can't be used why not do the audit to explicitly disable > them? Otherwise this statement seems to imply that the audit has not > been done. But KVM also emulates WBINVD only if DMA is supported. Otherwise it will be treated as noop. static bool need_emulate_wbinvd(struct kvm_vcpu *vcpu) { return kvm_arch_has_noncoherent_dma(vcpu->kvm); } -- Sathyanarayanan Kuppuswamy Linux Kernel Developer