Breaks i386 build.
Signed-off-by: Avi Kivity <[email protected]>
---
arch/x86/kvm/x86.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 1d71b13..c9d99e5 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1034,7 +1034,14 @@ void kvm_write_tsc(struct kvm_vcpu *vcpu, u64 data)
/* n.b - signed multiplication and division required */
nsdiff = data - kvm->arch.last_tsc_write;
+#ifdef CONFIG_X86_64
nsdiff = (nsdiff * 1000) / vcpu->arch.virtual_tsc_khz;
+#else
+ /* do_div() only does unsigned */
+ asm("idiv %2; xor %%edx, %%edx"
+ : "=A"(nsdiff)
+ : "A"(nsdiff * 1000), "rm"(vcpu->arch.virtual_tsc_khz));
+#endif
nsdiff -= elapsed;
if (nsdiff < 0)
nsdiff = -nsdiff;
--
1.7.9
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html