Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3121776rwb; Mon, 15 Aug 2022 18:39:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR60jzKBhm4puy2Kw5UyHezeHrkQsTNuYKdiIlUG/WOFG90TwTD+VXYgxY0MpRmK/43oF1Ma X-Received: by 2002:a17:90b:4c4b:b0:1f4:d176:aa5a with SMTP id np11-20020a17090b4c4b00b001f4d176aa5amr21051800pjb.233.1660613972829; Mon, 15 Aug 2022 18:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613972; cv=none; d=google.com; s=arc-20160816; b=tqc6S1bqVqpBoRtQjex7GRWMVSvgQR5J/wT/vqRvL1LVw5IlLSAiVKM5Q/L0tYhDYf 8lqtr/rcqCrjgV/Q/CUWIZrKAuY1OCFQYOuLATwOV4IWMgZac0ZrBJumdjifyfT4o235 JSHTLw+zFe0skJcmaIVKz3lcZkR9on5jMl8kyPJwo2rk8Ozei9+tTzTpBbaWC3aNETzI jF8gYgYM6amuXHOTtnmg7viicVJEN6POBmHKSY5FJaVXWhsgknf2kRQ29R8ifxSelFrO 9aSSSLNmtEdBvf1fN9vICECNwvl/WmQRVHqOge1cilkD98KJqbPd0gs9YDYKAqZ9fJyS r0+A== 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=YhoHoK61xlK3Av0UE+UwWAhxtuQ3TYgvqglZanzQbd4=; b=KlTeicXKIV+rUz7vur8hb6gO8t3ffOllEGxyk/p45NDh9mJ+JlqEJI3/2EX2r3Mrnl 7fWL2I58IdN54BfQjZUFXcOv6nF1ZSo1stCbwzGrP1kX/JWvEocIQEoMVvOFtpbxZ9Wk iHvzgwPo9JxS65MZl404ENdvQe+e8vjbpcQj5XcpRoTT/vcWrYe9Rxzveybnmh5DLBM/ pZGwHzntEcAmKnXeFUEyi0l+Pilo3Z99Awa1gBgEMa/W6BUnMJdcBxtDgLJQKAR0VNKQ hBKDeIaaaU08jJfaZ3yhdZY94/MOLEvZAKlyJT+xpr0Flq/ZalrL05k0ZB97UIi+KXEJ SQzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fRtG0vYR; 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 b3-20020a170903228300b001708e1bb3b8si13234874plh.335.2022.08.15.18.39.22; Mon, 15 Aug 2022 18:39:32 -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=fRtG0vYR; 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 S1348048AbiHPA53 (ORCPT + 99 others); Mon, 15 Aug 2022 20:57:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347638AbiHPAvw (ORCPT ); Mon, 15 Aug 2022 20:51:52 -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 C6FC119B70D; Mon, 15 Aug 2022 13:47:24 -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 BB01461274; Mon, 15 Aug 2022 20:47:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB32FC433C1; Mon, 15 Aug 2022 20:47:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596443; bh=7X7MmrZ08bBgdzIW1Zl5Wy+KfjZsXVE18OZDafYU/S0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fRtG0vYRwV++xlHaL8VW0UIoeKVxBQ83ByA6/bZiIhdatu6PGUs2n7m34BbHLMJZ3 gl5R3QK8XdQjMrIXTEyMKbFPzW4VXymKxcGxNLkOTEq8yFKObLNeTDcEQnxYG3gRnJ UUjgj5ZsXQ9ZKncbl16i4e35RFEZHNMYwni7tK5Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "x86@kernel.org" , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andrew Morton , "Steven Rostedt (Google)" Subject: [PATCH 5.19 1047/1157] ftrace/x86: Add back ftrace_expected assignment Date: Mon, 15 Aug 2022 20:06:43 +0200 Message-Id: <20220815180521.924584593@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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.1 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,T_SCC_BODY_TEXT_LINE 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: Steven Rostedt (Google) commit ac6c1b2ca77e722a1e5d651f12f437f2f237e658 upstream. When a ftrace_bug happens (where ftrace fails to modify a location) it is helpful to have what was at that location as well as what was expected to be there. But with the conversion to text_poke() the variable that assigns the expected for debugging was dropped. Unfortunately, I noticed this when I needed it. Add it back. Link: https://lkml.kernel.org/r/20220726101851.069d2e70@gandalf.local.home Cc: "x86@kernel.org" Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Andrew Morton Cc: stable@vger.kernel.org Fixes: 768ae4406a5c ("x86/ftrace: Use text_poke()") Signed-off-by: Steven Rostedt (Google) Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/ftrace.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c @@ -91,6 +91,7 @@ static int ftrace_verify_code(unsigned l /* Make sure it is what we expect it to be */ if (memcmp(cur_code, old_code, MCOUNT_INSN_SIZE) != 0) { + ftrace_expected = old_code; WARN_ON(1); return -EINVAL; }