From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KxLts-0006oQ-TF for qemu-devel@nongnu.org; Tue, 04 Nov 2008 08:24:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KxLts-0006o2-7G for qemu-devel@nongnu.org; Tue, 04 Nov 2008 08:24:52 -0500 Received: from [199.232.76.173] (port=54385 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxLtr-0006nt-Up for qemu-devel@nongnu.org; Tue, 04 Nov 2008 08:24:52 -0500 Received: from mx2.redhat.com ([66.187.237.31]:43587) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KxLtr-0006rf-Eu for qemu-devel@nongnu.org; Tue, 04 Nov 2008 08:24:51 -0500 Message-ID: <49104D1F.1020905@redhat.com> Date: Tue, 04 Nov 2008 15:24:47 +0200 From: Avi Kivity MIME-Version: 1.0 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> In-Reply-To: <1225224814-9875-3-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 3/3] Add KVM support to QEMU Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Glauber Costa , qemu-devel@nongnu.org, kvm-devel 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