On 09.06.21 18:40, Philippe Gerum wrote:
> 
> Jan Kiszka <[email protected]> writes:
> 
>> From: Philippe Gerum <[email protected]>
>>
>> Make sure that inband is marked stalled when entering from user mode,
>> taking an exception.
>>
>> This affects x86 which is currently the only arch using generic
>> irqentry_enter_from_user_mode on exceptions. It fixes this lockdep
>> warning:
>>
>> DEBUG_LOCKS_WARN_ON(!lockdep_stage_disabled())
>> WARNING: CPU: 2 PID: 1477 at ../kernel/locking/lockdep.c:4129 
>> lockdep_hardirqs_on_prepare+0x160/0x1a0
>>
>> Signed-off-by: Philippe Gerum <[email protected]>
>> Tested-by: Jan Kiszka <[email protected]>
>> ---
>>
>> Works as it should here. If the wording is fine, please add.
>>
>>  kernel/entry/common.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/entry/common.c b/kernel/entry/common.c
>> index 995123075375..51af58e61cb8 100644
>> --- a/kernel/entry/common.c
>> +++ b/kernel/entry/common.c
>> @@ -343,6 +343,8 @@ __visible noinstr void syscall_exit_to_user_mode(struct 
>> pt_regs *regs)
>>  
>>  noinstr void irqentry_enter_from_user_mode(struct pt_regs *regs)
>>  {
>> +    WARN_ON_ONCE(irq_pipeline_debug() && irqs_disabled());
>> +    stall_inband_nocheck();
>>      enter_from_user_mode(regs);
>>  }
>>  
>> @@ -373,8 +375,6 @@ noinstr irqentry_state_t irqentry_enter(struct pt_regs 
>> *regs)
>>  
>>      if (user_mode(regs)) {
>>  #ifdef CONFIG_IRQ_PIPELINE
>> -            WARN_ON_ONCE(irq_pipeline_debug() && irqs_disabled());
>> -            stall_inband_nocheck();
>>              ret.stage_info = IRQENTRY_INBAND_UNSTALLED;
>>  #endif
>>              irqentry_enter_from_user_mode(regs);
> 
> Ok, picked it. Thanks.
> 

For the sake of completeness: CONFIG_PROVE_RAW_LOCK_NESTING=y papered
over this. But I still don't get why as that only affects complete_all()...

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

Reply via email to