summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorXin Li (Intel) <xin@zytor.com>2025-01-10 09:46:39 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-23 17:23:03 +0100
commita737a81d5255ca68e276c5ae8907f5d56e9167d9 (patch)
tree6c0536b34e0baec03d4e43ce153c30ab52e450bd /drivers/gpu/drm/i915
parent6e641d499bb1b857a37a46438fb966ff71855a7e (diff)
downloadlinux-a737a81d5255ca68e276c5ae8907f5d56e9167d9.tar.gz
linux-a737a81d5255ca68e276c5ae8907f5d56e9167d9.tar.bz2
linux-a737a81d5255ca68e276c5ae8907f5d56e9167d9.zip
x86/fred: Fix the FRED RSP0 MSR out of sync with its per-CPU cache
commit de31b3cd706347044e1a57d68c3a683d58e8cca4 upstream. The FRED RSP0 MSR is only used for delivering events when running userspace. Linux leverages this property to reduce expensive MSR writes and optimize context switches. The kernel only writes the MSR when about to run userspace *and* when the MSR has actually changed since the last time userspace ran. This optimization is implemented by maintaining a per-CPU cache of FRED RSP0 and then checking that against the value for the top of current task stack before running userspace. However cpu_init_fred_exceptions() writes the MSR without updating the per-CPU cache. This means that the kernel might return to userspace with MSR_IA32_FRED_RSP0==0 when it needed to point to the top of current task stack. This would induce a double fault (#DF), which is bad. A context switch after cpu_init_fred_exceptions() can paper over the issue since it updates the cached value. That evidently happens most of the time explaining how this bug got through. Fix the bug through resynchronizing the FRED RSP0 MSR with its per-CPU cache in cpu_init_fred_exceptions(). Fixes: fe85ee391966 ("x86/entry: Set FRED RSP0 on return to userspace instead of context switch") Signed-off-by: Xin Li (Intel) <xin@zytor.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Acked-by: Dave Hansen <dave.hansen@linux.intel.com> Cc:stable@vger.kernel.org Link: https://lore.kernel.org/all/20250110174639.1250829-1-xin%40zytor.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/i915')
0 files changed, 0 insertions, 0 deletions