TWx Linux Repository
Go to file
Thomas Gleixner 37aedb806b x86/cpu: Consolidate CPUID leaf 0x2 tables
CPUID leaf 0x2 describes TLBs and caches. So there are two tables with the
respective descriptor constants in intel.c and cacheinfo.c. The tables
occupy almost 600 byte and require a loop based lookup for each variant.

Combining them into one table occupies exactly 1k rodata and allows to get
rid of the loop based lookup by just using the descriptor byte provided by
CPUID leaf 0x2 as index into the table, which simplifies the code and
reduces text size.

The conversion of the intel.c and cacheinfo.c code is done separately.

[ darwi: Actually define struct leaf_0x2_table.
	 Tab-align all of cpuid_0x2_table[] mapping entries.
	 Define needed SZ_* macros at <linux/sizes.h> instead (merged commit.)
	 Use CACHE_L1_{INST,DATA} as names for L1 cache descriptor types.
	 Set descriptor 0x63 type as TLB_DATA_1G_2M_4M and explain why.
	 Use enums for cache and TLB descriptor types (parent commits.)
	 Start enum types at 1 since type 0 is reserved for unknown descriptors.
	 Ensure that cache and TLB enum type values do not intersect.
	 Add leaf 0x2 table accessor for_each_leaf_0x2_entry() + documentation. ]

Co-developed-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ahmed S. Darwish <darwi@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20250324133324.23458-21-darwi@linutronix.de
2025-03-25 10:23:04 +01:00
arch x86/cpu: Consolidate CPUID leaf 0x2 tables 2025-03-25 10:23:04 +01:00
block cgroup: Changes for v6.15 2025-03-24 16:49:40 -07:00
certs sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3 2024-09-20 19:52:48 +03:00
crypto treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
Documentation x86/build updates for v6.15: 2025-03-24 22:23:23 -07:00
drivers [ Merge note: this pull request depends on you having merged 2025-03-24 22:06:11 -07:00
fs Scheduler updates for v6.15: 2025-03-24 21:28:12 -07:00
include x86/fpu updates for v6.15: 2025-03-24 22:27:18 -07:00
init [ Merge note: this pull request depends on you having merged 2025-03-24 22:06:11 -07:00
io_uring io_uring-6.14-20250322 2025-03-22 10:45:44 -07:00
ipc treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00
kernel [ Merge note: this pull request depends on you having merged 2025-03-24 22:06:11 -07:00
lib [ Merge note: this pull request depends on you having merged 2025-03-24 22:06:11 -07:00
LICENSES LICENSES: add 0BSD license text 2024-09-01 20:43:24 -07:00
mm [ Merge note: this pull request depends on you having merged 2025-03-24 22:06:11 -07:00
net vfs-6.15-rc1.afs 2025-03-24 13:15:16 -07:00
rust Locking changes for v6.15: 2025-03-24 20:55:03 -07:00
samples hardening updates for v6.15-rc1 2025-03-24 15:18:08 -07:00
scripts [ Merge note: this pull request depends on you having merged 2025-03-24 22:06:11 -07:00
security hardening updates for v6.15-rc1 2025-03-24 15:18:08 -07:00
sound ASoC: Fixes for v6.14 2025-03-13 07:33:48 +01:00
tools tools/x86/kcpuid: Update bitfields to x86-cpuid-db v2.3 2025-03-25 09:53:47 +01:00
usr kbuild: hdrcheck: fix cross build with clang 2025-03-05 04:06:45 +09:00
virt vfs-6.15-rc1.misc 2025-03-24 09:13:50 -07:00
.clang-format clang-format: Update with v6.11-rc1's for_each macro list 2024-08-02 13:20:31 +02:00
.clippy.toml rust: give Clippy the minimum supported Rust version 2025-01-10 00:17:25 +01:00
.cocciconfig
.editorconfig .editorconfig: remove trim_trailing_whitespace option 2024-06-13 16:47:52 +02:00
.get_maintainer.ignore MAINTAINERS: Retire Ralf Baechle 2024-11-12 15:48:59 +01:00
.gitattributes .gitattributes: set diff driver for Rust source code files 2023-05-31 17:48:25 +02:00
.gitignore rust: use host dylib naming convention to support macOS 2025-01-10 01:01:24 +01:00
.mailmap platform-drivers-x86 for v6.14-5 2025-03-14 10:57:28 -10:00
.rustfmt.toml rust: add .rustfmt.toml 2022-09-28 09:02:20 +02:00
COPYING
CREDITS MAINTAINERS: Move Pavel to kernel.org address 2025-02-07 09:12:33 -08:00
Kbuild Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Kconfig
MAINTAINERS MAINTAINERS: Include the entire kcpuid/ directory under the X86 CPUID DATABASE entry 2025-03-25 09:53:47 +01:00
Makefile [ Merge note: this pull request depends on you having merged 2025-03-24 22:06:11 -07:00
README README: Fix spelling 2024-03-18 03:36:32 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.