From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jr0Aw-0001u4-3V for qemu-devel@nongnu.org; Tue, 29 Apr 2008 20:27:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jr0Au-0001to-PL for qemu-devel@nongnu.org; Tue, 29 Apr 2008 20:27:57 -0400 Received: from [199.232.76.173] (port=52332 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jr0Au-0001tl-LC for qemu-devel@nongnu.org; Tue, 29 Apr 2008 20:27:56 -0400 Received: from py-out-1112.google.com ([64.233.166.182]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jr0Au-0000pZ-9e for qemu-devel@nongnu.org; Tue, 29 Apr 2008 20:27:56 -0400 Received: by py-out-1112.google.com with SMTP id u52so419346pyb.10 for ; Tue, 29 Apr 2008 17:27:54 -0700 (PDT) Message-ID: <4817BD06.5020909@codemonkey.ws> Date: Tue, 29 Apr 2008 19:27:50 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <12094981963747-git-send-email-gcosta@redhat.com> <4817A257.7000800@qumranet.com> <4817B0C8.8080301@redhat.com> In-Reply-To: <4817B0C8.8080301@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [kvm-devel] [PATCH] [RFC] try to reduce kvm impact in core qemu code. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber Costa Cc: kvm-devel@lists.sourceforge.net, qemu-devel@nongnu.org Glauber Costa wrote: > Avi Kivity wrote: > >> Glauber Costa wrote: >> >>> Hi. This is a proposal for reducing the impact of kvm functions in >>> core qemu >>> code. This is by all means not ready, but I felt like posting it, so a >>> discussion >>> on it could follow. >>> >>> The idea in this patch is to replace the specific kvm details from >>> core qemu files >>> like vl.c, with driver_yyy() functions. When kvm is not running, those >>> functions would >>> just return (most of time), absolutely reducing the impact of kvm code. >>> >>> As I wanted to test it, in this patch I changed the kvm functions to >>> be called driver_yyy(), >>> but that's not my final goal. I intend to use a function pointer >>> schema, similar to what the linux >>> kernel already do for a lot of its subsystem, to isolate the changes. >>> >>> Comments deeply welcome. >>> >>> >> While I would be very annoyed if someone referred to kvm as a qemu >> accelerator, I think accelerator_yyy() is more descriptive than >> driver_yyy(). >> > How about booster? ;-) > I don't think the concern from a QEMU perspective is that QEMU is too intimately tied to KVM. The concern is that overtime, it will be very difficult to make changes to QEMU without breaking KVM support because of the shear number of hooks we require. Fabrice had actually suggested merging libkvm into QEMU. We just need to reduce the overall number of if (kvm_enabled()) blocks. You have to understand a lot about KVM to know why it's necessary to do an register reload call-out in the vmport hw for instance. Instead of introducing generic hooks in vmport, a more appropriate solution may be to add wrappers to read individual register values within the QEMU device code. We can then add our hooks to that. I think a good argument can be made that devices should never access env-> directly. Regards, Anthony Liguori