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)
return -1;
if (unlikely(!ptep))
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
*/
int patch_instruction(u32 *addr, ppc_inst_t instr)
{
/* Make sure we aren't patching a freed init section */
- if (init_mem_is_free && init_section_contains(addr, 4)) {
- pr_debug("Skipping init section patching addr: 0x%px\n", addr);
+ if (init_mem_is_free && init_section_contains(addr, 4))
return 0;
- }
+
return do_patch_instruction(addr, instr);
}
NOKPROBE_SYMBOL(patch_instruction);
asm ("nop;\n");
}
-#define check(x) \
- if (!(x)) printk("code-patching: test failed at line %d\n", __LINE__);
+#define check(x) do { \
+ if (!(x)) \
+ pr_err("code-patching: test failed at line %d\n", __LINE__); \
+} while (0)
static void __init test_branch_iform(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_bform();