From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 C505034E74D; Tue, 16 Dec 2025 11:46:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765885599; cv=none; b=hkan/AIPycs47hO/C1IsIT9W2PT4iZIeNJnsfkBzWqDl+WwkCYSxvOyZk2SrB4CwX2dT3ojBrDTUgkiV1YCZJFHTRkYIN4vtKg8Uv1Px7Hqyb5YqeTUDbN9Ypr0abQKMR/mMjYmt62f9AYT/hIDpftNv73Kj0SV/jfgyrq/eC9o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765885599; c=relaxed/simple; bh=3lhOmgW5VDUijR1psTpGI5O5xC3xULAH36/6BWuAFS4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eMI5l+7ij7oTd4YNVzzAmyDdBS0SoKXRil6N9y1R98zgGgjx8mgAQvyux0LigoNh8NPpk7mRvw7Rh2Y71/T5jrFsGxMhDPdx9DXZuY+T/KALsklfMciAz11NjM690LsLbzkKVLgdUvTv+4eTredfaWTvFMRKYLnOPcrRvogaf1E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ErJLxMu5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ErJLxMu5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E0C6C4CEF1; Tue, 16 Dec 2025 11:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765885599; bh=3lhOmgW5VDUijR1psTpGI5O5xC3xULAH36/6BWuAFS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ErJLxMu5RoQLA0IvKQA7VyJOmdhXHYF30DCJTZ3IpfQb+4FMTpsfPQy35MdIihtPR h1fxQXPJcArvVjUwnTCEP05RhhDI2zLpdT2rc1//HXHyzxQHZfbiDa6k6pWep2Ey48 fngMOSyfJr0tmOAI0hsNWNXhCNkrKU8+d+tTk5xA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dapeng Mi , "Peter Zijlstra (Intel)" , Sasha Levin Subject: [PATCH 6.17 188/507] perf/x86/intel: Correct large PEBS flag check Date: Tue, 16 Dec 2025 12:10:29 +0100 Message-ID: <20251216111352.323441548@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251216111345.522190956@linuxfoundation.org> References: <20251216111345.522190956@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.17-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dapeng Mi [ Upstream commit 5e4e355ae7cdeb0fef5dbe908866e1f895abfacc ] current large PEBS flag check only checks if sample_regs_user contains unsupported GPRs but doesn't check if sample_regs_intr contains unsupported GPRs. Of course, currently PEBS HW supports to sample all perf supported GPRs, the missed check doesn't cause real issue. But it won't be true any more after the subsequent patches support to sample SSP register. SSP sampling is not supported by adaptive PEBS HW and it would be supported until arch-PEBS HW. So correct this issue. Fixes: a47ba4d77e12 ("perf/x86: Enable free running PEBS for REGS_USER/INTR") Signed-off-by: Dapeng Mi Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20251029102136.61364-5-dapeng1.mi@linux.intel.com Signed-off-by: Sasha Levin --- arch/x86/events/intel/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index 046d12281fd94..52270268144c2 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -4029,7 +4029,9 @@ static unsigned long intel_pmu_large_pebs_flags(struct perf_event *event) if (!event->attr.exclude_kernel) flags &= ~PERF_SAMPLE_REGS_USER; if (event->attr.sample_regs_user & ~PEBS_GP_REGS) - flags &= ~(PERF_SAMPLE_REGS_USER | PERF_SAMPLE_REGS_INTR); + flags &= ~PERF_SAMPLE_REGS_USER; + if (event->attr.sample_regs_intr & ~PEBS_GP_REGS) + flags &= ~PERF_SAMPLE_REGS_INTR; return flags; } -- 2.51.0