提交 edecd2d6 编写于 作者: C Christophe Leroy 提交者: Michael Ellerman

powerpc/code-patching: Remove pr_debug()/pr_devel() messages and fix check()

code-patching has been working for years now, time has come to
remove debugging messages.

Change useful message to KERN_INFO and remove other ones.

Also add KERN_ERR to check() macro and change it into a do/while
to make checkpatch happy.
Signed-off-by: NChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/3ff9823c0a812a8a145d979a9600a6d4591b80ee.1638446239.git.christophe.leroy@csgroup.eu
上级 62479e6e
...@@ -95,7 +95,6 @@ static int map_patch_area(void *addr, unsigned long text_poke_addr) ...@@ -95,7 +95,6 @@ static int map_patch_area(void *addr, unsigned long text_poke_addr)
err = map_kernel_page(text_poke_addr, (pfn << PAGE_SHIFT), PAGE_KERNEL); err = map_kernel_page(text_poke_addr, (pfn << PAGE_SHIFT), PAGE_KERNEL);
pr_devel("Mapped addr %lx with pfn %lx:%d\n", text_poke_addr, pfn, err);
if (err) if (err)
return -1; return -1;
...@@ -130,8 +129,6 @@ static inline int unmap_patch_area(unsigned long addr) ...@@ -130,8 +129,6 @@ static inline int unmap_patch_area(unsigned long addr)
if (unlikely(!ptep)) if (unlikely(!ptep))
return -EINVAL; return -EINVAL;
pr_devel("clearing mm %p, pte %p, addr %lx\n", &init_mm, ptep, addr);
/* /*
* In hash, pte_clear flushes the tlb, in radix, we have to * In hash, pte_clear flushes the tlb, in radix, we have to
*/ */
...@@ -190,10 +187,9 @@ static int do_patch_instruction(u32 *addr, ppc_inst_t instr) ...@@ -190,10 +187,9 @@ static int do_patch_instruction(u32 *addr, ppc_inst_t instr)
int patch_instruction(u32 *addr, ppc_inst_t instr) int patch_instruction(u32 *addr, ppc_inst_t instr)
{ {
/* Make sure we aren't patching a freed init section */ /* Make sure we aren't patching a freed init section */
if (init_mem_is_free && init_section_contains(addr, 4)) { if (init_mem_is_free && init_section_contains(addr, 4))
pr_debug("Skipping init section patching addr: 0x%px\n", addr);
return 0; return 0;
}
return do_patch_instruction(addr, instr); return do_patch_instruction(addr, instr);
} }
NOKPROBE_SYMBOL(patch_instruction); NOKPROBE_SYMBOL(patch_instruction);
...@@ -411,8 +407,10 @@ static void __init test_trampoline(void) ...@@ -411,8 +407,10 @@ static void __init test_trampoline(void)
asm ("nop;\n"); asm ("nop;\n");
} }
#define check(x) \ #define check(x) do { \
if (!(x)) printk("code-patching: test failed at line %d\n", __LINE__); if (!(x)) \
pr_err("code-patching: test failed at line %d\n", __LINE__); \
} while (0)
static void __init test_branch_iform(void) static void __init test_branch_iform(void)
{ {
...@@ -737,7 +735,7 @@ static inline void test_prefixed_patching(void) {} ...@@ -737,7 +735,7 @@ static inline void test_prefixed_patching(void) {}
static int __init test_code_patching(void) static int __init test_code_patching(void)
{ {
printk(KERN_DEBUG "Running code patching self-tests ...\n"); pr_info("Running code patching self-tests ...\n");
test_branch_iform(); test_branch_iform();
test_branch_bform(); test_branch_bform();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册