From nobody Tue Sep 29 04:44:47 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 904AA45C70E; Wed, 12 Aug 2026 14:11:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786543894; cv=none; b=YUyJssom+RVil57NHKedkWf8Ke/TetaSfc96EDBaX+QEgnmb+DvQa2xNhkKjzh1nrdkgdSE2oiLWv1pWdutV8M2JRNWlvBiyRlSJrk6WfBTbOrVjZkOJ4DJJnHQ+L6wBQZh97eC1vNG/DFpYxdbHYwl4xLvoXdcR6VJFJ09OZJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786543894; c=relaxed/simple; bh=+IImFUAaeNNizfaPuCAu7PDUGnMWVXVnY+nZe/jkj7Y=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=egB6Cr6t/LRvaceYCy3b+nMlEV7Uhs0ERUcTRTcM5AqXSmX0BeNlGGNM472G0kPs4q3vk9Xh6tkIjw+3FuI3DhQp7nIgMCmXMoNkrhnVLtYnEJriuq5F2rDlsAaIPpzNxLqyRpQdxSexe/pWSZsl3Pv5HohXeq7nbhbmP8D1o0I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Jk8M3doV; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dxSqTrN5; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Jk8M3doV"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dxSqTrN5" Date: Wed, 12 Aug 2026 14:11:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1786543890; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/UrlofblOwgWEN6eWGBrvIhgQbqs9jqKk89/W5fTly8=; b=Jk8M3doV5a2TPbco02QCtvDSkB5KcHQybxDkHxZt4I7XRE3vpAdIv4VQjrsoP7Fl+CjaPb vRk6yeGK3GN5MMTSI9RCstGTw6P8BILAY5YD7hCtw9Eu9evW00ZV0Kf2m417GHEldA0PMA dD3RV+wC8jN+DF039yIPjuSvwxKznV3zgHvygYyuRmg/14Jgjs5Nu3kFBC7pT0eebB4JKt T0HNts+ywyTqzHWKpAqrYlboChd89q5rV8vOoVzlQaVlY65UJ3T13rPgstjp1iESII+Akl 3ElXVjPqh56ybz72GfbK2Ehse+OKiM6nl5KAGSA1gHuljYX9lsHxkKBUOUKWrg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1786543890; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/UrlofblOwgWEN6eWGBrvIhgQbqs9jqKk89/W5fTly8=; b=dxSqTrN5zNK+j8WzW5eAsGz1JpflHTK+cbUoIdRaVTf25JpuVKdt81QxbPL7Lzf1aFteIt 8m3DKJ0c2x0V4WAQ== From: "tip-bot2 for Dapeng Mi" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] perf/x86: Unregister PMI handler on PMU init failure Cc: Dapeng Mi , "Peter Zijlstra (Intel)" , Thomas Falcon , Zide Chen , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260717080342.1879573-2-dapeng1.mi@linux.intel.com> References: <20260717080342.1879573-2-dapeng1.mi@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178654388916.442315.10720421634068939626.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the perf/core branch of tip: Commit-ID: 91787047b1dc52b1fee68b07f79af70aae5fce47 Gitweb: https://git.kernel.org/tip/91787047b1dc52b1fee68b07f79af70aa= e5fce47 Author: Dapeng Mi AuthorDate: Fri, 17 Jul 2026 16:03:35 +08:00 Committer: Peter Zijlstra CommitterDate: Mon, 10 Aug 2026 15:05:47 +02:00 perf/x86: Unregister PMI handler on PMU init failure Fix an NMI handler leak in init_hw_perf_events(). When PMU initialization fails after register_nmi_handler(), the error path exits without calling unregister_nmi_handler(), leaving a stale NMI_LOCAL "PMI" handler registered. Add the missing call before clearing x86_pmu state. Signed-off-by: Dapeng Mi Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Thomas Falcon Reviewed-by: Zide Chen Link: https://patch.msgid.link/20260717080342.1879573-2-dapeng1.mi@linux.in= tel.com --- arch/x86/events/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index af0b67f..872d07a 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -2219,7 +2219,7 @@ static int __init init_hw_perf_events(void) err =3D cpuhp_setup_state(CPUHP_PERF_X86_PREPARE, "perf/x86:prepare", x86_pmu_prepare_cpu, x86_pmu_dead_cpu); if (err) - return err; + goto pmi_unregister; =20 err =3D cpuhp_setup_state(CPUHP_AP_PERF_X86_STARTING, "perf/x86:starting", x86_pmu_starting_cpu, @@ -2273,6 +2273,8 @@ out1: cpuhp_remove_state(CPUHP_AP_PERF_X86_STARTING); out: cpuhp_remove_state(CPUHP_PERF_X86_PREPARE); +pmi_unregister: + unregister_nmi_handler(NMI_LOCAL, "PMI"); out_bad_pmu: memset(&x86_pmu, 0, sizeof(x86_pmu)); return err;