Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp6116335rdb; Thu, 14 Dec 2023 08:42:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IF07r6Mgj7PhS2iOgPuyn2/iz+OOIee0nJREWoDRIPhGmdue2ogI1z0FkvG0yifGuXo+s7k X-Received: by 2002:a17:90a:1341:b0:28b:6d5:e53d with SMTP id y1-20020a17090a134100b0028b06d5e53dmr1034453pjf.85.1702572134981; Thu, 14 Dec 2023 08:42:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702572134; cv=none; d=google.com; s=arc-20160816; b=vxkb56ZREP15PGurUqs5KPwPOMP4N2xPk3Ip7q5cPANeeKhwwG5enFdGjJHEzPAeP4 508C/Drlfh+SL/66gOQIZcz0bLoevR4kH+1/yMM4uVYqwxmg5hgNI7hbgTMa7DMRECD2 qzVwF1qNw+35FqTSM+98/x6zPs13vqcVj44PK3T+ay0g0TIr9yaZlnEa/e2SenrAlips U9peTEOm8XxGt9ccOe89LfujkSKRyEcj1yqIxdfIYkwCUMZef/xZe7eSO0vO3/C3BbSk Aaz7q6qdiJXOv6fGjo+/rvjOlhbS374Tfxk3WILbhMJAfBic+fEhqvaSHKnZyWsFTw0D 4Oeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=yuDIlHPXc3h0xC5YU4/ai6dB8VlmCAB/+AvZ2ucJ1/U=; fh=nvBy3rJL+yGH0qq99avyyJUGBcY0rSboGVxtVCw8HII=; b=pdxpidJ6Um+zYQunDQ5Zqxid8xkfFeiZqgb20heyLnLUvw0y3TAOc4TB9ukCAIOkUv FNRTUJhpgCb1LJMASrcsqKjLg+nZkq2fNXxJpyGULraL7zj/6y1aeWoCzsBoEVqxDB/7 55dEsC5U2LhGQiaHiw06DsRjKgc1janiOGmAHYHRUj4Hv3IHV1UPEd+IuVSZp5IHn0gh UXM+EdE3msRFP5PmemngVL9kMqA6ayIeSctmqilN7cM2XpUkfdyUG3QsvfULU+CK4xGH vwe8dWRuvQNIQHVqVN971GAZVf1zITVx1uVkchKOsJiRy1wbFlgekXCoSS3vivTCKDRW gxug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="ludcU88/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id lp18-20020a17090b4a9200b0028b1e2045ffsi388791pjb.74.2023.12.14.08.42.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 08:42:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="ludcU88/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4AC6A81CA3EB; Thu, 14 Dec 2023 08:42:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229464AbjLNQlm (ORCPT + 99 others); Thu, 14 Dec 2023 11:41:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjLNQlj (ORCPT ); Thu, 14 Dec 2023 11:41:39 -0500 Received: from mail-pg1-x549.google.com (mail-pg1-x549.google.com [IPv6:2607:f8b0:4864:20::549]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1601114 for ; Thu, 14 Dec 2023 08:41:45 -0800 (PST) Received: by mail-pg1-x549.google.com with SMTP id 41be03b00d2f7-5cd5a1ad43aso312537a12.3 for ; Thu, 14 Dec 2023 08:41:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702572105; x=1703176905; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=yuDIlHPXc3h0xC5YU4/ai6dB8VlmCAB/+AvZ2ucJ1/U=; b=ludcU88/lGdmhVEW+b4J9KNQCqOjUyJndxHEHxyFA2tyw7xi4lao+CAXJmt7bQ5Uhd lOGxVGx2ooC/5GZcFYE1Zs3FrouwdoKxnxRe/uTE36XXzmQYvF8QRGMhtQbIRp5Xazb0 N2JzsbsAoXCydVGACzQ+plMn11/u6Jpbm5xgKqZ2n6FiRzcuJydQ6drjFmaLCxXVDt9b pPsBiPmXZvfFw9bg2VyS1O2RBMtKgZnMrXq3TIl4bldw3TMG1lxLaXFtYWkae+wgb99G CwItHcYy7RNJ+BdGNBtrmO9C19xpJOUEzpELBiIoON/yqwZTcftbsl9I9oKsIXKtsCVF ysaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702572105; x=1703176905; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yuDIlHPXc3h0xC5YU4/ai6dB8VlmCAB/+AvZ2ucJ1/U=; b=B0expfFl9tgjjL7mwi6iinu36NMtYI4BXN20u7rjdpdj6vzrb81R1qxQoMSQvovu4A OSAmpjxVZaUdh7ryOVyIiXFQlmc0B/lT9rHvyiAbkbu+jRdxGYkgx2DDrWWPRW+Q5ShU EeB0tfX1qGMmXdH7FLPOdyft1EMLw3jZC565U2RXrs8ohA2oM8IUHXoZbB5n7/VHZcYX AssQu8l9aoYtvZvd3UldoT58KzcHLK/VNhdkXcXkpbm7s/nqBz+gsJDzYSyBHeGqGIQn DTa8qoqtjw7UnY+ZcdnHMVwlXfE2oOFcuPkOzAKXUNizjZuIatYrj4XnUgVDoX4WEsc0 2S3A== X-Gm-Message-State: AOJu0YzFtMdxXRo3GUC9+JL5UQRtqnlnD8v3UHyLzc+mBEjq/d4Aaeko 6w8WG7zShFvH0fbCrsyZ3XsRv6hTsos= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a65:418a:0:b0:5ca:4357:347f with SMTP id a10-20020a65418a000000b005ca4357347fmr567734pgq.7.1702572105188; Thu, 14 Dec 2023 08:41:45 -0800 (PST) Date: Thu, 14 Dec 2023 08:41:43 -0800 In-Reply-To: Mime-Version: 1.0 References: <1c12f378af7de16d7895f8badb18c3b1715e9271.1699936040.git.isaku.yamahata@intel.com> <938efd3cfcb25d828deab0cc0ba797177cc69602.camel@redhat.com> Message-ID: Subject: Re: [PATCH v2 1/3] KVM: x86: Make the hardcoded APIC bus frequency vm variable From: Sean Christopherson To: Maxim Levitsky Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Vishal Annapurve , Jim Mattson Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 14 Dec 2023 08:42:12 -0800 (PST) On Thu, Dec 14, 2023, Maxim Levitsky wrote: > On Wed, 2023-12-13 at 15:10 -0800, Sean Christopherson wrote: > > Upstream KVM's non-TDX behavior is fine, because KVM doesn't advertise support > > for CPUID 0x15, i.e. doesn't announce to host userspace that it's safe to expose > > CPUID 0x15 to the guest. Because TDX makes exposing CPUID 0x15 mandatory, KVM > > needs to be taught to correctly emulate the guest's APIC bus frequency, a.k.a. > > the TDX guest core crystal frequency of 25Mhz. > > I assume that TDX doesn't allow to change the CPUID 0x15 leaf. Correct. I meant to call that out below, but left my sentence half-finished. It was supposed to say: I halfheartedly floated the idea of "fixing" the TDX module/architecture to either use 1Ghz as the base frequency or to allow configuring the base frequency advertised to the guest. > > I halfheartedly floated the idea of "fixing" the TDX module/architecture to either > > use 1Ghz as the base frequency (off list), but it definitely isn't a hill worth > > dying on since the KVM changes are relatively simple. > > > > https://lore.kernel.org/all/ZSnIKQ4bUavAtBz6@google.com > > > > Best regards, > Maxim Levitsky >