* [kvm-unit-tests PATCH] x86/hyperv_clock: be explicit about mul instruction data size
@ 2017-05-11 19:59 Thomas Petazzoni
2017-05-12 15:10 ` Radim Krčmář
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni @ 2017-05-11 19:59 UTC (permalink / raw)
To: kvm; +Cc: Thomas Petazzoni
With gcc 4.7.2, the build fails with:
x86/hyperv_clock.c: Assembler messages:
x86/hyperv_clock.c:21: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
In order to avoid this, make the mul instruction data size explicit by
adding the appropriate suffix. It operates on 64-bit data, so use
"mulq".
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
x86/hyperv_clock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/x86/hyperv_clock.c b/x86/hyperv_clock.c
index 8b1deba..6c4dd56 100644
--- a/x86/hyperv_clock.c
+++ b/x86/hyperv_clock.c
@@ -19,7 +19,7 @@ static inline u64 scale_delta(u64 delta, u64 mul_frac)
u64 product, unused;
__asm__ (
- "mul %3"
+ "mulq %3"
: "=d" (product), "=a" (unused) : "1" (delta), "rm" ((u64)mul_frac) );
return product;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [kvm-unit-tests PATCH] x86/hyperv_clock: be explicit about mul instruction data size
2017-05-11 19:59 [kvm-unit-tests PATCH] x86/hyperv_clock: be explicit about mul instruction data size Thomas Petazzoni
@ 2017-05-12 15:10 ` Radim Krčmář
0 siblings, 0 replies; 2+ messages in thread
From: Radim Krčmář @ 2017-05-12 15:10 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: kvm
2017-05-11 21:59+0200, Thomas Petazzoni:
> With gcc 4.7.2, the build fails with:
>
> x86/hyperv_clock.c: Assembler messages:
> x86/hyperv_clock.c:21: Error: no instruction mnemonic suffix given and no register operands; can't size instruction
>
> In order to avoid this, make the mul instruction data size explicit by
> adding the appropriate suffix. It operates on 64-bit data, so use
> "mulq".
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-12 15:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-11 19:59 [kvm-unit-tests PATCH] x86/hyperv_clock: be explicit about mul instruction data size Thomas Petazzoni
2017-05-12 15:10 ` Radim Krčmář
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).