]> git.proxmox.com Git - pve-kernel-2.6.32.git/blob - fix-register-corruption-in-pvclock-scale-delta.patch
remove aacraid patch
[pve-kernel-2.6.32.git] / fix-register-corruption-in-pvclock-scale-delta.patch
1 From: Zachary Amsden <zamsden@redhat.com>
2 Date: Thu, 16 Jun 2011 03:50:04 +0000 (-0700)
3 Subject: KVM: Fix register corruption in pvclock_scale_delta
4 X-Git-Url: http://git.kernel.org/?p=virt%2Fkvm%2Fkvm.git;a=commitdiff_plain;h=eaa6a665a3c0fb5f8dbf25bca02eae5594095f4f
5
6 KVM: Fix register corruption in pvclock_scale_delta
7
8 The 128-bit multiply in pvclock.h was missing an output constraint for
9 EDX which caused a register corruption to appear. Thanks to Ulrich for
10 diagnosing the EDX corruption and Avi for providing this fix.
11
12 Signed-off-by: Zachary Amsden <zamsden@redhat.com>
13 Signed-off-by: Avi Kivity <avi@redhat.com>
14 ---
15
16 diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h
17 index 31d84ac..a518c0a 100644
18 --- a/arch/x86/include/asm/pvclock.h
19 +++ b/arch/x86/include/asm/pvclock.h
20 @@ -22,6 +22,8 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
21 u64 product;
22 #ifdef __i386__
23 u32 tmp1, tmp2;
24 +#else
25 + ulong tmp;
26 #endif
27
28 if (shift < 0)
29 @@ -42,8 +44,11 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift)
30 : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
31 #elif defined(__x86_64__)
32 __asm__ (
33 - "mul %%rdx ; shrd $32,%%rdx,%%rax"
34 - : "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
35 + "mul %[mul_frac] ; shrd $32, %[hi], %[lo]"
36 + : [lo]"=a"(product),
37 + [hi]"=d"(tmp)
38 + : "0"(delta),
39 + [mul_frac]"rm"((u64)mul_frac));
40 #else
41 #error implement me!
42 #endif