public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* KVM: pvmmu breakage with gcc 4.3.0
@ 2008-06-26  2:10 Marcelo Tosatti
  2008-06-26  3:10 ` Anthony Liguori
  2008-06-26 11:43 ` Avi Kivity
  0 siblings, 2 replies; 13+ messages in thread
From: Marcelo Tosatti @ 2008-06-26  2:10 UTC (permalink / raw)
  To: Avi Kivity, Anthony Liguori; +Cc: Alexandre Oliva, kvm-devel


Some pvmmu functions store their commands on stack, and newer GCC
versions conclude that these commands are unused.

So stick an inline asm statement to convince the compiler otherwise.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>


diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 8b7a3cf..c892752 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -55,6 +55,12 @@ static void kvm_mmu_op(void *buffer, unsigned len)
 	int r;
 	unsigned long a1, a2;
 
+	/*
+   	 * GCC 4.3.0 concludes that on-stack kvm_mmu_op* is unused and
+   	 * optimizes its initialization away.
+ 	 */
+        asm ("" : : "p" (buffer));
+
 	do {
 		a1 = __pa(buffer);
 		a2 = 0;   /* on i386 __pa() always returns <4G */

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-06-29 10:16 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-26  2:10 KVM: pvmmu breakage with gcc 4.3.0 Marcelo Tosatti
2008-06-26  3:10 ` Anthony Liguori
2008-06-26 13:18   ` Christian Borntraeger
2008-06-26 18:06   ` Alexandre Oliva
2008-06-29  8:56     ` Avi Kivity
2008-06-26 11:43 ` Avi Kivity
2008-06-26 12:47   ` Anthony Liguori
2008-06-27 16:11     ` Bill Davidsen
2008-06-26 15:08   ` Christian Borntraeger
2008-06-26 15:21     ` Anthony Liguori
2008-06-26 15:41     ` Anthony Liguori
2008-06-26 16:34       ` Christian Borntraeger
2008-06-29 10:16     ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox