Patchwork [RFC,qom-cpu,30/41] cputlb: Change tlb_update_dirty() argument to CPUState

login
register
mail settings
Submitter Andreas Färber
Date Sept. 4, 2013, 9:05 a.m.
Message ID <1378285521-3230-31-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/272529/
State New
Headers show

Comments

Andreas Färber - Sept. 4, 2013, 9:05 a.m.
This allows to drop env in tb_invalidate_phys_page_range().

Note that the argument is unused.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 cputlb.c              |  2 +-
 include/exec/cputlb.h |  2 +-
 translate-all.c       | 12 ++----------
 3 files changed, 4 insertions(+), 12 deletions(-)

Patch

diff --git a/cputlb.c b/cputlb.c
index 3721bfc..bd5cf0e 100644
--- a/cputlb.c
+++ b/cputlb.c
@@ -134,7 +134,7 @@  void tlb_protect_code(ram_addr_t ram_addr)
 
 /* update the TLB so that writes in physical page 'phys_addr' are no longer
    tested for self modifying code */
-void tlb_unprotect_code_phys(CPUArchState *env, ram_addr_t ram_addr,
+void tlb_unprotect_code_phys(CPUState *cpu, ram_addr_t ram_addr,
                              target_ulong vaddr)
 {
     cpu_physical_memory_set_dirty_flags(ram_addr, CODE_DIRTY_FLAG);
diff --git a/include/exec/cputlb.h b/include/exec/cputlb.h
index e1eb4d9..31df03c 100644
--- a/include/exec/cputlb.h
+++ b/include/exec/cputlb.h
@@ -22,7 +22,7 @@ 
 #if !defined(CONFIG_USER_ONLY)
 /* cputlb.c */
 void tlb_protect_code(ram_addr_t ram_addr);
-void tlb_unprotect_code_phys(CPUArchState *env, ram_addr_t ram_addr,
+void tlb_unprotect_code_phys(CPUState *cpu, ram_addr_t ram_addr,
                              target_ulong vaddr);
 void tlb_reset_dirty_range(CPUTLBEntry *tlb_entry, uintptr_t start,
                            uintptr_t length);
diff --git a/translate-all.c b/translate-all.c
index 9b62b07..37b573b 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -1002,9 +1002,6 @@  void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
 {
     TranslationBlock *tb, *tb_next, *saved_tb;
     CPUState *cpu = current_cpu;
-#if !defined(CONFIG_USER_ONLY)
-    CPUArchState *env = NULL;
-#endif
     tb_page_addr_t tb_start, tb_end;
     PageDesc *p;
     int n;
@@ -1028,14 +1025,9 @@  void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
         /* build code bitmap */
         build_page_bitmap(p);
     }
-#if defined(TARGET_HAS_PRECISE_SMC) || !defined(CONFIG_USER_ONLY)
+#if defined(TARGET_HAS_PRECISE_SMC)
     if (cpu != NULL) {
-#ifndef CONFIG_USER_ONLY
-        env = cpu->env_ptr;
-#endif
-#ifdef TARGET_HAS_PRECISE_SMC
         cc = CPU_GET_CLASS(cpu);
-#endif
     }
 #endif
 
@@ -1103,7 +1095,7 @@  void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t end,
     if (!p->first_tb) {
         invalidate_page_bitmap(p);
         if (is_cpu_write_access) {
-            tlb_unprotect_code_phys(env, start, cpu->mem_io_vaddr);
+            tlb_unprotect_code_phys(cpu, start, cpu->mem_io_vaddr);
         }
     }
 #endif