From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JKsWU-0002CB-P0 for qemu-devel@nongnu.org; Fri, 01 Feb 2008 04:49:26 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKsWS-0002BX-Ha for qemu-devel@nongnu.org; Fri, 01 Feb 2008 04:49:24 -0500 Received: from mx1.polytechnique.org ([129.104.30.34]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JKsWR-0006rR-Q4 for qemu-devel@nongnu.org; Fri, 01 Feb 2008 04:49:24 -0500 Message-ID: <47A2EB14.8030804@bellard.org> Date: Fri, 01 Feb 2008 10:49:08 +0100 From: Fabrice Bellard MIME-Version: 1.0 References: <1201818980-27534-1-git-send-email-aliguori@us.ibm.com> <1201818980-27534-7-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1201818980-27534-7-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 6/6] QEMU support for the Kernel Virtual Machine interface Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm-devel@lists.sourceforge.net, Anthony Liguori , Paul Brook Anthony Liguori wrote: > This patch actually enables KVM support for QEMU. I apologize that it is so > large but this was the only sane way to preserve bisectability. > > The goal of this patch is to add KVM support, but not to impact users when > KVM isn't being used. It achieves this by using a kvm_enabled() macro that > evaluates to (0) when KVM support is not enabled. An if (kvm_enabled()) is > just as good as using an #ifdef since GCC will eliminate the dead code. > > This patches touches a lot of areas. For performance reasons, the guest CPU > state is not kept in sync with CPUState. This requires an explicit > synchronization whenever CPUState is required. KVM also uses it's own main > loop as it runs each VCPU in it's own thread. > > Trapping VGA updates via MMIO is far too slow when running KVM so there is > additional logic to allow VGA memory to be accessed as RAM. We use KVM's > shadow page tables to keep track of which portions of RAM have been dirtied. > > KVM also supports an in-kernel APIC implementation as a performance > enhancement. Finally, KVM supports APIC TPR patching. This allows TPR > accesses (which are very frequently for Windows) to be patches into CALL > instructions to the BIOS (for 32-bit guests). This results in a very > sigificant performance improvement for Windows guests. > > While this patch is very large, the new files are only included when KVM > support is compiled in. Every change to QEMU is wrapped in an > if (kvm_enabled()) so the code disappears when KVM support is not compiled in. > This is done to ensure no regressions are introduced to normal QEMU. Some questions: - QEMU already maintains modified page status for VGA memory (and kqemu for example fully supports that), so I don't see why KVM needs a new method. - Why is kvm_cpu_register_physical_memory() needed ? kqemu can work without it because there is a remapping between physical memory and RAM address. I suggest to add that feature in KVM or to modify cpu_register_physical_memory() to hide it. - If KVM implements its own CPU loop, why are there patches in libqemu.a (CPU core) ? Regards, Fabrice.