From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFu6Z-0006jK-0I for qemu-devel@nongnu.org; Mon, 17 Oct 2011 16:48:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFu6X-0000Xq-K9 for qemu-devel@nongnu.org; Mon, 17 Oct 2011 16:48:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8641) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFu6X-0000Xi-8t for qemu-devel@nongnu.org; Mon, 17 Oct 2011 16:48:13 -0400 Message-ID: <4E9C9488.4000908@redhat.com> Date: Mon, 17 Oct 2011 22:48:08 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1318860167-14014-1-git-send-email-avi@redhat.com> <1318860167-14014-19-git-send-email-avi@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 18/18] tcx: convert to memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On 10/17/2011 09:13 PM, Blue Swirl wrote: > > > > - ret = cpu_physical_memory_get_dirty(page, VGA_DIRTY_FLAG); > > + ret = memory_region_get_dirty(&s->vram_mem, page, DIRTY_MEMORY_VGA); > > for (off = 0; off < TARGET_PAGE_SIZE * 4; off += TARGET_PAGE_SIZE) { > > - ret |= cpu_physical_memory_get_dirty(page24 + off, VGA_DIRTY_FLAG); > > - ret |= cpu_physical_memory_get_dirty(cpage + off, VGA_DIRTY_FLAG); > > + ret |= memory_region_get_dirty(&s->vram_mem, page24 + off, > > + DIRTY_MEMORY_VGA); > > + ret |= memory_region_get_dirty(&s->vram_mem, cpage + off, > > + DIRTY_MEMORY_VGA); > > Like memory_region_set_dirty(), this should be changed to take a range > so that the for loops and PAGE_SIZEs can be dropped. Agree. Lets' keep it outside this conversion patchset though. What would the API look like? accept a range, return true if any of the pages in the range are dirty? -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.