]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
exec: introduce cpu_reload_memory_map
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 15 Jan 2015 11:46:47 +0000 (12:46 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Feb 2015 16:30:19 +0000 (17:30 +0100)
This for now is a simple TLB flush.  This can change later for two
reasons:

1) an AddressSpaceDispatch will be cached in the CPUState object

2) it will not be possible to do tlb_flush once the TCG-generated code
runs outside the BQL.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cpu-exec.c
exec.c
include/exec/exec-all.h

index fa506e628ac603723352343bbae64dd0b51d7f8c..78fe382162fc68f95e97107b6eb0f159932e274f 100644 (file)
@@ -141,6 +141,12 @@ void cpu_resume_from_signal(CPUState *cpu, void *puc)
     cpu->exception_index = -1;
     siglongjmp(cpu->jmp_env, 1);
 }
+
+void cpu_reload_memory_map(CPUState *cpu)
+{
+    /* The TLB is protected by the iothread lock.  */
+    tlb_flush(cpu, 1);
+}
 #endif
 
 /* Execute a TB, and fix up the CPU state afterwards if necessary */
diff --git a/exec.c b/exec.c
index 6dff7bc43a67b836b58fe18136a954310e65bdee..2bfb4d361f297ec561287fcebaaa636184d84d89 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -2026,7 +2026,7 @@ static void tcg_commit(MemoryListener *listener)
         if (cpu->tcg_as_listener != listener) {
             continue;
         }
-        tlb_flush(cpu, 1);
+        cpu_reload_memory_map(cpu);
     }
 }
 
index 6a154485ba248c44f67efe5ec4a0260319a71342..1b30813449dd6a2eb04f4ba800f41f16a183a033 100644 (file)
@@ -96,6 +96,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
 void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end,
                               int is_cpu_write_access);
 #if !defined(CONFIG_USER_ONLY)
+void cpu_reload_memory_map(CPUState *cpu);
 void tcg_cpu_address_space_init(CPUState *cpu, AddressSpace *as);
 /* cputlb.c */
 void tlb_flush_page(CPUState *cpu, target_ulong addr);