qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Project idea: make QEMU more flexible
@ 2014-01-06 12:54 Wei Liu
  2014-01-06 13:23 ` Peter Crosthwaite
                   ` (2 more replies)
  0 siblings, 3 replies; 43+ messages in thread
From: Wei Liu @ 2014-01-06 12:54 UTC (permalink / raw)
  To: qemu-devel, xen-devel; +Cc: wei.liu2

Hi all

This idea is to modify QEMU's Makefiles, plus implementing some stubs to
make it possible to tailor QEMU to a smaller binary.

The current setup for Xen on X86 is to build i386-softmmu, and uses this
single binary for two purposes:
1. serves as device emulator for HVM guest.
2. serves as PV driver backend for PV guest.

Either case CPU emulation is never used because Xen handles that
already. So we are in fact having a load of unused code in QEMU build.

What I have in mind is to build a QEMU binary which:
1. does not include CPU emulation code at all.
2. only includes components that's useful (what's useful is TBD).

And the rationales behind this idea are:

1. Reduce memory footprint. One usecase would be running Xen on embedded
   platform (X86 or ARM). We would expect the system has very limited
   resources. The smaller the binary, the better.

2. It doesn't make sense to have i386 emulation on ARM platform.
   Arguably nobody can prevent user from running i386 emulator on ARM
   platform, but it doesn't make sense in Xen's setup where QEMU is
   only used as PV device backend on ARM.

3. Security concern. It's much easier to audit small code base.

Please note that I'm not proposing to invalidate all the other usecases.
I'm only speaking with my Xen developer's hat on, aiming to make QEMU
more flexible.

Down to implementation level I only need to (hopefully) add a few stubs
and create some new CONFIG_* options and move a few things around. It
might not be as intrusive as one thinks.

In fact I've already hacked a prototype during Christmas. What's I've
done so far:

1. create target-null which only has some stubs to CPU emulation
   framework.

2. add a few lines to configure / Makefiles*, create
   default-configs/null-softmmu

Finally I got a qemu-system-null. And the effect is immediately visible
-- the size of QEMU binary shrinked from 13MB to 7.6MB. I haven't really
looked at what device emulation code can be removed so the size can even
be made smaller.

What do you think about this idea?

Thanks
Wei.

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

end of thread, other threads:[~2014-02-04  4:32 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-06 12:54 [Qemu-devel] Project idea: make QEMU more flexible Wei Liu
2014-01-06 13:23 ` Peter Crosthwaite
2014-01-06 15:11   ` Wei Liu
2014-01-06 16:32     ` Peter Maydell
2014-01-06 17:34       ` Stefano Stabellini
2014-01-06 18:06         ` Peter Maydell
2014-01-07 13:26           ` Stefano Stabellini
2014-01-07 13:35             ` Peter Maydell
2014-01-07 13:50             ` Paolo Bonzini
2014-01-07 14:34               ` Stefano Stabellini
2014-01-07 14:38               ` Wei Liu
2014-01-07 14:40                 ` Paolo Bonzini
2014-01-07 15:11               ` Peter Maydell
2014-01-07 15:34                 ` Paolo Bonzini
2014-01-06 13:25 ` [Qemu-devel] [Xen-devel] " Frediano Ziglio
2014-01-06 14:17   ` Stefano Stabellini
2014-01-06 14:21     ` Peter Maydell
2014-01-06 14:27       ` Anthony Liguori
2014-01-06 14:54         ` Stefano Stabellini
2014-01-06 15:04           ` Peter Maydell
2014-01-06 20:59             ` Paolo Bonzini
2014-01-06 15:39           ` Anthony Liguori
2014-01-06 15:57             ` Stefano Stabellini
2014-01-06 17:49               ` Anthony Liguori
2014-01-06 18:04                 ` Stefano Stabellini
2014-01-06 18:00             ` Andreas Färber
2014-01-06 20:53               ` Paolo Bonzini
2014-01-07 12:34                 ` Wei Liu
2014-01-07 13:32                   ` Paolo Bonzini
2014-01-07 13:37                     ` Wei Liu
2014-01-21 18:27                     ` Wei Liu
2014-01-22 10:20                       ` Paolo Bonzini
2014-01-22 12:09                         ` Wei Liu
2014-01-22 16:09                         ` Wei Liu
2014-01-23  9:11                           ` Paolo Bonzini
2014-01-23 13:54                             ` Wei Liu
2014-01-23 16:23                               ` Wei Liu
2014-02-04  4:32                                 ` Paolo Bonzini
2014-01-06 13:30 ` [Qemu-devel] " Peter Maydell
2014-01-06 15:12   ` Wei Liu
2014-01-06 18:12     ` Andreas Färber
2014-01-06 18:25       ` Wei Liu
2014-01-07 13:10         ` [Qemu-devel] [Xen-devel] " 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).