Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b217116 authored by Duncan Sands's avatar Duncan Sands Committed by Avi Kivity
Browse files

KVM: Fix instruction size issue in pvclock scaling



Commit de2d1a52 ("KVM: Fix register corruption in pvclock_scale_delta")
introduced a mul instruction that may have only a memory operand; the
assembler therefore cannot select the correct size:

   pvclock.s:229: Error: no instruction mnemonic suffix given and no register
operands; can't size instruction

In this example the assembler is:

         #APP
         mul -48(%rbp) ; shrd $32, %rdx, %rax
         #NO_APP

A simple solution is to use mulq.

Signed-off-by: default avatarDuncan Sands <baldrick@free.fr>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent b4ca46e4
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -44,7 +44,7 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
		: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
		: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
#elif defined(__x86_64__)
#elif defined(__x86_64__)
	__asm__ (
	__asm__ (
		"mul %[mul_frac] ; shrd $32, %[hi], %[lo]"
		"mulq %[mul_frac] ; shrd $32, %[hi], %[lo]"
		: [lo]"=a"(product),
		: [lo]"=a"(product),
		  [hi]"=d"(tmp)
		  [hi]"=d"(tmp)
		: "0"(delta),
		: "0"(delta),