Re: problem wit svm_get_msr on kvm-kmod-2.6.31.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/16/2009 01:17 PM, Dietmar Maurer wrote:
     38f0:       0f 85 82 01 00 00       jne    3a78<svm_get_msr+0x2b8>
     38f6:       48 8b 87 e0 27 00 00    mov    0x27e0(%rdi),%rax
     38fd:       48 8b 48 50             mov    0x50(%rax),%rcx
     3901:       0f 31                   rdtsc
     3903:       48 01 c8                add    %rcx,%rax

# this is svm_get_msr+0x146
     3906:       48 89 02                mov    %rax,(%rdx)


Looks like a miscompile of native_read_tsc(), it needs to use %edx:%eax, not assume the result is in %rax.

Jan, looks like the culprit is

  static inline unsigned long long kvm_native_read_tsc(void)
  {
        unsigned long long val;
        asm volatile("rdtsc" : "=A" (val));
        return val;
  }

"=A" only works correctly on i386, need to use "=a" "=d" for portability.

--
error compiling committee.c: too many arguments to function

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux