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

Re: [Xen-devel] [PATCH 5 of 7 v2] x86: don't use .subsection when compiling with clang



>>> On 05.04.12 at 17:51, Tim Deegan <tim@xxxxxxx> wrote:
> # HG changeset patch
> # User Tim Deegan <tim@xxxxxxx>
> # Date 1333640955 -3600
> # Node ID 0908535327a5b01e49b69cd96db464be21ff3ee6
> # Parent  a93381049790e4f8a02f2322851f78175c254c5b
> x86: don't use .subsection when compiling with clang
> 
> LLVM's assembler doesn't support the .subsection directive, so put
> the out-of-line failure path in .fixup instead.

Given that it's a single place only, addressing this inline rather than
creating a proper abstraction is probably fine, so ...

> Signed-off-by: Tim Deegan <tim@xxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>

> diff -r a93381049790 -r 0908535327a5 xen/include/asm-x86/spinlock.h
> --- a/xen/include/asm-x86/spinlock.h  Thu Apr 05 16:49:15 2012 +0100
> +++ b/xen/include/asm-x86/spinlock.h  Thu Apr 05 16:49:15 2012 +0100
> @@ -45,11 +45,19 @@ static always_inline int _raw_read_trylo
>      asm volatile (
>          "    lock; decl %0         \n"
>          "    jns 2f                \n"
> +#ifdef __clang__ /* clang's builtin assember can't do .subsection */
> +        "1:  .pushsection .fixup,\"ax\"\n"
> +#else
>          "1:  .subsection 1         \n"
> +#endif
>          "2:  lock; incl %0         \n"
>          "    decl %1               \n"
>          "    jmp 1b                \n"
> +#ifdef __clang__
> +        "    .popsection           \n"
> +#else
>          "    .subsection 0         \n"
> +#endif
>          : "=m" (rw->lock), "=r" (acquired) : "1" (1) : "memory" );
>  
>      return acquired;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx 
> http://lists.xen.org/xen-devel 




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.