Skip to contentSkip to conversation

Generic BUG for powerpc

PATCH Michael Ellerman 2 participants 2 messages Oct 4, 2006 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 6 lines · Jeremy Fitzhardinge

plain text document attachment (mm)
This makes powerpc use the generic BUG machinery. The biggest difference from the previous powerpc bug code is that it no longer reports the function name, since it is redundant with kallsyms, and not needed in general.

Quoted 6 lines

There is an overall reduction of code, since module_32/64 duplicated several functions.

Unfortunately there's no way to tell gcc that BUG won't return, so the BUG macro includes a goto loop. This will generate a real jmp instruction, which is never used.

I posted a patch a few weeks back to use __builtin_trap(), which gives GCC the hint that it's not going to return.
(http://patchwork.ozlabs.org/linuxppc/patch?id=7047)

Unfortunately this generated some negative feedback from some of our crackhead ... er wonderful colleagues who want to be able to step over BUGs in some circumstances.
(http://ozlabs.org/pipermail/linuxppc-dev/2006-September/026161.html)

I think they conceeded that it could be configurable, but I wasn't sure it was worth the trouble.

cheers

Signature · 8 lines
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
#3 lore raw
Quoted 3 lines · Michael Ellerman

I posted a patch a few weeks back to use __builtin_trap(), which gives GCC the hint that it's not going to return.

Ah, interesting. I'd been looking for it, and, yep, completely undocumented. It even generates the right instruction on x86. Unfortunately, your asm sequence isn't correct, since there's no guarantee that the asm and the builtin_trap will be adjacent (though its hard to see what might be interposed in this case, since it would be dead code). If only gcc labels-as-values worked properly...

Quoted 10 lines

(http://patchwork.ozlabs.org/linuxppc/patch?id=7047)

Unfortunately this generated some negative feedback from some of our crackhead ... er wonderful colleagues who want to be able to step over BUGs in some circumstances.
(http://ozlabs.org/pipermail/linuxppc-dev/2006-September/026161.html)

I think they conceeded that it could be configurable, but I wasn't sure it was worth the trouble.

Hm, not really. Well, it can be an arch-by-arch decision.

J