mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fei Li <fei1.li@intel.com>
To: <linux-kernel@vger.kernel.org>, <x86@kernel.org>, <peterz@infradead.org>
Cc: <dave.hansen@intel.com>, <gregkh@linuxfoundation.org>,
	<tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>, <hpa@zytor.com>,
	<Yu1.Wang@intel.com>, <conghui.chen@intel.com>,
	<fengwei.yin@intel.com>
Subject: Re: [PATCH v2] x86/acrn: Set X86_FEATURE_TSC_KNOWN_FREQ
Date: Mon, 7 Nov 2022 18:01:44 +0800	[thread overview]
Message-ID: <Y2jXiHMtR+4jDB1n@louislifei-OptiPlex-7090> (raw)
In-Reply-To: <20221101053019.174948-1-fei1.li@intel.com>

On 2022-11-01 at 13:30:19 +0800, Fei Li wrote:
> If the TSC frequency is known from the acrn_get_tsc_khz(),
> the TSC frequency does not need to be recalibrated.
> 
> Avoiding recalibration by setting X86_FEATURE_TSC_KNOWN_FREQ.
> This patch also removes `inline` for acrn_get_tsc_khz() since
> it doesn't make sense.
> 
> Signed-off-by: Fei Li <fei1.li@intel.com>
> Reviewed-by: Yin, Fengwei <fengwei.yin@intel.com>
> 
> ---
> v2:
> - Detail the commit message

Ping ...

> ---
>  arch/x86/include/asm/acrn.h | 5 -----
>  arch/x86/kernel/cpu/acrn.c  | 6 ++++++
>  2 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/x86/include/asm/acrn.h b/arch/x86/include/asm/acrn.h
> index 1dd14381bcb6..aa12c74ea959 100644
> --- a/arch/x86/include/asm/acrn.h
> +++ b/arch/x86/include/asm/acrn.h
> @@ -30,11 +30,6 @@ static inline u32 acrn_cpuid_base(void)
>  	return 0;
>  }
>  
> -static inline unsigned long acrn_get_tsc_khz(void)
> -{
> -	return cpuid_eax(ACRN_CPUID_TIMING_INFO);
> -}
> -
>  /*
>   * Hypercalls for ACRN
>   *
> diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c
> index 485441b7f030..c5ff75b6a949 100644
> --- a/arch/x86/kernel/cpu/acrn.c
> +++ b/arch/x86/kernel/cpu/acrn.c
> @@ -24,6 +24,12 @@ static u32 __init acrn_detect(void)
>  	return acrn_cpuid_base();
>  }
>  
> +static unsigned long acrn_get_tsc_khz(void)
> +{
> +	setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
> +	return cpuid_eax(ACRN_CPUID_TIMING_INFO);
> +}
> +
>  static void __init acrn_init_platform(void)
>  {
>  	/* Setup the IDT for ACRN hypervisor callback */
> 
> base-commit: 5aaef24b5c6d4246b2cac1be949869fa36577737
> -- 
> 2.34.1
> 

  reply	other threads:[~2022-11-07  9:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01  5:30 Fei Li
2022-11-07 10:01 ` Fei Li [this message]
2022-11-07 15:30 ` Borislav Petkov
2022-11-14  8:14   ` Fei Li
2022-11-21  7:52     ` Li, Fei1
2022-11-21  9:33     ` Borislav Petkov

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=Y2jXiHMtR+4jDB1n@louislifei-OptiPlex-7090 \
    --to=fei1.li@intel.com \
    --cc=Yu1.Wang@intel.com \
    --cc=bp@alien8.de \
    --cc=conghui.chen@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=fengwei.yin@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®