Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4346832rdb; Thu, 28 Dec 2023 20:41:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEWrkpHO/2w47o/7kOA+/y6+VCId/phbYvgZRxxyEXZJ5ZGBzNhTfWPI92cN2uFZw6dzAMy X-Received: by 2002:a17:906:c2c9:b0:a23:dffc:8366 with SMTP id ch9-20020a170906c2c900b00a23dffc8366mr5499646ejb.88.1703824900914; Thu, 28 Dec 2023 20:41:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703824900; cv=none; d=google.com; s=arc-20160816; b=lNLTXhd+S0NP3qvmE44bUESDpwJ5sePlRqXeqb96eoCNfpLAAROnvKx8Zvm1T7HNT1 wpeOG4vtLgnwK9hRVkT5Yyicapopktv3QbCt/QgFOzixdAHAzbCw+8n9jSWS0CJusk5K xszWENo1civRx9qMhMXH1hj4eFi4ihfVaMLdmi/D0oi1zmqb0VV6bxFDDauiawA5ntAP Y1Cow9nTSZkSbr/k00t62FmfpfA/p9Or1H62uiJddv8ROQLUC6mOO98Y8H0lh0oGPzuS KwzKz/2ej70dtkXTW9ftAIuSA4dTPdheJ+DqGcXfU1Cjxzb4TuVeWi0W/Ddt7P30p76k 1/Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=8AilC+UU3Bxdsk6UnqpECKiSelForZsBYmIyJMlUSWc=; fh=wu6/LcA7ViOsSr5vOXhdZdHUUl/lXWM89r/mcoWJXEA=; b=hWE/CesgbvK8mxfnGphilbaI1IeLNYq4tEuoATImJc38vaBAkXRydS6Rg7zYOaFTgP 6fbDIz6Gx8bj+dAcJJH5fiWy08SZ4ZgyjbiRLR7jih/aARAdgHrzTuOGXxj1wDY5M+EV beKVGO5HVCYLXYnGLLdgi3EEL6DAYIT46PGD+HuHYC6+rjvLY2+p6b0omZgYBbva7ZKX OIG2698bgw6O9g2tn/BIm/6twT1gLgZDB0/VGd2TZgOQMbpeWq24aKjOhocBPT5+9a1i 3BFuP1WwbxPgKJ82vxA4Lc4k3aFPb1lI56Ou7CBL/8ZAi3lYZ1DqDdxKqwzxA+lP0Fj4 punw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EScdZdXm; spf=pass (google.com: domain of linux-kernel+bounces-12944-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12944-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j21-20020a170906255500b00a232e088c69si1620578ejb.290.2023.12.28.20.41.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 20:41:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12944-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EScdZdXm; spf=pass (google.com: domain of linux-kernel+bounces-12944-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12944-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4EA741F241FF for ; Fri, 29 Dec 2023 04:41:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7ED3C23B3; Fri, 29 Dec 2023 04:41:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EScdZdXm" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A2E71FA8; Fri, 29 Dec 2023 04:41:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703824886; x=1735360886; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=dgfYqpicR7jhKma9kepYU0N3HnbYpIvRMXuoY3TARXw=; b=EScdZdXmiTxHUbubZ+2JvO2hVcly+UBV34F7d0ws0GrDcO2dvQ/zgP9N rhBeBZwnkXsLE1z7ywyhTBU6xPDw0rRsEK1rL5CGZYs7+js8PeF+X4sf4 cNSj9CWXaJgf4hpBtXCuSr0055lWcsrxrqgcIGcLNZiAeap7LD9B3mE51 F4tddgqxBex62HvqwT3zTnI/XzkXtgy9CpK2GvojvR34ADBDXu2dO9tsp WA+r9JmqDegNmxDvLIiZ7InV/K2/+SE01JONL2CXKGWK+PJWg9UnXnC9I PsXCeSMU2VbkiJlovBZcaJLKs8IQyXMMjDekzvDG8C4BeXUaMIhLaQRII g==; X-IronPort-AV: E=McAfee;i="6600,9927,10937"; a="376102601" X-IronPort-AV: E=Sophos;i="6.04,314,1695711600"; d="scan'208";a="376102601" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2023 20:41:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10937"; a="771878830" X-IronPort-AV: E=Sophos;i="6.04,314,1695711600"; d="scan'208";a="771878830" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.93.22.149]) ([10.93.22.149]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2023 20:41:22 -0800 Message-ID: Date: Fri, 29 Dec 2023 12:41:18 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 3/4] KVM: X86: Add a capability to configure bus frequency for APIC timer Content-Language: en-US To: Isaku Yamahata , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Vishal Annapurve , Jim Mattson , Maxim Levitsky Cc: isaku.yamahata@gmail.com References: From: Xiaoyao Li In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/19/2023 4:34 PM, Isaku Yamahata wrote: > +7.34 KVM_CAP_X86_BUS_FREQUENCY_CONTROL > +-------------------------------------- > + > +:Architectures: x86 > +:Target: VM > +:Parameters: args[0] is the value of apic bus clock frequency > +:Returns: 0 on success, -EINVAL if args[0] contains invalid value for the > + frequency, or -ENXIO if virtual local APIC isn't enabled by > + KVM_CREATE_IRQCHIP, or -EBUSY if any vcpu is created. > + > +This capability sets the APIC bus clock frequency (or core crystal clock > +frequency) for kvm to emulate APIC in the kernel. Isaku, you are mixing the `bus clock` and `core crystal clock` frequency. They are different. - When CPUID 0x15 doesn't exist, or CPUID 0x15 doesn't enumerate core crystal clock frequency, the APIC timer frequency is the processor's bus clock. - When CPUID 0x15 does enumerate the core crystal clock frequency, the APIC timer frequency is the core crystal clock frequency. This patch only enables the user-configurable bus clock frequency, or specifically APIC timer frequency. It doesn't enable the configuration of core crystal clock frequency. Userspace can configure core crystal clock frequency by passing a valid CPUID 0x15 leaf into KVM_SET_CPUID2, not by this KVM_CAP. > The default value is 1000000 > +(1GHz).