[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <769c580e-66cf-420d-a27e-f38b11abfde6@linux.dev>
Date: Thu, 29 Jan 2026 08:13:01 -0800
From: Yonghong Song <yonghong.song@...ux.dev>
To: Saket Kumar Bhaskar <skb99@...ux.ibm.com>, 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, john.fastabend@...il.com,
kpsingh@...nel.org, sdf@...ichev.me, haoluo@...gle.com, jolsa@...nel.org
Subject: Re: [PATCH bpf-next] selftests/bpf: Return -1 from
get_preempt_count() for unsupported architecture
On 1/29/26 8:03 AM, Yonghong Song wrote:
>
>
> On 1/28/26 9:09 PM, Saket Kumar Bhaskar wrote:
>> 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>
>
> LGTM.
>
> Acked-by: Yonghong Song <yonghong.song@...ux.dev>
Dig through further. My above Ack is invalid due the following usage
e.g.
static inline int bpf_in_nmi(void)
{
return get_preempt_count() & NMI_MASK;
}
in bpf_experimental.h. In such cases, returning -1 for get_preempt_count()
may cause bpf_in_nmi() to be true, but this is incorrect.
Powered by blists - more mailing lists