lkml.org 
[lkml]   [2006]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: 2.6.19-rc5-mm1 fails to compile with gcc 4.2
Date
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").
--- 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
\
 
 \ /
  Last update: 2006-11-12 14:53    [W:0.070 / U:3.344 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site