From nobody Tue Sep 29 09:09:21 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 611273B8950; Mon, 10 Aug 2026 10:29:44 +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=1786357785; cv=none; b=rJs8iTQRhOy9Lrh4BT0yNilhGnAdcws8ZV6OvtIdP7CgK3h3xA6EsrskuVcbH3xFlKJ9tkGX/r+kIigPZvlydDiDvw87bdcZn5pgnhQOfCfXcOxBBg3f6+wuOoDfJPZ6uRRB6absyhIxeNbr0CkLpt/m5TMaDG8uFyR7242RGDc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786357785; c=relaxed/simple; bh=oHnL7Dd6FxDUxqU/V0W/9cpVyUwhYZApFCIQTsj8WYA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=AO/j9f9bLQ/FJparP7T0q2PEzd4OgHgsGZkcqrwsCw3xaGxJZ9inVHdyikbYynEMSvlR1Vr55Vpt7+/ZSAEw6vFn5mjGHDmHt4owVOgvSCg98OMz3eMXx+1NJpC6wUeH+BwUYJv91T2BUH/hpcjZDeuY0+DbeuO0aubwyakSF8A= 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=VEZ61tr0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=/kY4+vHi; 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="VEZ61tr0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="/kY4+vHi" Date: Mon, 10 Aug 2026 10:29:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1786357782; 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=rzXhTClZsINqKSFRe/iyOGbfK0xDeIfPJ5hjT75zBNM=; b=VEZ61tr0zblH9sIvKq+HrgecSO1W3+DvYYc02S1/hu/c34SX8KWXgl1Pcr6HLdQYQfR+yS u5ejeRP8gpplOwYfyVYF1lISakbEByjmeR/jK/6Dov9ccZGzbiTFm77PfbEmAl+dFseCx5 bdyzarCqcTA3LeiJtn7p/B+/uhGL6Pz44nuibl3txFS8npk5TwnkhJHyDJgYDB5bVnM2P7 xkVzo4bV/6o7FrJsEIGOZvBcK1vkRBBiUdCSXpL9HGvpz/5UXAAzOh6e+LmPvenuBWl7KA 9aIg8LXNgVZqCFpRaVuOA75UgBmbQD2Vrx1YpZsDCTCtttcQr0I3iScORypMog== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1786357782; 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=rzXhTClZsINqKSFRe/iyOGbfK0xDeIfPJ5hjT75zBNM=; b=/kY4+vHiNmsdXyHNvtnE1zWrfSBdhFL4kB6rXxdN2EXIuEt7R096VSVx5ot4OTVRjnOqoe ZjM6CMyU5G2txXBg== From: "tip-bot2 for Adrian Hunter" 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/intel/pt: Factor out pt_config_enable() Cc: Adrian Hunter , "Peter Zijlstra (Intel)" , Yi Lai , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260721070254.13557-2-adrian.hunter@intel.com> References: <20260721070254.13557-2-adrian.hunter@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178635778093.442315.13836401050460819343.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: c6df517796189723ffbdd7679206c97d3642c2ef Gitweb: https://git.kernel.org/tip/c6df517796189723ffbdd7679206c97d3= 642c2ef Author: Adrian Hunter AuthorDate: Tue, 21 Jul 2026 10:02:52 +03:00 Committer: Peter Zijlstra CommitterDate: Fri, 07 Aug 2026 18:27:06 +02:00 perf/x86/intel/pt: Factor out pt_config_enable() pt_config() enables tracing by allowing NMIs and pause/resume, issuing the necessary barriers, and calling pt_config_start(). A later change needs to re-enable tracing on a (re-)start path without repeating the full pt_config() setup (filters, RTIT_CTL, buffer configuration). Factor that enabling sequence out into a new helper, pt_config_enable(), so it can be called on its own. No functional change intended. Signed-off-by: Adrian Hunter Signed-off-by: Peter Zijlstra (Intel) Tested-by: Yi Lai Link: https://patch.msgid.link/20260721070254.13557-2-adrian.hunter@intel.c= om --- arch/x86/events/intel/pt.c | 41 +++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c index b5726b5..dc1be7f 100644 --- a/arch/x86/events/intel/pt.c +++ b/arch/x86/events/intel/pt.c @@ -502,6 +502,29 @@ static u64 pt_config_filters(struct perf_event *event) return rtit_ctl; } =20 +static void pt_config_enable(struct perf_event *event) +{ + struct pt *pt =3D this_cpu_ptr(&pt_ctx); + + /* + * Allow resume before starting so as not to overwrite a value set by a + * PMI. + */ + barrier(); + WRITE_ONCE(pt->resume_allowed, 1); + /* Configuration is complete, it is now OK to handle an NMI */ + barrier(); + WRITE_ONCE(pt->handle_nmi, 1); + barrier(); + pt_config_start(event); + barrier(); + /* + * Allow pause after starting so its pt_config_stop() doesn't race with + * pt_config_start(). + */ + WRITE_ONCE(pt->pause_allowed, 1); +} + static void pt_config(struct perf_event *event) { struct pt *pt =3D this_cpu_ptr(&pt_ctx); @@ -541,23 +564,7 @@ static void pt_config(struct perf_event *event) =20 event->hw.aux_config =3D reg; =20 - /* - * Allow resume before starting so as not to overwrite a value set by a - * PMI. - */ - barrier(); - WRITE_ONCE(pt->resume_allowed, 1); - /* Configuration is complete, it is now OK to handle an NMI */ - barrier(); - WRITE_ONCE(pt->handle_nmi, 1); - barrier(); - pt_config_start(event); - barrier(); - /* - * Allow pause after starting so its pt_config_stop() doesn't race with - * pt_config_start(). - */ - WRITE_ONCE(pt->pause_allowed, 1); + pt_config_enable(event); } =20 static void pt_config_stop(struct perf_event *event)