From: Sohil Mehta <sohil.mehta@intel.com>
To: x86@kernel.org, Dave Hansen <dave.hansen@linux.intel.com>,
Tony Luck <tony.luck@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Borislav Petkov <bp@alien8.de>, "H . Peter Anvin" <hpa@zytor.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, Andy Lutomirski <luto@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Fenghua Yu <fenghua.yu@intel.com>,
Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
Zhang Rui <rui.zhang@intel.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
David Laight <david.laight.linux@gmail.com>,
Sohil Mehta <sohil.mehta@intel.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org, linux-pm@vger.kernel.org,
linux-hwmon@vger.kernel.org
Subject: [PATCH v2 00/17] Prepare for new Intel Family numbers
Date: Tue, 11 Feb 2025 19:43:50 +0000 [thread overview]
Message-ID: <20250211194407.2577252-1-sohil.mehta@intel.com> (raw)
---Summary---
Mainstream Intel processors have been using Family 6 for a couple of decades.
Audit all the Intel Family-model checks to get ready for the upcoming Family 18
and 19 models.
Patch 1: Preparatory cleanup in smpboot.
Patch 2-7: Fixes in arch/x86 and drivers.
Patch 8-17: Cleanups in arch/x86 to convert x86_model checks to VFM ones.
This series does not include cleanups in drivers/.
Please feel free to pick up whichever patches seem ready. Most of the patches
can be applied out of order except patches 1 and 2 which should be applied
together.
---v2 changes---
* Improve commit messages.
* Split and reorder patches for better readability.
* Added a cleanup patch in the beginning.
RFC-v1: https://lore.kernel.org/lkml/20241220213711.1892696-1-sohil.mehta@intel.com/
---Background---
The last mainstream Intel processors that deviated from Family 6 were the
Netburst architecture based Pentium 4s that had a Family number of 15. Intel
has recently started to introduce extended Family numbers greater than 15, as
seen in commit d1fb034b75a8 ("x86/cpu: Add two Intel CPU model numbers").
Though newer CPUs can have any Family number, the currently planned CPUs lie in
Families 18 and 19.
Some kernel code assumes that the Family number would always remain 6. There
are checks that apply to recent Family 6 models such as Lunar Lake and
Clearwater Forest but don't automatically extend to Family 19 models such as
Diamond Rapids. This series aims to fix and cleanup all of such Intel specific
checks (mainly in arch/x86) to avoid such issues in the future. It also
converts almost all of the x86_model checks in arch/x86 to the new VFM ones.
OTOH, x86_model usage in drivers/ is a huge mess. Some drivers might need to be
completely rewritten to make them future-proof. I have attempted a couple of
fixes in cpufreq and hwmon, but they are mostly superficial. A more thorough
clean up of drivers is needed to replace all x86_model usage with the new VFM
checks.
---Assumptions and Trade-offs---
Newer CPUs will have model numbers only in Family 6 or after Family 15. No new
processors would be added between Family 6 and 15.
As a convention, Intel Family numbers are referenced using decimals (Family 15,
19, etc.) even though the AMD-specific code might prefer hexadecimals in
similar situations.
It would be preferable to have simpler and more maintainable checks that might
in a rare situation change the behavior on really old platforms. If someone
pops up with an issue, the code would be fixed later.
For example, the check,
c->x86_vfm >= INTEL_PENTIUM_PRO
is preferred over,
c->x86 == 6 || c->x86 > 15
if the likelihood of adversely affecting Family 15 is low.
Also, the CPU defines in intel-family.h have been added as and when needed to
make reviewing and applying patches out of order easier.
Sohil Mehta (17):
x86/smpboot: Remove confusing quirk usage in INIT delay
x86/smpboot: Fix INIT delay optimization for extended Intel Families
x86/apic: Fix 32-bit APIC initialization for extended Intel Families
x86/cpu/intel: Fix the movsl alignment preference for extended
Families
x86/cpu/intel: Fix page copy performance for extended Families
cpufreq: Fix the efficient idle check for Intel extended Families
hwmon: Fix Intel Family-model checks to include extended Families
x86/microcode: Update the Intel processor flag scan check
x86/mtrr: Modify a x86_model check to an Intel VFM check
x86/cpu/intel: Replace early Family 6 checks with VFM ones
x86/cpu/intel: Replace Family 15 checks with VFM ones
x86/cpu/intel: Replace Family 5 model checks with VFM ones
x86/pat: Replace Intel x86_model checks with VFM ones
x86/acpi/cstate: Improve Intel Family model checks
x86/cpu/intel: Bound the non-architectural constant_tsc model checks
perf/x86: Simplify P6 PMU initialization
perf/x86/p4: Replace Pentium 4 model checks with VFM ones
arch/x86/events/intel/p4.c | 7 +--
arch/x86/events/intel/p6.c | 28 +++--------
arch/x86/include/asm/intel-family.h | 21 ++++++++-
arch/x86/kernel/acpi/cstate.c | 8 ++--
arch/x86/kernel/apic/apic.c | 4 +-
arch/x86/kernel/cpu/intel.c | 68 +++++++++++++--------------
arch/x86/kernel/cpu/microcode/intel.c | 2 +-
arch/x86/kernel/cpu/mtrr/generic.c | 4 +-
arch/x86/kernel/smpboot.c | 17 ++++---
arch/x86/mm/pat/memtype.c | 7 +--
drivers/cpufreq/cpufreq_ondemand.c | 15 +++---
drivers/hwmon/coretemp.c | 26 ++++++----
12 files changed, 111 insertions(+), 96 deletions(-)
--
2.43.0
next reply other threads:[~2025-02-11 19:46 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-11 19:43 Sohil Mehta [this message]
2025-02-11 19:43 ` [PATCH v2 01/17] x86/smpboot: Remove confusing quirk usage in INIT delay Sohil Mehta
2025-02-11 19:43 ` [PATCH v2 02/17] x86/smpboot: Fix INIT delay optimization for extended Intel Families Sohil Mehta
2025-02-11 20:10 ` Dave Hansen
2025-02-11 20:20 ` Sohil Mehta
2025-02-11 19:43 ` [PATCH v2 03/17] x86/apic: Fix 32-bit APIC initialization " Sohil Mehta
2025-02-11 19:43 ` [PATCH v2 04/17] x86/cpu/intel: Fix the movsl alignment preference for extended Families Sohil Mehta
2025-02-11 20:26 ` Dave Hansen
2025-02-11 21:45 ` David Laight
2025-02-11 19:43 ` [PATCH v2 05/17] x86/cpu/intel: Fix page copy performance " Sohil Mehta
2025-02-11 20:53 ` Dave Hansen
2025-02-12 0:54 ` Andrew Cooper
2025-02-12 21:19 ` Sohil Mehta
2025-02-13 23:02 ` Andrew Cooper
2025-02-14 0:29 ` Sohil Mehta
2025-02-11 19:43 ` [PATCH v2 06/17] cpufreq: Fix the efficient idle check for Intel " Sohil Mehta
2025-02-12 5:35 ` Zhang, Rui
2025-02-13 18:49 ` Sohil Mehta
2025-02-14 2:03 ` Zhang, Rui
2025-02-11 19:43 ` [PATCH v2 07/17] hwmon: Fix Intel Family-model checks to include " Sohil Mehta
2025-02-11 20:58 ` Dave Hansen
2025-02-11 21:38 ` Sohil Mehta
2025-02-12 13:43 ` Zhang, Rui
2025-02-12 16:57 ` Dave Hansen
2025-02-14 2:23 ` Zhang, Rui
2025-02-12 13:10 ` Zhang, Rui
2025-02-11 19:43 ` [PATCH v2 08/17] x86/microcode: Update the Intel processor flag scan check Sohil Mehta
2025-02-11 21:00 ` Dave Hansen
2025-02-11 19:43 ` [PATCH v2 09/17] x86/mtrr: Modify a x86_model check to an Intel VFM check Sohil Mehta
2025-02-11 21:00 ` Dave Hansen
2025-02-11 19:44 ` [PATCH v2 10/17] x86/cpu/intel: Replace early Family 6 checks with VFM ones Sohil Mehta
2025-02-11 21:03 ` Dave Hansen
2025-02-11 19:44 ` [PATCH v2 11/17] x86/cpu/intel: Replace Family 15 " Sohil Mehta
2025-02-11 21:03 ` Dave Hansen
2025-02-11 19:44 ` [PATCH v2 12/17] x86/cpu/intel: Replace Family 5 model " Sohil Mehta
2025-02-11 21:06 ` Dave Hansen
2025-02-11 19:44 ` [PATCH v2 13/17] x86/pat: Replace Intel x86_model " Sohil Mehta
2025-02-11 21:09 ` Dave Hansen
2025-02-11 21:42 ` Sohil Mehta
2025-02-11 19:44 ` [PATCH v2 14/17] x86/acpi/cstate: Improve Intel Family model checks Sohil Mehta
2025-02-11 21:20 ` Dave Hansen
2025-02-11 19:44 ` [PATCH v2 15/17] x86/cpu/intel: Bound the non-architectural constant_tsc " Sohil Mehta
2025-02-11 21:41 ` Dave Hansen
2025-02-12 0:45 ` Sohil Mehta
2025-02-11 19:44 ` [PATCH v2 16/17] perf/x86: Simplify P6 PMU initialization Sohil Mehta
2025-02-11 19:44 ` [PATCH v2 17/17] perf/x86/p4: Replace Pentium 4 model checks with VFM ones Sohil Mehta
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=20250211194407.2577252-1-sohil.mehta@intel.com \
--to=sohil.mehta@intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david.laight.linux@gmail.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=irogers@google.com \
--cc=jdelvare@suse.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=luto@kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=viresh.kumar@linaro.org \
--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