Re: [PATCH] m68k: Fix task info flags handling for 68000

Daniel Palmer <[email protected]>
Newsgroups org.kernel.vger.linux-m68k
Message-ID <CAFr9PXnO7y=PUPELb78qA1nN+4qsYqmk036PqXPLogk+L3Sv+A@mail.gmail.com>
Hi Greg,

On Mon, 16 Mar 2026 at 23:08, Greg Ungerer <[email protected]> wrote:
>
> The comments from arch/m68k/include/asm/thread_info.h are this:
>
> /* entry.S relies on these definitions!
>   * bits 0-7 are tested at every exception exit
>   * bits 8-15 are also tested at syscall exit
>   */
>
> So looking at what check is in arch/m68k/coldfire/entry.S:
>
>      moveb   %a0@(TINFO_FLAGS+3),%d1 /* thread_info->flags (low 8 bits) */
>
> In arch/m68k/kernel/entry.S it looks to be doing basically the same thing:
>
>      moveb   %a1@(TINFO_FLAGS+3),%d0
>
> So they do really only check bits 0-7 here.
>
> If you code the check like that do you still get correct running behavior?

That seems to work. One thing I'm unsure about is this in the coldfire version:

Luser_return:
movel %sp,%d1 /* get thread_info pointer */
andl #-THREAD_SIZE,%d1 /* at base of kernel stack */
movel %d1,%a0
moveb %a0@(TINFO_FLAGS+3),%d1 /* thread_info->flags (low 8 bits) */

^^^^^^
So the bottom 8 bits are in d1

jne Lwork_to_do /* still work to do */

Lreturn:
RESTORE_USER

Lwork_to_do:
movel %a0@(TINFO_FLAGS),%d1 /* get thread_info->flags */

^^^^^^^
Now the whole value is loaded into d1 to do the bit test.. but the
value needed is already in d1 as we'll be testing bit 7?

move #0x2000,%sr /* enable intrs again */
btst #TIF_NEED_RESCHED,%d1
jne reschedule


Thanks,

Daniel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.