Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1370186imi; Sat, 23 Jul 2022 03:57:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sw1IocqSrddVQhy0TpTnqs+0DDiFIFeCAJIkXjNWiUu/bgP7kWZyxhf6yMfkyK5mwUUb97 X-Received: by 2002:a17:907:3e07:b0:72e:e1e2:1415 with SMTP id hp7-20020a1709073e0700b0072ee1e21415mr3115102ejc.596.1658573859628; Sat, 23 Jul 2022 03:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658573859; cv=none; d=google.com; s=arc-20160816; b=otUs/N0jGehtjcv9vX1oEKYV3y0AFeqeB10ZSBmoveEFM4aklelTqsAm9sttCF2owv eFhh00Ut0iWJiN4MeLkzq1RJHQ1eRkZQCaQaDyiQQGE8nqfZVNZIxJ6Pkh84vFS2INg9 2krkTP2wnr4jqVP9DvVAtuJAf+tIY7ACW67CqnypOLSHfRpqvryzzJM45SCmIIDIHQIe yxBP/8sB1LIHlJ5K3R8yQO1/YHwkxWJk9KGeN4G6pxGPGPppPfPOJQBrQymwYJokY0I/ Nq3Ckgd+b5rYgmys6rS3knSGrL22znh8pIWKtV7rs46RUHNSlp1s/IpXj4lAILUBrPwx 0uQw== 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=7/3JGLoD62D89eIgCv9kzfKFLr1WBpeg6F6BzT7LokA=; b=S4QIlbBHndVxBeSYh1KOsbs5BXYTINQfjGhGyZmqFMo1RUV8I9AFAvyJs6QVC4MpSg C+nokpQO7e/r2Ygj5c09hjjTNjeivJQU3LkvXrff9H9x3xRoV7DfIM+35KaA7d1q7xqZ hXZ7n0je3lefzuW7KgQj4WZxQdd9++XGmUxjH4TG6xTGBarMh+loryHZDJpXSF74zU4e su6jOm3QzhUc9tmvH3MvChng131+d61QJiF+jinCDZ49zJuh7kNntttDSh1BZ6OuSaAq zm1rxRHS+iJE7brL4nXVSFbb2obUET5Mw2/DzbNxhvAlrHGRy8HsoJ7nmZ3TMH3g6V1r LomA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B13Slh3M; 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 hp33-20020a1709073e2100b0072b870ca25esi5647034ejc.996.2022.07.23.03.57.14; Sat, 23 Jul 2022 03:57:39 -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=B13Slh3M; 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 S238083AbiGWKCl (ORCPT + 99 others); Sat, 23 Jul 2022 06:02:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237723AbiGWKCP (ORCPT ); Sat, 23 Jul 2022 06:02:15 -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 7288A66AE5; Sat, 23 Jul 2022 02:58:57 -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 65737611BD; Sat, 23 Jul 2022 09:58:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A2E6C341C0; Sat, 23 Jul 2022 09:58:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658570326; bh=Z9v+W6Ypo/TtsuKDyVQ7GeOlltbq63xMAp1hYKg1CZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B13Slh3MIH/hbHJG/7JBDCPR8FKD1HhpfF1Z0JaNOl3/t3LDXfvqioPcwOjbQvoPc nfbHoiivnlcuo+l+p3YcNkYICY5JhxgFgzH/z8DhmAAXhMgip0j3gp7MUiUBFRr/Gb 1oh3gdkT+OcdG8M4dRxxNLti4jHqcWbsRDjio1XA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Borislav Petkov , Josh Poimboeuf , Alexei Starovoitov , Thadeu Lima de Souza Cascardo , Ben Hutchings Subject: [PATCH 5.10 058/148] x86/alternative: Add debug prints to apply_retpolines() Date: Sat, 23 Jul 2022 11:54:30 +0200 Message-Id: <20220723095240.500142143@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220723095224.302504400@linuxfoundation.org> References: <20220723095224.302504400@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 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: Peter Zijlstra commit d4b5a5c993009ffeb5febe3b701da3faab6adb96 upstream. 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 Signed-off-by: Thadeu Lima de Souza Cascardo Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/alternative.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -647,9 +647,15 @@ void __init_or_module noinline apply_ret 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); } }