Merge tag 'v6.8-rc4' into x86/percpu, to resolve conflicts and refresh the branch
[sfrench/cifs-2.6.git] / arch / x86 / include / asm / current.h
index dd4b67101bb7ed40013584f66cc80e805ea0ece1..fb7702d4170c554dd9f34737d76ac69e7b07fee0 100644 (file)
@@ -37,8 +37,15 @@ static_assert(sizeof(struct pcpu_hot) == 64);
 
 DECLARE_PER_CPU_ALIGNED(struct pcpu_hot, pcpu_hot);
 
+/* const-qualified alias to pcpu_hot, aliased by linker. */
+DECLARE_PER_CPU_ALIGNED(const struct pcpu_hot __percpu_seg_override,
+                       const_pcpu_hot);
+
 static __always_inline struct task_struct *get_current(void)
 {
+       if (IS_ENABLED(CONFIG_USE_X86_SEG_SUPPORT))
+               return this_cpu_read_const(const_pcpu_hot.current_task);
+
        return this_cpu_read_stable(pcpu_hot.current_task);
 }