* [PATCH bpf] selftests/bpf: Use asm constraint "m" for LoongArch
@ 2024-12-19 11:15 Tiezhu Yang
2024-12-19 12:07 ` Huacai Chen
2024-12-19 12:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Tiezhu Yang @ 2024-12-19 11:15 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Nathan Chancellor
Cc: bpf, llvm, loongarch, linux-kernel
Currently, LoongArch LLVM does not support the constraint "o" and no plan
to support it, it only supports the similar constraint "m", so change the
constraints from "nor" in the "else" case to arch-specific "nmr" to avoid
the build error such as "unexpected asm memory constraint" for LoongArch.
Cc: stable@vger.kernel.org
Fixes: 630301b0d59d ("selftests/bpf: Add basic USDT selftests")
Link: https://llvm.org/docs/LangRef.html#supported-constraint-code-list
Link: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp#L172
Suggested-by: Weining Lu <luweining@loongson.cn>
Suggested-by: Li Chen <chenli@loongson.cn>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
tools/testing/selftests/bpf/sdt.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/bpf/sdt.h b/tools/testing/selftests/bpf/sdt.h
index ca0162b4dc57..1fcfa5160231 100644
--- a/tools/testing/selftests/bpf/sdt.h
+++ b/tools/testing/selftests/bpf/sdt.h
@@ -102,6 +102,8 @@
# define STAP_SDT_ARG_CONSTRAINT nZr
# elif defined __arm__
# define STAP_SDT_ARG_CONSTRAINT g
+# elif defined __loongarch__
+# define STAP_SDT_ARG_CONSTRAINT nmr
# else
# define STAP_SDT_ARG_CONSTRAINT nor
# endif
--
2.42.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf] selftests/bpf: Use asm constraint "m" for LoongArch
2024-12-19 11:15 [PATCH bpf] selftests/bpf: Use asm constraint "m" for LoongArch Tiezhu Yang
@ 2024-12-19 12:07 ` Huacai Chen
2024-12-19 12:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2024-12-19 12:07 UTC (permalink / raw)
To: Tiezhu Yang
Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
Nathan Chancellor, bpf, llvm, loongarch, linux-kernel
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
On Thu, Dec 19, 2024 at 7:15 PM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>
> Currently, LoongArch LLVM does not support the constraint "o" and no plan
> to support it, it only supports the similar constraint "m", so change the
> constraints from "nor" in the "else" case to arch-specific "nmr" to avoid
> the build error such as "unexpected asm memory constraint" for LoongArch.
>
> Cc: stable@vger.kernel.org
> Fixes: 630301b0d59d ("selftests/bpf: Add basic USDT selftests")
> Link: https://llvm.org/docs/LangRef.html#supported-constraint-code-list
> Link: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp#L172
> Suggested-by: Weining Lu <luweining@loongson.cn>
> Suggested-by: Li Chen <chenli@loongson.cn>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> ---
> tools/testing/selftests/bpf/sdt.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/bpf/sdt.h b/tools/testing/selftests/bpf/sdt.h
> index ca0162b4dc57..1fcfa5160231 100644
> --- a/tools/testing/selftests/bpf/sdt.h
> +++ b/tools/testing/selftests/bpf/sdt.h
> @@ -102,6 +102,8 @@
> # define STAP_SDT_ARG_CONSTRAINT nZr
> # elif defined __arm__
> # define STAP_SDT_ARG_CONSTRAINT g
> +# elif defined __loongarch__
> +# define STAP_SDT_ARG_CONSTRAINT nmr
> # else
> # define STAP_SDT_ARG_CONSTRAINT nor
> # endif
> --
> 2.42.0
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf] selftests/bpf: Use asm constraint "m" for LoongArch
2024-12-19 11:15 [PATCH bpf] selftests/bpf: Use asm constraint "m" for LoongArch Tiezhu Yang
2024-12-19 12:07 ` Huacai Chen
@ 2024-12-19 12:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-19 12:30 UTC (permalink / raw)
To: Tiezhu Yang
Cc: ast, daniel, andrii, nathan, bpf, llvm, loongarch, linux-kernel
Hello:
This patch was applied to bpf/bpf.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:
On Thu, 19 Dec 2024 19:15:06 +0800 you wrote:
> Currently, LoongArch LLVM does not support the constraint "o" and no plan
> to support it, it only supports the similar constraint "m", so change the
> constraints from "nor" in the "else" case to arch-specific "nmr" to avoid
> the build error such as "unexpected asm memory constraint" for LoongArch.
>
> Cc: stable@vger.kernel.org
> Fixes: 630301b0d59d ("selftests/bpf: Add basic USDT selftests")
> Link: https://llvm.org/docs/LangRef.html#supported-constraint-code-list
> Link: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp#L172
> Suggested-by: Weining Lu <luweining@loongson.cn>
> Suggested-by: Li Chen <chenli@loongson.cn>
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
>
> [...]
Here is the summary with links:
- [bpf] selftests/bpf: Use asm constraint "m" for LoongArch
https://git.kernel.org/bpf/bpf/c/29d44cce324d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-12-19 12:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19 11:15 [PATCH bpf] selftests/bpf: Use asm constraint "m" for LoongArch Tiezhu Yang
2024-12-19 12:07 ` Huacai Chen
2024-12-19 12:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox