From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B23D6C433F5 for ; Fri, 29 Oct 2021 08:03:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9B05261151 for ; Fri, 29 Oct 2021 08:03:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232424AbhJ2IFh (ORCPT ); Fri, 29 Oct 2021 04:05:37 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:53172 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232335AbhJ2IF1 (ORCPT ); Fri, 29 Oct 2021 04:05:27 -0400 Date: Fri, 29 Oct 2021 08:02:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1635494578; 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: in-reply-to:in-reply-to:references:references; bh=uOhYdKz2vVjwIBSpqfY1BcJ5HUGjCIqOOchflR6n6Hk=; b=dsVMpCWTv0BCZFc16IC7gOREx3yn4TZedh7GrJjNOkf76JdMTVpNYljoNWHc3kRNcRnFRz 83nesiMw7Ji08MkMNFRkwomblQPRs3i6Yrp6ROaco95tFPfeLETPXqhrD5/+NpH5eWCc0u E7S+4RVhouS/OD28bvefK3Gkk3JywLZQNqiJWOsCMVB8Zl2PIOb3kDjGkb/YOzkc8rScwb 8YAXYmge8X1M4MZIN0nlblpKMyMQ/xupnfKOok6FdQ0EUXn1WR5w97R1P/4UuemTa5W3VG OI1+oTbpazDagPlxUxgh3iHP4j9wEF9uR7hRlE4K/89Y6EGgr4bQLobRJ7bxNA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1635494578; 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: in-reply-to:in-reply-to:references:references; bh=uOhYdKz2vVjwIBSpqfY1BcJ5HUGjCIqOOchflR6n6Hk=; b=QdnFfkcibYYtIaULh4lKRQtUnVadQmFbXgnEBT9k3OWXgTsZiqphubeoJJ8+aHS/xUpNPJ st2JjTVpL06h9kBA== 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: objtool/core] x86/alternative: Add debug prints to apply_retpolines() Cc: "Peter Zijlstra (Intel)" , Borislav Petkov , Josh Poimboeuf , Alexei Starovoitov , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20211026120310.422273830@infradead.org> References: <20211026120310.422273830@infradead.org> MIME-Version: 1.0 Message-ID: <163549457763.626.15865717578832539572.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the objtool/core branch of tip: Commit-ID: d4b5a5c993009ffeb5febe3b701da3faab6adb96 Gitweb: https://git.kernel.org/tip/d4b5a5c993009ffeb5febe3b701da3faab6adb96 Author: Peter Zijlstra AuthorDate: Tue, 26 Oct 2021 14:01:45 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 28 Oct 2021 23:25:28 +02:00 x86/alternative: Add debug prints to apply_retpolines() Make sure we can see the text changes when booting with 'debug-alternative'. Example output: [ ] SMP alternatives: retpoline at: __traceiter_initcall_level+0x1f/0x30 (ffffffff8100066f) len: 5 to: __x86_indirect_thunk_rax+0x0/0x20 [ ] SMP alternatives: ffffffff82603e58: [2:5) optimized NOPs: ff d0 0f 1f 00 [ ] SMP alternatives: ffffffff8100066f: orig: e8 cc 30 00 01 [ ] SMP alternatives: ffffffff8100066f: repl: ff d0 0f 1f 00 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Borislav Petkov Acked-by: Josh Poimboeuf Tested-by: Alexei Starovoitov Link: https://lore.kernel.org/r/20211026120310.422273830@infradead.org --- arch/x86/kernel/alternative.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index c89824c..23fb4d5 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -492,9 +492,15 @@ void __init_or_module noinline apply_retpolines(s32 *start, s32 *end) continue; } + DPRINTK("retpoline at: %pS (%px) len: %d to: %pS", + addr, addr, insn.length, + addr + insn.length + insn.immediate.value); + len = patch_retpoline(addr, &insn, bytes); if (len == insn.length) { optimize_nops(bytes, len); + DUMP_BYTES(((u8*)addr), len, "%px: orig: ", addr); + DUMP_BYTES(((u8*)bytes), len, "%px: repl: ", addr); text_poke_early(addr, bytes, len); } }