From: Thomas Gleixner <tglx@linutronix.de>
To: Dave Hansen <dave.hansen@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Rishabh Agrawal <rishabhagr@chromium.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
len.brown@intel.com, drake@endlessm.com,
rafael.j.wysocki@intel.com, mingo@redhat.com,
vaibhav.shankar@intel.com, biernacki@google.com,
zwisler@google.com, mattedavis@google.com,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Feng Tang <feng.tang@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org
Subject: Re: [PATCH v2] Add hardcoded crystal clock for KabyLake
Date: Mon, 14 Nov 2022 23:58:54 +0100 [thread overview]
Message-ID: <87y1sdqh1t.ffs@tglx> (raw)
In-Reply-To: <3d65c4cc-c002-9e6a-c6ea-fd776968a178@intel.com>
On Thu, Oct 20 2022 at 10:18, Dave Hansen wrote:
> On 10/20/22 10:13, Peter Zijlstra wrote:
>> And why, pray *WHY* can't Intel simply write the correct information in
>> CPUID leaf 15h. I mean, they defined the leaf, might as well use it, no?
>
> Is the data that's in the leaf just wrong? Doesn't that mean that the
> CPUID leaf on these models is violating the architecture contract? That
> sounds like something that deserves an erratum.
>
> Is there a documented erratum?
I don't know. The code has this comment:
/*
* Some Intel SoCs like Skylake and Kabylake don't report the crystal
* clock, but we can easily calculate it to a high degree of accuracy
* by considering the crystal ratio and the CPU speed.
*/
so those SoCs fail to expose clock in leaf 15h and then the information
in leaf 16h is so inaccurate that the calculation is off.
Sigh. It's 2022 and we are still relying on crystalball mechanisms to
figure out the damned crystal frequency.
The specification of leaf 15h is:
15H Time Stamp Counter and Nominal Core Crystal Clock Information Leaf
NOTES:
If EBX[31:0] is 0, the TSC/”core crystal clock” ratio is not enumerated.
If ECX is 0, the nominal core crystal clock frequency is not enumerated.
IOW, this CPUID leaf is defined to be useless and leaves it up to the
SoC integration to provide this information or not. It needs even two
fields to chose from to make it useless...
I'm sure this took 10+ draft versions and consumed a non-quantifiable
amount of work hours to come up with this joke.
Thanks,
tglx
next prev parent reply other threads:[~2022-11-14 22:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-18 19:01 [PATCH v2] Add hardcoded crystal clock for KabyLake Rishabh Agrawal
2022-10-20 17:13 ` Peter Zijlstra
2022-10-20 17:18 ` Dave Hansen
2022-11-14 22:58 ` Thomas Gleixner [this message]
2022-12-21 22:35 ` Christian A. Ehrhardt
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=87y1sdqh1t.ffs@tglx \
--to=tglx@linutronix.de \
--cc=biernacki@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=drake@endlessm.com \
--cc=feng.tang@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mattedavis@google.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rishabhagr@chromium.org \
--cc=vaibhav.shankar@intel.com \
--cc=x86@kernel.org \
--cc=zwisler@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