Skip to contentSkip to conversation

KVM: Fix asm constraints for segment loads

PATCH New Avi Kivity 1 participant 1 message Nov 12, 2006 KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 KVM: Fix asm constraints for segment loads

From: Bernhard Rosenkraenzer <[email protected]>

"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.

drivers/kvm/kvm_main.c +2 -2
Index: 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

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642