From: Patrick Talbert <[email protected]>

[redhat] powerpc: temporary assembler fix

Powerpc builds are failing with:

~~~
/tmp/cc1zjUTE.s: Assembler messages:
/tmp/cc1zjUTE.s:7195: Error: operand out of domain (39 is not a multiple of 4)
~~~

This is a proposed fix from upstream:
https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/

Signed-off-by: Patrick Talbert <[email protected]>

diff --git a/arch/powerpc/include/asm/atomic.h 
b/arch/powerpc/include/asm/atomic.h
index blahblah..blahblah 100644
--- a/arch/powerpc/include/asm/atomic.h
+++ b/arch/powerpc/include/asm/atomic.h
@@ -23,6 +23,12 @@
 #define __atomic_release_fence()                                       \
        __asm__ __volatile__(PPC_RELEASE_BARRIER "" : : : "memory")
 
+#ifdef CONFIG_CC_IS_CLANG
+#define DS_FORM_CONSTRAINT "Z<>"
+#else
+#define DS_FORM_CONSTRAINT "YZ<>"
+#endif
+
 static __inline__ int arch_atomic_read(const atomic_t *v)
 {
        int t;
@@ -197,7 +203,7 @@ static __inline__ s64 arch_atomic64_read(const atomic64_t 
*v)
        if (IS_ENABLED(CONFIG_PPC_KERNEL_PREFIXED))
                __asm__ __volatile__("ld %0,0(%1)" : "=r"(t) : 
"b"(&v->counter));
        else
-               __asm__ __volatile__("ld%U1%X1 %0,%1" : "=r"(t) : 
"m<>"(v->counter));
+               __asm__ __volatile__("ld%U1%X1 %0,%1" : "=r"(t) : 
DS_FORM_CONSTRAINT (v->counter));
 
        return t;
 }
@@ -208,7 +214,7 @@ static __inline__ void arch_atomic64_set(atomic64_t *v, s64 
i)
        if (IS_ENABLED(CONFIG_PPC_KERNEL_PREFIXED))
                __asm__ __volatile__("std %1,0(%2)" : "=m"(v->counter) : 
"r"(i), "b"(&v->counter));
        else
-               __asm__ __volatile__("std%U0%X0 %1,%0" : "=m<>"(v->counter) : 
"r"(i));
+               __asm__ __volatile__("std%U0%X0 %1,%0" : "=" DS_FORM_CONSTRAINT 
(v->counter) : "r"(i));
 }
 
 #define ATOMIC64_OP(op, asm_op)                                                
\

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3371

-- 
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to