diff options
author | Borislav Petkov <bp@suse.de> | 2018-01-26 07:11:36 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2018-01-26 09:53:19 -0500 |
commit | 0e6c16c652cadaffd25a6bb326ec10da5bcec6b4 (patch) | |
tree | 4e17d91b6c440b0ec7aec36683e2d43ded1bff60 | |
parent | 20ffa1caecca4db8f79fe665acdeaa5af815a24d (diff) |
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 <bp@suse.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: riel@redhat.com
Cc: ak@linux.intel.com
Cc: peterz@infradead.org
Cc: David Woodhouse <dwmw2@infradead.org>
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 <jpoimboe@redhat.com>
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
-rw-r--r-- | arch/x86/kernel/alternative.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index e0b97e4d1db5..14a52c7d23d4 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) | |||
298 | tgt_rip = next_rip + o_dspl; | 298 | tgt_rip = next_rip + o_dspl; |
299 | n_dspl = tgt_rip - orig_insn; | 299 | n_dspl = tgt_rip - orig_insn; |
300 | 300 | ||
301 | DPRINTK("target RIP: %p, new_displ: 0x%x", tgt_rip, n_dspl); | 301 | DPRINTK("target RIP: %px, new_displ: 0x%x", tgt_rip, n_dspl); |
302 | 302 | ||
303 | if (tgt_rip - orig_insn >= 0) { | 303 | if (tgt_rip - orig_insn >= 0) { |
304 | if (n_dspl - 2 <= 127) | 304 | if (n_dspl - 2 <= 127) |
@@ -355,7 +355,7 @@ static void __init_or_module noinline optimize_nops(struct alt_instr *a, u8 *ins | |||
355 | add_nops(instr + (a->instrlen - a->padlen), a->padlen); | 355 | add_nops(instr + (a->instrlen - a->padlen), a->padlen); |
356 | local_irq_restore(flags); | 356 | local_irq_restore(flags); |
357 | 357 | ||
358 | DUMP_BYTES(instr, a->instrlen, "%p: [%d:%d) optimized NOPs: ", | 358 | DUMP_BYTES(instr, a->instrlen, "%px: [%d:%d) optimized NOPs: ", |
359 | instr, a->instrlen - a->padlen, a->padlen); | 359 | instr, a->instrlen - a->padlen, a->padlen); |
360 | } | 360 | } |
361 | 361 | ||
@@ -376,7 +376,7 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start, | |||
376 | u8 *instr, *replacement; | 376 | u8 *instr, *replacement; |
377 | u8 insnbuf[MAX_PATCH_LEN]; | 377 | u8 insnbuf[MAX_PATCH_LEN]; |
378 | 378 | ||
379 | DPRINTK("alt table %p -> %p", start, end); | 379 | DPRINTK("alt table %px, -> %px", start, end); |
380 | /* | 380 | /* |
381 | * The scan order should be from start to end. A later scanned | 381 | * The scan order should be from start to end. A later scanned |
382 | * alternative code can overwrite previously scanned alternative code. | 382 | * alternative code can overwrite previously scanned alternative code. |
@@ -400,14 +400,14 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start, | |||
400 | continue; | 400 | continue; |
401 | } | 401 | } |
402 | 402 | ||
403 | DPRINTK("feat: %d*32+%d, old: (%p, len: %d), repl: (%p, len: %d), pad: %d", | 403 | DPRINTK("feat: %d*32+%d, old: (%px len: %d), repl: (%px, len: %d), pad: %d", |
404 | a->cpuid >> 5, | 404 | a->cpuid >> 5, |
405 | a->cpuid & 0x1f, | 405 | a->cpuid & 0x1f, |
406 | instr, a->instrlen, | 406 | instr, a->instrlen, |
407 | replacement, a->replacementlen, a->padlen); | 407 | replacement, a->replacementlen, a->padlen); |
408 | 408 | ||
409 | DUMP_BYTES(instr, a->instrlen, "%p: old_insn: ", instr); | 409 | DUMP_BYTES(instr, a->instrlen, "%px: old_insn: ", instr); |
410 | DUMP_BYTES(replacement, a->replacementlen, "%p: rpl_insn: ", replacement); | 410 | DUMP_BYTES(replacement, a->replacementlen, "%px: rpl_insn: ", replacement); |
411 | 411 | ||
412 | memcpy(insnbuf, replacement, a->replacementlen); | 412 | memcpy(insnbuf, replacement, a->replacementlen); |
413 | insnbuf_sz = a->replacementlen; | 413 | insnbuf_sz = a->replacementlen; |
@@ -433,7 +433,7 @@ void __init_or_module noinline apply_alternatives(struct alt_instr *start, | |||
433 | a->instrlen - a->replacementlen); | 433 | a->instrlen - a->replacementlen); |
434 | insnbuf_sz += a->instrlen - a->replacementlen; | 434 | insnbuf_sz += a->instrlen - a->replacementlen; |
435 | } | 435 | } |
436 | DUMP_BYTES(insnbuf, insnbuf_sz, "%p: final_insn: ", instr); | 436 | DUMP_BYTES(insnbuf, insnbuf_sz, "%px: final_insn: ", instr); |
437 | 437 | ||
438 | text_poke_early(instr, insnbuf, insnbuf_sz); | 438 | text_poke_early(instr, insnbuf, insnbuf_sz); |
439 | } | 439 | } |