Re: [patch 04/15] Generic Mutex Subsystem, add-atomic-call-func-x86_64.patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Zwane Mwaikambo <[email protected]> wrote:

> On Mon, 19 Dec 2005, Ingo Molnar wrote:
> 
> > +#define atomic_dec_call_if_negative(v, fn_name)				\
> > +do {									\
> > +	fastcall void (*__tmp)(atomic_t *) = fn_name;			\
> > +									\
> > +	(void)__tmp;							\
> > +	typecheck(atomic_t *, v);					\
> > +									\
> > +	__asm__ __volatile__(						\
> > +		LOCK "decl (%%rdi)\n"  					\
> > +		"js 2f\n"						\
> > +		"1:\n"							\
> > +		LOCK_SECTION_START("")					\
> > +		"2: call "#fn_name"\n\t"				\
> > +		"jmp 1b\n"						\
> > +		LOCK_SECTION_END					\
> > +		:							\
> > +		:"D" (v)						\
> > +		:"memory");						\
> > +} while (0)
> 
> Hi Ingo,
> 	Doesn't this corrupt caller saved registers?

good catch - i correctly marked them clobbered on i386, but not on 
x86_64. The function using this code uses nothing else, so this bug 
caused no real corruption - but that was just pure luck.

	Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux