Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4756244rwb; Tue, 8 Aug 2023 13:21:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQpoZNm9Rjoql1LeVij2B6VEQhfG8j95PT5gRQXZWSmm+DymrLkUks3QTzLaI6z+tUjaH/ X-Received: by 2002:a05:6e02:11a4:b0:348:797d:441a with SMTP id 4-20020a056e0211a400b00348797d441amr838226ilj.8.1691526117541; Tue, 08 Aug 2023 13:21:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691526117; cv=none; d=google.com; s=arc-20160816; b=iBdIn7Su0Ez1HglTiOY2MNVlwiRL8D5DwxgXvtWi0QIW4aD0tBQjP/SqrJOMql1gPh neZj+u9L+bFAGEhcZr00qQ4qaT+R5wNLnAoUGhvT6+kOysSeLhDVlI4fh7wNJtshz534 ukdBiBTmcN9FRBBSdwD5r0lxXw/HrMZYKCD9bLq/cSJ3NWsxGSA9VD5P44hi76VSqpoi FlQHwbcx0+g3F/x3EBC2Zg4knEaGvn4bEuwyg/pJ4ZaoLDxzB12nvCOur2AUWrRKEhhF +JbtOqvRZRFe5WYJJY/R6WEOhO/k+zTdg264Sa5wUAcVMOc1AEQZpETL/qsBzQ8F/FzV 5IjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=CuL7JzF381fr0GFaIU2vNt8YQkBqZ5RnQRo4OHNdo5M=; fh=SCGtvi3ucvPBYm70CMQDH01k+UfedX5nodHTvxHXp6Y=; b=iRRmZN5o5llS9LcTvLyCwKGnAVm4fIig6TpbfxuQusTY+qLexY49ChPjPXfBXzW18g +d1otxnLxNqhaOlmZWpsylMfDk7U2N2VaeBQOYL4lolTN3ono3kGN0y7KAPnSqSeNzMR Xfvdub3bngP3AD9reM6u0lA0FG/MYX300MGvouznkC5w8AMyEuQuOYb3uDQdWChpiDRj PyVXUUSe+tHG7RHGBqTOVCRtJwoLOTZpsSGG8FEOPC9w7uUnFhzKiFfsONYl1VhxsQz/ td5k2kV678heD4XVVVoXrxh+UbBzKV0LQFRNnrSFJRVrXVGB2CQbtc5kk98UWrv3nEgW Dzbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WWK5p9Rl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a633506000000b0054ff38f6448si7715617pga.238.2023.08.08.13.21.44; Tue, 08 Aug 2023 13:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WWK5p9Rl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234729AbjHHSLJ (ORCPT + 99 others); Tue, 8 Aug 2023 14:11:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235329AbjHHSKk (ORCPT ); Tue, 8 Aug 2023 14:10:40 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FAF91BAE6 for ; Tue, 8 Aug 2023 10:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691514785; x=1723050785; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=mhUr+URDNngCOROwuc7a7eHBnzo84/kxXYPI0jAI72U=; b=WWK5p9Rl/qRP6LajiMZyFFZ6QaEo2hrJ9p1yibf3X91xPeXFVGnzovOU f3bxr8rQ61DaNytrCS20Uf2IYOKSbZCMcxNjWZt5yrCPsXWze5N+i9qjN V/thq5tTT29az43fITuj7STHj15A6GP35MiPNpePRETtDbXx6eKXeUsZP df7fcUUQ0dL0Yj1B1VNCPIzG6gbuAb45Q5UNfQzKrhP5uc7ckIWFqRxJN Vvv36vYmDip1e7LWG1SjI1vc2WfI4bIZ4Z2362BzRtmyDHpkK0R+t4EU9 BRPyBcKNlNXmu3zPb+TMrCieWltcRl+t07bcR7xyybm/m7tuTBLiD+XDV w==; X-IronPort-AV: E=McAfee;i="6600,9927,10795"; a="368347649" X-IronPort-AV: E=Sophos;i="6.01,156,1684825200"; d="scan'208";a="368347649" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 10:13:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; d="scan'208";a="874829818" Received: from mdaugher-mobl.amr.corp.intel.com (HELO [10.212.220.28]) ([10.212.220.28]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2023 10:13:07 -0700 Message-ID: Date: Tue, 8 Aug 2023 10:13:05 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] x86/tdx: Mark TSC reliable Content-Language: en-US To: "Kirill A. Shutemov" , Thomas Gleixner , Borislav Petkov , Andy Lutomirski Cc: Kuppuswamy Sathyanarayanan , Elena Reshetova , Jun Nakajima , x86@kernel.org, linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org References: <20230808162320.27297-1-kirill.shutemov@linux.intel.com> From: Dave Hansen In-Reply-To: <20230808162320.27297-1-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/8/23 09:23, Kirill A. Shutemov wrote: ... > On the other hand, other clock sources (such as HPET, ACPI timer, > APIC, etc.) necessitate VM exits to implement, resulting in more > fluctuating measurements compared to TSC. Thus, those clock sources > are not effective for calibrating TSC. Do we need to do anything to _those_ to mark them as slightly stinky? > In TD guests, TSC is virtualized by the TDX module, which ensures: > > - Virtual TSC values are consistent among all the TD’s VCPUs; > - Monotonously incrementing for any single VCPU; > - The frequency is determined by TD configuration. The host TSC is > invariant on platforms where TDX is available. I take it this is carved in stone in the TDX specs somewhere. A reference would be nice. We've got VMWare and Hyper-V code basically doing the same thing today. So TDX is in kinda good company. But this still makes me rather nervous. Do you have any encouraging words about how unlikely future hardware is to screw this up, especially as TDX-supporting hardware gets more diverse?