diff options
Diffstat (limited to 'arch/x86/kernel/process.c')
| -rw-r--r-- | arch/x86/kernel/process.c | 11 | 
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index b650cde3f64d..dac41a0072ea 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -5,6 +5,7 @@  #include <linux/kernel.h>  #include <linux/mm.h>  #include <linux/smp.h> +#include <linux/cpu.h>  #include <linux/prctl.h>  #include <linux/slab.h>  #include <linux/sched.h> @@ -48,6 +49,7 @@  #include <asm/frame.h>  #include <asm/unwind.h>  #include <asm/tdx.h> +#include <asm/mmu_context.h>  #include "process.h" @@ -162,6 +164,9 @@ int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)  	savesegment(es, p->thread.es);  	savesegment(ds, p->thread.ds); + +	if (p->mm && (clone_flags & (CLONE_VM | CLONE_VFORK)) == CLONE_VM) +		set_bit(MM_CONTEXT_LOCK_LAM, &p->mm->context.flags);  #else  	p->thread.sp0 = (unsigned long) (childregs + 1);  	savesegment(gs, p->thread.gs); @@ -368,6 +373,8 @@ void arch_setup_new_exec(void)  		task_clear_spec_ssb_noexec(current);  		speculation_ctrl_update(read_thread_flags());  	} + +	mm_reset_untag_mask(current->mm);  }  #ifdef CONFIG_X86_IOPL_IOPERM @@ -715,7 +722,7 @@ static bool x86_idle_set(void)  }  #ifndef CONFIG_SMP -static inline void play_dead(void) +static inline void __noreturn play_dead(void)  {  	BUG();  } @@ -727,7 +734,7 @@ void arch_cpu_idle_enter(void)  	local_touch_nmi();  } -void arch_cpu_idle_dead(void) +void __noreturn arch_cpu_idle_dead(void)  {  	play_dead();  }  |