aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2024-02-08 15:53:10 +0000
committerMark Johnston <markj@FreeBSD.org>2024-02-08 16:35:03 +0000
commitb5ed3ef802ebfed6f08008bff602834b18f83a11 (patch)
treeb3793f6878d09dff5bb65e47b457ea1ecff27293
parent92eb673b2b0d229ba046d386f19df7c01c09b26f (diff)
downloadsrc-b5ed3ef802ebfed6f08008bff602834b18f83a11.tar.gz
src-b5ed3ef802ebfed6f08008bff602834b18f83a11.zip
ck/aarch64: Specify output operands for ck_pr_md_store_*
This is a backport of upstream commit d1e9f03b89: ck_pr/aarch64: Specify output operands for ck_pr_md_store_* As in commit 2f9acab, we want to specify output operand widths so that MSAN compiler instrumentation correctly updates the shadow map. In particular, LLVM's implementation depends on having type information for output operands, even when that's not otherwise necessary. Without it, KMSAN in FreeBSD generates false positives on aarch64. Reviewed by: cognet MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Juniper Networks, Inc.
-rw-r--r--sys/contrib/ck/include/gcc/aarch64/ck_pr.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/contrib/ck/include/gcc/aarch64/ck_pr.h b/sys/contrib/ck/include/gcc/aarch64/ck_pr.h
index 0a473072fffd..3d269a5066c2 100644
--- a/sys/contrib/ck/include/gcc/aarch64/ck_pr.h
+++ b/sys/contrib/ck/include/gcc/aarch64/ck_pr.h
@@ -137,8 +137,8 @@ CK_PR_LOAD_S_64(double, double, "ldr")
CK_CC_INLINE static void \
ck_pr_md_store_##S(M *target, T v) \
{ \
- __asm__ __volatile__(I " %w1, [%0]" \
- : \
+ __asm__ __volatile__(I " %w2, [%1]" \
+ : "=m" (*(T *)target) \
: "r" (target), \
"r" (v) \
: "memory"); \
@@ -148,8 +148,8 @@ CK_PR_LOAD_S_64(double, double, "ldr")
CK_CC_INLINE static void \
ck_pr_md_store_##S(M *target, T v) \
{ \
- __asm__ __volatile__(I " %1, [%0]" \
- : \
+ __asm__ __volatile__(I " %2, [%1]" \
+ : "=m" (*(T *)target) \
: "r" (target), \
"r" (v) \
: "memory"); \