All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kan Liang <kan.liang@linux.intel.com>
Subject: [GIT PULL] perf events fixes
Date: Fri, 21 Mar 2025 11:39:44 +0100	[thread overview]
Message-ID: <Z91B8ILV-cXRUULf@gmail.com> (raw)

Linus,

Please pull the latest perf/urgent Git tree from:

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-2025-03-21

   # HEAD: 7e512f5ad24458e2c930b5be5d96ddf9e176e05d perf/x86/rapl: Fix error handling in init_rapl_pmus()

Two fixes: an RAPL PMU driver error handling fix, and an AMD IBS software
filter fix.

Thanks,

	Ingo

------------------>
Dhananjay Ugwekar (1):
      perf/x86/rapl: Fix error handling in init_rapl_pmus()

Namhyung Kim (1):
      perf/x86: Check data address for IBS software filter


 arch/x86/events/amd/ibs.c | 10 ++++++----
 arch/x86/events/rapl.c    |  7 ++++++-
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index e7a8b8758e08..c46500592002 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -1128,8 +1128,13 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
 		regs.flags |= PERF_EFLAGS_EXACT;
 	}
 
+	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) &&
-	    perf_exclude_event(event, &regs)) {
+	    (perf_exclude_event(event, &regs) ||
+	     ((data.sample_flags & PERF_SAMPLE_ADDR) &&
+	      event->attr.exclude_kernel && kernel_ip(data.addr)))) {
 		throttle = perf_event_account_interrupt(event);
 		goto out;
 	}
@@ -1144,9 +1149,6 @@ static int perf_ibs_handle_irq(struct perf_ibs *perf_ibs, struct pt_regs *iregs)
 		perf_sample_save_raw_data(&data, event, &raw);
 	}
 
-	if (perf_ibs == &perf_ibs_op)
-		perf_ibs_parse_ld_st_data(event->attr.sample_type, &ibs_data, &data);
-
 	/*
 	 * rip recorded by IbsOpRip will not be consistent with rsp and rbp
 	 * recorded as part of interrupt regs. Thus we need to use rip from
diff --git a/arch/x86/events/rapl.c b/arch/x86/events/rapl.c
index 6941f4811bec..043f0a0b1e00 100644
--- a/arch/x86/events/rapl.c
+++ b/arch/x86/events/rapl.c
@@ -730,6 +730,7 @@ static int __init init_rapl_pmus(struct rapl_pmus **rapl_pmus_ptr, int rapl_pmu_
 {
 	int nr_rapl_pmu = topology_max_packages();
 	struct rapl_pmus *rapl_pmus;
+	int ret;
 
 	/*
 	 * rapl_pmu_scope must be either PKG, DIE or CORE
@@ -761,7 +762,11 @@ static int __init init_rapl_pmus(struct rapl_pmus **rapl_pmus_ptr, int rapl_pmu_
 	rapl_pmus->pmu.module		= THIS_MODULE;
 	rapl_pmus->pmu.capabilities	= PERF_PMU_CAP_NO_EXCLUDE;
 
-	return init_rapl_pmu(rapl_pmus);
+	ret = init_rapl_pmu(rapl_pmus);
+	if (ret)
+		kfree(rapl_pmus);
+
+	return ret;
 }
 
 static struct rapl_model model_snb = {

             reply	other threads:[~2025-03-21 10:39 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-21 10:39 Ingo Molnar [this message]
2025-03-21 17:39 ` [GIT PULL] perf events fixes pr-tracker-bot
  -- strict thread matches above, loose matches on Subject: below --
2026-05-09  1:40 Ingo Molnar
2026-05-09  3:32 ` pr-tracker-bot
2026-04-12  7:17 Ingo Molnar
2026-04-12 17:45 ` pr-tracker-bot
2026-03-22  8:24 Ingo Molnar
2026-03-22 18:04 ` pr-tracker-bot
2026-03-01  9:00 Ingo Molnar
2026-03-01 21:37 ` pr-tracker-bot
2026-01-24  9:28 Ingo Molnar
2026-01-24 18:00 ` pr-tracker-bot
2025-12-12  9:36 Ingo Molnar
2025-12-13 18:12 ` pr-tracker-bot
2025-11-23  7:45 Ingo Molnar
2025-11-23 16:26 ` pr-tracker-bot
2025-11-01  7:13 Ingo Molnar
2025-11-01 17:41 ` pr-tracker-bot
2025-05-04  7:17 Ingo Molnar
2025-05-04 15:23 ` pr-tracker-bot
2025-04-26  8:35 Ingo Molnar
2025-04-26 17:06 ` pr-tracker-bot
2025-04-18 20:32 Ingo Molnar
2025-04-18 21:15 ` pr-tracker-bot
2025-04-10 21:10 Ingo Molnar
2025-04-10 22:52 ` pr-tracker-bot
2025-03-07 12:22 Ingo Molnar
2025-03-07 21:04 ` pr-tracker-bot
2025-02-28 19:17 Ingo Molnar
2025-03-01  1:41 ` pr-tracker-bot
2024-06-02  7:08 Ingo Molnar
2024-06-02 16:41 ` pr-tracker-bot
2024-03-17  8:57 Ingo Molnar
2024-03-17 19:34 ` pr-tracker-bot
2023-10-01  8:35 Ingo Molnar
2023-10-01 17:08 ` pr-tracker-bot
2010-09-08 13:00 Ingo Molnar
2010-01-16 16:59 Ingo Molnar
2009-11-10 17:45 Ingo Molnar
2009-11-01 15:36 Ingo Molnar
2009-10-23 14:49 Ingo Molnar
2009-10-13 18:25 Ingo Molnar
2009-10-08 18:37 Ingo Molnar
2009-10-02 12:42 Ingo Molnar
2009-09-26 12:29 Ingo Molnar

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=Z91B8ILV-cXRUULf@gmail.com \
    --to=mingo@kernel.org \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    /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.