From patchwork Thu Nov 24 09:43:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 25412 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3292258wrr; Thu, 24 Nov 2022 01:48:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf4RUYntQAE7lxAm7uFIwj+1uWIenMV9e0Tp+Lgkz62H8Ny+Zk8tZ8Z0I5yul9PFsnBtxZkY X-Received: by 2002:a17:906:2510:b0:78d:3be1:8d3d with SMTP id i16-20020a170906251000b0078d3be18d3dmr27148526ejb.304.1669283334327; Thu, 24 Nov 2022 01:48:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669283334; cv=none; d=google.com; s=arc-20160816; b=M4isbAoihrSMyY4Po3Xlo/ZtZUIu7Z/QllW9AMsjQES8eekc+4K8swJzqdzyel1w+8 jll0my5QfROtBtcGfR9zGnDXdbizOkSyGY0/cpSJmZYbTaaroNuQhAyDwhynNZwr2tlm pfm3yESzOi/YvcBjX8OvZVy/V6Tjfg2CogCS+gwLyy12Kx2SZGPXc1UUWiSXRAvfuD2j TLgUxt1AbKCjfNNl1e3LS1cs74IXcaTjYe9Sfdh7SJnhgG2sSu76K0MiN6j3Siq/S5QI 6HzmGlH1zoa9EEjP7dGLuHRYDARIdaiZs6g/bTDihjQlE5V1jVNePFNj2EeQ6lWm/EBb yF8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:cc:subject:to:reply-to:sender:from :dkim-signature:dkim-signature:date; bh=zith/c1gooq49wXBjsCVTEvk/wM7F85VYzolXP/wniw=; b=MKa3oOtx4JeNKh4Q776Q4ZBM4BFoeItD/RXF1iN7eUw1y+tMxnCe6FUeTRg91VpJvj 3mffH/Slickm45BgBBoMqf5MNZ/TVzE+LceE+s3FsX6n/jfcQKTEQCgi6T1aD8H5R4ws 9NRjIc/RHiAWosp537cAXNYy3FIB5Vhw9m+qUKrcWqWqiUyhKYRMigM5/nSwz5VuW09F qVEy/OcB22UQbAOCOqLpgUxtyhdrScKyokb2+wRjwY7nAZjkfDbpYwRgxTrjMEc8GTfq PnxBsDzjSTQ4QPzq00G1eaWVfPm9FYVSEe9s3+F3Xt4NchdiUDEcN/yCnWUPyxr0MQkj 787Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JQliAv7K; dkim=neutral (no key) header.i=@linutronix.de header.b="p/wPFPuF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs17-20020a170906dc9100b00780def41dc4si507073ejc.527.2022.11.24.01.48.30; Thu, 24 Nov 2022 01:48:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JQliAv7K; dkim=neutral (no key) header.i=@linutronix.de header.b="p/wPFPuF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbiKXJnU (ORCPT + 99 others); Thu, 24 Nov 2022 04:43:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbiKXJnM (ORCPT ); Thu, 24 Nov 2022 04:43:12 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50183D2DF9; Thu, 24 Nov 2022 01:43:06 -0800 (PST) Date: Thu, 24 Nov 2022 09:43:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669282985; 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; bh=zith/c1gooq49wXBjsCVTEvk/wM7F85VYzolXP/wniw=; b=JQliAv7K+a3B7CEqR4w6tsOhyXD+4ysfQUklbqzzrHaotdkNYOcZBmin43+EW2X+EVDDU5 hp62S/oI4xDJ3C/MfGC+2glPSO1WE1Lx7fuYAVxtN+a2mbP0jj9CJl6GPSB3cosxkMe/No xyJ/3VuQDG+U2da29csROVuomnArCCl0Bek7KF/xkOJ0idk65KRbAE3sBsNiZVbNCt0LfU katevl2o8KVoB1bnUCWLUJOrNYg5zgnclrgLhZivBV5Sb7anLtXg8ZL5wUmoZTK2VDdebB IPTE4UU10iWPBMX1J1/HhEHFulgksdORwZZx7sY1B0994pZf/v7CDy5NQMDM4g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669282985; 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; bh=zith/c1gooq49wXBjsCVTEvk/wM7F85VYzolXP/wniw=; b=p/wPFPuF+7dv27n5SNFE4nSYcR+9HVz9lZW9XRoqKdDe6iESKWDRLX6AMLRkhE403mNsVg s1nMxlyvrfB1K/DA== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf: Fixup SIGTRAP and sample_flags interaction Cc: "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <166928298371.4906.16784064084816616923.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750370441390883922?= X-GMAIL-MSGID: =?utf-8?q?1750370441390883922?= The following commit has been merged into the perf/urgent branch of tip: Commit-ID: af169b7759a9b9369b5106cd07a25c57ce60119e Gitweb: https://git.kernel.org/tip/af169b7759a9b9369b5106cd07a25c57ce60119e Author: Peter Zijlstra AuthorDate: Mon, 21 Nov 2022 15:57:44 +01:00 Committer: Peter Zijlstra CommitterDate: Thu, 24 Nov 2022 10:12:23 +01:00 perf: Fixup SIGTRAP and sample_flags interaction The perf_event_attr::sigtrap functionality relies on data->addr being set. However commit 7b0846301531 ("perf: Use sample_flags for addr") changed this to only initialize data->addr when not 0. Fixes: 7b0846301531 ("perf: Use sample_flags for addr") Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/Y3426b4OimE%2FI5po%40hirez.programming.kicks-ass.net --- kernel/events/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel/events/core.c b/kernel/events/core.c index 8848714..f2bb27e 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -9328,7 +9328,10 @@ static int __perf_event_overflow(struct perf_event *event, */ WARN_ON_ONCE(event->pending_sigtrap != pending_id); } - event->pending_addr = data->addr; + + event->pending_addr = 0; + if (data->sample_flags & PERF_SAMPLE_ADDR) + event->pending_addr = data->addr; irq_work_queue(&event->pending_irq); }