From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFppE-0004Gg-TU for qemu-devel@nongnu.org; Fri, 29 Apr 2011 11:41:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFppD-0001c1-TQ for qemu-devel@nongnu.org; Fri, 29 Apr 2011 11:41:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59043) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFppD-0001bv-IW for qemu-devel@nongnu.org; Fri, 29 Apr 2011 11:41:47 -0400 From: Alex Williamson In-Reply-To: <20110429153450.GC27816@redhat.com> References: <20110429031437.3796.49456.stgit@s20.home> <20110429150640.GB27816@redhat.com> <4DBAD942.6080001@siemens.com> <20110429153450.GC27816@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 29 Apr 2011 09:41:44 -0600 Message-ID: <1304091704.3418.14.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Fix phys memory client - pass guest physical address not region offset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Jan Kiszka , qemu-devel@nongnu.org On Fri, 2011-04-29 at 18:34 +0300, Michael S. Tsirkin wrote: > On Fri, Apr 29, 2011 at 05:29:06PM +0200, Jan Kiszka wrote: > > On 2011-04-29 17:06, Michael S. Tsirkin wrote: > > > On Thu, Apr 28, 2011 at 09:15:23PM -0600, Alex Williamson wrote: > > >> When we're trying to get a newly registered phys memory client updated > > >> with the current page mappings, we end up passing the region offset > > >> (a ram_addr_t) as the start address rather than the actual guest > > >> physical memory address (target_phys_addr_t). If your guest has less > > >> than 3.5G of memory, these are coincidentally the same thing. If > > > > I think this broke even with < 3.5G as phys_offset also encodes the > > memory type while region_offset does not. So everything became RAMthis > > way, no MMIO was announced. > > > > >> there's more, the region offset for the memory above 4G starts over > > >> at 0, so the set_memory client will overwrite it's lower memory entries. > > >> > > >> Instead, keep track of the guest phsyical address as we're walking the > > >> tables and pass that to the set_memory client. > > >> > > >> Signed-off-by: Alex Williamson > > > > > > Acked-by: Michael S. Tsirkin > > > > > > Given all this, can yo tell how much time does > > > it take to hotplug a device with, say, a 40G RAM guest? > > > > Why not collect pages of identical types and report them as one chunk > > once the type changes? > > Sure, but before we bother to optimize this, is this too slow? At a set_memory call per 4k page, it's probably worthwhile to factor in some simply optimizations. My set_memory callback was being hit 10^6 times. Thanks, Alex