[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z9hMlYsjeSmmnZCl@google.com>
Date: Mon, 17 Mar 2025 09:23:49 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Ravi Bangoria <ravi.bangoria@....com>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>,
Kan Liang <kan.liang@...ux.intel.com>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Matteo Rizzo <matteorizzo@...gle.com>
Subject: Re: [PATCH] perf/x86: Check data address for IBS software filter
On Mon, Mar 17, 2025 at 09:02:12AM -0700, Namhyung Kim wrote:
> Hi Ravi,
>
> On Mon, Mar 17, 2025 at 06:59:33PM +0530, Ravi Bangoria wrote:
> > 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.
>
> Sure, will do.
Hmm.. but I think it also needs to check op_data3_dc_lin_addr_valid bit.
Can we move up the perf_ibs_parse_ld_st_data() too and check data.addr?
Thanks,
Namhyung
Powered by blists - more mailing lists