Skip to contentSkip to conversation

2.4.14 Missing asm clobbers

Linux-ia64 Keith Owens 2 participants 3 messages Nov 21, 2001 – Nov 26, 2001

lore
Share & tools
lore
#0 lore raw

A comment of Linus's on l-k promoted me to check ia64 inline asm for predicates. I was surprised to find what look like missing asm clobbers. I am not 100% sure that these are errors (gcc clobbers are a black art ;) so there is no patch.

include/asm-ia64/spinlock.h.

spin_lock() changes ar.ccv, p7 without a clobber (!NEW_LOCK version). read_lock() changes p6 without a clobber.
write_lock() changes ar.ccv, p7 without a clobber.

arch/ia64/kernel/traps.c

fp_emulate() does ldf f10, f11 without a clobber.

arch/ia64/kernel/unaligned.c

invala_gr() and invala_fr() do invala without a "memory" clobber. Not sure if it is necessary or not.

#1 lore raw

Thanks for reporting on this. I'm certain some of asm need to be fixed given not-so-recent compiler developments, though I'm not aware of there being any real problems in this area at the moment. I'll look into it next week.

	--david
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Keith Owens

Keith> A comment of Linus's on l-k promoted me to check ia64 inline Keith> asm for predicates. I was surprised to find what look like Keith> missing asm clobbers. I am not 100% sure that these are Keith> errors (gcc clobbers are a black art ;) so there is no patch.

Keith> include/asm-ia64/spinlock.h.

Keith> spin_lock() changes ar.ccv, p7 without a clobber (!NEW_LOCK
Keith> version). read_lock() changes p6 without a clobber. Keith> write_lock() changes ar.ccv, p7 without a clobber.

Keith> arch/ia64/kernel/traps.c

Keith> fp_emulate() does ldf f10, f11 without a clobber.

Keith> arch/ia64/kernel/unaligned.c

Keith> invala_gr() and invala_fr() do invala without a "memory"
Keith> clobber. Not sure if it is necessary or not.

#2 lore raw
In reply to Keith Owens
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Keith Owens

Keith> include/asm-ia64/spinlock.h.

Keith> spin_lock() changes ar.ccv, p7 without a clobber (!NEW_LOCK
Keith> version). read_lock() changes p6 without a clobber. Keith> write_lock() changes ar.ccv, p7 without a clobber.

Ok, those should be fixed now. They clearly are needed, though I don't think the missing ar.ccv really had any effect because gcc uses that register only for the builtin synchronization ops use them (which we don't use in the kernel).

Keith> arch/ia64/kernel/traps.c

Keith> fp_emulate() does ldf f10, f11 without a clobber.

That's fine because f10 and f11 are marked "fixed" on the command line.

Keith> arch/ia64/kernel/unaligned.c

Keith> invala_gr() and invala_fr() do invala without a "memory"
Keith> clobber. Not sure if it is necessary or not.

This is fine because the instructions affect the code that caused the unaliged access, not the unaligned handler itself. However, we shouldn't need that code anymore because we now do an "invala" on entry to the kernel. I'll remove it in 2.5.xx.

Thanks,

	--david