* [PATCH] perf/x86/intel: Annotate x86_pmu::hybrid_pmu with __counted_by_ptr
@ 2026-09-04 14:17 Thorsten Blum
2026-09-04 15:47 ` Ian Rogers
2026-09-25 10:48 ` [tip: perf/core] " tip-bot2 for Thorsten Blum
0 siblings, 2 replies; 4+ messages in thread
From: Thorsten Blum @ 2026-09-04 14:17 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, James Clark, Thomas Gleixner,
Borislav Petkov, Dave Hansen, x86, H. Peter Anvin, Kees Cook,
Gustavo A. R. Silva
Cc: Thorsten Blum, linux-perf-users, linux-kernel, linux-hardening
Add __counted_by_ptr() to x86_pmu::hybrid_pmu to improve access bounds
checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
arch/x86/events/perf_event.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
index 71ed5b2acea2..b66691a4fc31 100644
--- a/arch/x86/events/perf_event.h
+++ b/arch/x86/events/perf_event.h
@@ -1050,7 +1050,7 @@ struct x86_pmu {
* unique capabilities.
*/
int num_hybrid_pmus;
- struct x86_hybrid_pmu *hybrid_pmu;
+ struct x86_hybrid_pmu *hybrid_pmu __counted_by_ptr(num_hybrid_pmus);
enum intel_cpu_type (*get_hybrid_cpu_type) (void);
};
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf/x86/intel: Annotate x86_pmu::hybrid_pmu with __counted_by_ptr
2026-09-04 14:17 [PATCH] perf/x86/intel: Annotate x86_pmu::hybrid_pmu with __counted_by_ptr Thorsten Blum
@ 2026-09-04 15:47 ` Ian Rogers
2026-09-07 6:59 ` Mi, Dapeng
2026-09-25 10:48 ` [tip: perf/core] " tip-bot2 for Thorsten Blum
1 sibling, 1 reply; 4+ messages in thread
From: Ian Rogers @ 2026-09-04 15:47 UTC (permalink / raw)
To: Thorsten Blum, Dapeng Mi
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Adrian Hunter, James Clark, Thomas Gleixner, Borislav Petkov,
Dave Hansen, x86, H. Peter Anvin, Kees Cook, Gustavo A. R. Silva,
linux-perf-users, linux-kernel, linux-hardening
On Fri, Sep 4, 2026 at 7:17 AM Thorsten Blum <blum@kernel.org> wrote:
>
> Add __counted_by_ptr() to x86_pmu::hybrid_pmu to improve access bounds
> checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.
>
> Signed-off-by: Thorsten Blum <blum@kernel.org>
> ---
> arch/x86/events/perf_event.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
> index 71ed5b2acea2..b66691a4fc31 100644
> --- a/arch/x86/events/perf_event.h
> +++ b/arch/x86/events/perf_event.h
> @@ -1050,7 +1050,7 @@ struct x86_pmu {
> * unique capabilities.
> */
> int num_hybrid_pmus;
> - struct x86_hybrid_pmu *hybrid_pmu;
> + struct x86_hybrid_pmu *hybrid_pmu __counted_by_ptr(num_hybrid_pmus);
Reviewed-by: Ian Rogers <irogers@google.com>
Thanks,
Ian
> enum intel_cpu_type (*get_hybrid_cpu_type) (void);
> };
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] perf/x86/intel: Annotate x86_pmu::hybrid_pmu with __counted_by_ptr
2026-09-04 15:47 ` Ian Rogers
@ 2026-09-07 6:59 ` Mi, Dapeng
0 siblings, 0 replies; 4+ messages in thread
From: Mi, Dapeng @ 2026-09-07 6:59 UTC (permalink / raw)
To: Ian Rogers, Thorsten Blum
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Adrian Hunter, James Clark, Thomas Gleixner, Borislav Petkov,
Dave Hansen, x86, H. Peter Anvin, Kees Cook, Gustavo A. R. Silva,
linux-perf-users, linux-kernel, linux-hardening
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Thanks.
On 9/4/2026 11:47 PM, Ian Rogers wrote:
> On Fri, Sep 4, 2026 at 7:17 AM Thorsten Blum <blum@kernel.org> wrote:
>> Add __counted_by_ptr() to x86_pmu::hybrid_pmu to improve access bounds
>> checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.
>>
>> Signed-off-by: Thorsten Blum <blum@kernel.org>
>> ---
>> arch/x86/events/perf_event.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
>> index 71ed5b2acea2..b66691a4fc31 100644
>> --- a/arch/x86/events/perf_event.h
>> +++ b/arch/x86/events/perf_event.h
>> @@ -1050,7 +1050,7 @@ struct x86_pmu {
>> * unique capabilities.
>> */
>> int num_hybrid_pmus;
>> - struct x86_hybrid_pmu *hybrid_pmu;
>> + struct x86_hybrid_pmu *hybrid_pmu __counted_by_ptr(num_hybrid_pmus);
> Reviewed-by: Ian Rogers <irogers@google.com>
>
> Thanks,
> Ian
>
>> enum intel_cpu_type (*get_hybrid_cpu_type) (void);
>> };
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip: perf/core] perf/x86/intel: Annotate x86_pmu::hybrid_pmu with __counted_by_ptr
2026-09-04 14:17 [PATCH] perf/x86/intel: Annotate x86_pmu::hybrid_pmu with __counted_by_ptr Thorsten Blum
2026-09-04 15:47 ` Ian Rogers
@ 2026-09-25 10:48 ` tip-bot2 for Thorsten Blum
1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Thorsten Blum @ 2026-09-25 10:48 UTC (permalink / raw)
To: linux-tip-commits
Cc: Thorsten Blum, Peter Zijlstra (Intel),
Ian Rogers, Dapeng Mi, x86, linux-kernel
The following commit has been merged into the perf/core branch of tip:
Commit-ID: 52a6457f59adf70d624ef1b1bed8d55cb7b73af6
Gitweb: https://git.kernel.org/tip/52a6457f59adf70d624ef1b1bed8d55cb7b73af6
Author: Thorsten Blum <blum@kernel.org>
AuthorDate: Fri, 04 Sep 2026 16:17:00 +02:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 25 Sep 2026 12:45:52 +02:00
perf/x86/intel: Annotate x86_pmu::hybrid_pmu with __counted_by_ptr
Add __counted_by_ptr() to x86_pmu::hybrid_pmu to improve access bounds
checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE.
Signed-off-by: Thorsten Blum <blum@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://patch.msgid.link/20260904141659.224248-2-blum@kernel.org
---
arch/x86/events/perf_event.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
index 6eb1bf4..5deca1a 100644
--- a/arch/x86/events/perf_event.h
+++ b/arch/x86/events/perf_event.h
@@ -1245,7 +1245,7 @@ struct x86_pmu {
* unique capabilities.
*/
int num_hybrid_pmus;
- struct x86_hybrid_pmu *hybrid_pmu;
+ struct x86_hybrid_pmu *hybrid_pmu __counted_by_ptr(num_hybrid_pmus);
enum intel_cpu_type (*get_hybrid_cpu_type) (void);
};
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-25 10:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-04 14:17 [PATCH] perf/x86/intel: Annotate x86_pmu::hybrid_pmu with __counted_by_ptr Thorsten Blum
2026-09-04 15:47 ` Ian Rogers
2026-09-07 6:59 ` Mi, Dapeng
2026-09-25 10:48 ` [tip: perf/core] " tip-bot2 for Thorsten Blum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®