From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbBkM-0005dv-PL for qemu-devel@nongnu.org; Thu, 26 Mar 2015 13:39:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YbBkG-0003av-Kx for qemu-devel@nongnu.org; Thu, 26 Mar 2015 13:39:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40119) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YbBkG-0003ah-8D for qemu-devel@nongnu.org; Thu, 26 Mar 2015 13:39:04 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2QHd3th023482 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 26 Mar 2015 13:39:03 -0400 Received: from donizetti.redhat.com (ovpn-112-86.ams2.redhat.com [10.36.112.86]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2QHcflH025898 for ; Thu, 26 Mar 2015 13:39:02 -0400 From: Paolo Bonzini Date: Thu, 26 Mar 2015 18:38:29 +0100 Message-Id: <1427391520-29497-12-git-send-email-pbonzini@redhat.com> In-Reply-To: <1427391520-29497-1-git-send-email-pbonzini@redhat.com> References: <1427391520-29497-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 11/22] exec: simplify notdirty_mem_write List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The function has just set two dirty bits and invalidated code, thus cpu_physical_memory_is_clean cannot return true here. Signed-off-by: Paolo Bonzini --- exec.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/exec.c b/exec.c index ffa57dd..56fd0f5 100644 --- a/exec.c +++ b/exec.c @@ -1810,6 +1810,7 @@ found: static void notdirty_mem_write(void *opaque, hwaddr ram_addr, uint64_t val, unsigned size) { + CPUArchState *env = current_cpu->env_ptr; if (!cpu_physical_memory_get_dirty_flag(ram_addr, DIRTY_MEMORY_CODE)) { tb_invalidate_phys_page_fast(ram_addr, size); } @@ -1827,12 +1828,7 @@ static void notdirty_mem_write(void *opaque, hwaddr ram_addr, abort(); } cpu_physical_memory_set_dirty_range_nocode(ram_addr, size); - /* we remove the notdirty callback only if the code has been - flushed */ - if (!cpu_physical_memory_is_clean(ram_addr)) { - CPUArchState *env = current_cpu->env_ptr; - tlb_set_dirty(env, current_cpu->mem_io_vaddr); - } + tlb_set_dirty(env, current_cpu->mem_io_vaddr); } static bool notdirty_mem_accepts(void *opaque, hwaddr addr, -- 2.3.3