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 381AA1494D5; Thu, 13 Jun 2024 11:59:13 +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=1718279953; cv=none; b=BQDbQ4O+nOz6MauqtcYMOmknzoP3T0NWbCg2DCoDiBTEmb+99HTrdaelcm8ZkckKGLqaJ5a8Svxx+QdqKMbczhiZjg3lWVCyrI6pCwPBbCSKdXfeLpqtFyCeUJW0J1qsPJYXjHXwA0yse2a45G7S4FhuJmkPGXmwuBWwvy1TvOA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718279953; c=relaxed/simple; bh=KmbhwZEBbvkvMG9ALOMhRE92WgBBMCFGZv+F59wjbnE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rv8mxGHBI5RpLwsiIWx/9jtPmGrz12G64Im+U1XiAhOe5816/HdYIHCgKQfS65mQrfJeS/n/BvbmhNhPbJ/KZa1PPeP5eM58ZmLvTgpyg05a5lml+W0zVeBSsg7Y1EuVQSXKeXOT0sq9g/aPFRJ8fFrdJ/CDwTWaOxbyIB17PZg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=kBs1mwi1; 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="kBs1mwi1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B0218C4AF1D; Thu, 13 Jun 2024 11:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718279953; bh=KmbhwZEBbvkvMG9ALOMhRE92WgBBMCFGZv+F59wjbnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kBs1mwi1Gvmif80v63yHPheAQKCtdn0SO668BAq0yF0qnE5IO2NoEni2xqEjXYDLb z8ptkWUqNG4+XeFh6J7CF8LnH4TFi8ErlZM9EGFF2oTkQGge0U4j+xm+fBXErxoocA Fh0Qo7HN916QBCqEUAhUxMl9hn7pniiHOMyGIpHo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Geert Uytterhoeven , John Paul Adrian Glaubitz , Sasha Levin Subject: [PATCH 5.4 051/202] sh: kprobes: Merge arch_copy_kprobe() into arch_prepare_kprobe() Date: Thu, 13 Jun 2024 13:32:29 +0200 Message-ID: <20240613113229.744095472@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240613113227.759341286@linuxfoundation.org> References: <20240613113227.759341286@linuxfoundation.org> User-Agent: quilt/0.67 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 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Geert Uytterhoeven [ Upstream commit 1422ae080b66134fe192082d9b721ab7bd93fcc5 ] arch/sh/kernel/kprobes.c:52:16: warning: no previous prototype for 'arch_copy_kprobe' [-Wmissing-prototypes] Although SH kprobes support was only merged in v2.6.28, it missed the earlier removal of the arch_copy_kprobe() callback in v2.6.15. Based on the powerpc part of commit 49a2a1b83ba6fa40 ("[PATCH] kprobes: changed from using spinlock to mutex"). Fixes: d39f5450146ff39f ("sh: Add kprobes support.") Signed-off-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz Link: https://lore.kernel.org/r/717d47a19689cc944fae6e981a1ad7cae1642c89.1709326528.git.geert+renesas@glider.be Signed-off-by: John Paul Adrian Glaubitz Signed-off-by: Sasha Levin --- arch/sh/kernel/kprobes.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/sh/kernel/kprobes.c b/arch/sh/kernel/kprobes.c index 318296f48f1ac..75f51bc2d801e 100644 --- a/arch/sh/kernel/kprobes.c +++ b/arch/sh/kernel/kprobes.c @@ -44,17 +44,12 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) if (OPCODE_RTE(opcode)) return -EFAULT; /* Bad breakpoint */ + memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); p->opcode = opcode; return 0; } -void __kprobes arch_copy_kprobe(struct kprobe *p) -{ - memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); - p->opcode = *p->addr; -} - void __kprobes arch_arm_kprobe(struct kprobe *p) { *p->addr = BREAKPOINT_INSTRUCTION; -- 2.43.0