qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/4] memory: change dirty setting APIs to take a


From: Blue Swirl
Subject: Re: [Qemu-devel] [PATCH 2/4] memory: change dirty setting APIs to take a size
Date: Sun, 22 Jan 2012 07:40:46 +0000

On Mon, Jan 9, 2012 at 12:11, Avi Kivity <address@hidden> wrote:
> On 01/08/2012 11:10 PM, Blue Swirl wrote:
>> Instead of each target knowing or guessing the guest page size,
>> just pass the desired size of dirtied memory area. This should also
>> improve performance due to memset() optimizations.
>>
>> diff --git a/exec-obsolete.h b/exec-obsolete.h
>> index f8af27e..019c09a 100644
>> --- a/exec-obsolete.h
>> +++ b/exec-obsolete.h
>> @@ -76,6 +76,20 @@ static inline int
>> cpu_physical_memory_set_dirty_flags(ram_addr_t addr,
>>      return ram_list.phys_dirty[addr >> TARGET_PAGE_BITS] |= dirty_flags;
>>  }
>>
>> +static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start,
>> +                                                       int length,
>> +                                                       int dirty_flags)
>> +{
>> +    int i, len;
>> +    uint8_t *p;
>> +
>> +    len = length >> TARGET_PAGE_BITS;
>> +    p = ram_list.phys_dirty + (start >> TARGET_PAGE_BITS);
>> +    for (i = 0; i < len; i++) {
>> +        p[i] |= dirty_flags;
>> +    }
>> +}
>> +
>
> Breaks for start = 0xfff, length = 2.

Right. I copied this from cpu_physical_memory_mask_dirty_range() which
suffers from the same problem.



reply via email to

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