aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorDave Hansen <[email protected]>2025-06-10 22:24:20 +0000
committerDave Hansen <[email protected]>2025-06-17 22:36:57 +0000
commit94a17f2dc90bc7eae36c0f478515d4bd1c23e877 (patch)
treec5e7ab0f3d13724fe9e91003877487242ce00588 /rust/helpers/helpers.c
parentx86,fs/resctrl: Remove inappropriate references to cacheinfo in the resctrl s... (diff)
downloadkernel-94a17f2dc90bc7eae36c0f478515d4bd1c23e877.tar.gz
kernel-94a17f2dc90bc7eae36c0f478515d4bd1c23e877.zip
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: 4afeb0ed1753 ("x86/mm: Enable broadcast TLB invalidation for multi-threaded processes") Signed-off-by: Dave Hansen <[email protected]> Acked-by: Rik van Riel <[email protected]> Cc:[email protected] Link: https://lore.kernel.org/all/20250610222420.E8CBF472%40davehans-spike.ostc.intel.com
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions