*sigh* I really shouldn't have mailed this out in the first place. Every
time I look at it I find new bugs despite the fact that it actually
works on my machine.

>       ld      r3,SOFTE(r1)
> -     bl      .local_irq_restore
> +#ifdef CONFIG_TRACE_IRQFLAGS
> +     cmpdi   r3,0
> +     beq     14f
> +     bl      .trace_hardirqs_on
> +     ld      r3,SOFTE(r1)
> +14:
> +     bl      .raw_local_irq_restore
> +     cmpdi   r3,0

This should reload r3 before the second compare as raw_local_irq_restore
returns nothing (void). And why does it need a second compare anyway?
Just rewrite as

        ld      r3, SOFTE(r1)
#ifdef CONFIG_TRACE_IRQFLAGS
        cmpdi   r3, 0
        bne     14f
        bl      .raw_local_irq_restore
        bl      .trace_hardirqs_off
        b       15f
14:
        bl      .trace_hardirqs_on
        li      r3, 1
#endif
        bl      .raw_local_irq_restore
15:

which has the advantage of having only one conditional branch and less
preprocessor foo.

> +#ifdef CONFIG_TRACE_IRQFLAGS
> +     cmpdi   r5,0
> +     beq     5f
> +     bl      .trace_hardirqs_on
> +     ld      r5,SOFTE(r1)
>       stb     r5,PACASOFTIRQEN(r13)
> -
> +     b       6f
> +5:
> +     stb     r5,PACASOFTIRQEN(r13)
> +     bl      .trace_hardirqs_off
> +6:
> +#else
> +     stb     r5,PACASOFTIRQEN(r13)
> +#endif

Similarly, that could be rewritten as

#ifdef CONFIG_TRACE_IRQFLAGS
        cmpdi   r5, 0
        bne     5f
        stb     r5, PACASOFTIRQEN(r13)
        bl      .trace_hardirqs_off
        b       6f
5:
        bl      .trace_hardirqs_on
        li      r5, 1
#endif
        stb     r5, PACASOFTIRQEN(r13)
6:

I can't test these modifications over the weekend but they should be
fine.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to