Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5144502pxj; Wed, 9 Jun 2021 10:07:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBvixjOS2J/zmG3TYHbO26Q8UFhn//e4EjIivW17b7axkCQ/BksAmmqNvwb79F375CNtKC X-Received: by 2002:aa7:c84a:: with SMTP id g10mr443548edt.326.1623258447601; Wed, 09 Jun 2021 10:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623258447; cv=none; d=google.com; s=arc-20160816; b=mRWTuSXLZTDOG+iuTSaWwxN9cBvmxihJ17IuMKJeGj2ADVUiaPO7c4Lu1DoEZyAsSY CEJ0rYVYa5Sv/qfv2bhimKJ6bbW4ncug7gqhy5FXLT/npMUvXKvW0VOx+TMRL9yFMl3o d/eok3HIToze7EFU2cVO3qgqCpGwp0j/5HRgpLgEyVvZhaMkFbItaZTh4niSJtwY3mNw IWPaE3esH10xrCfJfJ3bD2ckXSr7Q1xe8cb4Dl1tUZ97M27GwUfNmSz7F3J0+pEUR5y7 lKvAp5/v7qO6NTswa8lwGW3uy/k7pl1PmPF01M97ZkDyso/KEKPvg5Ig6RIBNGhgXquO QocA== 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=i/8Geb6HXSGyjyQQ4tbisKCd5kG+IBs7hX7sbHqUEXE=; b=haZeIKCrmkHuQOdKs0qU0FbNR7TzdMb6hB/8Hfr83iuT2ctxfqiLrDGeyRwiH9jAzW 8mgevT1s+wWsx8hE6/rjZiTxtGK7smkMmF4BKkTZcg1xx66KK8tUlXO8rB4kaUxqWhEl 7C1LRbGeC4rCUN7iIAC+CWz6duSc8Hr9C1fByrebM8Yech9r2lixhuyFBUjyp20STTFF 5inJMOLwex/74haCyC1bqRNA1/coE3e0IA6iVYKZv4Bhp9jx2kt6+HSUIjd7CtnLk9Ks LEBV6wtEsTbZRzwdLhuAYy1zGYzvIzlFkLVeVKw9anOpx8nFow2J8aojtSL/4sRhZgpX 2FUA== 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 m25si177388edr.588.2021.06.09.10.07.04; Wed, 09 Jun 2021 10:07:27 -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 S231420AbhFIE1I (ORCPT + 99 others); Wed, 9 Jun 2021 00:27:08 -0400 Received: from mga05.intel.com ([192.55.52.43]:38704 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231363AbhFIE1I (ORCPT ); Wed, 9 Jun 2021 00:27:08 -0400 IronPort-SDR: uSqZqPHBTmYxLhzw3tiO2+/KV1kdn0+WzJE5IIig/WmvlqiiQzaOWU6oB11ZJBqoKteRE9fboc nrWuAyOHXtBg== X-IronPort-AV: E=McAfee;i="6200,9189,10009"; a="290628618" X-IronPort-AV: E=Sophos;i="5.83,260,1616482800"; d="scan'208";a="290628618" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 21:25:14 -0700 IronPort-SDR: JH0kAQVFSuekhOPjY6eIIkGeFRDcVgl6/Wn7mKKJtEBv9us6Ts/+jnnHSRM8HNv+S6q4ylGDa5 X+ZNL/rbdDwQ== X-IronPort-AV: E=Sophos;i="5.83,260,1616482800"; d="scan'208";a="551854128" 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 21:25:13 -0700 Subject: Re: [RFC v2-fix-v4 1/1] x86/tdx: Skip WBINVD instruction for TDX guest To: Andy Lutomirski , Dan Williams , Kuppuswamy Sathyanarayanan Cc: Peter Zijlstra , Dave Hansen , Tony Luck , Kirill Shutemov , Kuppuswamy Sathyanarayanan , Raj Ashok , Sean Christopherson , Linux Kernel Mailing List References: <20210609011030.751451-1-sathyanarayanan.kuppuswamy@linux.intel.com> <23418f34-7c03-7477-6fbf-1b36b4718cb9@kernel.org> From: Andi Kleen Message-ID: <4e5ac34f-28cb-def6-0b87-e560fa42e5e5@linux.intel.com> Date: Tue, 8 Jun 2021 21:25:13 -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: <23418f34-7c03-7477-6fbf-1b36b4718cb9@kernel.org> 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 > I like this description, but shouldn't the logic be: > > if (!CPUID has hypervisor bit set) > wbinvd(); > > As far as I know, most hypervisors will turn WBINVD into a noop and, > even if they don't, it seems to be that something must be really quite > wrong for a guest to need to WBINVD for ACPI purposes. KVM only turns it into a noop if there is no VT-d, because with VT-d you might need it to turn mappings into uncached and vice versa. But yes the change would make sense for reboot. BTW I suspect for the reboot path it isn't really needed anywhere modern, so it might actually be ok to completely disable it. But that's some risk, so doing it only for hypervisor is reasonable. I can see it making sense for the S3 path, but nobody supports S3 for guests. -Andi > > -Andy