Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp801963rwb; Mon, 26 Sep 2022 06:08:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BFupNDObm5K9/oj08+bdiNwdE6EQLk/DAbmHG1nZNu/ClcJ3aO7JKTppzqkLi2Rshvnp+ X-Received: by 2002:a17:907:2bd8:b0:770:77f2:b7af with SMTP id gv24-20020a1709072bd800b0077077f2b7afmr18025521ejc.545.1664197697297; Mon, 26 Sep 2022 06:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664197697; cv=none; d=google.com; s=arc-20160816; b=RdAKGS+3kT/qoMquUt0nNL5B7mQcEEFY64jWgi+A3su9SSKiwzr9neAjkA8TjHJaBK 7d+qc8vlBkDmIu2eZtMaapK8BIdPsua7OyjsBI9NjSJzNPqyVTK5HQJh4ULx/tqXkDvK W1N6hkt/gHq3nxMmkwqSml0XVpUMQ85V2qFnRHDaHthoc/t/8GjOZxubzhKImVy4nQiQ MX+lo6yt6OByidd7lcnk5REfnuZxBuyIJrbddBCRjJp4FSyodcjdNw9LFfhoTYQm/+bK 0TMjo0/sCPsjxTl18Iki+SRhoDWf1wNbfGaljIAUmGJU0EI3vcDQlT36bJgLR/ecxzqN yV9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LYMnsNx9Kzuo4kojDasIEdD9/YQp4qyeZnOKB5NZ5vg=; b=WDBFKwGgEg7nfnWeTTLJl95efZRb4NuwyxVB2Sb2MqAUvV4Ax1Q0Pv+pIhekICXHxW w3zAv1JiwxYbMByE6OvP08R2q3n7vCKp6/o/Xr4fJyFuqYmr7xw8IlFxnDQulelTHD6Y W/J6R+2mi2/dH4PQ/SX7mq3x70p4epyPu6lvnp3oWEKeLbRTzfjMx4tnNbjgux3OfAGX WU6Y3nsPcyrX4WwIkH/VS+CSb300dGBoV/QKcK1wwwg5KzfMufVpwB8A8fhWzugpy3sB 0zOJ6mmlS3Op+ESNM5k0BZjFXT8Dy+H3dX5/GG92c6evEmJ9l/ndy8S2aTsp3+HY5f85 XzUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=L1Wqblb9; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y12-20020a50bb0c000000b00445f85b00f3si14280768ede.299.2022.09.26.06.07.27; Mon, 26 Sep 2022 06:08:17 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=L1Wqblb9; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235929AbiIZKf3 (ORCPT + 99 others); Mon, 26 Sep 2022 06:35:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235872AbiIZKdV (ORCPT ); Mon, 26 Sep 2022 06:33:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE56B4F65C; Mon, 26 Sep 2022 03:20:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 03A8B60BB7; Mon, 26 Sep 2022 10:20:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13308C433D6; Mon, 26 Sep 2022 10:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664187630; bh=gQ1s/FiAXl9iYKZ/lkQN032VXwbMRyy9gtt37y6HU2o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L1Wqblb9M/ciyV63zNORM0YpJmkyBaSRx8Wrqi23qwCpID2bZg5awIzFw8MsLeyN8 NXPaHEyEHCyMvOzhRCvwMDtdeBKiDADTjODl4nLwa8Yb8LjPc5+xfDkl7PabP0fCIt 6vRjubJjOn5boSaKInHCthb15D+l7j4ZwJlG7CAc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yipeng Zou , "Steven Rostedt (Google)" , Sasha Levin Subject: [PATCH 5.4 011/120] tracing: hold caller_addr to hardirq_{enable,disable}_ip Date: Mon, 26 Sep 2022 12:10:44 +0200 Message-Id: <20220926100750.981656855@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100750.519221159@linuxfoundation.org> References: <20220926100750.519221159@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Yipeng Zou [ Upstream commit 54c3931957f6a6194d5972eccc36d052964b2abe ] Currently, The arguments passing to lockdep_hardirqs_{on,off} was fixed in CALLER_ADDR0. The function trace_hardirqs_on_caller should have been intended to use caller_addr to represent the address that caller wants to be traced. For example, lockdep log in riscv showing the last {enabled,disabled} at __trace_hardirqs_{on,off} all the time(if called by): [ 57.853175] hardirqs last enabled at (2519): __trace_hardirqs_on+0xc/0x14 [ 57.853848] hardirqs last disabled at (2520): __trace_hardirqs_off+0xc/0x14 After use trace_hardirqs_xx_caller, we can get more effective information: [ 53.781428] hardirqs last enabled at (2595): restore_all+0xe/0x66 [ 53.782185] hardirqs last disabled at (2596): ret_from_exception+0xa/0x10 Link: https://lkml.kernel.org/r/20220901104515.135162-2-zouyipeng@huawei.com Cc: stable@vger.kernel.org Fixes: c3bc8fd637a96 ("tracing: Centralize preemptirq tracepoints and unify their usage") Signed-off-by: Yipeng Zou Signed-off-by: Steven Rostedt (Google) Signed-off-by: Sasha Levin --- kernel/trace/trace_preemptirq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_preemptirq.c b/kernel/trace/trace_preemptirq.c index 26b06b09c9f6..e9645f829b94 100644 --- a/kernel/trace/trace_preemptirq.c +++ b/kernel/trace/trace_preemptirq.c @@ -56,14 +56,14 @@ __visible void trace_hardirqs_on_caller(unsigned long caller_addr) this_cpu_write(tracing_irq_cpu, 0); } - lockdep_hardirqs_on(CALLER_ADDR0); + lockdep_hardirqs_on(caller_addr); } EXPORT_SYMBOL(trace_hardirqs_on_caller); NOKPROBE_SYMBOL(trace_hardirqs_on_caller); __visible void trace_hardirqs_off_caller(unsigned long caller_addr) { - lockdep_hardirqs_off(CALLER_ADDR0); + lockdep_hardirqs_off(caller_addr); if (!this_cpu_read(tracing_irq_cpu)) { this_cpu_write(tracing_irq_cpu, 1); -- 2.35.1