All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 01/11] powerpc/code-patching: Remove pr_debug()/pr_devel() messages and fix check()
@ 2021-12-02 12:00 ` Christophe Leroy
  0 siblings, 0 replies; 26+ messages in thread
From: Christophe Leroy @ 2021-12-02 12:00 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: Christophe Leroy, linux-kernel, linuxppc-dev

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: Christophe Leroy <christophe.leroy@csgroup.eu>
---
This series applies on top of series "[v5,1/5] powerpc/inst: Refactor ___get_user_instr()" https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=274258

 arch/powerpc/lib/code-patching.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c
index 312324a26df3..4fe4464b7a84 100644
--- a/arch/powerpc/lib/code-patching.c
+++ b/arch/powerpc/lib/code-patching.c
@@ -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);
 
-	pr_devel("Mapped addr %lx with pfn %lx:%d\n", text_poke_addr, pfn, err);
 	if (err)
 		return -1;
 
@@ -130,8 +129,6 @@ static inline int unmap_patch_area(unsigned long addr)
 	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
 	 */
@@ -190,10 +187,9 @@ static int do_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 */
-	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);
@@ -411,8 +407,10 @@ static void __init test_trampoline(void)
 	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)
 {
@@ -737,7 +735,7 @@ static inline void test_prefixed_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_bform();
-- 
2.33.1


^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-12-26 21:55 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 12:00 [PATCH v1 01/11] powerpc/code-patching: Remove pr_debug()/pr_devel() messages and fix check() Christophe Leroy
2021-12-02 12:00 ` Christophe Leroy
2021-12-02 12:00 ` [PATCH v1 02/11] powerpc/code-patching: Remove init_mem_is_free Christophe Leroy
2021-12-02 12:00   ` Christophe Leroy
2021-12-02 12:00 ` [PATCH v1 03/11] powerpc/code-patching: Fix error handling in do_patch_instruction() Christophe Leroy
2021-12-02 12:00   ` Christophe Leroy
2021-12-02 12:00 ` [PATCH v1 04/11] powerpc/code-patching: Fix unmap_patch_area() error handling Christophe Leroy
2021-12-02 12:00   ` Christophe Leroy
2021-12-02 12:00 ` [PATCH v1 05/11] powerpc/code-patching: Reorganise do_patch_instruction() to ease " Christophe Leroy
2021-12-02 12:00   ` Christophe Leroy
2021-12-02 12:00 ` [PATCH v1 06/11] powerpc/code-patching: Fix patch_branch() return on out-of-range failure Christophe Leroy
2021-12-02 12:00   ` Christophe Leroy
2021-12-22 13:16   ` Christophe Leroy
2021-12-22 13:16     ` Christophe Leroy
2021-12-02 12:00 ` [PATCH v1 07/11] powerpc/code-patching: Use test_trampoline for prefixed patch test Christophe Leroy
2021-12-02 12:00   ` Christophe Leroy
2021-12-02 12:00 ` [PATCH v1 08/11] powerpc/code-patching: Move patch_exception() outside code-patching.c Christophe Leroy
2021-12-02 12:00   ` Christophe Leroy
2021-12-02 12:00 ` [PATCH v1 09/11] powerpc/code-patching: Move instr_is_branch_{i/b}form() in code-patching.h Christophe Leroy
2021-12-02 12:00   ` Christophe Leroy
2021-12-02 12:00 ` [PATCH v1 10/11] powerpc/code-patching: Move code patching selftests in its own file Christophe Leroy
2021-12-02 12:00   ` Christophe Leroy
2021-12-02 12:00 ` [PATCH v1 11/11] powerpc/code-patching: Replace patch_instruction() by ppc_inst_write() in selftests Christophe Leroy
2021-12-02 12:00   ` Christophe Leroy
2021-12-26 21:52 ` [PATCH v1 01/11] powerpc/code-patching: Remove pr_debug()/pr_devel() messages and fix check() Michael Ellerman
2021-12-26 21:52   ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.