All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Bernhard Rosenkraenzer <bero@arklinux.org>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org
Subject: Re: 2.6.19-rc5-mm1 fails to compile with gcc 4.2
Date: Sun, 12 Nov 2006 15:55:17 +0200	[thread overview]
Message-ID: <455727C5.9070400@qumranet.com> (raw)
In-Reply-To: <200611121450.24859.bero@arklinux.org>

Bernhard Rosenkraenzer wrote:
> On Sunday, 12. November 2006 14:43, Avi Kivity wrote:
>   
>> 'sel' is a variable, so gcc can't provide it as an immediate operand.
>> Specifying it as "rm" instead of "g" would have been better, but can't
>> have any real influence.
>>     
>
> Specifying it as "rm" instead of "g" does fix it -- patch attached.
>
>   
>> Well, for the code you posted in in the gcc bug, it probaby generated
>> something like
>>
>>     mov $0, %fs
>>
>> which is indeed invalid assembly.  But the kvm miscompile is something
>> else (running out of registers or something like that).
>>     
>
> What am I overlooking? The code is the exact same (except I replaced "u16" 
> with "unsigned short" to avoid the #include), and produces the exact same 
> error message, and the fix is the same ("g" -> "rm").
>   

Well, since it works, I guess I'm overlooking something.  Maybe it's 
just a bad error message from gcc.

I'll apply this.  Thanks!

> ------------------------------------------------------------------------
>
> --- linux-2.6.18/drivers/kvm/kvm_main.c.ark	2006-11-12 14:40:09.000000000 +0100
> +++ linux-2.6.18/drivers/kvm/kvm_main.c	2006-11-12 14:44:57.000000000 +0100
> @@ -150,12 +150,12 @@
>  
>  static void load_fs(u16 sel)
>  {
> -	asm ("mov %0, %%fs" : : "g"(sel));
> +	asm ("mov %0, %%fs" : : "rm"(sel));
>  }
>  
>  static void load_gs(u16 sel)
>  {
> -	asm ("mov %0, %%gs" : : "g"(sel));
> +	asm ("mov %0, %%gs" : : "rm"(sel));
>  }
>  
>  #ifndef load_ldt
>   


-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2006-11-12 13:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-11 22:34 2.6.19-rc5-mm1 fails to compile with gcc 4.2 Bernhard Rosenkraenzer
2006-11-12  8:22 ` Avi Kivity
2006-11-12  9:05   ` Bernhard Rosenkraenzer
2006-11-12  9:24     ` Avi Kivity
2006-11-12 13:36       ` Bernhard Rosenkraenzer
2006-11-12 13:43         ` Avi Kivity
2006-11-12 13:50           ` Bernhard Rosenkraenzer
2006-11-12 13:55             ` Avi Kivity [this message]
2006-11-12 14:13           ` Segher Boessenkool
2006-11-12 14:10         ` Segher Boessenkool
2006-11-12 11:17     ` Segher Boessenkool
2006-11-12 13:43   ` Bernhard Rosenkraenzer
2006-11-12 13:50     ` Avi Kivity

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=455727C5.9070400@qumranet.com \
    --to=avi@qumranet.com \
    --cc=akpm@osdl.org \
    --cc=bero@arklinux.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.