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

[xen master] xen/arm: mark __guest_cmpxchg always_inline



commit 0678220defe2b5183a4e33ceeb58780cccce9ac5
Author:     Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
AuthorDate: Fri Apr 14 14:57:12 2023 -0400
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Wed Apr 19 19:26:28 2023 +0100

    xen/arm: mark __guest_cmpxchg always_inline
    
    When building the hypervisor with -Og, we run into a __bad_cmpxchg link 
error:
    
    aarch64-none-linux-gnu-ld: prelink.o: in function `__int_cmpxchg':
    .../xen/./arch/arm/include/asm/arm64/cmpxchg.h:117: undefined reference to 
`__bad_cmpxchg'
    aarch64-none-linux-gnu-ld: 
.../xen/./arch/arm/include/asm/arm64/cmpxchg.h:117: undefined reference to 
`__bad_cmpxchg'
    aarch64-none-linux-gnu-ld: ./.xen-syms.0: hidden symbol `__bad_cmpxchg' 
isn't defined
    aarch64-none-linux-gnu-ld: final link failed: bad value
    
    This is due to the function __guest_cmpxchg not being inlined in the -Og 
build
    with gcc 12. Fix this by marking __guest_cmpxchg always_inline.
    
    Signed-off-by: Stewart Hildebrand <stewart.hildebrand@xxxxxxx>
    Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
    Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>
---
 xen/arch/arm/include/asm/guest_atomics.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/include/asm/guest_atomics.h 
b/xen/arch/arm/include/asm/guest_atomics.h
index 9e2e96d4ff..a1745f8613 100644
--- a/xen/arch/arm/include/asm/guest_atomics.h
+++ b/xen/arch/arm/include/asm/guest_atomics.h
@@ -86,11 +86,11 @@ static inline void guest_clear_mask16(struct domain *d, 
uint16_t mask,
     domain_unpause(d);
 }
 
-static inline unsigned long __guest_cmpxchg(struct domain *d,
-                                            volatile void *ptr,
-                                            unsigned long old,
-                                            unsigned long new,
-                                            unsigned int size)
+static always_inline unsigned long __guest_cmpxchg(struct domain *d,
+                                                   volatile void *ptr,
+                                                   unsigned long old,
+                                                   unsigned long new,
+                                                   unsigned int size)
 {
     unsigned long oldval = old;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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