qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 18/18] tcx: convert to memory API


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH 18/18] tcx: convert to memory API
Date: Tue, 18 Oct 2011 18:08:54 +0000

On Mon, Oct 17, 2011 at 8:48 PM, Avi Kivity <address@hidden> wrote:
> 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.

Yes.

> What would the API look like?  accept a range, return true if any of the
> pages in the range are dirty?

That would be 1:1 conversion but maybe better approach would be to
return the first dirty address (or zero if not found), then various
bitmap speedups may be available.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]