Skip to contentSkip to conversation

warnings in rc4-mm2

DISCUSSION Andrew Morton 2 participants 2 messages Nov 2, 2006 – Nov 5, 2006 virtio core

lore
Share & tools
lore
#0 lore raw

i386 allmodconfig

arch/i386/power/cpu.c: In function '__save_processor_state':
arch/i386/power/cpu.c:29: warning: passing argument 1 of 'paravirt_ops.store_gdt' from incompatible pointer type arch/i386/power/cpu.c:30: warning: passing argument 1 of 'paravirt_ops.store_idt' from incompatible pointer type arch/i386/power/cpu.c: In function '__restore_processor_state':
arch/i386/power/cpu.c:102: warning: passing argument 1 of 'paravirt_ops.load_gdt' from incompatible pointer type arch/i386/power/cpu.c:103: warning: passing argument 1 of 'paravirt_ops.load_idt' from incompatible pointer type arch/i386/kernel/paravirt.c:481: warning: initialization from incompatible pointer type

#1 lore raw
Quoted 9 lines · Andrew Morton

i386 allmodconfig

arch/i386/power/cpu.c: In function '__save_processor_state':
arch/i386/power/cpu.c:29: warning: passing argument 1 of 'paravirt_ops.store_gdt' from incompatible pointer type arch/i386/power/cpu.c:30: warning: passing argument 1 of 'paravirt_ops.store_idt' from incompatible pointer type arch/i386/power/cpu.c: In function '__restore_processor_state':
arch/i386/power/cpu.c:102: warning: passing argument 1 of 'paravirt_ops.load_gdt' from incompatible pointer type arch/i386/power/cpu.c:103: warning: passing argument 1 of 'paravirt_ops.load_idt' from incompatible pointer type arch/i386/kernel/paravirt.c:481: warning: initialization from incompatible pointer type

Thanks for the reminder!

The previous store_gdt() was a macro, with CONFIG_PARAVIRT we have typechecking that the arg is a struct Xgt_desc_struct *. When I looked at changing "struct saved_context" to use that struct, I realized that the padding was in a different place: will changing it be a compatibility issue?

Rusty.

With CONFIG_PARAVIRT enabled, store_gdt/store_idt etc are actual functions which expect a struct Xgt_desc_struct *. Make saved_context conform rather than using manually-assembled GDT.

include/asm-i386/suspend.h +2 -6
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/dontdiff --minimal linux-2.6.19-rc4-mm2/include/asm-i386/suspend.h working-2.6.19-rc4-mm2-warnings/include/asm-i386/suspend.h
@@ -12,12 +12,8 @@ static inline int arch_prepare_suspend(v
 struct saved_context {
   	u16 es, fs, gs, ss;
 	unsigned long cr0, cr2, cr3, cr4;
-	u16 gdt_pad;
-	u16 gdt_limit;
-	unsigned long gdt_base;
-	u16 idt_pad;
-	u16 idt_limit;
-	unsigned long idt_base;
+	struct Xgt_desc_struct gdt;
+	struct Xgt_desc_struct idt;
 	u16 ldt;
 	u16 tss;
 	unsigned long tr;
arch/i386/power/cpu.c +4 -4
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/dontdiff --minimal linux-2.6.19-rc4-mm2/arch/i386/power/cpu.c working-2.6.19-rc4-mm2-warnings/arch/i386/power/cpu.c
@@ -26,8 +26,8 @@ void __save_processor_state(struct saved
 	/*
 	 * descriptor tables
 	 */
- 	store_gdt(&ctxt->gdt_limit);
- 	store_idt(&ctxt->idt_limit);
+ 	store_gdt(&ctxt->gdt);
+ 	store_idt(&ctxt->idt);
  	store_tr(ctxt->tr);
 
 	/*
@@ -99,8 +99,8 @@ void __restore_processor_state(struct sa
 	 * now restore the descriptor tables to their proper values
 	 * ltr is done i fix_processor_context().
 	 */
- 	load_gdt(&ctxt->gdt_limit);
- 	load_idt(&ctxt->idt_limit);
+ 	load_gdt(&ctxt->gdt);
+ 	load_idt(&ctxt->idt);
 
 	/*
 	 * segment registers