aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2008-07-03 12:02:36 -0400
committerAvi Kivity <avi@qumranet.com>2008-07-06 04:05:18 -0400
commitca3739327b89bb4053a62ac41b67b106c1967ab0 (patch)
treee6bc50886363c3af4875c84ab60a3965409dcbf8
parentb7279469d66b55119784b8b9529c99c1955fe747 (diff)
x86: KVM guest: Add memory clobber to hypercalls
Hypercalls can modify arbitrary regions of memory. Make sure to indicate this in the clobber list. This fixes a hang when using KVM_GUEST kernel built with GCC 4.3.0. This was originally spotted and analyzed by Marcelo. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--include/asm-x86/kvm_para.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/asm-x86/kvm_para.h b/include/asm-x86/kvm_para.h
index bfd9900742bf..76f392146daa 100644
--- a/include/asm-x86/kvm_para.h
+++ b/include/asm-x86/kvm_para.h
@@ -71,7 +71,8 @@ static inline long kvm_hypercall0(unsigned int nr)
71 long ret; 71 long ret;
72 asm volatile(KVM_HYPERCALL 72 asm volatile(KVM_HYPERCALL
73 : "=a"(ret) 73 : "=a"(ret)
74 : "a"(nr)); 74 : "a"(nr)
75 : "memory");
75 return ret; 76 return ret;
76} 77}
77 78
@@ -80,7 +81,8 @@ static inline long kvm_hypercall1(unsigned int nr, unsigned long p1)
80 long ret; 81 long ret;
81 asm volatile(KVM_HYPERCALL 82 asm volatile(KVM_HYPERCALL
82 : "=a"(ret) 83 : "=a"(ret)
83 : "a"(nr), "b"(p1)); 84 : "a"(nr), "b"(p1)
85 : "memory");
84 return ret; 86 return ret;
85} 87}
86 88
@@ -90,7 +92,8 @@ static inline long kvm_hypercall2(unsigned int nr, unsigned long p1,
90 long ret; 92 long ret;
91 asm volatile(KVM_HYPERCALL 93 asm volatile(KVM_HYPERCALL
92 : "=a"(ret) 94 : "=a"(ret)
93 : "a"(nr), "b"(p1), "c"(p2)); 95 : "a"(nr), "b"(p1), "c"(p2)
96 : "memory");
94 return ret; 97 return ret;
95} 98}
96 99
@@ -100,7 +103,8 @@ static inline long kvm_hypercall3(unsigned int nr, unsigned long p1,
100 long ret; 103 long ret;
101 asm volatile(KVM_HYPERCALL 104 asm volatile(KVM_HYPERCALL
102 : "=a"(ret) 105 : "=a"(ret)
103 : "a"(nr), "b"(p1), "c"(p2), "d"(p3)); 106 : "a"(nr), "b"(p1), "c"(p2), "d"(p3)
107 : "memory");
104 return ret; 108 return ret;
105} 109}
106 110
@@ -111,7 +115,8 @@ static inline long kvm_hypercall4(unsigned int nr, unsigned long p1,
111 long ret; 115 long ret;
112 asm volatile(KVM_HYPERCALL 116 asm volatile(KVM_HYPERCALL
113 : "=a"(ret) 117 : "=a"(ret)
114 : "a"(nr), "b"(p1), "c"(p2), "d"(p3), "S"(p4)); 118 : "a"(nr), "b"(p1), "c"(p2), "d"(p3), "S"(p4)
119 : "memory");
115 return ret; 120 return ret;
116} 121}
117 122