public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: fix calculation of initial value of rdx register
@ 2006-11-06 13:15 Avi Kivity
  2006-11-06 18:47 ` Hesse, Christian
  0 siblings, 1 reply; 25+ messages in thread
From: Avi Kivity @ 2006-11-06 13:15 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: akpm-3NddpPZAyC0, linux-kernel-u79uwXL29TY76Z2rM5mHXA

On bootup, the rdx register contains information about the processor.  The
function which calculates this value has the bugs:

 - missing 'cpuid' to get the value from the processor
 - missing register clobber caused a miscompilation in some circumstances
 - we shouldn't return a value that depends on the current processor in 
   case we migrate

In any case nobody looks at the value, so just return a generic P6
identifier.

Thanks to Christian Hesse <mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org> for debugging help.

Signed-off-by: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

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
@@ -1052,12 +1052,7 @@ static void set_cr8(struct kvm_vcpu *vcp
 
 static u32 get_rdx_init_val(void)
 {
-	u32 val;
-
-	asm ("movl $1, %%eax \n\t"
-	     "movl %%eax, %0 \n\t" : "=g"(val) );
-	return val;
-
+	return 0x600; /* P6 family */
 }
 
 static void fx_init(struct kvm_vcpu *vcpu)

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2006-11-19  8:22 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-06 13:15 [PATCH] KVM: fix calculation of initial value of rdx register Avi Kivity
2006-11-06 18:47 ` Hesse, Christian
     [not found]   ` <200611061947.47165.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-07  8:14     ` Avi Kivity
     [not found]       ` <4550407F.6030007-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-07 11:55         ` Hesse, Christian
     [not found]           ` <200611071255.59831.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-07 12:31             ` Avi Kivity
     [not found]               ` <45507C84.70504-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-07 13:04                 ` Hesse, Christian
     [not found]                   ` <200611071404.38825.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-07 13:25                     ` Avi Kivity
     [not found]                       ` <4550893A.1000304-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-07 13:46                         ` Hesse, Christian
     [not found]                           ` <200611071446.17870.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-07 14:11                             ` Avi Kivity
     [not found]                               ` <4550941E.4070409-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-08  8:04                                 ` Hesse, Christian
     [not found]                                   ` <200611080904.27777.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-08  8:11                                     ` Avi Kivity
     [not found]                                       ` <4551914D.70303-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-08  8:24                                         ` Hesse, Christian
     [not found]                                           ` <200611080924.59607.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-08  8:28                                             ` Avi Kivity
     [not found]                                               ` <45519512.3050606-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-09 12:10                                                 ` Hesse, Christian
     [not found]                                                   ` <200611091310.25066.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-09 13:01                                                     ` Avi Kivity
     [not found]                                                       ` <455326C3.90601-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-09 13:29                                                         ` Hesse, Christian
     [not found]                                                           ` <200611091429.57097.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-09 14:03                                                             ` Hesse, Christian
     [not found]                                                               ` <200611091503.25231.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-09 14:27                                                                 ` Avi Kivity
2006-11-10  8:09                                                         ` Hesse, Christian
     [not found]                                                           ` <200611100909.32168.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-10 15:51                                                             ` Avi Kivity
     [not found]                                                               ` <45549FF0.8070207-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-14 10:41                                                                 ` Avi Kivity
     [not found]                                                                   ` <45599D57.2090001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-14 10:55                                                                     ` Avi Kivity
2006-11-16 13:03                                                                     ` Hesse, Christian
     [not found]                                                                       ` <200611161403.13461.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-18 10:16                                                                         ` Hesse, Christian
     [not found]                                                                           ` <200611181116.07278.mail-8oMOrB1mGocUSW6y5lq3GQ@public.gmane.org>
2006-11-19  8:22                                                                             ` Avi Kivity

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