public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Marcelo Tosatti <mtosatti@redhat.com>,
	kvm@vger.kernel.org, Randy Dunlap <rdunlap@xenotime.net>
Subject: [PATCH] KVM: Fix unsigned asm instruction in kvm_write_tsc()
Date: Thu,  8 Mar 2012 13:57:23 +0200	[thread overview]
Message-ID: <1331207843-13711-1-git-send-email-avi@redhat.com> (raw)

'idiv', when given a memory operand, can't determine the instruction
size.  Provide it explicitly.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch/x86/kvm/x86.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 7ce5878..32096cf 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1038,7 +1038,7 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, u64 data)
 	nsdiff = (nsdiff * 1000) / vcpu->arch.virtual_tsc_khz;
 #else
 	/* do_div() only does unsigned */
-	asm("idiv %2; xor %%edx, %%edx"
+	asm("idivl %2; xor %%edx, %%edx"
 	    : "=A"(nsdiff)
 	    : "A"(nsdiff * 1000), "rm"(vcpu->arch.virtual_tsc_khz));
 #endif
-- 
1.7.9


             reply	other threads:[~2012-03-08 11:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-08 11:57 Avi Kivity [this message]
2012-03-08 21:45 ` [PATCH] KVM: Fix unsigned asm instruction in kvm_write_tsc() Marcelo Tosatti

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=1331207843-13711-1-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=rdunlap@xenotime.net \
    /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