From: Avi Kivity Subject: [PATCH] KVM: Fix asm constraints for segment loads Date: Sun, 12 Nov 2006 14:02:43 -0000 Message-ID: <20061112140243.ADDA8A0001@cleopatra.q> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: akpm-3NddpPZAyC0@public.gmane.org, bero-9zdaV+82baBg9hUCZPvPmw@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Return-path: To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org From: Bernhard Rosenkraenzer "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 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 ------------------------------------------------------------------------- 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