mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] KVM: Fix asm constraints for segment loads
@ 2006-11-12 14:02 Avi Kivity
  0 siblings, 0 replies; only message in thread
From: Avi Kivity @ 2006-11-12 14:02 UTC (permalink / raw)
  To: kvm-devel; +Cc: akpm, linux-kernel, bero

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-11-12 14:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-12 14:02 [PATCH] KVM: Fix asm constraints for segment loads Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®