qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RFC PATCH 0/5] Add configure flag to disable TCG


From: Anthony Liguori
Subject: [Qemu-devel] [RFC PATCH 0/5] Add configure flag to disable TCG
Date: Fri, 2 Sep 2011 16:47:58 -0500

Hi,

There have been a few attempts in the past to allow TCG to be disabled
at build time.  Recently, Alex made the suggestion that we could do it by using
the same trick that we used to introduce kvm support.  That involves introducing
a tcg_enabled() macro that will be (0) if TCG is disabled in the build.

GCC is smart enough to do dead code elimination if it sees an if (0) and the
result is that if you can do:

if (tcg_enabled()) {
  foo();
}

and it's more or less equivalent to:

#ifdef CONFIG_TCG
  foo();
#endif

Without the ugliness that comes from using the preprocessor.  I think this ended
up being pretty straight forward.  exec.c could use a fair bit of cleanup but
other than that, this pretty much eliminates all of the TCG code from the build.

This absolutely is going to break non-x86 KVM builds if they use the
--disable-tcg flag as I haven't tested those yet.  The normal TCG build
shouldn't be affected at all though.

In principle, the code assumes that you need KVM if you don't have TCG.  Of
course, some extra logic could be added to allow for Xen if TCG isn't present.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]