@@ -49,6 +49,9 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr,
void tlb_protect_code(ram_addr_t ram_addr);
void tlb_unprotect_code(ram_addr_t ram_addr);
+void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length);
+void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length);
+
/**
* iotlb_to_section:
* @cpu: CPU performing the access
@@ -69,6 +72,13 @@ hwaddr memory_region_section_get_iotlb(CPUState *cpu,
#endif /* CONFIG_USER_ONLY */
-#endif /* CONFIG_TCG */
+#else /* !CONFIG_TCG */
+
+static inline void tlb_reset_dirty_range_all(ram_addr_t start,
+ ram_addr_t length)
+{
+}
+
+#endif /* !CONFIG_TCG */
#endif
@@ -640,9 +640,6 @@ static inline void mmap_lock(void) {}
static inline void mmap_unlock(void) {}
#define WITH_MMAP_LOCK_GUARD()
-void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length);
-void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length);
-
#endif
#endif
@@ -26,6 +26,7 @@
#include "exec/ramlist.h"
#include "exec/ramblock.h"
#include "exec/exec-all.h"
+#include "cputlb.h"
#include "qemu/rcu.h"
extern uint64_t total_dirty_pages;
@@ -850,6 +850,7 @@ found:
return block;
}
+#ifdef CONFIG_TCG
void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length)
{
CPUState *cpu;
@@ -869,6 +870,7 @@ void tlb_reset_dirty_range_all(ram_addr_t start, ram_addr_t length)
tlb_reset_dirty(cpu, start1, length);
}
}
+#endif
/* Note: start and end must be within the same ram block. */
bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t start,
Declare tlb_reset_dirty() and tlb_reset_dirty_range_all() in "exec/cputlb.h". Restrict tlb_reset_dirty_range_all() to TCG accel. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- include/exec/cputlb.h | 12 +++++++++++- include/exec/exec-all.h | 3 --- include/exec/ram_addr.h | 1 + system/physmem.c | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-)