Re: [PATCH v2 10/11] lockdep: Only trace IRQ edges

From: Guenter Roeck
Date: Tue Sep 08 2020 - 11:28:39 EST


On 9/8/20 7:22 AM, peterz@xxxxxxxxxxxxx wrote:
> On Wed, Sep 02, 2020 at 06:48:30AM -0700, Guenter Roeck wrote:
>> On 9/2/20 2:12 AM, peterz@xxxxxxxxxxxxx wrote:
>>> On Wed, Sep 02, 2020 at 11:09:35AM +0200, peterz@xxxxxxxxxxxxx wrote:
>>>> On Tue, Sep 01, 2020 at 09:21:37PM -0700, Guenter Roeck wrote:
>>>>> [ 0.000000] WARNING: CPU: 0 PID: 0 at kernel/locking/lockdep.c:4875 check_flags.part.39+0x280/0x2a0
>>>>> [ 0.000000] DEBUG_LOCKS_WARN_ON(lockdep_hardirqs_enabled())
>>>>
>>>>> [ 0.000000] [<00000000004cff18>] lock_acquire+0x218/0x4e0
>>>>> [ 0.000000] [<0000000000d740c8>] _raw_spin_lock+0x28/0x40
>>>>> [ 0.000000] [<00000000009870f4>] p1275_cmd_direct+0x14/0x60
>>>>
>>>> Lol! yes, I can see that going side-ways... let me poke at that.
>>>
>>> I suspect this will do.
>>>
>>> diff --git a/arch/sparc/prom/p1275.c b/arch/sparc/prom/p1275.c
>>> index 889aa602f8d8..7cfe88e30b52 100644
>>> --- a/arch/sparc/prom/p1275.c
>>> +++ b/arch/sparc/prom/p1275.c
>>> @@ -38,7 +38,7 @@ void p1275_cmd_direct(unsigned long *args)
>>> unsigned long flags;
>>>
>>> local_save_flags(flags);
>>> - local_irq_restore((unsigned long)PIL_NMI);
>>> + arch_local_irq_restore((unsigned long)PIL_NMI);
>>> raw_spin_lock(&prom_entry_lock);
>>>
>>> prom_world(1);
>>>
>> No, that doesn't help. Even removing that line entirely doesn't help.
>> The problem seems to be that interrupts are not enabled in the first
>> place. But why wasn't this a problem before ?
>
> Previously every interrupt opt would disable/enable things, now we only
> update state when something actually changes.
>
> Anyway, I'm struggling with qemu-system-sparc64, I've got a sparc64
> cross booting to mount, but I'm not seeing this, could you get me your
> specific qemu cmdline please?
>

initrd:

qemu-system-sparc64 -M sun4u -cpu "TI UltraSparc IIi" -m 512 \
-initrd rootfs.cpio \
-kernel arch/sparc/boot/image -no-reboot \
-append "panic=-1 slub_debug=FZPUA rdinit=/sbin/init console=ttyS0" \
-nographic -monitor none

root file system:

qemu-system-sparc64 -M sun4u -cpu "TI UltraSparc IIi" -m 512 \
-snapshot =drive file=rootfs.ext2,format=raw,if=ide \
-kernel arch/sparc/boot/image -no-reboot \
-append "panic=-1 slub_debug=FZPUA root=/dev/sda rootwait console=ttyS0" \
-nographic -monitor none

Some of it, like the CPU, should not be needed. qemu version is v5.1,
but v5.0 should do as well. Some older qemu versions won't accept the
kernel from the command line.

Did you enable lockdep debugging ? In my configuration I enable lots
of debug options on top of defconfig. See [1], function __setup_fragment(),
for details.

Some root file systems are at [2] if needed. The complete script used
to build and run the code is at [3].

Guenter

---
[1] https://github.com/groeck/linux-build-test/blob/master/rootfs/scripts/common.sh
[2] https://github.com/groeck/linux-build-test/tree/master/rootfs/sparc64
[3] https://github.com/groeck/linux-build-test/blob/master/rootfs/sparc64/run-qemu-sparc64.sh