Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-03-17 Thread John Paul Adrian Glaubitz
Hi!

On 3/17/21 6:42 PM, John Paul Adrian Glaubitz wrote:
>> Here are dmesg and config from my machine with successfull boot:
>> https://dev.gentoo.org/~slyfox/configs/guppy-dmesg-5.11
>> https://dev.gentoo.org/~slyfox/configs/guppy-config-5.11
> 
> Just gave it a try using this kernel configuration. It's never loading the 
> hpsa
> module for me which I find really strange. The module isn't even showing up in
> the kernel message buffer.

Never mind. I just forgot to create an initrd this time, user error :-).

Works again.

>>> [0.036000] ERROR: Invalid distance value range  
>>>   
>>> [0.036000]  
>>>   
>>> [0.036000]   00 00 00 00 00 00
>>
>> I don't see this string in the 5.11 kernel source. But
>>
>> https://lore.kernel.org/lkml/161356785681.20312.13022545187499987936.tip-bot2@tip-bot2/T/
>> hints it's might be something very new and you are in the
>> middle of 5.12-rc1?
> 
> I'm seeing this using your exact kernel configuration.

This issue is still there, however. Do you see this as well?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-03-17 Thread John Paul Adrian Glaubitz
Hi!

On 2/23/21 8:27 PM, Sergei Trofimovich wrote:
>>> Just gave it a try and it still doesn't work.  
>>
>> Maybe your other two patches to fix the strace issues are required as well?
> 
> I'd say it's very unlikely they have any effect here. AFAIU they only amend
> ptrace() behaviour called from userspace. Failure to boot so early is probably
> way before any userspace.
> 
>> Or do you happen to have more patches in the Gentoo kernel?
> 
> Nope. It was a vanilla 5.11 release with 3 patches: 1 signal fix and
> 2 ptrace() patches.
> 
> Here are dmesg and config from my machine with successfull boot:
> https://dev.gentoo.org/~slyfox/configs/guppy-dmesg-5.11
> https://dev.gentoo.org/~slyfox/configs/guppy-config-5.11

Just gave it a try using this kernel configuration. It's never loading the hpsa
module for me which I find really strange. The module isn't even showing up in
the kernel message buffer.

>> [0.036000] ERROR: Invalid distance value range   
>>  
>> [0.036000]   
>>  
>> [0.036000]   00 00 00 00 00 00
> 
> I don't see this string in the 5.11 kernel source. But
>
> https://lore.kernel.org/lkml/161356785681.20312.13022545187499987936.tip-bot2@tip-bot2/T/
> hints it's might be something very new and you are in the
> middle of 5.12-rc1?

I'm seeing this using your exact kernel configuration.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-03-03 Thread Jens Axboe
On 3/2/21 5:34 PM, Jens Axboe wrote:
> On 3/2/21 4:27 PM, Sergei Trofimovich wrote:
>> On Tue, 2 Mar 2021 15:31:13 -0700
>> Jens Axboe  wrote:
>>
>>> On 3/2/21 3:07 PM, Sergei Trofimovich wrote:
 On Tue, 23 Feb 2021 08:08:30 +
 Sergei Trofimovich  wrote:
   
> On Mon, 22 Feb 2021 17:43:58 -0700
> Jens Axboe  wrote:
>  
>> On 2/22/21 5:41 PM, Jens Axboe wrote:
>>> On 2/22/21 5:34 PM, Jens Axboe wrote:  
 On 2/22/21 4:53 PM, Sergei Trofimovich wrote:  
> On Mon, 22 Feb 2021 16:34:50 -0700
> Jens Axboe  wrote:
>  
>> On 2/22/21 4:05 PM, Sergei Trofimovich wrote:  
>>> Hia Jens!
>>>
>>> Tried 5.11 on rx3600 box and noticed it has
>>> a problem handling init (5.10 booted fine):
>>>
>>> INIT: version 2.98 booting
>>>
>>>OpenRC 0.42.1 is starting up Gentoo Linux (ia64)
>>>
>>> mkdir `/run/openrc': Read-only file system
>>> mkdir `/run/openrc/starting': No such file or directory
>>> mkdir `/run/openrc/started': No such file or directory
>>> mkdir `/run/openrc/stopping': No such file or directory
>>> mkdir `/run/openrc/inactive': No such file or directory
>>> mkdir `/run/openrc/wasinactive': No such file or directory
>>> mkdir `/run/openrc/failed': No such file or directory
>>> mkdir `/run/openrc/hotplugged': No such file or directory
>>> mkdir `/run/openrc/daemons': No such file or directory
>>> mkdir `/run[   14.595059] Kernel panic - not syncing: Attempted to 
>>> kill init! exitcode=0x000b
>>> [   14.599059] ---[ end Kernel panic - not syncing: Attempted to 
>>> kill init! exitcode=0x000b ]---
>>>
>>> I suspect we build bad signal stack frame for userspace.
>>>
>>> With a bit of #define DEBUG_SIG 1 enabled the signals are SIGCHLD:
>>>
>>> [   34.969771] SIG deliver (gendepends.sh:69): sig=17 
>>> sp=6f6aeaa0 ip=a0040740 handler=4b4c59b6
>>> [   34.969948] SIG deliver (init:1): sig=17 sp=6f1ccc50 
>>> ip=a0040740 handler=4638b9e5
>>> [   34.969948] SIG deliver (gendepends.sh:69): sig=17 
>>> sp=6f6adf90 ip=a0040740 handler=4b4c59b6
>>> [   34.973948] SIG deliver (init:1): sig=17 sp=6f1cc140 
>>> ip=a0040740 handler=4638b9e5
>>> [   34.973948] Kernel panic - not syncing: Attempted to kill init! 
>>> exitcode=0x000b
>>> [   34.973948] SIG deliver (gendepends.sh:69): sig=17 
>>> sp=6f6ad480 ip=a0040740 handler=4b4c59b6
>>> [   34.973948] ---[ end Kernel panic - not syncing: Attempted to 
>>> kill init! exitcode=0x000b ]---
>>>
>>> Bisect points at:
>>>
>>> commit b269c229b0e89aedb7943c06673b56b6052cf5e5
>>> Author: Jens Axboe 
>>> Date:   Fri Oct 9 14:49:43 2020 -0600
>>>
>>> ia64: add support for TIF_NOTIFY_SIGNAL
>>>
>>> Wire up TIF_NOTIFY_SIGNAL handling for ia64.
>>>
>>> Cc: linux-i...@vger.kernel.org
>>> [axboe: added fixes from Mike Rapoport ]
>>> Signed-off-by: Jens Axboe 
>>>
>>> diff --git a/arch/ia64/include/asm/thread_info.h 
>>> b/arch/ia64/include/asm/thread_info.h
>>> index 64a1011f6812..51d20cb37706 100644
>>> --- a/arch/ia64/include/asm/thread_info.h
>>> +++ b/arch/ia64/include/asm/thread_info.h
>>> @@ -103,6 +103,7 @@ struct thread_info {
>>>  #define TIF_SYSCALL_TRACE  2   /* syscall trace active */
>>>  #define TIF_SYSCALL_AUDIT  3   /* syscall auditing active 
>>> */
>>>  #define TIF_SINGLESTEP 4   /* restore singlestep on 
>>> return to user mode */
>>> +#define TIF_NOTIFY_SIGNAL  5   /* signal notification 
>>> exist */
>>>  #define TIF_NOTIFY_RESUME  6   /* resumption notification 
>>> requested */
>>>  #define TIF_MEMDIE 17  /* is terminating due to 
>>> OOM killer */
>>>  #define TIF_MCA_INIT   18  /* this task is processing 
>>> MCA or INIT */
>>> @@ -115,6 +116,7 @@ struct thread_info {
>>>  #define _TIF_SINGLESTEP(1 << TIF_SINGLESTEP)
>>>  #define _TIF_SYSCALL_TRACEAUDIT
>>> (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
>>>  #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
>>> +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
>>>  #define _TIF_SIGPENDING(1 << TIF_SIGPENDING)
>>>  #define _TIF_NEED_RESCHED  (1 << TIF_NEED_RESCHED)
>>>  

Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-03-03 Thread Jens Axboe
On 3/2/21 4:27 PM, Sergei Trofimovich wrote:
> On Tue, 2 Mar 2021 15:31:13 -0700
> Jens Axboe  wrote:
> 
>> On 3/2/21 3:07 PM, Sergei Trofimovich wrote:
>>> On Tue, 23 Feb 2021 08:08:30 +
>>> Sergei Trofimovich  wrote:
>>>   
 On Mon, 22 Feb 2021 17:43:58 -0700
 Jens Axboe  wrote:
  
> On 2/22/21 5:41 PM, Jens Axboe wrote:
>> On 2/22/21 5:34 PM, Jens Axboe wrote:  
>>> On 2/22/21 4:53 PM, Sergei Trofimovich wrote:  
 On Mon, 22 Feb 2021 16:34:50 -0700
 Jens Axboe  wrote:
  
> On 2/22/21 4:05 PM, Sergei Trofimovich wrote:  
>> Hia Jens!
>>
>> Tried 5.11 on rx3600 box and noticed it has
>> a problem handling init (5.10 booted fine):
>>
>> INIT: version 2.98 booting
>>
>>OpenRC 0.42.1 is starting up Gentoo Linux (ia64)
>>
>> mkdir `/run/openrc': Read-only file system
>> mkdir `/run/openrc/starting': No such file or directory
>> mkdir `/run/openrc/started': No such file or directory
>> mkdir `/run/openrc/stopping': No such file or directory
>> mkdir `/run/openrc/inactive': No such file or directory
>> mkdir `/run/openrc/wasinactive': No such file or directory
>> mkdir `/run/openrc/failed': No such file or directory
>> mkdir `/run/openrc/hotplugged': No such file or directory
>> mkdir `/run/openrc/daemons': No such file or directory
>> mkdir `/run[   14.595059] Kernel panic - not syncing: Attempted to 
>> kill init! exitcode=0x000b
>> [   14.599059] ---[ end Kernel panic - not syncing: Attempted to 
>> kill init! exitcode=0x000b ]---
>>
>> I suspect we build bad signal stack frame for userspace.
>>
>> With a bit of #define DEBUG_SIG 1 enabled the signals are SIGCHLD:
>>
>> [   34.969771] SIG deliver (gendepends.sh:69): sig=17 
>> sp=6f6aeaa0 ip=a0040740 handler=4b4c59b6
>> [   34.969948] SIG deliver (init:1): sig=17 sp=6f1ccc50 
>> ip=a0040740 handler=4638b9e5
>> [   34.969948] SIG deliver (gendepends.sh:69): sig=17 
>> sp=6f6adf90 ip=a0040740 handler=4b4c59b6
>> [   34.973948] SIG deliver (init:1): sig=17 sp=6f1cc140 
>> ip=a0040740 handler=4638b9e5
>> [   34.973948] Kernel panic - not syncing: Attempted to kill init! 
>> exitcode=0x000b
>> [   34.973948] SIG deliver (gendepends.sh:69): sig=17 
>> sp=6f6ad480 ip=a0040740 handler=4b4c59b6
>> [   34.973948] ---[ end Kernel panic - not syncing: Attempted to 
>> kill init! exitcode=0x000b ]---
>>
>> Bisect points at:
>>
>> commit b269c229b0e89aedb7943c06673b56b6052cf5e5
>> Author: Jens Axboe 
>> Date:   Fri Oct 9 14:49:43 2020 -0600
>>
>> ia64: add support for TIF_NOTIFY_SIGNAL
>>
>> Wire up TIF_NOTIFY_SIGNAL handling for ia64.
>>
>> Cc: linux-i...@vger.kernel.org
>> [axboe: added fixes from Mike Rapoport ]
>> Signed-off-by: Jens Axboe 
>>
>> diff --git a/arch/ia64/include/asm/thread_info.h 
>> b/arch/ia64/include/asm/thread_info.h
>> index 64a1011f6812..51d20cb37706 100644
>> --- a/arch/ia64/include/asm/thread_info.h
>> +++ b/arch/ia64/include/asm/thread_info.h
>> @@ -103,6 +103,7 @@ struct thread_info {
>>  #define TIF_SYSCALL_TRACE  2   /* syscall trace active */
>>  #define TIF_SYSCALL_AUDIT  3   /* syscall auditing active */
>>  #define TIF_SINGLESTEP 4   /* restore singlestep on 
>> return to user mode */
>> +#define TIF_NOTIFY_SIGNAL  5   /* signal notification exist 
>> */
>>  #define TIF_NOTIFY_RESUME  6   /* resumption notification 
>> requested */
>>  #define TIF_MEMDIE 17  /* is terminating due to OOM 
>> killer */
>>  #define TIF_MCA_INIT   18  /* this task is processing 
>> MCA or INIT */
>> @@ -115,6 +116,7 @@ struct thread_info {
>>  #define _TIF_SINGLESTEP(1 << TIF_SINGLESTEP)
>>  #define _TIF_SYSCALL_TRACEAUDIT
>> (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
>>  #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
>> +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
>>  #define _TIF_SIGPENDING(1 << TIF_SIGPENDING)
>>  #define _TIF_NEED_RESCHED  (1 << TIF_NEED_RESCHED)
>>  #define _TIF_MCA_INIT  (1 << TIF_MCA_INIT)
>> @@ -124,7 +126,7 @@ struct thread_info {
>>
>>  /* "work to do on 

Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-03-02 Thread John Paul Adrian Glaubitz
Hi Sergei!

On 3/2/21 11:26 PM, Sergei Trofimovich wrote:
> Gave v5.12-rc1 a try today and got a similar boot failure around
> hpsa queue initialization, but my failure is later:
> https://dev.gentoo.org/~slyfox/configs/guppy-dmesg-5.12-rc1
> Maybe I get different error because I flipped on most debugging
> kernel options :)
> 
> Looks like 'ERROR: Invalid distance value range' while being
> very scary are harmless. It's just a new spammy way for kernel
> to report lack of NUMA config on the machine (no SRAT and SLIT
> ACPI tables).
> 
> At least I get hpsa detected on PCI bus. But I guess it's discovered
> configuration is very wrong as I get unaligned accesses:
> [   19.811570] kernel unaligned access to 0xe00105dd8295, 
> ip=0xa00100b874d1
> 
> Bisecting now.

Sounds good. I guess we should get Jens' fix for the signal regression
merged as well as your two fixes for strace.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-03-02 Thread Jens Axboe
On 3/2/21 3:07 PM, Sergei Trofimovich wrote:
> On Tue, 23 Feb 2021 08:08:30 +
> Sergei Trofimovich  wrote:
> 
>> On Mon, 22 Feb 2021 17:43:58 -0700
>> Jens Axboe  wrote:
>>
>>> On 2/22/21 5:41 PM, Jens Axboe wrote:  
 On 2/22/21 5:34 PM, Jens Axboe wrote:
> On 2/22/21 4:53 PM, Sergei Trofimovich wrote:
>> On Mon, 22 Feb 2021 16:34:50 -0700
>> Jens Axboe  wrote:
>>
>>> On 2/22/21 4:05 PM, Sergei Trofimovich wrote:
 Hia Jens!

 Tried 5.11 on rx3600 box and noticed it has
 a problem handling init (5.10 booted fine):

 INIT: version 2.98 booting

OpenRC 0.42.1 is starting up Gentoo Linux (ia64)

 mkdir `/run/openrc': Read-only file system
 mkdir `/run/openrc/starting': No such file or directory
 mkdir `/run/openrc/started': No such file or directory
 mkdir `/run/openrc/stopping': No such file or directory
 mkdir `/run/openrc/inactive': No such file or directory
 mkdir `/run/openrc/wasinactive': No such file or directory
 mkdir `/run/openrc/failed': No such file or directory
 mkdir `/run/openrc/hotplugged': No such file or directory
 mkdir `/run/openrc/daemons': No such file or directory
 mkdir `/run[   14.595059] Kernel panic - not syncing: Attempted to 
 kill init! exitcode=0x000b
 [   14.599059] ---[ end Kernel panic - not syncing: Attempted to kill 
 init! exitcode=0x000b ]---

 I suspect we build bad signal stack frame for userspace.

 With a bit of #define DEBUG_SIG 1 enabled the signals are SIGCHLD:

 [   34.969771] SIG deliver (gendepends.sh:69): sig=17 
 sp=6f6aeaa0 ip=a0040740 handler=4b4c59b6
 [   34.969948] SIG deliver (init:1): sig=17 sp=6f1ccc50 
 ip=a0040740 handler=4638b9e5
 [   34.969948] SIG deliver (gendepends.sh:69): sig=17 
 sp=6f6adf90 ip=a0040740 handler=4b4c59b6
 [   34.973948] SIG deliver (init:1): sig=17 sp=6f1cc140 
 ip=a0040740 handler=4638b9e5
 [   34.973948] Kernel panic - not syncing: Attempted to kill init! 
 exitcode=0x000b
 [   34.973948] SIG deliver (gendepends.sh:69): sig=17 
 sp=6f6ad480 ip=a0040740 handler=4b4c59b6
 [   34.973948] ---[ end Kernel panic - not syncing: Attempted to kill 
 init! exitcode=0x000b ]---

 Bisect points at:

 commit b269c229b0e89aedb7943c06673b56b6052cf5e5
 Author: Jens Axboe 
 Date:   Fri Oct 9 14:49:43 2020 -0600

 ia64: add support for TIF_NOTIFY_SIGNAL

 Wire up TIF_NOTIFY_SIGNAL handling for ia64.

 Cc: linux-i...@vger.kernel.org
 [axboe: added fixes from Mike Rapoport ]
 Signed-off-by: Jens Axboe 

 diff --git a/arch/ia64/include/asm/thread_info.h 
 b/arch/ia64/include/asm/thread_info.h
 index 64a1011f6812..51d20cb37706 100644
 --- a/arch/ia64/include/asm/thread_info.h
 +++ b/arch/ia64/include/asm/thread_info.h
 @@ -103,6 +103,7 @@ struct thread_info {
  #define TIF_SYSCALL_TRACE  2   /* syscall trace active */
  #define TIF_SYSCALL_AUDIT  3   /* syscall auditing active */
  #define TIF_SINGLESTEP 4   /* restore singlestep on 
 return to user mode */
 +#define TIF_NOTIFY_SIGNAL  5   /* signal notification exist */
  #define TIF_NOTIFY_RESUME  6   /* resumption notification 
 requested */
  #define TIF_MEMDIE 17  /* is terminating due to OOM 
 killer */
  #define TIF_MCA_INIT   18  /* this task is processing MCA 
 or INIT */
 @@ -115,6 +116,7 @@ struct thread_info {
  #define _TIF_SINGLESTEP(1 << TIF_SINGLESTEP)
  #define _TIF_SYSCALL_TRACEAUDIT
 (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
  #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
 +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
  #define _TIF_SIGPENDING(1 << TIF_SIGPENDING)
  #define _TIF_NEED_RESCHED  (1 << TIF_NEED_RESCHED)
  #define _TIF_MCA_INIT  (1 << TIF_MCA_INIT)
 @@ -124,7 +126,7 @@ struct thread_info {

  /* "work to do on user-return" bits */
  #define TIF_ALLWORK_MASK   
 (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\
 -_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE)
 +
 _TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_NOTIFY_SIGNAL)
  /* like 

Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-03-02 Thread Sergei Trofimovich
On Tue, 23 Feb 2021 08:08:30 +
Sergei Trofimovich  wrote:

> On Mon, 22 Feb 2021 17:43:58 -0700
> Jens Axboe  wrote:
> 
> > On 2/22/21 5:41 PM, Jens Axboe wrote:  
> > > On 2/22/21 5:34 PM, Jens Axboe wrote:
> > >> On 2/22/21 4:53 PM, Sergei Trofimovich wrote:
> > >>> On Mon, 22 Feb 2021 16:34:50 -0700
> > >>> Jens Axboe  wrote:
> > >>>
> >  On 2/22/21 4:05 PM, Sergei Trofimovich wrote:
> > > Hia Jens!
> > >
> > > Tried 5.11 on rx3600 box and noticed it has
> > > a problem handling init (5.10 booted fine):
> > >
> > > INIT: version 2.98 booting
> > >
> > >OpenRC 0.42.1 is starting up Gentoo Linux (ia64)
> > >
> > > mkdir `/run/openrc': Read-only file system
> > > mkdir `/run/openrc/starting': No such file or directory
> > > mkdir `/run/openrc/started': No such file or directory
> > > mkdir `/run/openrc/stopping': No such file or directory
> > > mkdir `/run/openrc/inactive': No such file or directory
> > > mkdir `/run/openrc/wasinactive': No such file or directory
> > > mkdir `/run/openrc/failed': No such file or directory
> > > mkdir `/run/openrc/hotplugged': No such file or directory
> > > mkdir `/run/openrc/daemons': No such file or directory
> > > mkdir `/run[   14.595059] Kernel panic - not syncing: Attempted to 
> > > kill init! exitcode=0x000b
> > > [   14.599059] ---[ end Kernel panic - not syncing: Attempted to kill 
> > > init! exitcode=0x000b ]---
> > >
> > > I suspect we build bad signal stack frame for userspace.
> > >
> > > With a bit of #define DEBUG_SIG 1 enabled the signals are SIGCHLD:
> > >
> > > [   34.969771] SIG deliver (gendepends.sh:69): sig=17 
> > > sp=6f6aeaa0 ip=a0040740 handler=4b4c59b6
> > > [   34.969948] SIG deliver (init:1): sig=17 sp=6f1ccc50 
> > > ip=a0040740 handler=4638b9e5
> > > [   34.969948] SIG deliver (gendepends.sh:69): sig=17 
> > > sp=6f6adf90 ip=a0040740 handler=4b4c59b6
> > > [   34.973948] SIG deliver (init:1): sig=17 sp=6f1cc140 
> > > ip=a0040740 handler=4638b9e5
> > > [   34.973948] Kernel panic - not syncing: Attempted to kill init! 
> > > exitcode=0x000b
> > > [   34.973948] SIG deliver (gendepends.sh:69): sig=17 
> > > sp=6f6ad480 ip=a0040740 handler=4b4c59b6
> > > [   34.973948] ---[ end Kernel panic - not syncing: Attempted to kill 
> > > init! exitcode=0x000b ]---
> > >
> > > Bisect points at:
> > >
> > > commit b269c229b0e89aedb7943c06673b56b6052cf5e5
> > > Author: Jens Axboe 
> > > Date:   Fri Oct 9 14:49:43 2020 -0600
> > >
> > > ia64: add support for TIF_NOTIFY_SIGNAL
> > >
> > > Wire up TIF_NOTIFY_SIGNAL handling for ia64.
> > >
> > > Cc: linux-i...@vger.kernel.org
> > > [axboe: added fixes from Mike Rapoport ]
> > > Signed-off-by: Jens Axboe 
> > >
> > > diff --git a/arch/ia64/include/asm/thread_info.h 
> > > b/arch/ia64/include/asm/thread_info.h
> > > index 64a1011f6812..51d20cb37706 100644
> > > --- a/arch/ia64/include/asm/thread_info.h
> > > +++ b/arch/ia64/include/asm/thread_info.h
> > > @@ -103,6 +103,7 @@ struct thread_info {
> > >  #define TIF_SYSCALL_TRACE  2   /* syscall trace active */
> > >  #define TIF_SYSCALL_AUDIT  3   /* syscall auditing active */
> > >  #define TIF_SINGLESTEP 4   /* restore singlestep on 
> > > return to user mode */
> > > +#define TIF_NOTIFY_SIGNAL  5   /* signal notification exist 
> > > */
> > >  #define TIF_NOTIFY_RESUME  6   /* resumption notification 
> > > requested */
> > >  #define TIF_MEMDIE 17  /* is terminating due to OOM 
> > > killer */
> > >  #define TIF_MCA_INIT   18  /* this task is processing 
> > > MCA or INIT */
> > > @@ -115,6 +116,7 @@ struct thread_info {
> > >  #define _TIF_SINGLESTEP(1 << TIF_SINGLESTEP)
> > >  #define _TIF_SYSCALL_TRACEAUDIT
> > > (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
> > >  #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
> > > +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
> > >  #define _TIF_SIGPENDING(1 << TIF_SIGPENDING)
> > >  #define _TIF_NEED_RESCHED  (1 << TIF_NEED_RESCHED)
> > >  #define _TIF_MCA_INIT  (1 << TIF_MCA_INIT)
> > > @@ -124,7 +126,7 @@ struct thread_info {
> > >
> > >  /* "work to do on user-return" bits */
> > >  #define TIF_ALLWORK_MASK   
> > > (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\
> > > -_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE)
> > > +
> > > 

Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-02-23 Thread John Paul Adrian Glaubitz
On 2/23/21 10:13 AM, John Paul Adrian Glaubitz wrote:
> On 2/23/21 9:35 AM, Sergei Trofimovich wrote:> On Tue, 23 Feb 2021 00:55:50 
> +0100
>> John Paul Adrian Glaubitz  wrote:
>>
>>> For me, Debian also stopped booting on ia64 with systemd and I bisected it 
>>> to this
>>> change. Glad to see I'm not the only one.
>>>
>>> The changes Jens suggested back then unfortunately didn't help :(.
>>
>> I wonder if systemd is less tolerant to kernel that throws signal 0 at it.
>>
>> Looks like https://marc.info/?l=linux-ia64=161404320617004=2
>> fixed all the issues for me.
> 
> Just gave it a try and it still doesn't work.

Maybe your other two patches to fix the strace issues are required as well?

Or do you happen to have more patches in the Gentoo kernel?

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-02-22 Thread Jens Axboe
On 2/22/21 5:41 PM, Jens Axboe wrote:
> On 2/22/21 5:34 PM, Jens Axboe wrote:
>> On 2/22/21 4:53 PM, Sergei Trofimovich wrote:
>>> On Mon, 22 Feb 2021 16:34:50 -0700
>>> Jens Axboe  wrote:
>>>
 On 2/22/21 4:05 PM, Sergei Trofimovich wrote:
> Hia Jens!
>
> Tried 5.11 on rx3600 box and noticed it has
> a problem handling init (5.10 booted fine):
>
> INIT: version 2.98 booting
>
>OpenRC 0.42.1 is starting up Gentoo Linux (ia64)
>
> mkdir `/run/openrc': Read-only file system
> mkdir `/run/openrc/starting': No such file or directory
> mkdir `/run/openrc/started': No such file or directory
> mkdir `/run/openrc/stopping': No such file or directory
> mkdir `/run/openrc/inactive': No such file or directory
> mkdir `/run/openrc/wasinactive': No such file or directory
> mkdir `/run/openrc/failed': No such file or directory
> mkdir `/run/openrc/hotplugged': No such file or directory
> mkdir `/run/openrc/daemons': No such file or directory
> mkdir `/run[   14.595059] Kernel panic - not syncing: Attempted to kill 
> init! exitcode=0x000b
> [   14.599059] ---[ end Kernel panic - not syncing: Attempted to kill 
> init! exitcode=0x000b ]---
>
> I suspect we build bad signal stack frame for userspace.
>
> With a bit of #define DEBUG_SIG 1 enabled the signals are SIGCHLD:
>
> [   34.969771] SIG deliver (gendepends.sh:69): sig=17 sp=6f6aeaa0 
> ip=a0040740 handler=4b4c59b6
> [   34.969948] SIG deliver (init:1): sig=17 sp=6f1ccc50 
> ip=a0040740 handler=4638b9e5
> [   34.969948] SIG deliver (gendepends.sh:69): sig=17 sp=6f6adf90 
> ip=a0040740 handler=4b4c59b6
> [   34.973948] SIG deliver (init:1): sig=17 sp=6f1cc140 
> ip=a0040740 handler=4638b9e5
> [   34.973948] Kernel panic - not syncing: Attempted to kill init! 
> exitcode=0x000b
> [   34.973948] SIG deliver (gendepends.sh:69): sig=17 sp=6f6ad480 
> ip=a0040740 handler=4b4c59b6
> [   34.973948] ---[ end Kernel panic - not syncing: Attempted to kill 
> init! exitcode=0x000b ]---
>
> Bisect points at:
>
> commit b269c229b0e89aedb7943c06673b56b6052cf5e5
> Author: Jens Axboe 
> Date:   Fri Oct 9 14:49:43 2020 -0600
>
> ia64: add support for TIF_NOTIFY_SIGNAL
>
> Wire up TIF_NOTIFY_SIGNAL handling for ia64.
>
> Cc: linux-i...@vger.kernel.org
> [axboe: added fixes from Mike Rapoport ]
> Signed-off-by: Jens Axboe 
>
> diff --git a/arch/ia64/include/asm/thread_info.h 
> b/arch/ia64/include/asm/thread_info.h
> index 64a1011f6812..51d20cb37706 100644
> --- a/arch/ia64/include/asm/thread_info.h
> +++ b/arch/ia64/include/asm/thread_info.h
> @@ -103,6 +103,7 @@ struct thread_info {
>  #define TIF_SYSCALL_TRACE  2   /* syscall trace active */
>  #define TIF_SYSCALL_AUDIT  3   /* syscall auditing active */
>  #define TIF_SINGLESTEP 4   /* restore singlestep on return 
> to user mode */
> +#define TIF_NOTIFY_SIGNAL  5   /* signal notification exist */
>  #define TIF_NOTIFY_RESUME  6   /* resumption notification 
> requested */
>  #define TIF_MEMDIE 17  /* is terminating due to OOM 
> killer */
>  #define TIF_MCA_INIT   18  /* this task is processing MCA or 
> INIT */
> @@ -115,6 +116,7 @@ struct thread_info {
>  #define _TIF_SINGLESTEP(1 << TIF_SINGLESTEP)
>  #define _TIF_SYSCALL_TRACEAUDIT
> (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
>  #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
> +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
>  #define _TIF_SIGPENDING(1 << TIF_SIGPENDING)
>  #define _TIF_NEED_RESCHED  (1 << TIF_NEED_RESCHED)
>  #define _TIF_MCA_INIT  (1 << TIF_MCA_INIT)
> @@ -124,7 +126,7 @@ struct thread_info {
>
>  /* "work to do on user-return" bits */
>  #define TIF_ALLWORK_MASK   
> (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\
> -_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE)
> +
> _TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_NOTIFY_SIGNAL)
>  /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT 
> */
>  #define TIF_WORK_MASK  
> (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT))
>
> diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
> index 6b61a703bcf5..8d4e1cab9190 100644
> --- a/arch/ia64/kernel/process.c
> +++ b/arch/ia64/kernel/process.c
> @@ -171,7 +171,8 @@ do_notify_resume_user(sigset_t *unused, struct 
> sigscratch *scr, long 

Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-02-22 Thread Jens Axboe
On 2/22/21 5:34 PM, Jens Axboe wrote:
> On 2/22/21 4:53 PM, Sergei Trofimovich wrote:
>> On Mon, 22 Feb 2021 16:34:50 -0700
>> Jens Axboe  wrote:
>>
>>> On 2/22/21 4:05 PM, Sergei Trofimovich wrote:
 Hia Jens!

 Tried 5.11 on rx3600 box and noticed it has
 a problem handling init (5.10 booted fine):

 INIT: version 2.98 booting

OpenRC 0.42.1 is starting up Gentoo Linux (ia64)

 mkdir `/run/openrc': Read-only file system
 mkdir `/run/openrc/starting': No such file or directory
 mkdir `/run/openrc/started': No such file or directory
 mkdir `/run/openrc/stopping': No such file or directory
 mkdir `/run/openrc/inactive': No such file or directory
 mkdir `/run/openrc/wasinactive': No such file or directory
 mkdir `/run/openrc/failed': No such file or directory
 mkdir `/run/openrc/hotplugged': No such file or directory
 mkdir `/run/openrc/daemons': No such file or directory
 mkdir `/run[   14.595059] Kernel panic - not syncing: Attempted to kill 
 init! exitcode=0x000b
 [   14.599059] ---[ end Kernel panic - not syncing: Attempted to kill 
 init! exitcode=0x000b ]---

 I suspect we build bad signal stack frame for userspace.

 With a bit of #define DEBUG_SIG 1 enabled the signals are SIGCHLD:

 [   34.969771] SIG deliver (gendepends.sh:69): sig=17 sp=6f6aeaa0 
 ip=a0040740 handler=4b4c59b6
 [   34.969948] SIG deliver (init:1): sig=17 sp=6f1ccc50 
 ip=a0040740 handler=4638b9e5
 [   34.969948] SIG deliver (gendepends.sh:69): sig=17 sp=6f6adf90 
 ip=a0040740 handler=4b4c59b6
 [   34.973948] SIG deliver (init:1): sig=17 sp=6f1cc140 
 ip=a0040740 handler=4638b9e5
 [   34.973948] Kernel panic - not syncing: Attempted to kill init! 
 exitcode=0x000b
 [   34.973948] SIG deliver (gendepends.sh:69): sig=17 sp=6f6ad480 
 ip=a0040740 handler=4b4c59b6
 [   34.973948] ---[ end Kernel panic - not syncing: Attempted to kill 
 init! exitcode=0x000b ]---

 Bisect points at:

 commit b269c229b0e89aedb7943c06673b56b6052cf5e5
 Author: Jens Axboe 
 Date:   Fri Oct 9 14:49:43 2020 -0600

 ia64: add support for TIF_NOTIFY_SIGNAL

 Wire up TIF_NOTIFY_SIGNAL handling for ia64.

 Cc: linux-i...@vger.kernel.org
 [axboe: added fixes from Mike Rapoport ]
 Signed-off-by: Jens Axboe 

 diff --git a/arch/ia64/include/asm/thread_info.h 
 b/arch/ia64/include/asm/thread_info.h
 index 64a1011f6812..51d20cb37706 100644
 --- a/arch/ia64/include/asm/thread_info.h
 +++ b/arch/ia64/include/asm/thread_info.h
 @@ -103,6 +103,7 @@ struct thread_info {
  #define TIF_SYSCALL_TRACE  2   /* syscall trace active */
  #define TIF_SYSCALL_AUDIT  3   /* syscall auditing active */
  #define TIF_SINGLESTEP 4   /* restore singlestep on return to 
 user mode */
 +#define TIF_NOTIFY_SIGNAL  5   /* signal notification exist */
  #define TIF_NOTIFY_RESUME  6   /* resumption notification 
 requested */
  #define TIF_MEMDIE 17  /* is terminating due to OOM 
 killer */
  #define TIF_MCA_INIT   18  /* this task is processing MCA or 
 INIT */
 @@ -115,6 +116,7 @@ struct thread_info {
  #define _TIF_SINGLESTEP(1 << TIF_SINGLESTEP)
  #define _TIF_SYSCALL_TRACEAUDIT
 (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
  #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
 +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
  #define _TIF_SIGPENDING(1 << TIF_SIGPENDING)
  #define _TIF_NEED_RESCHED  (1 << TIF_NEED_RESCHED)
  #define _TIF_MCA_INIT  (1 << TIF_MCA_INIT)
 @@ -124,7 +126,7 @@ struct thread_info {

  /* "work to do on user-return" bits */
  #define TIF_ALLWORK_MASK   
 (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\
 -_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE)
 +
 _TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_NOTIFY_SIGNAL)
  /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT 
 */
  #define TIF_WORK_MASK  
 (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT))

 diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
 index 6b61a703bcf5..8d4e1cab9190 100644
 --- a/arch/ia64/kernel/process.c
 +++ b/arch/ia64/kernel/process.c
 @@ -171,7 +171,8 @@ do_notify_resume_user(sigset_t *unused, struct 
 sigscratch *scr, long in_syscall)
 }

 /* deal with pending signal delivery */
 -   if (test_thread_flag(TIF_SIGPENDING)) {
 +   if 

Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-02-22 Thread Jens Axboe
On 2/22/21 4:53 PM, Sergei Trofimovich wrote:
> On Mon, 22 Feb 2021 16:34:50 -0700
> Jens Axboe  wrote:
> 
>> On 2/22/21 4:05 PM, Sergei Trofimovich wrote:
>>> Hia Jens!
>>>
>>> Tried 5.11 on rx3600 box and noticed it has
>>> a problem handling init (5.10 booted fine):
>>>
>>> INIT: version 2.98 booting
>>>
>>>OpenRC 0.42.1 is starting up Gentoo Linux (ia64)
>>>
>>> mkdir `/run/openrc': Read-only file system
>>> mkdir `/run/openrc/starting': No such file or directory
>>> mkdir `/run/openrc/started': No such file or directory
>>> mkdir `/run/openrc/stopping': No such file or directory
>>> mkdir `/run/openrc/inactive': No such file or directory
>>> mkdir `/run/openrc/wasinactive': No such file or directory
>>> mkdir `/run/openrc/failed': No such file or directory
>>> mkdir `/run/openrc/hotplugged': No such file or directory
>>> mkdir `/run/openrc/daemons': No such file or directory
>>> mkdir `/run[   14.595059] Kernel panic - not syncing: Attempted to kill 
>>> init! exitcode=0x000b
>>> [   14.599059] ---[ end Kernel panic - not syncing: Attempted to kill init! 
>>> exitcode=0x000b ]---
>>>
>>> I suspect we build bad signal stack frame for userspace.
>>>
>>> With a bit of #define DEBUG_SIG 1 enabled the signals are SIGCHLD:
>>>
>>> [   34.969771] SIG deliver (gendepends.sh:69): sig=17 sp=6f6aeaa0 
>>> ip=a0040740 handler=4b4c59b6
>>> [   34.969948] SIG deliver (init:1): sig=17 sp=6f1ccc50 
>>> ip=a0040740 handler=4638b9e5
>>> [   34.969948] SIG deliver (gendepends.sh:69): sig=17 sp=6f6adf90 
>>> ip=a0040740 handler=4b4c59b6
>>> [   34.973948] SIG deliver (init:1): sig=17 sp=6f1cc140 
>>> ip=a0040740 handler=4638b9e5
>>> [   34.973948] Kernel panic - not syncing: Attempted to kill init! 
>>> exitcode=0x000b
>>> [   34.973948] SIG deliver (gendepends.sh:69): sig=17 sp=6f6ad480 
>>> ip=a0040740 handler=4b4c59b6
>>> [   34.973948] ---[ end Kernel panic - not syncing: Attempted to kill init! 
>>> exitcode=0x000b ]---
>>>
>>> Bisect points at:
>>>
>>> commit b269c229b0e89aedb7943c06673b56b6052cf5e5
>>> Author: Jens Axboe 
>>> Date:   Fri Oct 9 14:49:43 2020 -0600
>>>
>>> ia64: add support for TIF_NOTIFY_SIGNAL
>>>
>>> Wire up TIF_NOTIFY_SIGNAL handling for ia64.
>>>
>>> Cc: linux-i...@vger.kernel.org
>>> [axboe: added fixes from Mike Rapoport ]
>>> Signed-off-by: Jens Axboe 
>>>
>>> diff --git a/arch/ia64/include/asm/thread_info.h 
>>> b/arch/ia64/include/asm/thread_info.h
>>> index 64a1011f6812..51d20cb37706 100644
>>> --- a/arch/ia64/include/asm/thread_info.h
>>> +++ b/arch/ia64/include/asm/thread_info.h
>>> @@ -103,6 +103,7 @@ struct thread_info {
>>>  #define TIF_SYSCALL_TRACE  2   /* syscall trace active */
>>>  #define TIF_SYSCALL_AUDIT  3   /* syscall auditing active */
>>>  #define TIF_SINGLESTEP 4   /* restore singlestep on return to 
>>> user mode */
>>> +#define TIF_NOTIFY_SIGNAL  5   /* signal notification exist */
>>>  #define TIF_NOTIFY_RESUME  6   /* resumption notification 
>>> requested */
>>>  #define TIF_MEMDIE 17  /* is terminating due to OOM killer 
>>> */
>>>  #define TIF_MCA_INIT   18  /* this task is processing MCA or 
>>> INIT */
>>> @@ -115,6 +116,7 @@ struct thread_info {
>>>  #define _TIF_SINGLESTEP(1 << TIF_SINGLESTEP)
>>>  #define _TIF_SYSCALL_TRACEAUDIT
>>> (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
>>>  #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
>>> +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
>>>  #define _TIF_SIGPENDING(1 << TIF_SIGPENDING)
>>>  #define _TIF_NEED_RESCHED  (1 << TIF_NEED_RESCHED)
>>>  #define _TIF_MCA_INIT  (1 << TIF_MCA_INIT)
>>> @@ -124,7 +126,7 @@ struct thread_info {
>>>
>>>  /* "work to do on user-return" bits */
>>>  #define TIF_ALLWORK_MASK   
>>> (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\
>>> -_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE)
>>> +
>>> _TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_NOTIFY_SIGNAL)
>>>  /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */
>>>  #define TIF_WORK_MASK  
>>> (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT))
>>>
>>> diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
>>> index 6b61a703bcf5..8d4e1cab9190 100644
>>> --- a/arch/ia64/kernel/process.c
>>> +++ b/arch/ia64/kernel/process.c
>>> @@ -171,7 +171,8 @@ do_notify_resume_user(sigset_t *unused, struct 
>>> sigscratch *scr, long in_syscall)
>>> }
>>>
>>> /* deal with pending signal delivery */
>>> -   if (test_thread_flag(TIF_SIGPENDING)) {
>>> +   if (test_thread_flag(TIF_SIGPENDING) ||
>>> +   test_thread_flag(TIF_NOTIFY_SIGNAL)) {
>>> local_irq_enable(); /* force interrupt 

Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-02-22 Thread John Paul Adrian Glaubitz
Hi Sergei!

On 2/23/21 12:34 AM, Jens Axboe wrote:
> On 2/22/21 4:05 PM, Sergei Trofimovich wrote:
>> Hia Jens!
>>
>> Tried 5.11 on rx3600 box and noticed it has
>> a problem handling init (5.10 booted fine):
>>
>> INIT: version 2.98 booting
>>
>>OpenRC 0.42.1 is starting up Gentoo Linux (ia64)
>>
>> mkdir `/run/openrc': Read-only file system
>> mkdir `/run/openrc/starting': No such file or directory
>> mkdir `/run/openrc/started': No such file or directory
>> mkdir `/run/openrc/stopping': No such file or directory
>> mkdir `/run/openrc/inactive': No such file or directory
>> mkdir `/run/openrc/wasinactive': No such file or directory
>> mkdir `/run/openrc/failed': No such file or directory
>> mkdir `/run/openrc/hotplugged': No such file or directory
>> mkdir `/run/openrc/daemons': No such file or directory
>> mkdir `/run[   14.595059] Kernel panic - not syncing: Attempted to kill 
>> init! exitcode=0x000b
>> [   14.599059] ---[ end Kernel panic - not syncing: Attempted to kill init! 
>> exitcode=0x000b ]---
>>
>> I suspect we build bad signal stack frame for userspace.

For me, Debian also stopped booting on ia64 with systemd and I bisected it to 
this
change. Glad to see I'm not the only one.

The changes Jens suggested back then unfortunately didn't help :(.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: 5.11 regression: "ia64: add support for TIF_NOTIFY_SIGNAL" breaks ia64 boot

2021-02-22 Thread Jens Axboe
On 2/22/21 4:05 PM, Sergei Trofimovich wrote:
> Hia Jens!
> 
> Tried 5.11 on rx3600 box and noticed it has
> a problem handling init (5.10 booted fine):
> 
> INIT: version 2.98 booting
> 
>OpenRC 0.42.1 is starting up Gentoo Linux (ia64)
> 
> mkdir `/run/openrc': Read-only file system
> mkdir `/run/openrc/starting': No such file or directory
> mkdir `/run/openrc/started': No such file or directory
> mkdir `/run/openrc/stopping': No such file or directory
> mkdir `/run/openrc/inactive': No such file or directory
> mkdir `/run/openrc/wasinactive': No such file or directory
> mkdir `/run/openrc/failed': No such file or directory
> mkdir `/run/openrc/hotplugged': No such file or directory
> mkdir `/run/openrc/daemons': No such file or directory
> mkdir `/run[   14.595059] Kernel panic - not syncing: Attempted to kill init! 
> exitcode=0x000b
> [   14.599059] ---[ end Kernel panic - not syncing: Attempted to kill init! 
> exitcode=0x000b ]---
> 
> I suspect we build bad signal stack frame for userspace.
> 
> With a bit of #define DEBUG_SIG 1 enabled the signals are SIGCHLD:
> 
> [   34.969771] SIG deliver (gendepends.sh:69): sig=17 sp=6f6aeaa0 
> ip=a0040740 handler=4b4c59b6
> [   34.969948] SIG deliver (init:1): sig=17 sp=6f1ccc50 
> ip=a0040740 handler=4638b9e5
> [   34.969948] SIG deliver (gendepends.sh:69): sig=17 sp=6f6adf90 
> ip=a0040740 handler=4b4c59b6
> [   34.973948] SIG deliver (init:1): sig=17 sp=6f1cc140 
> ip=a0040740 handler=4638b9e5
> [   34.973948] Kernel panic - not syncing: Attempted to kill init! 
> exitcode=0x000b
> [   34.973948] SIG deliver (gendepends.sh:69): sig=17 sp=6f6ad480 
> ip=a0040740 handler=4b4c59b6
> [   34.973948] ---[ end Kernel panic - not syncing: Attempted to kill init! 
> exitcode=0x000b ]---
> 
> Bisect points at:
> 
> commit b269c229b0e89aedb7943c06673b56b6052cf5e5
> Author: Jens Axboe 
> Date:   Fri Oct 9 14:49:43 2020 -0600
> 
> ia64: add support for TIF_NOTIFY_SIGNAL
> 
> Wire up TIF_NOTIFY_SIGNAL handling for ia64.
> 
> Cc: linux-i...@vger.kernel.org
> [axboe: added fixes from Mike Rapoport ]
> Signed-off-by: Jens Axboe 
> 
> diff --git a/arch/ia64/include/asm/thread_info.h 
> b/arch/ia64/include/asm/thread_info.h
> index 64a1011f6812..51d20cb37706 100644
> --- a/arch/ia64/include/asm/thread_info.h
> +++ b/arch/ia64/include/asm/thread_info.h
> @@ -103,6 +103,7 @@ struct thread_info {
>  #define TIF_SYSCALL_TRACE  2   /* syscall trace active */
>  #define TIF_SYSCALL_AUDIT  3   /* syscall auditing active */
>  #define TIF_SINGLESTEP 4   /* restore singlestep on return to 
> user mode */
> +#define TIF_NOTIFY_SIGNAL  5   /* signal notification exist */
>  #define TIF_NOTIFY_RESUME  6   /* resumption notification requested 
> */
>  #define TIF_MEMDIE 17  /* is terminating due to OOM killer */
>  #define TIF_MCA_INIT   18  /* this task is processing MCA or 
> INIT */
> @@ -115,6 +116,7 @@ struct thread_info {
>  #define _TIF_SINGLESTEP(1 << TIF_SINGLESTEP)
>  #define _TIF_SYSCALL_TRACEAUDIT
> (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP)
>  #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
> +#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)
>  #define _TIF_SIGPENDING(1 << TIF_SIGPENDING)
>  #define _TIF_NEED_RESCHED  (1 << TIF_NEED_RESCHED)
>  #define _TIF_MCA_INIT  (1 << TIF_MCA_INIT)
> @@ -124,7 +126,7 @@ struct thread_info {
> 
>  /* "work to do on user-return" bits */
>  #define TIF_ALLWORK_MASK   
> (_TIF_SIGPENDING|_TIF_NOTIFY_RESUME|_TIF_SYSCALL_AUDIT|\
> -_TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE)
> +
> _TIF_NEED_RESCHED|_TIF_SYSCALL_TRACE|_TIF_NOTIFY_SIGNAL)
>  /* like TIF_ALLWORK_BITS but sans TIF_SYSCALL_TRACE or TIF_SYSCALL_AUDIT */
>  #define TIF_WORK_MASK  
> (TIF_ALLWORK_MASK&~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT))
> 
> diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
> index 6b61a703bcf5..8d4e1cab9190 100644
> --- a/arch/ia64/kernel/process.c
> +++ b/arch/ia64/kernel/process.c
> @@ -171,7 +171,8 @@ do_notify_resume_user(sigset_t *unused, struct sigscratch 
> *scr, long in_syscall)
> }
> 
> /* deal with pending signal delivery */
> -   if (test_thread_flag(TIF_SIGPENDING)) {
> +   if (test_thread_flag(TIF_SIGPENDING) ||
> +   test_thread_flag(TIF_NOTIFY_SIGNAL)) {
> local_irq_enable(); /* force interrupt enable */
> ia64_do_signal(scr, in_syscall);
> 
> which looks benign, but it enables a bit of conditional
> TIF_NOTIFY_SIGNAL handling I don't understand.
> 
> Can you help me get what is the interaction between
> TIF_NOTIFY_SIGNAL and TIF_SIGPENDING for
> simple processes without io_uring use