Received: by 10.223.176.46 with SMTP id f43csp811305wra; Fri, 26 Jan 2018 07:17:46 -0800 (PST) X-Google-Smtp-Source: AH8x224jEuNFpRymSJD3+i3tbbJqSmbjw6ynLSbRajSRpSboFx1Z+PSxwVpVkTG0R1l+onXh4Qjc X-Received: by 10.98.141.25 with SMTP id z25mr19337207pfd.165.1516979866846; Fri, 26 Jan 2018 07:17:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516979866; cv=none; d=google.com; s=arc-20160816; b=ZTtyGkqdvmbtretkr1Y/JlPlMXVEEyX7tYBgS4qhPFQclHf9l+RBn0ZRa6pSm4pCVE gfDnAcZ7Cyuh1Vjg5br2FlQHF/VqXkUZP1S8SgTtuokWFDivPDSQJZgH0fZne7m4k9x8 3Uj3LZfqkfnUaq3ZuVqnKOn94xSZwm1f2c1xW0JZUdTgIbQ1GNG9DLgC6eq73alurKGA XM1zmTULfu44OkHAw+/uEk76genPUhc4SFmkhum3eFVGWDbJH0nalbrwSwQCiiyFXWpm wNwLW30EoR/GNxVd86sXqeH1qKKnRBCF2xnDhT5OCwhlCyhfSlG5FW9Eqiu/oEvYqHpo 7I+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=WIxBlcZSMyoOUP/bje+mjen6OKQtJDt742yVvKuUkuA=; b=zJzmEPsF/8wkAmfLVCtIf/g83rsgaSPqhUrw0pIwDZxEa3hPmMueYL/6mxp8D0zqcf nrunJis6wbNUXK5E6ca8JtSATuWqQrcDLhAnTXIw78+ADuArJCfH6X2SNENP1lzzVkgl otj4y7/f6FWYeVcOyiQ4M8dO4LNPsrgFGWxRoyiT1L2eGd4Nw8l16NrRb7mPRXKwMF8t Oox6ZBparVOgIFMQXslaCHgTrF84imjEL3myBfox2tVKkp8SjMX9mP1gmjyxwZDGzEYd QFF5+HpFNdsirhd4OXMA7jYFLYVpQQzPJjkVq8TyphRnHZ1rOyf1xXwwv00SnYsP3snw /oIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x81si6492603pfe.361.2018.01.26.07.17.31; Fri, 26 Jan 2018 07:17:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753511AbeAZPMi (ORCPT + 99 others); Fri, 26 Jan 2018 10:12:38 -0500 Received: from terminus.zytor.com ([65.50.211.136]:39825 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752916AbeAZPMh (ORCPT ); Fri, 26 Jan 2018 10:12:37 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w0QF2id0031783; Fri, 26 Jan 2018 07:02:44 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w0QF2hXE031778; Fri, 26 Jan 2018 07:02:43 -0800 Date: Fri, 26 Jan 2018 07:02:43 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Borislav Petkov Message-ID: Cc: bp@suse.de, dwmw2@infradead.org, mingo@kernel.org, tglx@linutronix.de, jpoimboe@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com Reply-To: linux-kernel@vger.kernel.org, hpa@zytor.com, jpoimboe@redhat.com, mingo@kernel.org, bp@suse.de, dwmw2@infradead.org, tglx@linutronix.de In-Reply-To: <20180126121139.31959-2-bp@alien8.de> References: <20180126121139.31959-2-bp@alien8.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/alternative: Print unadorned pointers Git-Commit-ID: 0e6c16c652cadaffd25a6bb326ec10da5bcec6b4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 0e6c16c652cadaffd25a6bb326ec10da5bcec6b4 Gitweb: https://git.kernel.org/tip/0e6c16c652cadaffd25a6bb326ec10da5bcec6b4 Author: Borislav Petkov AuthorDate: Fri, 26 Jan 2018 13:11:36 +0100 Committer: Thomas Gleixner CommitDate: Fri, 26 Jan 2018 15:53:19 +0100 x86/alternative: Print unadorned pointers After commit ad67b74d2469 ("printk: hash addresses printed with %p") pointers are being hashed when printed. However, this makes the alternative debug output completely useless. Switch to %px in order to see the unadorned kernel pointers. Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Cc: riel@redhat.com Cc: ak@linux.intel.com Cc: peterz@infradead.org Cc: David Woodhouse Cc: jikos@kernel.org Cc: luto@amacapital.net Cc: dave.hansen@intel.com Cc: torvalds@linux-foundation.org Cc: keescook@google.com Cc: Josh Poimboeuf Cc: tim.c.chen@linux.intel.com Cc: gregkh@linux-foundation.org Cc: pjt@google.com Link: https://lkml.kernel.org/r/20180126121139.31959-2-bp@alien8.de --- arch/x86/kernel/alternative.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index e0b97e4..14a52c7 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -298,7 +298,7 @@ recompute_jump(struct alt_instr *a, u8 *orig_insn, u8 *repl_insn, u8 *insnbuf) tgt_rip = next_rip + o_dspl; n_dspl = tgt_rip - orig_insn; - DPRINTK("target RIP: %p, new_displ: 0x%x", tgt_rip, n_dspl); + DPRINTK("target RIP: %px, new_displ: 0x%x", tgt_rip, n_dspl); if (tgt_rip - orig_insn >= 0) { if (n_dspl - 2 <= 127) @@ -355,7 +355,7 @@ static void __init_or_module noinline optimize_nops(struct alt_instr *a, u8 *ins add_nops(instr + (a->instrlen - a->padlen), a->padlen); local_irq_restore(flags); - DUMP_BYTES(instr, a->instrlen, "%p: [%d:%d) optimized NOPs: ", + DUMP_BYTES(instr, a->instrlen, "%px: [%d:%d) optimized NOPs: ", instr, a->instrlen - a->padlen, a->padlen); } @@ -376,7 +376,7 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start, u8 *instr, *replacement; u8 insnbuf[MAX_PATCH_LEN]; - DPRINTK("alt table %p -> %p", start, end); + DPRINTK("alt table %px, -> %px", start, end); /* * The scan order should be from start to end. A later scanned * alternative code can overwrite previously scanned alternative code. @@ -400,14 +400,14 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start, continue; } - DPRINTK("feat: %d*32+%d, old: (%p, len: %d), repl: (%p, len: %d), pad: %d", + DPRINTK("feat: %d*32+%d, old: (%px len: %d), repl: (%px, len: %d), pad: %d", a->cpuid >> 5, a->cpuid & 0x1f, instr, a->instrlen, replacement, a->replacementlen, a->padlen); - DUMP_BYTES(instr, a->instrlen, "%p: old_insn: ", instr); - DUMP_BYTES(replacement, a->replacementlen, "%p: rpl_insn: ", replacement); + DUMP_BYTES(instr, a->instrlen, "%px: old_insn: ", instr); + DUMP_BYTES(replacement, a->replacementlen, "%px: rpl_insn: ", replacement); memcpy(insnbuf, replacement, a->replacementlen); insnbuf_sz = a->replacementlen; @@ -433,7 +433,7 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start, a->instrlen - a->replacementlen); insnbuf_sz += a->instrlen - a->replacementlen; } - DUMP_BYTES(insnbuf, insnbuf_sz, "%p: final_insn: ", instr); + DUMP_BYTES(insnbuf, insnbuf_sz, "%px: final_insn: ", instr); text_poke_early(instr, insnbuf, insnbuf_sz); }