mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Isaku Yamahata <isaku.yamahata@intel.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	erdemaktas@google.com, Sean Christopherson <seanjc@google.com>,
	Vishal Annapurve <vannapurve@google.com>,
	Jim Mattson <jmattson@google.com>,
	Maxim Levitsky <mlevitsk@redhat.com>
Cc: isaku.yamahata@gmail.com
Subject: Re: [PATCH v3 3/4] KVM: X86: Add a capability to configure bus frequency for APIC timer
Date: Fri, 29 Dec 2023 12:41:18 +0800	[thread overview]
Message-ID: <a22047ed-22e2-4b7f-9a61-16e9f77f3ba2@intel.com> (raw)
In-Reply-To: <f393da364d3389f8e65c7fae3e5d9210ffe7a2db.1702974319.git.isaku.yamahata@intel.com>

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).


  reply	other threads:[~2023-12-29  4:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19  8:34 [PATCH v3 0/4] KVM: X86: Make bus clock frequency for vapic timer configurable Isaku Yamahata
2023-12-19  8:34 ` [PATCH v3 1/4] KVM: x86/hyperv: Calculate APIC bus frequency for hyper-v Isaku Yamahata
2023-12-21  5:26   ` Xiaoyao Li
2023-12-29  4:20     ` Xiaoyao Li
2023-12-21 17:39   ` Maxim Levitsky
2023-12-19  8:34 ` [PATCH v3 2/4] KVM: x86: Make the APIC bus cycles per nsec VM variable Isaku Yamahata
2023-12-21  5:34   ` Xiaoyao Li
2023-12-21 17:39   ` Maxim Levitsky
2023-12-19  8:34 ` [PATCH v3 3/4] KVM: X86: Add a capability to configure bus frequency for APIC timer Isaku Yamahata
2023-12-29  4:41   ` Xiaoyao Li [this message]
2024-02-23 19:33   ` Sean Christopherson
2024-03-08  1:36     ` Isaku Yamahata
2023-12-19  8:34 ` [PATCH v3 4/4] KVM: selftests: Add test case for x86 apic_bus_clock_frequency Isaku Yamahata
2023-12-21 17:38   ` Maxim Levitsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a22047ed-22e2-4b7f-9a61-16e9f77f3ba2@intel.com \
    --to=xiaoyao.li@intel.com \
    --cc=erdemaktas@google.com \
    --cc=isaku.yamahata@gmail.com \
    --cc=isaku.yamahata@intel.com \
    --cc=jmattson@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=vannapurve@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome