summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2026-02-17 19:05:09 +0300
committerAlexei Starovoitov <ast@kernel.org>2026-03-03 19:35:07 +0300
commit0f87614c4dbdd14bbcc23c69b09be58177ce7b9b (patch)
treeade91f9d2ca3f424da9d4f109db585845f79459f /tools
parent6fe54677bcc2e7a42f5fcaa3c66600232ba54d44 (diff)
downloadlinux-0f87614c4dbdd14bbcc23c69b09be58177ce7b9b.tar.xz
bpf/s390: Implement get_preempt_count()
exe_ctx test fails on s390, because get_preempt_count() is not implemented and its fallback path always returns 0. Implement it using the new bpf_get_lowcore() kfunc. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Link: https://lore.kernel.org/r/20260217160813.100855-3-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/bpf/bpf_experimental.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bpf_experimental.h b/tools/testing/selftests/bpf/bpf_experimental.h
index 4453ad27b2ef..44466acf8083 100644
--- a/tools/testing/selftests/bpf/bpf_experimental.h
+++ b/tools/testing/selftests/bpf/bpf_experimental.h
@@ -651,6 +651,8 @@ static inline int get_preempt_count(void)
return bpf_get_current_task_btf()->thread_info.preempt.count;
#elif defined(bpf_target_powerpc)
return bpf_get_current_task_btf()->thread_info.preempt_count;
+#elif defined(bpf_target_s390)
+ return bpf_get_lowcore()->preempt_count;
#endif
return 0;
}
@@ -660,6 +662,7 @@ static inline int get_preempt_count(void)
* * x86
* * arm64
* * powerpc64
+ * * s390x
*/
static inline int bpf_in_interrupt(void)
{
@@ -680,6 +683,7 @@ static inline int bpf_in_interrupt(void)
* * x86
* * arm64
* * powerpc64
+ * * s390x
*/
static inline int bpf_in_nmi(void)
{
@@ -691,6 +695,7 @@ static inline int bpf_in_nmi(void)
* * x86
* * arm64
* * powerpc64
+ * * s390x
*/
static inline int bpf_in_hardirq(void)
{
@@ -702,6 +707,7 @@ static inline int bpf_in_hardirq(void)
* * x86
* * arm64
* * powerpc64
+ * * s390x
*/
static inline int bpf_in_serving_softirq(void)
{
@@ -721,6 +727,7 @@ static inline int bpf_in_serving_softirq(void)
* * x86
* * arm64
* * powerpc64
+ * * s390x
*/
static inline int bpf_in_task(void)
{