Linux virtualization list
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@osdl.org>
Cc: "virtualization@lists.osdl.org" <virtualization@lists.osdl.org>,
	Pavel Machek <pavel@ucw.cz>
Subject: Re: warnings in rc4-mm2
Date: Sun, 05 Nov 2006 16:56:44 +1100	[thread overview]
Message-ID: <1162706204.29777.25.camel@localhost.localdomain> (raw)
In-Reply-To: <20061102152507.70ab4dd2.akpm@osdl.org>

On Thu, 2006-11-02 at 15:25 -0800, Andrew Morton wrote:
> 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.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

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
--- linux-2.6.19-rc4-mm2/include/asm-i386/suspend.h	2006-11-05 15:35:56.000000000 +1100
+++ working-2.6.19-rc4-mm2-warnings/include/asm-i386/suspend.h	2006-11-05 16:40:40.000000000 +1100
@@ -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;
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
--- linux-2.6.19-rc4-mm2/arch/i386/power/cpu.c	2006-09-22 15:35:56.000000000 +1000
+++ working-2.6.19-rc4-mm2-warnings/arch/i386/power/cpu.c	2006-11-05 16:42:52.000000000 +1100
@@ -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

      reply	other threads:[~2006-11-05  5:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-02 23:25 warnings in rc4-mm2 Andrew Morton
2006-11-05  5:56 ` Rusty Russell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1162706204.29777.25.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@osdl.org \
    --cc=pavel@ucw.cz \
    --cc=virtualization@lists.osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox