]> xenbits.xensource.com Git - people/larsk/xen.git/commitdiff
xen/arm: cpufeature: Match register size with value size in cpus_have_const_cap
authorJulien Grall <julien.grall@arm.com>
Tue, 26 Mar 2019 21:26:57 +0000 (21:26 +0000)
committerJulien Grall <julien.grall@arm.com>
Thu, 3 Oct 2019 10:38:34 +0000 (11:38 +0100)
Clang is pickier than GCC for the register size in asm statement. It
expects the register size to match the value size.

The asm statement expects a 32-bit (resp. 64-bit) value on Arm32
(resp. Arm64) whereas the value is a boolean (Clang consider to be
32-bit).

It would be possible to impose 32-bit register for both architecture
but this require the code to use __OP32. However, it does no really
improve the assembly generated. Instead, replace switch the variable to
use register_t.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/cpufeature.h

index c2c8f3417c41e3359f78efac53e2930ccf5bb2eb..d06f09ecfa3497a9e0d01b71c975b07d463817eb 100644 (file)
@@ -67,7 +67,7 @@ static inline bool cpus_have_cap(unsigned int num)
 
 /* System capability check for constant cap */
 #define cpus_have_const_cap(num) ({                 \
-        bool __ret;                                 \
+        register_t __ret;                           \
                                                     \
         asm volatile (ALTERNATIVE("mov %0, #0",     \
                                   "mov %0, #1",     \