From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 3/3] Add KVM support to QEMU Date: Tue, 04 Nov 2008 15:24:47 +0200 Message-ID: <49104D1F.1020905@redhat.com> References: <1225224814-9875-1-git-send-email-aliguori@us.ibm.com> <1225224814-9875-2-git-send-email-aliguori@us.ibm.com> <1225224814-9875-3-git-send-email-aliguori@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org, Glauber Costa , kvm-devel To: Anthony Liguori Return-path: Received: from mx2.redhat.com ([66.187.237.31]:48170 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbYKDNYx (ORCPT ); Tue, 4 Nov 2008 08:24:53 -0500 In-Reply-To: <1225224814-9875-3-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: Anthony Liguori wrote: > This patch adds very basic KVM support. KVM is a kernel module for Linux that > allows userspace programs to make use of hardware virtualization support. It > current supports x86 hardware virtualization using Intel VT-x or AMD-V. It > also supports IA64 VT-i, PPC 440, and S390. > > This patch only implements the bare minimum support to get a guest booting. It > has very little impact the rest of QEMU and attempts to integrate nicely with > the rest of QEMU. > > Even though this implementation is basic, it is significantly faster than TCG. > Booting and shutting down a Linux guest: > > w/TCG: 1:32.36 elapsed 84% CPU > > w/KVM: 0:31.14 elapsed 59% CPU > > Right now, KVM is disabled by default and must be explicitly enabled with > -enable-kvm. We can enable it by default later when we have had better > testing. > > Signed-off-by: Anthony Liguori > > diff --git a/KVM_TODO b/KVM_TODO > new file mode 100644 > index 0000000..9529049 > --- /dev/null > +++ b/KVM_TODO > @@ -0,0 +1,9 @@ > +1) Add hooks for load/save of register state > + o Fixes gdbstub, save/restore, and vmport > +2) Add VGA optimization > +3) Add IO thread > +4) Add guest SMP support > +5) Add TPR optimization > +6) Add support for in-kernel APIC > +7) Add support for in-kernel PIT > +8) Merge in additional changes in kvm-userspace tree > One of the important changes is running with signal delivery disabled, since that's particularly slow (requires save/restore of the floating point state, for example). > + > +typedef struct kvm_userspace_memory_region KVMSlot; > KVMMemorySlot? > + > +static KVMState *kvm_state; > Why a pointer? > + if (ret < 0) { > + dprintf("kvm_create_vcpu failed\n"); > showing errno would be nice. > + > +static void kvm_getput_reg(__u64 *kvm_reg, target_ulong *qemu_reg, int set) > +{ > + if (set) > + *kvm_reg = *qemu_reg; > + else > + *qemu_reg = *kvm_reg; > +} > Ugh. I think live migration is now broken, since kvm accesses will not update the qemu dirty bitmap. -- error compiling committee.c: too many arguments to function