From: Avi Kivity 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 for debugging help. Signed-off-by: Avi Kivity Signed-off-by: Andrew Morton --- drivers/kvm/kvm_main.c | 7 +------ 1 files changed, 1 insertion(+), 6 deletions(-) diff -puN drivers/kvm/kvm_main.c~kvm-fix-calculation-of-initial-value-of-rdx-register drivers/kvm/kvm_main.c --- a/drivers/kvm/kvm_main.c~kvm-fix-calculation-of-initial-value-of-rdx-register +++ a/drivers/kvm/kvm_main.c @@ -1053,12 +1053,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) _