[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E52E9BF.3050904@goop.org>
Date: Mon, 22 Aug 2011 16:43:59 -0700
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: "H. Peter Anvin" <hpa@...or.com>
CC: Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...e.hu>,
the arch/x86 maintainers <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Nick Piggin <npiggin@...nel.dk>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
Subject: Re: [PATCH 07/15] x86: add xadd helper macro
On 08/22/2011 04:29 PM, H. Peter Anvin wrote:
> On 08/22/2011 04:15 PM, Jeremy Fitzhardinge wrote:
>> From: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
>>
>> Add a common xadd implementation.
>>
>> This has the side effect of generating a bad instruction if you try to
>> use it on a 64-bit value on a 32-bit system - but don't do that.
>>
> It would be better to barf at that point, so we get the error with a C
> line... also, there needs to be a default clause with
> __compiletime_error() in it.
OK, but the "standard of care" here is the old "calling undefined
function" link error; getting a bad asm instruction is a little more
helpful, in a sense. But agreed on the default: case. I'll see if I
can fix up xadd and cmpxchg to fail better as well.
> There are a few additional xadd users which should be converted unless
> I'm mistaken:
>
> rwsem_atomic_update() in asm/rwsem.h.
>
> atomic_add_return() in asm/atomic.h.
>
> atomic64_add_return() in asm/atomic64_64.h.
>
> atom_asr() in asm/uv/uv_bau.h (*VOMIT* - the UV people have created a
> whole different type in private code...)
>
Yeah, I hadn't done a full xadd audit. I'll take a look.
J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists