[lkml]   [2018]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] arm/arm64: smccc: Use xN for arm64 register constraints with clang
On 03/22/2018 03:44 PM, Matthias Kaehlcke wrote:
> El Thu, Mar 22, 2018 at 10:26:18PM +0000 Nick Desaulniers ha dit:
>> Note that a patch in this form has previously been implemented by:
>> Andrey Konovalov <>:
>> and another by:
>> Greg Hackmann <>:
>> If you used either as a reference, you may want to credit them with a
>> `Suggested-by:` in the commit message.
> Not really, but I think I prefer Greg's version over mine and might
> use it in a respin if nobody raises objections.

NAK. There's a reason I didn't send my change upstream.

As Marc pointed out (, the "r"
prefix tells gcc to pick the appropriate register width. "x" makes it
unconditionally use the entire 64-bit register width. Just swapping out
one for the other changes the macro's semantics.

Unfortunately since this was breaking builds in android-4.14 and we
didn't have an immediate-term fix, I bit the bullet and added the above
commit -- but *only* as a short-term workaround. For the one caller we
currently have in 4.14.y, gcc was using the entire 64-bit width for all
its inputs anyway, so "r" vs. "x" didn't make a difference. But that
might not be true if/when someone introduces other SMCCC 1.1 callers.

Unfortunately I don't see a better way to deal with this than waiting
for clang to support "r"-style constraints on ARM64.

 \ /
  Last update: 2018-03-23 00:20    [W:0.038 / U:0.656 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site