From: Namhyung Kim <namhyung@kernel.org>
To: Ravi Bangoria <ravi.bangoria@amd.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
Kan Liang <kan.liang@linux.intel.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Matteo Rizzo <matteorizzo@google.com>
Subject: Re: [PATCH] perf/x86: Check data address for IBS software filter
Date: Mon, 17 Mar 2025 09:23:49 -0700 [thread overview]
Message-ID: <Z9hMlYsjeSmmnZCl@google.com> (raw)
In-Reply-To: <Z9hHhKwUoQMAqZAa@google.com>
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
prev parent reply other threads:[~2025-03-17 16:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 8:10 [PATCH] perf/x86: Check data address for IBS software filter Namhyung Kim
2025-03-17 9:15 ` [tip: perf/urgent] " tip-bot2 for Namhyung Kim
2025-03-17 10:10 ` Borislav Petkov
2025-03-17 15:57 ` Namhyung Kim
2025-03-17 10:15 ` Peter Zijlstra
2025-03-17 16:01 ` Namhyung Kim
2025-03-17 13:29 ` [PATCH] " Ravi Bangoria
2025-03-17 16:02 ` Namhyung Kim
2025-03-17 16:23 ` Namhyung Kim [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z9hMlYsjeSmmnZCl@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=matteorizzo@google.com \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.