lkml.org 
[lkml]   [2006]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] KVM: Fix asm constraints for segment loads
From
Date
From: Bernhard Rosenkraenzer <bero@arklinux.org>

"g" is an invalid constraint for a segment register load, since it includes
immediate operands, which are illegal for segment moves.

Fix by specifying register or memory operands.

Signed-off-by: Avi Kivity <avi@qumranet.com>

Index: linux-2.6/drivers/kvm/kvm_main.c
===================================================================
--- linux-2.6.orig/drivers/kvm/kvm_main.c
+++ linux-2.6/drivers/kvm/kvm_main.c
@@ -154,12 +154,12 @@ static u16 read_ldt(void)

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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-11-12 15:05    [W:0.030 / U:1.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site