KVM: Fix unsigned asm instruction in kvm_write_tsc()
PATCH 1/1 KVM: Fix unsigned asm instruction in kvm_write_tsc()
'idiv', when given a memory operand, can't determine the instruction size. Provide it explicitly.
Reported-by Randy Dunlap <[email protected]>
Signed-off-by Avi Kivity <[email protected]>
--- arch/x86/kvm/x86.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/x86.c +1 -1
@@ -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
Signature · 1 line
1.7.9
Marcelo Tosatti
AppliedQuoted 8 lines · Avi Kivity
'idiv', when given a memory operand, can't determine the instruction size. Provide it explicitly.
Reported-by Randy Dunlap <[email protected]>Signed-off-by Avi Kivity <[email protected]>--- arch/x86/kvm/x86.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.