Re: [PATCH] perf/x86: Check data address for IBS software filter

Ravi Bangoria
2025-03-17T13:29:45Z

Hi Namhyung,

> @@ -1286,6 +1286,13 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
> if (perf_ibs == &perf_ibs_op)
> perf_ibs_parse_ld_st_data(event->attr.sample_type, &ibs_data, &data);
>
> + if ((event->attr.config2 & IBS_SW_FILTER_MASK) &&
> + (event->attr.sample_type & PERF_SAMPLE_ADDR) &&
> + event->attr.exclude_kernel && !access_ok(data.addr)) {
> + throttle = perf_event_account_interrupt(event);
> + goto out;
> + }

Can this move up where it checks perf_exclude_event()? Use
ibs_data.regs[ibs_op_msr_idx(MSR_AMD64_IBSDCLINAD)] instead
of data.addr.

Thanks,
Ravi