Skip to content

Commit 785cdec

Browse files
committed
Merge tag 'x86-core-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core x86 updates from Ingo Molnar: "Boot code changes: - A large series of changes to reorganize the x86 boot code into a better isolated and easier to maintain base of PIC early startup code in arch/x86/boot/startup/, by Ard Biesheuvel. Motivation & background: | Since commit | | c88d715 ("x86/boot/64: Rewrite startup_64() in C") | | dated Jun 6 2017, we have been using C code on the boot path in a way | that is not supported by the toolchain, i.e., to execute non-PIC C | code from a mapping of memory that is different from the one provided | to the linker. It should have been obvious at the time that this was a | bad idea, given the need to sprinkle fixup_pointer() calls left and | right to manipulate global variables (including non-pointer variables) | without crashing. | | This C startup code has been expanding, and in particular, the SEV-SNP | startup code has been expanding over the past couple of years, and | grown many of these warts, where the C code needs to use special | annotations or helpers to access global objects. This tree includes the first phase of this work-in-progress x86 boot code reorganization. Scalability enhancements and micro-optimizations: - Improve code-patching scalability (Eric Dumazet) - Remove MFENCEs for X86_BUG_CLFLUSH_MONITOR (Andrew Cooper) CPU features enumeration updates: - Thorough reorganization and cleanup of CPUID parsing APIs (Ahmed S. Darwish) - Fix, refactor and clean up the cacheinfo code (Ahmed S. Darwish, Thomas Gleixner) - Update CPUID bitfields to x86-cpuid-db v2.3 (Ahmed S. Darwish) Memory management changes: - Allow temporary MMs when IRQs are on (Andy Lutomirski) - Opt-in to IRQs-off activate_mm() (Andy Lutomirski) - Simplify choose_new_asid() and generate better code (Borislav Petkov) - Simplify 32-bit PAE page table handling (Dave Hansen) - Always use dynamic memory layout (Kirill A. Shutemov) - Make SPARSEMEM_VMEMMAP the only memory model (Kirill A. Shutemov) - Make 5-level paging support unconditional (Kirill A. Shutemov) - Stop prefetching current->mm->mmap_lock on page faults (Mateusz Guzik) - Predict valid_user_address() returning true (Mateusz Guzik) - Consolidate initmem_init() (Mike Rapoport) FPU support and vector computing: - Enable Intel APX support (Chang S. Bae) - Reorgnize and clean up the xstate code (Chang S. Bae) - Make task_struct::thread constant size (Ingo Molnar) - Restore fpu_thread_struct_whitelist() to fix CONFIG_HARDENED_USERCOPY=y (Kees Cook) - Simplify the switch_fpu_prepare() + switch_fpu_finish() logic (Oleg Nesterov) - Always preserve non-user xfeatures/flags in __state_perm (Sean Christopherson) Microcode loader changes: - Help users notice when running old Intel microcode (Dave Hansen) - AMD: Do not return error when microcode update is not necessary (Annie Li) - AMD: Clean the cache if update did not load microcode (Boris Ostrovsky) Code patching (alternatives) changes: - Simplify, reorganize and clean up the x86 text-patching code (Ingo Molnar) - Make smp_text_poke_batch_process() subsume smp_text_poke_batch_finish() (Nikolay Borisov) - Refactor the {,un}use_temporary_mm() code (Peter Zijlstra) Debugging support: - Add early IDT and GDT loading to debug relocate_kernel() bugs (David Woodhouse) - Print the reason for the last reset on modern AMD CPUs (Yazen Ghannam) - Add AMD Zen debugging document (Mario Limonciello) - Fix opcode map (!REX2) superscript tags (Masami Hiramatsu) - Stop decoding i64 instructions in x86-64 mode at opcode (Masami Hiramatsu) CPU bugs and bug mitigations: - Remove X86_BUG_MMIO_UNKNOWN (Borislav Petkov) - Fix SRSO reporting on Zen1/2 with SMT disabled (Borislav Petkov) - Restructure and harmonize the various CPU bug mitigation methods (David Kaplan) - Fix spectre_v2 mitigation default on Intel (Pawan Gupta) MSR API: - Large MSR code and API cleanup (Xin Li) - In-kernel MSR API type cleanups and renames (Ingo Molnar) PKEYS: - Simplify PKRU update in signal frame (Chang S. Bae) NMI handling code: - Clean up, refactor and simplify the NMI handling code (Sohil Mehta) - Improve NMI duration console printouts (Sohil Mehta) Paravirt guests interface: - Restrict PARAVIRT_XXL to 64-bit only (Kirill A. Shutemov) SEV support: - Share the sev_secrets_pa value again (Tom Lendacky) x86 platform changes: - Introduce the <asm/amd/> header namespace (Ingo Molnar) - i2c: piix4, x86/platform: Move the SB800 PIIX4 FCH definitions to <asm/amd/fch.h> (Mario Limonciello) Fixes and cleanups: - x86 assembly code cleanups and fixes (Uros Bizjak) - Misc fixes and cleanups (Andi Kleen, Andy Lutomirski, Andy Shevchenko, Ard Biesheuvel, Bagas Sanjaya, Baoquan He, Borislav Petkov, Chang S. Bae, Chao Gao, Dan Williams, Dave Hansen, David Kaplan, David Woodhouse, Eric Biggers, Ingo Molnar, Josh Poimboeuf, Juergen Gross, Malaya Kumar Rout, Mario Limonciello, Nathan Chancellor, Oleg Nesterov, Pawan Gupta, Peter Zijlstra, Shivank Garg, Sohil Mehta, Thomas Gleixner, Uros Bizjak, Xin Li)" * tag 'x86-core-2025-05-25' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (331 commits) x86/bugs: Fix spectre_v2 mitigation default on Intel x86/bugs: Restructure ITS mitigation x86/xen/msr: Fix uninitialized variable 'err' x86/msr: Remove a superfluous inclusion of <asm/asm.h> x86/paravirt: Restrict PARAVIRT_XXL to 64-bit only x86/mm/64: Make 5-level paging support unconditional x86/mm/64: Make SPARSEMEM_VMEMMAP the only memory model x86/mm/64: Always use dynamic memory layout x86/bugs: Fix indentation due to ITS merge x86/cpuid: Rename hypervisor_cpuid_base()/for_each_possible_hypervisor_cpuid_base() to cpuid_base_hypervisor()/for_each_possible_cpuid_base_hypervisor() x86/cpu/intel: Rename CPUID(0x2) descriptors iterator parameter x86/cacheinfo: Rename CPUID(0x2) descriptors iterator parameter x86/cpuid: Rename cpuid_get_leaf_0x2_regs() to cpuid_leaf_0x2() x86/cpuid: Rename have_cpuid_p() to cpuid_feature() x86/cpuid: Set <asm/cpuid/api.h> as the main CPUID header x86/cpuid: Move CPUID(0x2) APIs into <cpuid/api.h> x86/msr: Add rdmsrl_on_cpu() compatibility wrapper x86/mm: Fix kernel-doc descriptions of various pgtable methods x86/asm-offsets: Export certain 'struct cpuinfo_x86' fields for 64-bit asm use too x86/boot: Defer initialization of VM space related global variables ...
2 parents ddddf9d + 6a7c3c2 commit 785cdec

File tree

408 files changed

+9285
-7698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

408 files changed

+9285
-7698
lines changed

Documentation/ABI/testing/sysfs-devices-system-cpu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ What: /sys/devices/system/cpu/vulnerabilities
517517
/sys/devices/system/cpu/vulnerabilities/mds
518518
/sys/devices/system/cpu/vulnerabilities/meltdown
519519
/sys/devices/system/cpu/vulnerabilities/mmio_stale_data
520+
/sys/devices/system/cpu/vulnerabilities/old_microcode
520521
/sys/devices/system/cpu/vulnerabilities/reg_file_data_sampling
521522
/sys/devices/system/cpu/vulnerabilities/retbleed
522523
/sys/devices/system/cpu/vulnerabilities/spec_store_bypass

Documentation/admin-guide/hw-vuln/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ are configurable at compile, boot or run time.
2323
gather_data_sampling
2424
reg-file-data-sampling
2525
rsb
26+
old_microcode
2627
indirect-target-selection
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.. SPDX-License-Identifier: GPL-2.0
2+
3+
=============
4+
Old Microcode
5+
=============
6+
7+
The kernel keeps a table of released microcode. Systems that had
8+
microcode older than this at boot will say "Vulnerable". This means
9+
that the system was vulnerable to some known CPU issue. It could be
10+
security or functional, the kernel does not know or care.
11+
12+
You should update the CPU microcode to mitigate any exposure. This is
13+
usually accomplished by updating the files in
14+
/lib/firmware/intel-ucode/ via normal distribution updates. Intel also
15+
distributes these files in a github repo:
16+
17+
https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files.git
18+
19+
Just like all the other hardware vulnerabilities, exposure is
20+
determined at boot. Runtime microcode updates do not change the status
21+
of this vulnerability.

Documentation/arch/x86/amd-debugging.rst

Lines changed: 368 additions & 0 deletions
Large diffs are not rendered by default.

Documentation/arch/x86/cpuinfo.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ For example, when an old kernel is running on new hardware.
173173
The kernel disabled support for it at compile-time
174174
--------------------------------------------------
175175

176-
For example, if 5-level-paging is not enabled when building (i.e.,
177-
CONFIG_X86_5LEVEL is not selected) the flag "la57" will not show up [#f1]_.
176+
For example, if Linear Address Masking (LAM) is not enabled when building (i.e.,
177+
CONFIG_ADDRESS_MASKING is not selected) the flag "lam" will not show up.
178178
Even though the feature will still be detected via CPUID, the kernel disables
179-
it by clearing via setup_clear_cpu_cap(X86_FEATURE_LA57).
179+
it by clearing via setup_clear_cpu_cap(X86_FEATURE_LAM).
180180

181181
The feature is disabled at boot-time
182182
------------------------------------
@@ -200,5 +200,3 @@ missing at runtime. For example, AVX flags will not show up if XSAVE feature
200200
is disabled since they depend on XSAVE feature. Another example would be broken
201201
CPUs and them missing microcode patches. Due to that, the kernel decides not to
202202
enable a feature.
203-
204-
.. [#f1] 5-level paging uses linear address of 57 bits.

Documentation/arch/x86/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ x86-specific Documentation
2525
shstk
2626
iommu
2727
intel_txt
28+
amd-debugging
2829
amd-memory-encryption
2930
amd_hsmp
3031
tdx

Documentation/arch/x86/resume.svg

Lines changed: 4 additions & 0 deletions
Loading

Documentation/arch/x86/suspend.svg

Lines changed: 4 additions & 0 deletions
Loading

Documentation/arch/x86/x86_64/5level-paging.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ QEMU 2.9 and later support 5-level paging.
2222
Virtual memory layout for 5-level paging is described in
2323
Documentation/arch/x86/x86_64/mm.rst
2424

25-
26-
Enabling 5-level paging
27-
=======================
28-
CONFIG_X86_5LEVEL=y enables the feature.
29-
30-
Kernel with CONFIG_X86_5LEVEL=y still able to boot on 4-level hardware.
31-
In this case additional page table level -- p4d -- will be folded at
32-
runtime.
33-
3425
User-space and large virtual address space
3526
==========================================
3627
On x86, 5-level paging enables 56-bit userspace virtual address space.

MAINTAINERS

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ R: Carlos Bilbao <carlos.bilbao@kernel.org>
10971097
L: platform-driver-x86@vger.kernel.org
10981098
S: Maintained
10991099
F: Documentation/arch/x86/amd_hsmp.rst
1100-
F: arch/x86/include/asm/amd_hsmp.h
1100+
F: arch/x86/include/asm/amd/hsmp.h
11011101
F: arch/x86/include/uapi/asm/amd_hsmp.h
11021102
F: drivers/platform/x86/amd/hsmp/
11031103

@@ -1142,7 +1142,7 @@ M: Mario Limonciello <mario.limonciello@amd.com>
11421142
M: Yazen Ghannam <yazen.ghannam@amd.com>
11431143
L: linux-kernel@vger.kernel.org
11441144
S: Supported
1145-
F: arch/x86/include/asm/amd_node.h
1145+
F: arch/x86/include/asm/amd/node.h
11461146
F: arch/x86/kernel/amd_node.c
11471147

11481148
AMD PDS CORE DRIVER
@@ -26368,7 +26368,7 @@ R: Ahmed S. Darwish <darwi@linutronix.de>
2636826368
L: x86-cpuid@lists.linux.dev
2636926369
S: Maintained
2637026370
W: https://x86-cpuid.org
26371-
F: tools/arch/x86/kcpuid/cpuid.csv
26371+
F: tools/arch/x86/kcpuid/
2637226372

2637326373
X86 ENTRY CODE
2637426374
M: Andy Lutomirski <luto@kernel.org>

0 commit comments

Comments
 (0)