From patchwork Tue Apr 6 00:51:19 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshiaki Tamura X-Patchwork-Id: 90712 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o360vSPY030427 for ; Tue, 6 Apr 2010 00:57:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756396Ab0DFA5Z (ORCPT ); Mon, 5 Apr 2010 20:57:25 -0400 Received: from sh.osrg.net ([192.16.179.4]:47255 "EHLO sh.osrg.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756114Ab0DFA5Q (ORCPT ); Mon, 5 Apr 2010 20:57:16 -0400 Received: from fs.osrg.net (postfix@fs.osrg.net [10.0.0.12]) by sh.osrg.net (8.14.3/8.14.3/OSRG-NET) with ESMTP id o360uo0j018678; Tue, 6 Apr 2010 09:56:50 +0900 Received: from localhost (hype-wd0.osrg.net [10.72.1.16]) by fs.osrg.net (Postfix) with ESMTP id 19E4A3E02EA; Tue, 6 Apr 2010 09:56:50 +0900 (JST) From: Yoshiaki Tamura To: kvm@vger.kernel.org, qemu-devel@nongnu.org Cc: avi@redhat.com, anthony@codemonkey.ws, aliguori@us.ibm.com, mtosatti@redhat.com, ohmura.kei@lab.ntt.co.jp, Yoshiaki Tamura Subject: [PATCH v2 1/6] Modify DIRTY_FLAG value to use as indexes of bit-based phys_ram_dirty. Date: Tue, 6 Apr 2010 09:51:19 +0900 Message-Id: <1270515084-24120-2-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> X-Mailer: git-send-email 1.7.0.31.g1df487 In-Reply-To: <1270515084-24120-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> References: <1270515084-24120-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> X-Dispatcher: imput version 20070423(IM149) Lines: 39 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 06 Apr 2010 00:57:29 +0000 (UTC) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (sh.osrg.net [192.16.179.4]); Tue, 06 Apr 2010 09:56:52 +0900 (JST) X-Virus-Scanned: clamav-milter 0.95.3 at sh X-Virus-Status: Clean Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/cpu-all.h b/cpu-all.h index f8bfa66..c409fad 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -853,7 +853,6 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr); /* memory API */ extern int phys_ram_fd; -extern uint8_t *phys_ram_dirty; extern ram_addr_t ram_size; extern ram_addr_t last_ram_offset; @@ -878,9 +877,16 @@ extern int mem_prealloc; /* Set if TLB entry is an IO callback. */ #define TLB_MMIO (1 << 5) +/* Use DIRTY_FLAG as indexes of bit-based phys_ram_dirty. + 0x03 is empty to make it compatible with byte-based bitmap. */ +#define MASTER_DIRTY_FLAG 0x00 #define VGA_DIRTY_FLAG 0x01 #define CODE_DIRTY_FLAG 0x02 -#define MIGRATION_DIRTY_FLAG 0x08 +#define MIGRATION_DIRTY_FLAG 0x04 + +#define NUM_DIRTY_FLAGS 5 + +extern unsigned long *phys_ram_dirty[NUM_DIRTY_FLAGS]; /* read dirty bit (return 0 or 1) */ static inline int cpu_physical_memory_is_dirty(ram_addr_t addr)