All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Jamie Lokier <jamie@shareable.org>
Cc: Glauber Costa <glommer@redhat.com>,
	aliguori@us.ibm.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH] remove pieces of source code
Date: Sun, 31 May 2009 17:43:35 +0200	[thread overview]
Message-ID: <4A22A5A7.9060504@web.de> (raw)
In-Reply-To: <20090531145358.GA25422@shareable.org>

[-- Attachment #1: Type: text/plain, Size: 4840 bytes --]

Jamie Lokier wrote:
> Jan Kiszka wrote:
>>>  o There is no alternative for non-Linux users and folks with non-VT/SVM
>>> hardware
>> The non-HVM argument will become widely irrelevant (for desktops) very
>> soon.
> 
> Only if your looking at the virtualisation market.
> As far as I know
> 
>     - There are no non-Intel, non-AMD CPUs which support HVM
>     - Laptops are outselling desktops these days
>     - Little low-power PCs are gaining in popularity at home

VIA will soon (or already started to?) deliver working VT-x support with
their CPUs. As HVM also became a marketing tag, probably only very
resource-restricted systems will soon be sold without it, and on those
kqemu is no fun anyway (at best only for very very resource-restricted
guests).

> 
> Personally I have HVM on one of my laptops but not the other.  I have
> several "media player" nano-ITX PCs, and I don't think any of them
> support HVM, even the Intel ones.  I have one dual-AMD desktop machine
> which does not have HVM.  I have access to two big Intel Xeon servers.
> Only one has HVM, and annoyingly the faster one does not have HVM,
> even though it's 64-bit.
> 
> That's only 2 out 7 PC types I have ready access to which have HVM.
> 
> I do understand the wish to drop KQEMU, and I understand the wish of
> the staff developers to not want to spend time supporting platforms
> they aren't using themselves, and aren't their customers.  Especially
> when it complicates the code base.
> 
> But it will make QEMU a less useful tool for some.
> 
> I suspect if QEMU development was still a "hobby" project, the
> "coolness factor" of being able to do things like KQEMU would win over
> "target market" rule which I guess is more motivating for paid developers.

That wouldn't change any of the technical problems it has. If we had no
broadly available HVM support today, /then/ you could bet that a kqemu
rewrite would be on the way, either driven by hobbyists or commercial use.

> 
> Anyway, we had this discussion before and the obvious conclusion was
> that the only viable way to keep KQEMU is if there are volunteers
> stepping up to maintain it, both the userspace and kernel portions.
> 
> Or ideally, to replace it with something KVM-compatible, as that would
> reduce the maintenance burden.
> 
> For replacing KQEMU on Linux, that's realistic I think.  Either it's
> done, or there's no maintainer anyway.
> 
> But for non-Linux hosts I see a non-technical problem:
> 
>    - Without API documentation you have to read the KVM source code.
> 
>    - Those goes doubly so for the fiddly bits like kernel APIC
>      emulation and virtio.
> 
>    - But it may not be legally safe to read the KVM source code and
>      reimplement it in such detail for a GPL-incompatible target kernel.
>      (It might be seen as a form of translation).

For that case (and Avi still haven written the API docs): Take (at
least) two people, one reading the source and writing that docs and the
others reading the docs and re-implementing a backend under whatever
license they want.

> 
> (We've already seen someone implementing a virtio driver on the list
> who was worried about GPL implications).
> 
> So how can anyone implement a KVM-compatible replacement for KQEMU on
> other host platforms?

It's not that easy. The major design challenge is that kqemu is running
in cooperative mode with TCG, using the latter to handle cases the
in-kernel monitor cannot (or doesn't want to due to performance/latency
impact). Kvm does not need this as its guest-host switches are less
frequent and less heavy. We played with an approach to drive kqemu into
the same direction (patch and trap those un-virtualizable instructions)
and reduced the exists. The next step would have been to adopt kvm's I/O
handling philosophy (or even code), but problems of our approach on
heavily segmented guests stopped the effort.

There might have been another issue of the patch&trap approach:
self-checking guests (you can't easily hide the binary changes from the
guest). Then the only option would have been to translate the guest code
like TCG already does, but optimized for host = guest = x86. But that
effort would have been enormous and simply no longer worth it.


That said, I think the best one can do for kqemu remaining a qemu
citizen is to move it out of the way the latter wants to take, e.g.
eliminating the reason for

/* address in the RAM (different from a physical address) */
#ifdef CONFIG_KQEMU
/* FIXME: This is wrong.  */
typedef uint32_t ram_addr_t;
#else
typedef unsigned long ram_addr_t;
#endif

or reducing the impact of its hooks. One could, as another example, push
the hooks in cpu_in/out to helpers injected into the TCG output.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  reply	other threads:[~2009-05-31 15:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28 23:03 [Qemu-devel] [PATCH] remove pieces of source code Glauber Costa
2009-05-29  5:50 ` Anthony Liguori
2009-05-29  9:08   ` [Qemu-devel] " Jan Kiszka
2009-05-29  9:12     ` Anthony Liguori
2009-05-29  9:35       ` Stefan Weil
2009-06-02 20:09       ` Stuart Brady
2009-06-02 20:29         ` Avi Kivity
2009-05-29 10:00     ` Daniel P. Berrange
2009-05-29 10:20       ` Jan Kiszka
2009-05-29 11:35     ` Glauber Costa
2009-05-30 18:04     ` François Revol
2009-05-31  9:13       ` Jan Kiszka
2009-05-31 14:53     ` Jamie Lokier
2009-05-31 15:43       ` Jan Kiszka [this message]
2009-05-29 11:32   ` [Qemu-devel] " Glauber Costa
2009-05-29 11:42     ` Gerd Hoffmann
2009-05-29 15:43     ` [Qemu-devel] " Consul
2009-05-29 18:49       ` Glauber Costa
2009-05-30 10:26         ` Andreas Färber
2009-05-31  9:15           ` Jan Kiszka
2009-05-31 13:08             ` Andreas Färber
2009-05-31 13:40               ` Avi Kivity
2009-05-31 16:20                 ` M. Warner Losh
2009-05-31 15:10               ` Jan Kiszka
2009-06-06 10:17                 ` Andreas Färber

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=4A22A5A7.9060504@web.de \
    --to=jan.kiszka@web.de \
    --cc=aliguori@us.ibm.com \
    --cc=glommer@redhat.com \
    --cc=jamie@shareable.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.