aboutsummaryrefslogtreecommitdiff
path: root/include/exec
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-03-23 11:41:32 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2015-06-05 17:10:00 +0200
commit9460dee4b2258e3990906fb34099481c8334c267 (patch)
treeae15c915a7fcf741b6a55bcee3a14656ad5472fd /include/exec
parente87f7778b64d4a6a78e16c288c7fdc6c15317d5f (diff)
memory: do not touch code dirty bitmap unless TCG is enabled
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 <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/ram_addr.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index 3e42b4f602..98110108b7 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);
}
}