* [PATCH] KVM: Fix unsigned asm instruction in kvm_write_tsc()
@ 2012-03-08 11:57 Avi Kivity
2012-03-08 21:45 ` Marcelo Tosatti
0 siblings, 1 reply; 2+ messages in thread
From: Avi Kivity @ 2012-03-08 11:57 UTC (permalink / raw)
To: Marcelo Tosatti, kvm, Randy Dunlap
'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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] KVM: Fix unsigned asm instruction in kvm_write_tsc()
2012-03-08 11:57 [PATCH] KVM: Fix unsigned asm instruction in kvm_write_tsc() Avi Kivity
@ 2012-03-08 21:45 ` Marcelo Tosatti
0 siblings, 0 replies; 2+ messages in thread
From: Marcelo Tosatti @ 2012-03-08 21:45 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm, Randy Dunlap
On Thu, Mar 08, 2012 at 01:57:23PM +0200, Avi Kivity wrote:
> '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(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-08 21:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-08 11:57 [PATCH] KVM: Fix unsigned asm instruction in kvm_write_tsc() Avi Kivity
2012-03-08 21:45 ` Marcelo Tosatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox