From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxI9B-0004zZ-Ib for qemu-devel@nongnu.org; Tue, 26 May 2015 12:56:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YxI98-0004mn-Lr for qemu-devel@nongnu.org; Tue, 26 May 2015 12:56:09 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:35460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YxI98-0004mR-Fc for qemu-devel@nongnu.org; Tue, 26 May 2015 12:56:06 -0400 Received: by wicmx19 with SMTP id mx19so84008111wic.0 for ; Tue, 26 May 2015 09:56:05 -0700 (PDT) Received: from 640k.localdomain (dynamic-adsl-94-39-199-114.clienti.tiscali.it. [94.39.199.114]) by mx.google.com with ESMTPSA id x3sm17749309wiy.20.2015.05.26.09.56.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2015 09:56:05 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 26 May 2015 18:54:58 +0200 Message-Id: <1432659305-54578-23-git-send-email-pbonzini@redhat.com> In-Reply-To: <1432659305-54578-1-git-send-email-pbonzini@redhat.com> References: <1432659305-54578-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v3 22/29] memory: do not touch code dirty bitmap unless TCG is enabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org cpu_physical_memory_set_dirty_lebitmap unconditionally syncs the DIRTY_MEMORY_CODE bitmap. This however is unused unless TCG is enabled. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- include/exec/ram_addr.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 9778398..c2037f7 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -162,11 +162,14 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, ram_list.dirty_memory[DIRTY_MEMORY_MIGRATION][page + k] |= temp; ram_list.dirty_memory[DIRTY_MEMORY_VGA][page + k] |= temp; - ram_list.dirty_memory[DIRTY_MEMORY_CODE][page + k] |= temp; + if (tcg_enabled()) { + ram_list.dirty_memory[DIRTY_MEMORY_CODE][page + k] |= temp; + } } } xen_modified_memory(start, pages << TARGET_PAGE_BITS); } else { + uint8_t clients = tcg_enabled() ? DIRTY_CLIENTS_ALL : DIRTY_CLIENTS_NOCODE; /* * bitmap-traveling is faster than memory-traveling (for addr...) * especially when most of the memory is not dirty. @@ -181,8 +184,7 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(unsigned long *bitmap, addr = page_number * TARGET_PAGE_SIZE; ram_addr = start + addr; cpu_physical_memory_set_dirty_range(ram_addr, - TARGET_PAGE_SIZE * hpratio, - DIRTY_CLIENTS_ALL); + TARGET_PAGE_SIZE * hpratio, clients); } while (c != 0); } } -- 1.8.3.1