qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH 0/5] Add configure flag to disable TCG
@ 2011-09-02 21:47 Anthony Liguori
  2011-09-02 21:47 ` [Qemu-devel] [PATCH 1/5] configure: add --disable-tcg configure option Anthony Liguori
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Anthony Liguori @ 2011-09-02 21:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alex Graf, Stefano Stabellini

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.

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

end of thread, other threads:[~2011-09-05 14:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-02 21:47 [Qemu-devel] [RFC PATCH 0/5] Add configure flag to disable TCG Anthony Liguori
2011-09-02 21:47 ` [Qemu-devel] [PATCH 1/5] configure: add --disable-tcg configure option Anthony Liguori
2011-09-02 21:48 ` [Qemu-devel] [PATCH 2/5] vl: don't expose TCG as a supported accelerator if TCG is disabled Anthony Liguori
2011-09-02 21:48 ` [Qemu-devel] [PATCH 3/5] tcg: add tcg_enabled() and stop compiling translate.o when " Anthony Liguori
2011-09-02 23:51   ` Peter Maydell
2011-09-02 21:48 ` [Qemu-devel] [PATCH 4/5] tcg: don't build tcg/tcg.o, tcg/optimize.o, or translate-all.o when TCG disabled Anthony Liguori
2011-09-03 12:07   ` Blue Swirl
2011-09-02 21:48 ` [Qemu-devel] [PATCH 5/5] tcg: don't build cpu-exec.o, op_helper.o, or fpu/softloat.o " Anthony Liguori
2011-09-02 23:26   ` Peter Maydell
2011-09-03 12:02   ` Blue Swirl
2011-09-03 11:58 ` [Qemu-devel] [RFC PATCH 0/5] Add configure flag to disable TCG Blue Swirl
2011-09-03 12:50   ` Alexander Graf
2011-09-05 14:53 ` Stefano Stabellini

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).