public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <aliguori-NZpS4cJIG2HvQtjrzfazuQ@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 7/7] Allow KVM from a normal QEMU binary
Date: Sun, 05 Nov 2006 11:28:32 -0600	[thread overview]
Message-ID: <454E1F40.2070200@cs.utexas.edu> (raw)
In-Reply-To: <454DAE74.4030306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

Avi Kivity wrote:
> Anthony Liguori wrote:
>> This patch depends on patch 6 and modifies the KVM changes to be an 
>> "accelerator" for QEMU in much the same way kqemu is.
>>
>> The basic idea was to introduce a use_kvm flag in CPUState and, where 
>> appropriate, check for use_kvm before doing KVM specific things.  
>> There are a number of places where a valid CPUState is not available 
>> or simply not created yet.  In these cases, we use the global 
>> kvm_allowed variable.
>
> Applied, with the following changes:
>
> - actually define kvm_allowed (gcc 3.4 insists)

Sorry, I had a small SNAFU with my patch queue with qemu-kvm.c not being 
in the original hg tree.  I had defined kqemu_allowed in qemu-kvm.c but 
that wasn't in this patch.

> - a couple of places had kqemu_allowed instead of kvm_allowed

I guess I lucked out since kqemu_allowed=1 under normal circumstances.  
Thanks for catching that :-)

> - renamed the command line option to -no-kvm (similar to -no-kqemu)

When kqemu first went in, since it was considered "experimental" it had 
to be explicitly enabled with an -enable-kqemu option.  Once it was 
considered to be stable, it was enabled by default (hence -no-kqemu).

It really doesn't matter to me all that much.

>
> Most of the places where USE_KVM is used are now never called - they 
> are relics from the days when we had mixed qemu/kvm execution.

One of the things I was thinking of doing was getting rid of USE_KVM 
completely.  What I was thinking of doing is moving kvmctl.[ch] into the 
QEMU tree and refactoring things a bit so that it fails gracefully in 
the absence of a working KVM device.

The idea is to get rid of external dependencies.  What are your thoughts 
on this?  Do you think there will be significant users of libkvm.a 
outside of QEMU?

> Now, the "big real" fiasco means that we need some sort of emulation, 
> but I'm not sure the qemu cpu loop is the best choice.  Qemu is very 
> complex because it is geared to multi-host, multi-target, 
> high-performance emulation.  The cpu state is baroque, and SMP isn't 
> going to be fun.

Right.

> I think we're better off with taking the x86 emulator from the kernel 
> and extending it to support the non-memory instructions.  It can run 
> in the kernel or userspace since there's no performance requirement.

This is the opposite strategy that Xen is taking FWIW.  You not only 
need a full 16 bit emulator but a 32 bit emulator too (to deal with the 
transitions to/from userspace).

The tree we're working in is:

http://xenbits.xensource.com/ext/xen-unstable-hvm.hg

Linux kernel boots quite nicely and I'm in the process of debugging why 
Windows guests aren't booting (there appears to be a problem in the 
state transfer right now).

SMP guest support is still a hard problem that needs thinking through 
but if Xen solves it, KVM can use the solution (or vice versa).

Don't discount the importance of 16 bit emulation performance.  I use 
QEMU a lot to play old DOS games :-)

Regards,

Anthony Liguori

>>
>> This isn't a very pretty approach but it seems to work.  Figuring out 
>> how to make this all work with SMP is going to largely depend on how 
>> SMP gets implemented in KVM.
>>
>
> If we proceed as outlined above all we need is to slap a lock on all 
> accesses to the device model.  Later we can fine-grain it so that each 
> device has its own lock and accesses to multiple devices can occur in 
> parallel.
>
>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

  parent reply	other threads:[~2006-11-05 17:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-03  6:21 [PATCH 0/7] Split up QEMU patches Anthony Liguori
     [not found] ` <454AE007.5070905-NZpS4cJIG2HvQtjrzfazuQ@public.gmane.org>
2006-11-03  6:25   ` [PATCH 1/7] Compile fix for usb-linux.c Anthony Liguori
2006-11-03  6:26   ` [PATCH 2/7] APIC save/restore fix Anthony Liguori
2006-11-03  6:27   ` [PATCH 3/7] Timer " Anthony Liguori
2006-11-03  6:29   ` [PATCH 4/7] gdbstub for x86-64 Anthony Liguori
2006-11-03  6:30   ` [PATCH 5/7] VMDK Snapshot Support Anthony Liguori
2006-11-03  6:31   ` [PATCH 6/7] KVM changes for QEMU Anthony Liguori
2006-11-03  6:35   ` [PATCH 7/7] Allow KVM from a normal QEMU binary Anthony Liguori
     [not found]     ` <454AE323.8090309-NZpS4cJIG2HvQtjrzfazuQ@public.gmane.org>
2006-11-05  9:27       ` Avi Kivity
     [not found]         ` <454DAE74.4030306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-05 17:28           ` Anthony Liguori [this message]
     [not found]             ` <454E1F40.2070200-NZpS4cJIG2HvQtjrzfazuQ@public.gmane.org>
2006-11-05 17:48               ` Avi Kivity
     [not found]                 ` <454E23EE.7040505-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-05 18:18                   ` Anthony Liguori
     [not found]                     ` <454E2ADC.1060607-NZpS4cJIG2HvQtjrzfazuQ@public.gmane.org>
2006-11-05 18:29                       ` Avi Kivity
     [not found]                         ` <454E2DA4.8070405-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-05 19:53                           ` Anthony Liguori

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=454E1F40.2070200@cs.utexas.edu \
    --to=aliguori-nzps4cjig2hvqtjrzfazuq@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox