lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1454680092-30523-2-git-send-email-slaoub@gmail.com>
Date:	Fri,  5 Feb 2016 21:48:12 +0800
From:	Chen Yucong <slaoub@...il.com>
To:	mingo@...nel.org
Cc:	tglx@...utronix.de, hpa@...or.com, x86@...nel.org,
	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] x86: use pr_default() macro

 - convert printk(KERN_DEFAULT ...) to pr_default(...)

Signed-off-by: Chen Yucong <slaoub@...il.com>
---
 arch/x86/kernel/dumpstack.c    |  3 +--
 arch/x86/kernel/dumpstack_64.c |  4 ++--
 arch/x86/kernel/process_32.c   | 29 ++++++++++++++---------------
 arch/x86/kernel/process_64.c   | 41 ++++++++++++++++++++---------------------
 arch/x86/mm/fault.c            |  2 +-
 5 files changed, 38 insertions(+), 41 deletions(-)

diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 993706a..1ae9a6d 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -257,8 +257,7 @@ int __die(const char *str, struct pt_regs *regs, long err)
 	unsigned short ss;
 	unsigned long sp;
 #endif
-	printk(KERN_DEFAULT
-	       "%s: %04lx [#%d] ", str, err & 0xffff, ++die_counter);
+	pr_default("%s: %04lx [#%d] ", str, err & 0xffff, ++die_counter);
 #ifdef CONFIG_PREEMPT
 	printk("PREEMPT ");
 #endif
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 5f1c626..8e6c739 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -316,11 +316,11 @@ void show_regs(struct pt_regs *regs)
 		unsigned char c;
 		u8 *ip;
 
-		printk(KERN_DEFAULT "Stack:\n");
+		pr_default("Stack:\n");
 		show_stack_log_lvl(NULL, regs, (unsigned long *)sp,
 				   0, KERN_DEFAULT);
 
-		printk(KERN_DEFAULT "Code: ");
+		pr_default("Code: ");
 
 		ip = (u8 *)regs->ip - code_prologue;
 		if (ip < (u8 *)PAGE_OFFSET || probe_kernel_address(ip, c)) {
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 9f95091..4039da4 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -83,17 +83,17 @@ void __show_regs(struct pt_regs *regs, int all)
 		savesegment(gs, gs);
 	}
 
-	printk(KERN_DEFAULT "EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n",
-			(u16)regs->cs, regs->ip, regs->flags,
-			smp_processor_id());
+	pr_default("EIP: %04x:[<%08lx>] EFLAGS: %08lx CPU: %d\n",
+		   (u16)regs->cs, regs->ip, regs->flags,
+		   smp_processor_id());
 	print_symbol("EIP is at %s\n", regs->ip);
 
-	printk(KERN_DEFAULT "EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
-		regs->ax, regs->bx, regs->cx, regs->dx);
-	printk(KERN_DEFAULT "ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n",
-		regs->si, regs->di, regs->bp, sp);
-	printk(KERN_DEFAULT " DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n",
-	       (u16)regs->ds, (u16)regs->es, (u16)regs->fs, gs, ss);
+	pr_default("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
+		   regs->ax, regs->bx, regs->cx, regs->dx);
+	pr_default("ESI: %08lx EDI: %08lx EBP: %08lx ESP: %08lx\n",
+		   regs->si, regs->di, regs->bp, sp);
+	pr_default(" DS: %04x ES: %04x FS: %04x GS: %04x SS: %04x\n",
+		   (u16)regs->ds, (u16)regs->es, (u16)regs->fs, gs, ss);
 
 	if (!all)
 		return;
@@ -102,8 +102,8 @@ void __show_regs(struct pt_regs *regs, int all)
 	cr2 = read_cr2();
 	cr3 = read_cr3();
 	cr4 = __read_cr4_safe();
-	printk(KERN_DEFAULT "CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n",
-			cr0, cr2, cr3, cr4);
+	pr_default("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n",
+		   cr0, cr2, cr3, cr4);
 
 	get_debugreg(d0, 0);
 	get_debugreg(d1, 1);
@@ -117,10 +117,9 @@ void __show_regs(struct pt_regs *regs, int all)
 	    (d6 == DR6_RESERVED) && (d7 == 0x400))
 		return;
 
-	printk(KERN_DEFAULT "DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n",
-			d0, d1, d2, d3);
-	printk(KERN_DEFAULT "DR6: %08lx DR7: %08lx\n",
-			d6, d7);
+	pr_default("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n",
+		   d0, d1, d2, d3);
+	pr_default("DR6: %08lx DR7: %08lx\n", d6, d7);
 }
 
 void release_thread(struct task_struct *dead_task)
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 71a18a2..37ff6be 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -61,20 +61,20 @@ void __show_regs(struct pt_regs *regs, int all)
 	unsigned int fsindex, gsindex;
 	unsigned int ds, cs, es;
 
-	printk(KERN_DEFAULT "RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip);
+	pr_default("RIP: %04lx:[<%016lx>] ", regs->cs & 0xffff, regs->ip);
 	printk_address(regs->ip);
-	printk(KERN_DEFAULT "RSP: %04lx:%016lx  EFLAGS: %08lx\n", regs->ss,
-			regs->sp, regs->flags);
-	printk(KERN_DEFAULT "RAX: %016lx RBX: %016lx RCX: %016lx\n",
-	       regs->ax, regs->bx, regs->cx);
-	printk(KERN_DEFAULT "RDX: %016lx RSI: %016lx RDI: %016lx\n",
-	       regs->dx, regs->si, regs->di);
-	printk(KERN_DEFAULT "RBP: %016lx R08: %016lx R09: %016lx\n",
-	       regs->bp, regs->r8, regs->r9);
-	printk(KERN_DEFAULT "R10: %016lx R11: %016lx R12: %016lx\n",
-	       regs->r10, regs->r11, regs->r12);
-	printk(KERN_DEFAULT "R13: %016lx R14: %016lx R15: %016lx\n",
-	       regs->r13, regs->r14, regs->r15);
+	pr_default("RSP: %04lx:%016lx  EFLAGS: %08lx\n", regs->ss,
+		   regs->sp, regs->flags);
+	pr_default("RAX: %016lx RBX: %016lx RCX: %016lx\n",
+		   regs->ax, regs->bx, regs->cx);
+	pr_default("RDX: %016lx RSI: %016lx RDI: %016lx\n",
+		   regs->dx, regs->si, regs->di);
+	pr_default("RBP: %016lx R08: %016lx R09: %016lx\n",
+		   regs->bp, regs->r8, regs->r9);
+	pr_default("R10: %016lx R11: %016lx R12: %016lx\n",
+		   regs->r10, regs->r11, regs->r12);
+	pr_default("R13: %016lx R14: %016lx R15: %016lx\n",
+		   regs->r13, regs->r14, regs->r15);
 
 	asm("movl %%ds,%0" : "=r" (ds));
 	asm("movl %%cs,%0" : "=r" (cs));
@@ -94,12 +94,11 @@ void __show_regs(struct pt_regs *regs, int all)
 	cr3 = read_cr3();
 	cr4 = __read_cr4();
 
-	printk(KERN_DEFAULT "FS:  %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n",
-	       fs, fsindex, gs, gsindex, shadowgs);
-	printk(KERN_DEFAULT "CS:  %04x DS: %04x ES: %04x CR0: %016lx\n", cs, ds,
-			es, cr0);
-	printk(KERN_DEFAULT "CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3,
-			cr4);
+	pr_default("FS:  %016lx(%04x) GS:%016lx(%04x) knlGS:%016lx\n",
+		   fs, fsindex, gs, gsindex, shadowgs);
+	pr_default("CS:  %04x DS: %04x ES: %04x CR0: %016lx\n", cs, ds,
+		   es, cr0);
+	pr_default("CR2: %016lx CR3: %016lx CR4: %016lx\n", cr2, cr3, cr4);
 
 	get_debugreg(d0, 0);
 	get_debugreg(d1, 1);
@@ -113,8 +112,8 @@ void __show_regs(struct pt_regs *regs, int all)
 	    (d6 == DR6_RESERVED) && (d7 == 0x400))
 		return;
 
-	printk(KERN_DEFAULT "DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2);
-	printk(KERN_DEFAULT "DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7);
+	pr_default("DR0: %016lx DR1: %016lx DR2: %016lx\n", d0, d1, d2);
+	pr_default("DR3: %016lx DR6: %016lx DR7: %016lx\n", d3, d6, d7);
 
 }
 
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index eef44d9..531fe75 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -723,7 +723,7 @@ no_context(struct pt_regs *regs, unsigned long error_code,
 		sig = 0;
 
 	/* Executive summary in case the body of the oops scrolled away */
-	printk(KERN_DEFAULT "CR2: %016lx\n", address);
+	pr_default("CR2: %016lx\n", address);
 
 	oops_end(flags, regs, sig);
 }
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ