aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-01-25 15:13:47 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2016-02-09 15:45:26 +0100
commit8bafcb21643a39a5b29109f8bd5ee5a6f0f6850b (patch)
tree9e2b35405d12137e18f8ad65d95889fe9fb2d651
parentac1be2ae6b2995b99430c48329eb971b0281acf1 (diff)
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>
-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 606e277092..f2e872d87a 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))) {