Re: [PATCH 6/8] x86/fpu: Make sure x86_task_fpu() doesn't get called for PF_KTHREAD|PF_USER_WORKER tasks during exit
From: Ingo Molnar
Date: Sat Apr 12 2025 - 04:38:11 EST
* Chang S. Bae <chang.seok.bae@xxxxxxxxx> wrote:
> On 4/9/2025 2:11 PM, Ingo Molnar wrote:
> > void arch_release_task_struct(struct task_struct *tsk)
> > {
> > - if (fpu_state_size_dynamic())
> > + if (fpu_state_size_dynamic() && !(current->flags & (PF_KTHREAD | PF_USER_WORKER)))
> > fpstate_free(x86_task_fpu(tsk));
> > }
>
> Looks like the AMX system couldn't boot properly, and I found that
> referencing tsk->flags here resolves the issue.
Indeed, fixed!
I've also added your Fixed-by tag to the patch:
Fixed-by: Chang S. Bae <chang.seok.bae@xxxxxxxxx>
Thanks,
Ingo
==========>
arch/x86/kernel/process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index de9df37c5d67..7a1bfb61d86f 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -109,7 +109,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
#ifdef CONFIG_X86_64
void arch_release_task_struct(struct task_struct *tsk)
{
- if (fpu_state_size_dynamic() && !(current->flags & (PF_KTHREAD | PF_USER_WORKER)))
+ if (fpu_state_size_dynamic() && !(tsk->flags & (PF_KTHREAD | PF_USER_WORKER)))
fpstate_free(x86_task_fpu(tsk));
}
#endif