Message ID | 20221209105247.01d4e51d@gandalf.local.home |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp852998wrr; Fri, 9 Dec 2022 07:55:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf6E3jYR4+y7RJY0BVYigSrtsuIz8z3eJRCMXZDcKOr0MGPt2ubzxeAEMaB+SegnMUYjFRj0 X-Received: by 2002:a17:90a:5d13:b0:218:cda8:f2f with SMTP id s19-20020a17090a5d1300b00218cda80f2fmr6467949pji.10.1670601318053; Fri, 09 Dec 2022 07:55:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670601318; cv=none; d=google.com; s=arc-20160816; b=iVzMOeV+9X24O4E07mVSs6VVGlmy0fBUY+bFWkUk7SGmwBi7GxbaJCrXml7bimoDP1 IzS2eFW+0rPbe/2aXg1+dBhNe+jFJgnL/YHooKsT9sJq1bVXYOYVDKb6QJARQvGYgfWf VcaCqJYzKpg78BPGUZgHkCtlNnVPjRHeZ+vssnmoJbguCz5I7p8ArWKDEztENqwIfsUh bm0fUcOLdblsiLY7/7HkXdIXDodQ37Qw8SnX0ksQ5bAD+o5RYWQUJLNbHASO+ejpCww/ MlZHip4sxvq7TqgH+NLr7+9qK98V69+/Ob14wQ3nj8UdifneGVj+CEAPCloSQCmSDsxL vc+w== 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 :message-id:subject:cc:to:from:date; bh=ziUIrC8JvLVrIWyo8yhblSqfUMBdJUj4HJnpsnu0UGk=; b=oQthJEHQNoHzgXnQCnBIHEzHVk8YPI5XHdwzsQY9f5RfyJUWF0dINtGp+bP2Mfmuum FpzdEHD2b9yAIfKJlYQEbZERgEMnbm6ALrzj2PfjZxD3uNtSrjDHpiRiyMjqcrEGaHL9 GOttPGX3Gwz/OZpHkGEhVPDkybxLOvmKt2iJGtc5CmBn+/OmiL5jMqZM2wiBpk6ci55n bJk3DwUNKTzpOdN5brf2ii5uZsyyWxIBB/XxF2QExBZXhR801xbFuE31Lvj8ldz6e4rT e84/Iuu+j8FgnMQM78a+szLsBq6MPLolw9Ek1HimwjQyhbI4eztgqTrqNkeiXKbB1O9Y tkzw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o8-20020a17090ac70800b00213054baa79si10093371pjt.0.2022.12.09.07.55.03; Fri, 09 Dec 2022 07:55:18 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230406AbiLIPxI (ORCPT <rfc822;sophiezhao968@gmail.com> + 99 others); Fri, 9 Dec 2022 10:53:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230389AbiLIPxB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 9 Dec 2022 10:53:01 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD65822BFD; Fri, 9 Dec 2022 07:52:50 -0800 (PST) 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 769A862292; Fri, 9 Dec 2022 15:52:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7550C433F0; Fri, 9 Dec 2022 15:52:48 +0000 (UTC) Date: Fri, 9 Dec 2022 10:52:47 -0500 From: Steven Rostedt <rostedt@goodmis.org> To: LKML <linux-kernel@vger.kernel.org>, Linux Trace Kernel <linux-trace-kernel@vger.kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Peter Zijlstra <peterz@infradead.org>, Thomas Gleixner <tglx@linutronix.de>, "x86@kernel.org" <x86@kernel.org>, Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@kernel.org> Subject: [PATCH] ftrace/x86: Add back ftrace_expected for ftrace bug reports Message-ID: <20221209105247.01d4e51d@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751752447945418606?= X-GMAIL-MSGID: =?utf-8?q?1751752447945418606?= |
Series |
ftrace/x86: Add back ftrace_expected for ftrace bug reports
|
|
Commit Message
Steven Rostedt
Dec. 9, 2022, 3:52 p.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org> After someone reported a bug report with a failed modification due to the expected value not matching what was found, it came to my attention that the ftrace_expected is no longer set when that happens. This makes for debugging the issue a bit more difficult. Set ftrace_expected to the expected code before calling ftrace_bug, so that it shows what was expected and why it failed. Link: https://lore.kernel.org/all/CA+wXwBQ-VhK+hpBtYtyZP-NiX4g8fqRRWithFOHQW-0coQ3vLg@mail.gmail.com/ Cc: stable@vger.kernel.org Fixes: 768ae4406a5c ("x86/ftrace: Use text_poke()") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> --- arch/x86/kernel/ftrace.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index bd165004776d..e07234ec7e23 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c @@ -217,7 +217,9 @@ void ftrace_replace_code(int enable) ret = ftrace_verify_code(rec->ip, old); if (ret) { + ftrace_expected = old; ftrace_bug(ret, rec); + ftrace_expected = NULL; return; } }