From: Paolo Bonzini <pbonzini@redhat.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>, Alexander Graf <agraf@suse.de>,
qemu-devel Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] Re: [PATCH 28/40] xenner: libxc emu: evtchn
Date: Tue, 02 Nov 2010 11:06:35 +0100 [thread overview]
Message-ID: <4CCFE2AB.1050204@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1011020031100.1407@kaball-desktop>
On 11/02/2010 05:33 AM, Stefano Stabellini wrote:
> On Mon, 1 Nov 2010, Anthony Liguori wrote:
>> On 11/01/2010 02:47 PM, Alexander Graf wrote:
>>> Where else would it belong? Qemu is an emulator. Device emulation belongs to qemu code. The xen PV machine is nothing but a special case of the pc machine with custom firmware and odd devices :).
>>>
>>> As I stated in my cover letter, the goal of all this should be to have the qemu pieces be 100% independent of any xen headers or libraries,
>>
>> I'm not sure I agree with the goal. I think where ever possible we
>> should reuse code with the Xen project when it makes sense. Reusing
>> blkback/netback is impossible because we want userspace implementations
>> and the current implementations are in the kernel. blktap also doesn't
>> tie into the QEMU block layer and making it tie into the QEMU block
>> layer would probably result in more code than it saved.
>>
>> OTOH, xenstored and xenconsoled have very little direct dependence on
>> Xen. I'm not saying that we shouldn't make things Just Work in QEMU, so
>> if that means spawning xenconsoled/xenstored automagically from QEMU
>> with special options, that's perfectly fine.
>>
>> But to replicate the functionality of this code solely because of NIH
>> seems like a waste of effort.
>
> I am a strong proponent of code sharing and reuse so I agree with
> Anthony on this: we should reuse Xen libraries and daemons as much as
> possible. If you need some patches to port xenstored and/or xenconsoled
> to PowerPC we would gladly accept them.
The question is, how much do the Xen userspace and Xenner have in common?
If you remove code that Xen runs in the hypervisor or in the dom0
kernel, or code that (like xenconsoled) is IMHO best moved to the Xenner
kernel, what remains is the domain builder and of course xenstore
handling. The domain builder is in libxc, which makes it hard to share,
and this leaves xenstore.
Now, half of it (the ring buffer protocol) already has a million
duplicate implementation in userspace, in the kernel, in Windows PV
drivers (at least three independent versions), and is pretty much set in
stone.
So, what remains is actually parsing the xenstore messages and handling
the tree data structure. Which is actually a _very_ small part of
xenstored: xenstored has to work across multiple domains and clients, be
careful about inter-domain security, and so on. Xenner has the _big_
advantage of having total independence between domUs (it's like if each
domU had its own little dom0, its own little xenstore and so on). While
it doesn't mean there are no security concerns with guest-facing code,
it simplifies the code to the point where effectively it makes no sense
to share anything but the APIs.
I took a look at recent changes to libxs and xenstored in
xen-unstable.hg. Here are some subjects going back to c/s 17400 (about
30 months):
- xenstore: libxenstore: fix threading bug which cause xend startup hang
- xenstore: correctly handle errors from read_message
- xenstore: Make sure that libxs reports an error if xenstored drops
- xenstore: Fix cleanup_pop() definition for some (buggy) pthread.h headers.
- xs: avoid pthread_join deadlock in xs_daemon_close
- xs: make sure mutexes are cleaned up and memory freed if the read
thread is cancelled
- xenstore,libxl: cleanup of xenstore connections across fork()
- xenstored: fix use-after free bug
- xenstore: Fix a memory leak in 'xs_is_domain_introduced'.
- xenstored: Fix xenstored abort when connection dropped.
- xenstore: fix canonicalize for metanodes
Almost all of them are about threading or error conditions, and even
those that aren't wouldn't apply to a simple implementation like
Xenner's. This shows that the risk of missing bugfixes in guest-facing
code is much smaller than one would think (including what I thought).
(BTW, I noticed that Xenner does not limit guest segments like Xen does.
Does it mean the guest can overwrite the Xenner kernel and effectively
run ring0?)
Paolo
next prev parent reply other threads:[~2010-11-02 13:38 UTC|newest]
Thread overview: 96+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-01 15:01 [Qemu-devel] [PATCH 00/40] RFC: Xenner Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 01/40] elf: Move translate_fn to helper struct Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 02/40] elf: Add notes implementation Alexander Graf
2010-11-01 18:29 ` Blue Swirl
2010-11-01 18:42 ` Stefan Weil
2010-11-01 19:51 ` Alexander Graf
2010-11-01 20:19 ` Stefan Weil
2010-11-01 21:17 ` Alexander Graf
2010-11-01 21:28 ` [Qemu-devel] " Paolo Bonzini
2010-11-01 21:31 ` [Qemu-devel] " Stefan Weil
2010-11-02 10:17 ` Michael Matz
2010-11-01 18:41 ` [Qemu-devel] " Paolo Bonzini
2010-11-01 18:52 ` Alexander Graf
2010-11-01 19:43 ` Paolo Bonzini
2010-11-01 19:48 ` Alexander Graf
2010-11-01 21:23 ` Paolo Bonzini
2010-11-01 15:01 ` [Qemu-devel] [PATCH 03/40] elf: add header notification Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 04/40] elf: add section analyzer Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 05/40] xen-disk: disable aio Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 06/40] qdev-ify: xen backends Alexander Graf
2010-11-02 10:08 ` Markus Armbruster
2010-11-02 10:43 ` Gerd Hoffmann
2010-11-02 13:26 ` Markus Armbruster
2010-11-01 15:01 ` [Qemu-devel] [PATCH 07/40] xenner: kernel: 32 bit files Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 08/40] xenner: kernel: 64-bit files Alexander Graf
2010-11-01 15:44 ` Anthony Liguori
2010-11-01 15:47 ` Alexander Graf
2010-11-01 15:59 ` Anthony Liguori
2010-11-01 19:00 ` Blue Swirl
2010-11-01 19:02 ` Anthony Liguori
2010-11-01 19:05 ` Alexander Graf
2010-11-01 19:23 ` Blue Swirl
2010-11-01 19:37 ` Anthony Liguori
2010-11-01 15:01 ` [Qemu-devel] [PATCH 09/40] xenner: kernel: Global data Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 10/40] xenner: kernel: Hypercall handler (i386) Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 11/40] xenner: kernel: Hypercall handler (x86_64) Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 12/40] xenner: kernel: Hypercall handler (generic) Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 13/40] xenner: kernel: Headers Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 14/40] xenner: kernel: Instruction emulator Alexander Graf
2010-11-01 15:41 ` malc
2010-11-01 18:46 ` [Qemu-devel] " Paolo Bonzini
2010-11-01 15:01 ` [Qemu-devel] [PATCH 15/40] xenner: kernel: lapic code Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 16/40] xenner: kernel: Main (i386) Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 17/40] xenner: kernel: Main (x86_64) Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 18/40] xenner: kernel: Main Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 19/40] xenner: kernel: Makefile Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 20/40] xenner: kernel: mmu support for 32-bit PAE Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 21/40] xenner: kernel: mmu support for 32-bit normal Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 22/40] xenner: kernel: mmu support for 64-bit Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 23/40] xenner: kernel: generic MM functionality Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 24/40] xenner: kernel: printk Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 25/40] xenner: kernel: KVM PV code Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 26/40] xenner: kernel: xen-names Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 27/40] xenner: add xc_dom.h Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 28/40] xenner: libxc emu: evtchn Alexander Graf
2010-11-01 15:45 ` Anthony Liguori
2010-11-01 15:49 ` Alexander Graf
2010-11-01 16:01 ` Anthony Liguori
2010-11-01 16:07 ` Alexander Graf
2010-11-01 16:14 ` Anthony Liguori
2010-11-01 16:15 ` Alexander Graf
2010-11-01 19:39 ` [Qemu-devel] " Paolo Bonzini
2010-11-01 19:41 ` Anthony Liguori
2010-11-01 19:47 ` Alexander Graf
2010-11-01 20:32 ` Anthony Liguori
2010-11-01 21:47 ` Paolo Bonzini
2010-11-01 22:00 ` Anthony Liguori
2010-11-01 22:08 ` Paolo Bonzini
2010-11-01 22:29 ` Anthony Liguori
2010-11-02 4:33 ` Stefano Stabellini
2010-11-02 10:06 ` Paolo Bonzini [this message]
2010-11-02 10:31 ` Gerd Hoffmann
2010-11-02 10:38 ` Paolo Bonzini
2010-11-02 13:55 ` Stefano Stabellini
2010-11-02 15:48 ` Alexander Graf
2010-11-02 19:20 ` Stefano Stabellini
2010-11-01 15:01 ` [Qemu-devel] [PATCH 29/40] xenner: libxc emu: grant tables Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 30/40] xenner: libxc emu: memory mapping Alexander Graf
2010-11-01 15:12 ` malc
2010-11-01 15:15 ` Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 31/40] xenner: libxc emu: xenstore Alexander Graf
2010-11-01 18:36 ` Blue Swirl
2010-11-01 15:01 ` [Qemu-devel] [PATCH 32/40] xenner: emudev Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 33/40] xenner: core Alexander Graf
2010-11-01 15:13 ` malc
2010-11-01 15:01 ` [Qemu-devel] [PATCH 34/40] xenner: PV machine Alexander Graf
2010-11-01 15:01 ` [Qemu-devel] [PATCH 35/40] xenner: Domain Builder Alexander Graf
2010-11-02 10:09 ` [Qemu-devel] " Paolo Bonzini
2010-11-02 15:36 ` Alexander Graf
2010-11-02 15:51 ` Paolo Bonzini
2010-11-02 16:28 ` Alexander Graf
2010-11-01 15:21 ` [Qemu-devel] [PATCH 00/40] RFC: Xenner Alexander Graf
2010-11-02 16:26 ` [Qemu-devel] [PATCH 36/40] xen: only create dummy env when necessary Alexander Graf
2010-11-02 16:26 ` [Qemu-devel] [PATCH 38/40] xenner: integrate into build system Alexander Graf
2010-11-02 16:26 ` [Qemu-devel] [PATCH 39/40] xenner: integrate into xen pv machine Alexander Graf
2010-11-02 16:26 ` [Qemu-devel] [PATCH 40/40] xen: add sysrq support Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CCFE2AB.1050204@redhat.com \
--to=pbonzini@redhat.com \
--cc=agraf@suse.de \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefano.stabellini@eu.citrix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).