# Re: \[PATCH 4/6\] arm64: Kill 32-bit applications scheduled on 64-bit-only CPUs

- From: Will Deacon \<will@kernel.org\>
- Date: 2020-10-28 12:37:46 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2020/10/8800596
- Thread: https://ratatoskr.run/linux-arch/2020/10/8800548/t.md

```text
On Wed, Oct 28, 2020 at 12:10:53PM +0000, Catalin Marinas wrote:
> On Tue, Oct 27, 2020 at 09:51:16PM +0000, Will Deacon wrote:
> > diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c
> > index 4784011cecac..c45b5f9dd66b 100644
> > --- a/arch/arm64/kernel/process.c
> > +++ b/arch/arm64/kernel/process.c
> > @@ -542,6 +542,17 @@ static void erratum_1418040_thread_switch(struct task_struct *prev,
> >  	write_sysreg(val, cntkctl_el1);
> >  }
> >  
> > +static void compat_thread_switch(struct task_struct *next)
> > +{
> > +	if (!is_compat_thread(task_thread_info(next)))
> > +		return;
> > +
> > +	if (!system_has_mismatched_32bit_el0())
> > +		return;
> > +
> > +	set_tsk_thread_flag(next, TIF_NOTIFY_RESUME);
> > +}
> 
> I wonder whether you could use set_notify_resume() for consistency.

I looked at that, but it ends up kicking the task which is not needed
here and can result in a reschedule via preempt_enable().

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
```
