lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260129050949.157410-1-skb99@linux.ibm.com>
Date: Thu, 29 Jan 2026 10:39:49 +0530
From: Saket Kumar Bhaskar <skb99@...ux.ibm.com>
To: linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
        bpf@...r.kernel.org
Cc: hbathini@...ux.ibm.com, sachinpb@...ux.ibm.com, venkat88@...ux.ibm.com,
        andrii@...nel.org, eddyz87@...il.com, ast@...nel.org,
        daniel@...earbox.net, martin.lau@...ux.dev, song@...nel.org,
        yonghong.song@...ux.dev, john.fastabend@...il.com, kpsingh@...nel.org,
        sdf@...ichev.me, haoluo@...gle.com, jolsa@...nel.org
Subject: [PATCH bpf-next] selftests/bpf: Return -1 from get_preempt_count() for unsupported architecture

Make get_preempt_count() to return -1 for unsupported
architectures instead of 0, so callers can distinguish not supported
from a valid preempt_count of 0.

Signed-off-by: Saket Kumar Bhaskar <skb99@...ux.ibm.com>
---
 tools/testing/selftests/bpf/bpf_experimental.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/bpf_experimental.h b/tools/testing/selftests/bpf/bpf_experimental.h
index 2cd9165c7348..6759d2ae6151 100644
--- a/tools/testing/selftests/bpf/bpf_experimental.h
+++ b/tools/testing/selftests/bpf/bpf_experimental.h
@@ -631,7 +631,7 @@ static inline int get_preempt_count(void)
 #elif defined(bpf_target_arm64)
 	return bpf_get_current_task_btf()->thread_info.preempt.count;
 #endif
-	return 0;
+	return -1;
 }
 
 /* Description
-- 
2.52.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ