warnings in rc4-mm2
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
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 typearch/i386/power/cpu.c:30: warning: passing argument 1 of 'paravirt_ops.store_idt' from incompatible pointer typearch/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 typearch/i386/power/cpu.c:103: warning: passing argument 1 of 'paravirt_ops.load_idt' from incompatible pointer typearch/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
@@ -12,12 +12,8 @@ static inline int arch_prepare_suspend(vstruct 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
@@ -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