2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/arch/x86/mm
Dave Hansen 94a17f2dc9 x86/mm: Disable INVLPGB when PTI is enabled
PTI uses separate ASIDs (aka. PCIDs) for kernel and user address
spaces. When the kernel needs to flush the user address space, it
just sets a bit in a bitmap and then flushes the entire PCID on
the next switch to userspace.

This bitmap is a single 'unsigned long' which is plenty for all 6
dynamic ASIDs. But, unfortunately, the INVLPGB support brings along a
bunch more user ASIDs, as many as ~2k more. The bitmap can't address
that many.

Fortunately, the bitmap is only needed for PTI and all the CPUs
with INVLPGB are AMD CPUs that aren't vulnerable to Meltdown and
don't need PTI. The only way someone can run into an issue in
practice is by booting with pti=on on a newer AMD CPU.

Disable INVLPGB if PTI is enabled. Avoid overrunning the small
bitmap.

Note: this will be fixed up properly by making the bitmap bigger.
For now, just avoid the mostly theoretical bug.

Fixes: 4afeb0ed17 ("x86/mm: Enable broadcast TLB invalidation for multi-threaded processes")
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Rik van Riel <riel@surriel.com>
Cc:stable@vger.kernel.org
Link: https://lore.kernel.org/all/20250610222420.E8CBF472%40davehans-spike.ostc.intel.com
2025-06-17 15:36:57 -07:00
..
pat x86/mm/pat: don't collapse pages without PSE set 2025-06-11 11:20:51 +02:00
amdtopology.c x86/platform/amd: Move the <asm/amd_nb.h> header to <asm/amd/nb.h> 2025-04-14 09:34:14 +02:00
cpu_entry_area.c x86/cpu_entry_area: Annotate percpu_setup_exception_stacks() as __init 2024-08-25 14:29:38 +02:00
debug_pagetables.c x86/bugs: Rename CONFIG_PAGE_TABLE_ISOLATION => CONFIG_MITIGATION_PAGE_TABLE_ISOLATION 2024-01-10 10:52:28 +01:00
dump_pagetables.c mm/ptdump: split effective_prot() into level specific callbacks 2025-05-11 17:48:19 -07:00
extable.c x86/fpu: Convert task_struct::thread.fpu accesses to use x86_task_fpu() 2025-04-14 08:18:29 +02:00
fault.c Move the x86 page fault tracepoints to generic code, because 2025-05-26 21:18:59 -07:00
hugetlbpage.c mm: drop hugetlb_get_unmapped_area{_*} functions 2024-11-06 20:11:10 -08:00
ident_map.c x86/mm/ident_map: Fix theoretical virtual address overflow to zero 2025-03-19 11:12:29 +01:00
init_32.c Revert "mm/execmem: Unify early execmem_cache behaviour" 2025-06-11 11:20:52 +02:00
init_64.c Revert "mm/execmem: Unify early execmem_cache behaviour" 2025-06-11 11:20:52 +02:00
init.c x86/mm/64: Make 5-level paging support unconditional 2025-05-17 10:38:16 +02:00
iomap_32.c
ioremap.c mm, x86: use for_each_valid_pfn() from __ioremap_check_ram() 2025-05-12 23:50:44 -07:00
kasan_init_64.c tracing: Disable branch profiling in noinstr code 2025-03-22 09:49:26 +01:00
kaslr.c x86/kaslr: Reduce KASLR entropy on most x86 systems 2025-02-22 12:25:57 +01:00
kmmio.c x86/mm/kmmio: Remove redundant preempt_disable() 2022-12-12 10:54:48 -05:00
kmsan_shadow.c x86: kmsan: handle CPU entry area 2022-10-03 14:03:26 -07:00
maccess.c x86/mm: Disallow vsyscall page read for copy_from_kernel_nofault() 2024-02-15 19:21:39 -08:00
Makefile Move the x86 page fault tracepoints to generic code, because 2025-05-26 21:18:59 -07:00
mem_encrypt_amd.c x86/boot: Add a bunch of PIC aliases 2025-05-04 15:59:43 +02:00
mem_encrypt_boot.S x86/cfi: Clean up linkage 2025-02-14 10:32:05 +01:00
mem_encrypt.c x86/sev: Add Secure TSC support for SNP guests 2025-01-07 20:27:23 +01:00
mm_internal.h x86/mm: Consolidate initmem_init() 2025-04-09 22:02:30 +02:00
mmap.c x86/mm: Replace open-coded gap bounding with clamp() 2025-02-21 15:33:57 +01:00
mmio-mod.c x86: Replace cpumask_weight() with cpumask_empty() where appropriate 2022-04-10 22:35:38 +02:00
numa.c Merge branch 'x86/mm' into x86/core, to resolve conflicts 2025-05-13 10:39:22 +02:00
pf_in.c
pf_in.h
pgprot.c x86/mm: move protection_map[] inside the platform 2022-07-17 17:14:38 -07:00
pgtable_32.c
pgtable.c - The 11 patch series "Add folio_mk_pte()" from Matthew Wilcox 2025-05-31 15:44:16 -07:00
physaddr.c
physaddr.h
pkeys.c x86/pkeys: Clarify PKRU_AD_KEY macro 2022-06-07 16:06:33 -07:00
pti.c x86/mm: Disable INVLPGB when PTI is enabled 2025-06-17 15:36:57 -07:00
srat.c x86/mm: Don't print out SRAT table information 2024-08-08 17:23:40 +02:00
testmmiotrace.c x86/mm: add testmmiotrace MODULE_DESCRIPTION() 2024-09-01 20:43:31 -07:00
tlb.c Merge branch 'x86/msr' into x86/core, to resolve conflicts 2025-05-13 10:42:06 +02:00