Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4699889imw; Tue, 12 Jul 2022 12:40:20 -0700 (PDT) X-Google-Smtp-Source: AGRyM1smySF+koBOYZQSfV3zODGMMQelvUvP37KxzNzDCLndRutaboPQbWsycwzK8frJNeypSLFC X-Received: by 2002:a63:5a49:0:b0:40d:e7a0:3cb with SMTP id k9-20020a635a49000000b0040de7a003cbmr21541179pgm.69.1657654819987; Tue, 12 Jul 2022 12:40:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657654819; cv=none; d=google.com; s=arc-20160816; b=qxDJbhU2JNduVrtMXpmXomBwFoz3abnwSmzBHCgfdcdmJnrOjoh1229o4yVj5ElQ7o dafzUOnyhwKo6v/tx2RqNXNaN/IOVe+t5ZbNiLvSCX2Aky5F/Y7QzOgZq77xTkwvF6JC dgTWTw5/1qMqzhGvu91KFOUPxckztdt7W3svZ/Q20yUxv8i7293cXLcx9mgEG3UP1iOo Wov6JEiqmd7M22SS14n4S+uZLFkJIG4X/hPzT786mYbJhQBFfKaplokLq0+PcBy4oNbR OwPNMz1H5wL4lwUcChbyY3C3KBaj3bjFqtWY0Xl2ChzxW84fpkoGyJ0l4T7aJacWxqx0 3N9A== 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=vTnAkU1yNlyflsJ788xNejDBnOpZ4XxYwoefFbDEzIA7CBr35f30VVIRdqD6f8bYZm GizVH8sp3q1VXuNsr4OTYohfcWgAUu4MfVBTG+eiYCfvk/79Qi15tWItyMSls+V532nR 7AS4dO55XYLO7FKMQ3W66MTz8aGakAAxAjDjAZxvc6qCxDvNLZXXH2siqa2lymqkhLRP gx1oKAEo2ZWMo0elIwZF4IrLxmyhnEfY8Q3Uq08fEa8cDPPVU7lt8U1TV6e3e7wE87cl 6bWov7pqYDu/9k5mxVFt+a84xU9BZJT/6twQh710K+T+9NcLfaleJXysNYRhsIVgcW76 icjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RTGtjR59; 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 q22-20020aa79836000000b0051a1c743627si16081552pfl.35.2022.07.12.12.40.07; Tue, 12 Jul 2022 12:40:19 -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=RTGtjR59; 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 S234403AbiGLSr0 (ORCPT + 99 others); Tue, 12 Jul 2022 14:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234344AbiGLSq5 (ORCPT ); Tue, 12 Jul 2022 14:46:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE512DD214; Tue, 12 Jul 2022 11:43:02 -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 ams.source.kernel.org (Postfix) with ESMTPS id 57CDAB81BBC; Tue, 12 Jul 2022 18:42:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A721EC3411C; Tue, 12 Jul 2022 18:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657651376; bh=Z9v+W6Ypo/TtsuKDyVQ7GeOlltbq63xMAp1hYKg1CZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RTGtjR59M0s9jmnQgeoTQUBW0ZwGrTqGh05u9XvhDl9gmWBJM5eVG5X9xAEK0csNS vWeluzxw0VqW+Lo0pR56Je+d9zqS85hH4TlH+oTyKu2CEl8YfpaLRescxhlKZ8d8KA o45BfGdr8KTfY+HOgglZcml8jaoIkLWegB3p8OZU= 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/130] x86/alternative: Add debug prints to apply_retpolines() Date: Tue, 12 Jul 2022 20:38:24 +0200 Message-Id: <20220712183249.131952817@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220712183246.394947160@linuxfoundation.org> References: <20220712183246.394947160@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.7 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: 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); } }