public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Dietmar Maurer <dietmar@proxmox.com>,
	Jan Kiszka <jan.kiszka@siemens.com>
Cc: kvm <kvm@vger.kernel.org>
Subject: Re: problem wit svm_get_msr on kvm-kmod-2.6.31.6
Date: Mon, 16 Nov 2009 14:01:46 +0200	[thread overview]
Message-ID: <4B013F2A.2040900@redhat.com> (raw)
In-Reply-To: <90D306BE6EBC8D428A824FBBA7A3113D014275E0F5@ronja.maurer-it.com>

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


  reply	other threads:[~2009-11-16 12:01 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-16  9:42 problem wit svm_get_msr on kvm-kmod-2.6.31.6 Dietmar Maurer
2009-11-16 10:18 ` Avi Kivity
2009-11-16 10:46   ` Dietmar Maurer
2009-11-16 10:52     ` Avi Kivity
2009-11-16 11:17       ` Dietmar Maurer
2009-11-16 12:01         ` Avi Kivity [this message]
2009-11-16 12:03           ` Jan Kiszka
2009-11-16 12:06             ` Avi Kivity
2009-11-16 12:08               ` Jan Kiszka
2009-11-16 12:11                 ` Avi Kivity
2009-11-17  8:14             ` Dietmar Maurer
2009-11-17  9:50               ` Jan Kiszka
2009-11-17  9:59                 ` Jan Kiszka
2009-11-17 12:18                   ` Avi Kivity
2009-11-17 17:00                     ` Jan Kiszka
2009-11-18  7:07                       ` Dietmar Maurer
2009-11-17  9:59                 ` Dietmar Maurer
2009-11-16 12:02         ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B013F2A.2040900@redhat.com \
    --to=avi@redhat.com \
    --cc=dietmar@proxmox.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox