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: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH 2/4] memory: change dirty setting APIs to take a size
Date: Mon, 09 Jan 2012 14:11:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0

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.


-- 
error compiling committee.c: too many arguments to function




reply via email to

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