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 EB28B38FA3; Fri, 9 Jan 2026 12:27:28 +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=1767961649; cv=none; b=T+hDimfGPu1/NnQBI5oX3PCGUp451osCJt9faFzVqmVlaGZWFTbbVLNzf0OyBNfhXqYUtI0khqLQmAQs2R9lW1Fz3pvOjzoUR+6X4SPGztJWoRoGCVN6zDMOJTe2tjFAoFNNjeS4VZN/MxClDCbL6bzGAk0Tiv5shJggE8Sg3IE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767961649; c=relaxed/simple; bh=Ae+H6bVkc/W0tdQX1Qk0ajwL77kcYrTqx1W4z3R5Eik=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=crzzPd24lUy/DgmsBYtpjgx3bO7xV+A6Hpu8g/D/dVEqMyTzxWAgtrTfLWkBRUTOWzJBQoptfBeNQgK/PEwzHJEPliXdy0xDgA9jsFE/4rlOmZNe8v/4fYZ8+q7fjVqo2w2WurhLl+s6aIkqD/kVC0eOwOoJ1XDrEOc6UqEdTEo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=r6X7bq3z; 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="r6X7bq3z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 770E1C19421; Fri, 9 Jan 2026 12:27:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767961648; bh=Ae+H6bVkc/W0tdQX1Qk0ajwL77kcYrTqx1W4z3R5Eik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r6X7bq3ztFH+ZKi+cXQqBbFmZi1elk/NXOOvxcTUJI9znStbm02FLSR8huj4HbyH8 gfPVL78YbDMY3WGMPPD8ytHTxbHFRBVZ+NjrklxTH8t16g9VZepmCVN1AYouFqYKrM W+MO9tBnKR5EK2kqnoxnlIamtmNX1bHKpFFsiYAE= 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.1 087/634] perf/x86/intel: Correct large PEBS flag check Date: Fri, 9 Jan 2026 12:36:05 +0100 Message-ID: <20260109112120.709777989@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112117.407257400@linuxfoundation.org> References: <20260109112117.407257400@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 2cb5b1f715b62..b1bc81bef4083 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -3779,7 +3779,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