From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtFeo-0006Ye-2V for qemu-devel@nongnu.org; Wed, 18 Dec 2013 06:51:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtFei-00089H-2p for qemu-devel@nongnu.org; Wed, 18 Dec 2013 06:51:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtFeh-00089C-RN for qemu-devel@nongnu.org; Wed, 18 Dec 2013 06:51:12 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBIBpBbv006111 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 18 Dec 2013 06:51:11 -0500 Message-ID: <52B18C50.9030601@redhat.com> Date: Wed, 18 Dec 2013 13:51:44 +0200 From: Orit Wasserman MIME-Version: 1.0 References: <1387293974-24718-1-git-send-email-quintela@redhat.com> <1387293974-24718-28-git-send-email-quintela@redhat.com> In-Reply-To: <1387293974-24718-28-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 27/38] memory: s/dirty/clean/ in cpu_physical_memory_is_dirty() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela , qemu-devel@nongnu.org On 12/17/2013 05:26 PM, Juan Quintela wrote: > All uses except one really want the other meaning. > > Signed-off-by: Juan Quintela > Reviewed-by: Eric Blake > --- > cputlb.c | 3 ++- > exec.c | 6 +++--- > include/exec/memory-internal.h | 5 ++--- > 3 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/cputlb.c b/cputlb.c > index dfd747a..911d764 100644 > --- a/cputlb.c > +++ b/cputlb.c > @@ -299,7 +299,8 @@ void tlb_set_page(CPUArchState *env, target_ulong vaddr, > /* Write access calls the I/O callback. */ > te->addr_write = address | TLB_MMIO; > } else if (memory_region_is_ram(section->mr) > - && !cpu_physical_memory_is_dirty(section->mr->ram_addr + xlat)) { > + && cpu_physical_memory_is_clean(section->mr->ram_addr > + + xlat)) { > te->addr_write = address | TLB_NOTDIRTY; > } else { > te->addr_write = address; > diff --git a/exec.c b/exec.c > index 6bef3e5..a2f89eb 100644 > --- a/exec.c > +++ b/exec.c > @@ -1513,7 +1513,7 @@ static void notdirty_mem_write(void *opaque, hwaddr ram_addr, > cpu_physical_memory_set_dirty_flag(ram_addr, DIRTY_MEMORY_VGA); > /* we remove the notdirty callback only if the code has been > flushed */ > - if (cpu_physical_memory_is_dirty(ram_addr)) { > + if (!cpu_physical_memory_is_clean(ram_addr)) { > CPUArchState *env = current_cpu->env_ptr; > tlb_set_dirty(env, env->mem_io_vaddr); > } > @@ -1916,7 +1916,7 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr, > static void invalidate_and_set_dirty(hwaddr addr, > hwaddr length) > { > - if (!cpu_physical_memory_is_dirty(addr)) { > + if (cpu_physical_memory_is_clean(addr)) { > /* invalidate code */ > tb_invalidate_phys_page_range(addr, addr + length, 0); > /* set dirty bit */ > @@ -2499,7 +2499,7 @@ void stl_phys_notdirty(hwaddr addr, uint32_t val) > stl_p(ptr, val); > > if (unlikely(in_migration)) { > - if (!cpu_physical_memory_is_dirty(addr1)) { > + if (cpu_physical_memory_is_clean(addr1)) { > /* invalidate code */ > tb_invalidate_phys_page_range(addr1, addr1 + 4, 0); > /* set dirty bit */ > diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h > index e2f55ea..771b23f 100644 > --- a/include/exec/memory-internal.h > +++ b/include/exec/memory-internal.h > @@ -61,14 +61,13 @@ static inline bool cpu_physical_memory_get_dirty_flag(ram_addr_t addr, > return cpu_physical_memory_get_dirty(addr, 1, client); > } > > -/* read dirty bit (return 0 or 1) */ > -static inline bool cpu_physical_memory_is_dirty(ram_addr_t addr) > +static inline bool cpu_physical_memory_is_clean(ram_addr_t addr) > { > bool vga = cpu_physical_memory_get_dirty_flag(addr, DIRTY_MEMORY_VGA); > bool code = cpu_physical_memory_get_dirty_flag(addr, DIRTY_MEMORY_CODE); > bool migration = > cpu_physical_memory_get_dirty_flag(addr, DIRTY_MEMORY_MIGRATION); > - return vga && code && migration; > + return !(vga && code && migration); > } > > static inline void cpu_physical_memory_set_dirty_flag(ram_addr_t addr, > Reviewed-by: Orit Wasserman