Skip to contentSkip to conversation

arch/i386/kernel/doublefault.c

PATCH New Christophe Lucas 4 participants 8 messages Oct 3, 2005 – Oct 8, 2005 Kernel janitors

lore
Share & tools
lore
#0 lore raw
Quoted 15 lines · [email protected] ([email protected]) wrote:
Signed-off-by Anton Brondz
arch/i386/kernel/doublefault.c +1 -1
@@ -23,23 +23,23 @@ static void doublefault_fn(void)
 	store_gdt(&gdt_desc);
 	gdt = gdt_desc.address;
 
-	printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
+	printk(KERN_WARNING "double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
[...]

}
}

Quoted 2 lines

This is the third time I'm sending this. Hope you're not tired of me yet :). This time I've added a signed off line, used a different mail client to get the word wrap off and changed the constants.

Please use correctly Signed-off-by such as :

Send your patch with correct syntax as said in :

http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt

Have a nice day,

- Christophe ([email protected])

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

arch/i386/kernel/doublefault.c static void doublefault_fn(void) · line 26

Quoted 10 lines · [email protected] ([email protected]) wrote:
Signed-off-by Anton Brondz
arch/i386/kernel/doublefault.c +1 -1
@@ -23,23 +23,23 @@ static void doublefault_fn(void)
 	store_gdt(&gdt_desc);
 	gdt = gdt_desc.address;
 
-	printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
+	printk(KERN_WARNING "double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);

When a double fault happens we are not in good terms with os ;) So I don't think KERN_WARNING, KERN_NOTICE, KERN_ERR are the good flags. I think the issue is in KERN_CRIT, KERN_EMERG, KERN_ALERT.

Please read it (Debugging by printing : printk):

	http://lwn.net/images/pdf/LDD3/ch04.pdf

Have a nice day,

- Christophe ([email protected])

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw

PATCH 1/1 arch/i386/kernel/doublefault.c

In reply to Christophe Lucas
Signed-off-by Anton Brondz
arch/i386/kernel/doublefault.c +5 -5
@@ -23,23 +23,23 @@ static void doublefault_fn(void)
 	store_gdt(&gdt_desc);
 	gdt = gdt_desc.address;
 
-	printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
+	printk(KERN_WARNING "double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
 
 	if (ptr_ok(gdt)) {
 		gdt += GDT_ENTRY_TSS << 3;
 		tss = *(u16 *)(gdt+2);
 		tss += *(u8 *)(gdt+4) << 16;
 		tss += *(u8 *)(gdt+7) << 24;
-		printk("double fault, tss at %08lx\n", tss);
+		printk(KERN_NOTICE "double fault, tss at %08lx\n", tss);
 
 		if (ptr_ok(tss)) {
 			struct tss_struct *t = (struct tss_struct *)tss;
 
-			printk("eip = %08lx, esp = %08lx\n", t->eip, t->esp);
+			printk(KERN_NOTICE "eip = %08lx, esp = %08lx\n", t->eip, t->esp);
 
-			printk("eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
+			printk(KERN_NOTICE "eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
 				t->eax, t->ebx, t->ecx, t->edx);
-			printk("esi = %08lx, edi = %08lx\n",
+			printk(KERN_ERR "esi = %08lx, edi = %08lx\n",
 				t->esi, t->edi);
 		}
 	}

This is the third time I'm sending this. Hope you're not tired of me yet :). This time I've added a signed off line, used a different mail client to get the word wrap off and changed the constants.

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#3 lore raw
In reply to Christophe Lucas
Quoted 44 lines · Dinolinux
Quoted 20 lines · Christophe Lucas

arch/i386/kernel/doublefault.c static void doublefault_fn(void) · line 28

Quoted 12 lines · [email protected] ([email protected]) wrote:
Signed-off-by Anton Brondz
arch/i386/kernel/doublefault.c +1 -1
@@ -23,23 +23,23 @@ static void doublefault_fn(void)
 	store_gdt(&gdt_desc);
 	gdt = gdt_desc.address;
 
-	printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
+	printk(KERN_WARNING "double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
 
 

When a double fault happens we are not in good terms with os ;) So I don't think KERN_WARNING, KERN_NOTICE, KERN_ERR are the good flags. I think the issue is in KERN_CRIT, KERN_EMERG, KERN_ALERT.

Quoted 5 lines

Please read it (Debugging by printing : printk):

	http://lwn.net/images/pdf/LDD3/ch04.pdf

Have a nice day,

Now I've made some editing on the patch. I don't want to send the whole thing now as there may be some more editing. I'll put only the lines with the constants here now.

*printk(KERN_ALERT "double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);*
KERN_ALERT because it prints the address of the double fault which requires immediate action.

*printk(KERN_CRIT "double fault, tss at %08lx\n", tss);* KERN_CRIT because it prints the tss address.
*
printk(KERN_CRIT "eip = %08lx, esp = %08lx\n", t->eip, t->esp); *KERN_CRIT because it prints eip and esp address.

*printk(KERN_CRIT "eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",

Quoted 8 lines
                t->eax, t->ebx, t->ecx, t->edx);

*KERN_CRIT because it prints eax, ebx, ecx and edx address.

*printk(KERN_CRIT "esi = %08lx, edi = %08lx\n",

                t->esi, t->edi);

*KERN_CRIT because it prints esi and edi address.

Hope this is better, so I can send the patch. ;-)

I think it will be better.

- Christophe ([email protected])

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#4 lore raw
In reply to Christophe Lucas
Quoted 30 lines · Christophe Lucas

arch/i386/kernel/doublefault.c static void doublefault_fn(void) · line 28

Quoted 12 lines · [email protected] ([email protected]) wrote:
Signed-off-by Anton Brondz
arch/i386/kernel/doublefault.c +1 -1
@@ -23,23 +23,23 @@ static void doublefault_fn(void)
 	store_gdt(&gdt_desc);
 	gdt = gdt_desc.address;
 
-	printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
+	printk(KERN_WARNING "double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
 
 

When a double fault happens we are not in good terms with os ;) So I don't think KERN_WARNING, KERN_NOTICE, KERN_ERR are the good flags. I think the issue is in KERN_CRIT, KERN_EMERG, KERN_ALERT.

Please read it (Debugging by printing : printk):

	http://lwn.net/images/pdf/LDD3/ch04.pdf

Have a nice day,

- Christophe ([email protected])

Quoted 8 lines

------------------------------------------------------------------------

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

Now I've made some editing on the patch. I don't want to send the whole thing now as there may be some more editing. I'll put only the lines with the constants here now.

*printk(KERN_ALERT "double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);*
KERN_ALERT because it prints the address of the double fault which requires immediate action.

*printk(KERN_CRIT "double fault, tss at %08lx\n", tss);* KERN_CRIT because it prints the tss address.
*
printk(KERN_CRIT "eip = %08lx, esp = %08lx\n", t->eip, t->esp); *KERN_CRIT because it prints eip and esp address.

*printk(KERN_CRIT "eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",

                t->eax, t->ebx, t->ecx, t->edx);

*KERN_CRIT because it prints eax, ebx, ecx and edx address.

*printk(KERN_CRIT "esi = %08lx, edi = %08lx\n",

                t->esi, t->edi);

*KERN_CRIT because it prints esi and edi address.

Hope this is better, so I can send the patch. ;-)

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#5 lore raw

PATCH 1/1 arch/i386/kernel/doublefault.c

In reply to Christophe Lucas
arch/i386/kernel/doublefault.c +5 -5
@@ -23,23 +23,23 @@ static void doublefault_fn(void)
 	store_gdt(&gdt_desc);
 	gdt = gdt_desc.address;
 
-	printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
+	printk(KERN_ALERT "double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
 
 	if (ptr_ok(gdt)) {
 		gdt += GDT_ENTRY_TSS << 3;
 		tss = *(u16 *)(gdt+2);
 		tss += *(u8 *)(gdt+4) << 16;
 		tss += *(u8 *)(gdt+7) << 24;
-		printk("double fault, tss at %08lx\n", tss);
+		printk(KERN_CRIT "double fault, tss at %08lx\n", tss);
 
 		if (ptr_ok(tss)) {
 			struct tss_struct *t = (struct tss_struct *)tss;
 
-			printk("eip = %08lx, esp = %08lx\n", t->eip, t->esp);
+			printk(KERN_CRIT "eip = %08lx, esp = %08lx\n", t->eip, t->esp);
 
-			printk("eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
+			printk(KERN_CRIT "eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
 				t->eax, t->ebx, t->ecx, t->edx);
-			printk("esi = %08lx, edi = %08lx\n",
+			printk(KERN_CRIT "esi = %08lx, edi = %08lx\n",
 				t->esi, t->edi);
 		}
 	}

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#6 lore raw
In reply to Christophe Lucas

arch/i386/kernel/doublefault.c

Quoted 13 lines · On Mon, Oct 03, 2005 at 04:54:41PM +0000, [email protected] wrote:
arch/i386/kernel/doublefault.c +2 -2
 
-	printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
+	printk(KERN_ALERT "double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
 
 	if (ptr_ok(gdt)) {
 		gdt += GDT_ENTRY_TSS << 3;
 		tss = *(u16 *)(gdt+2);
 		tss += *(u8 *)(gdt+4) << 16;
 		tss += *(u8 *)(gdt+7) << 24;
-		printk("double fault, tss at %08lx\n", tss);
+		printk(KERN_CRIT "double fault, tss at %08lx\n", tss);

Different priorities?

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#7 lore raw
In reply to Christophe Lucas
Quoted 27 lines · Alexey Dobriyan
Quoted 17 lines · On Mon, Oct 03, 2005 at 04:54:41PM +0000, [email protected] wrote:
arch/i386/kernel/doublefault.c +1 -1
 
 
 
 
 
-	printk("double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
+	printk(KERN_ALERT "double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
	if (ptr_ok(gdt)) {
		gdt += GDT_ENTRY_TSS << 3;
		tss = *(u16 *)(gdt+2);
		tss += *(u8 *)(gdt+4) << 16;
		tss += *(u8 *)(gdt+7) << 24;

arch/i386/kernel/doublefault.c

Quoted 2 lines
arch/i386/kernel/doublefault.c +1 -1
-		printk("double fault, tss at %08lx\n", tss);
+		printk(KERN_CRIT "double fault, tss at %08lx\n", tss);

Different priorities?

Quoted 8 lines

------------------------------------------------------------------------

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

Will it be better if I put KERN_CRIT on all printk lines?

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors