summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-01-25 15:13:47 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:34:37 -0600
commit3b4351c9aefaae068666ee14c773c2b0951a5d84 (patch)
tree1523cff31b5d348a55e2839f7c6347a3c647df8d /include
parente5905872bf54dec265ac8f75f3395590bd515e71 (diff)
downloadhqemu-3b4351c9aefaae068666ee14c773c2b0951a5d84.zip
hqemu-3b4351c9aefaae068666ee14c773c2b0951a5d84.tar.gz
memory: add early bail out from cpu_physical_memory_set_dirty_range
This condition is true in the common case, so we can cut out the body of the function. In addition, this makes it easier for the compiler to do at least partial inlining, even if it decides that fully inlining the function is unreasonable. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/exec/ram_addr.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index 606e277..f2e872d 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -165,6 +165,10 @@ static inline void cpu_physical_memory_set_dirty_range(ram_addr_t start,
unsigned long end, page;
unsigned long **d = ram_list.dirty_memory;
+ if (!mask && !xen_enabled()) {
+ return;
+ }
+
end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS;
page = start >> TARGET_PAGE_BITS;
if (likely(mask & (1 << DIRTY_MEMORY_MIGRATION))) {
OpenPOWER on IntegriCloud