From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45229 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5NMw-0007Li-0l for qemu-devel@nongnu.org; Thu, 31 Mar 2011 15:17:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5NMu-0004E6-NY for qemu-devel@nongnu.org; Thu, 31 Mar 2011 15:17:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5NMu-0004Dg-EI for qemu-devel@nongnu.org; Thu, 31 Mar 2011 15:17:20 -0400 Subject: Re: [Qemu-devel] [PATCH RFC] vga: flag vga ram for notifiers From: Alex Williamson In-Reply-To: <4D94CFA0.3030605@codemonkey.ws> References: <20110331174328.GA25133@redhat.com> <4D94C916.6080709@codemonkey.ws> <20110331184940.GA25688@redhat.com> <4D94CFA0.3030605@codemonkey.ws> Content-Type: text/plain; charset="UTF-8" Date: Thu, 31 Mar 2011 13:17:15 -0600 Message-ID: <1301599035.3131.8.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" On Thu, 2011-03-31 at 14:01 -0500, Anthony Liguori wrote: > On 03/31/2011 01:49 PM, Michael S. Tsirkin wrote: > > On Thu, Mar 31, 2011 at 01:33:58PM -0500, Anthony Liguori wrote: > >> On 03/31/2011 12:43 PM, Michael S. Tsirkin wrote: > >>> Currently, vga cards that allocate vga ram, > >>> register it as regular ram. When this happens > >>> a lot, vhost need to get notified and flush > >>> its memory tables, which is slow. > >>> > >>> This was observed with cirrus vga. > >>> > >>> As a solution, add an explicit flag when > >>> registering vga ram, vhost-net can simply ignore it. > >>> > >>> Long term, we might be able to use this API > >>> to avoid the need to request > >>> dirty loggin from devices explicitly. > >>> > >>> Tested: with cirrus vga only. > >>> > >>> Signed-off-by: Michael S. Tsirkin > >> Treating vga specially is not the right approach. > >> > >> You want to treat real RAM specially and only make that visible to > >> vhost. See http://wiki.qemu.org/Features/RamAPI > > That seems like a dead project? And VGa is unhandled there. > > Just needs some love. > > VGA is just another device. It happens to be that we treat VGA device > memory as something that behaves like ram occassionally but that does > not make it RAM. > > Something like vhost doesn't need to see anything but RAM. If we have a > mechanism to identify RAM as RAM, then vhost can only look at RAM memory > and not worry about things like VGA. > > I thought Alex had gotten a mini-version of RamAPI in but I can't seem > to figure out what that included. At any rate, the point is still that > registering things that you want to exclude in vhost is the wrong > approach, you want to explicitly mark the things you want to include. Conveniently I've just started to push my WIP VFIO patches out to a public tree. You can find the minimal RamAPI in these: https://github.com/awilliam/qemu-kvm-vfio/commit/182e557b544bb6e8c6cc57a2a6075d768d224082 https://github.com/awilliam/qemu-kvm-vfio/commit/a505fe08defb4fa1720fffbdf3489289bc930264 (I reserve the right to break these commits) VFIO only needs the ram_for_each_slot() interface to setup and teardown the iommu, but obviously this should include memory client type callbacks for things that only want to track memory. Alex