[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/47] accel/tcg: Drop cpu_get_tb_cpu_state from TARGET_HAS_PRECIS
From: |
Richard Henderson |
Subject: |
[PULL 13/47] accel/tcg: Drop cpu_get_tb_cpu_state from TARGET_HAS_PRECISE_SMC |
Date: |
Wed, 26 Oct 2022 12:10:42 +1000 |
The results of the calls to cpu_get_tb_cpu_state,
current_{pc,cs_base,flags}, are not used.
In tb_invalidate_phys_page, use bool for current_tb_modified.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/tb-maint.c | 25 ++-----------------------
1 file changed, 2 insertions(+), 23 deletions(-)
diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index 66c1900ae6..9af5cb49e0 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -502,23 +502,13 @@ tb_invalidate_phys_page_range__locked(struct
page_collection *pages,
int n;
#ifdef TARGET_HAS_PRECISE_SMC
CPUState *cpu = current_cpu;
- CPUArchState *env = NULL;
bool current_tb_not_found = retaddr != 0;
bool current_tb_modified = false;
TranslationBlock *current_tb = NULL;
- target_ulong current_pc = 0;
- target_ulong current_cs_base = 0;
- uint32_t current_flags = 0;
#endif /* TARGET_HAS_PRECISE_SMC */
assert_page_locked(p);
-#if defined(TARGET_HAS_PRECISE_SMC)
- if (cpu != NULL) {
- env = cpu->env_ptr;
- }
-#endif
-
/*
* We remove all the TBs in the range [start, end[.
* XXX: see if in some cases it could be faster to invalidate all the code
@@ -554,8 +544,6 @@ tb_invalidate_phys_page_range__locked(struct
page_collection *pages,
*/
current_tb_modified = true;
cpu_restore_state_from_tb(cpu, current_tb, retaddr, true);
- cpu_get_tb_cpu_state(env, ¤t_pc, ¤t_cs_base,
- ¤t_flags);
}
#endif /* TARGET_HAS_PRECISE_SMC */
tb_phys_invalidate__locked(tb);
@@ -679,11 +667,7 @@ bool tb_invalidate_phys_page(tb_page_addr_t addr,
uintptr_t pc)
#ifdef TARGET_HAS_PRECISE_SMC
TranslationBlock *current_tb = NULL;
CPUState *cpu = current_cpu;
- CPUArchState *env = NULL;
- int current_tb_modified = 0;
- target_ulong current_pc = 0;
- target_ulong current_cs_base = 0;
- uint32_t current_flags = 0;
+ bool current_tb_modified = false;
#endif
assert_memory_lock();
@@ -698,9 +682,6 @@ bool tb_invalidate_phys_page(tb_page_addr_t addr, uintptr_t
pc)
if (p->first_tb && pc != 0) {
current_tb = tcg_tb_lookup(pc);
}
- if (cpu != NULL) {
- env = cpu->env_ptr;
- }
#endif
assert_page_locked(p);
PAGE_FOR_EACH_TB(p, tb, n) {
@@ -713,10 +694,8 @@ bool tb_invalidate_phys_page(tb_page_addr_t addr,
uintptr_t pc)
* after the current PC, but it would require a specialized
* function to partially restore the CPU state.
*/
- current_tb_modified = 1;
+ current_tb_modified = true;
cpu_restore_state_from_tb(cpu, current_tb, pc, true);
- cpu_get_tb_cpu_state(env, ¤t_pc, ¤t_cs_base,
- ¤t_flags);
}
#endif /* TARGET_HAS_PRECISE_SMC */
tb_phys_invalidate(tb, addr);
--
2.34.1
- [PULL 03/47] tcg/aarch64: Remove unused code in tcg_out_op, (continued)
- [PULL 03/47] tcg/aarch64: Remove unused code in tcg_out_op, Richard Henderson, 2022/10/25
- [PULL 05/47] include/qemu/osdep: Add qemu_build_assert, Richard Henderson, 2022/10/25
- [PULL 04/47] accel/tcg: Add a quicker check for breakpoints, Richard Henderson, 2022/10/25
- [PULL 06/47] include/qemu/atomic: Use qemu_build_assert, Richard Henderson, 2022/10/25
- [PULL 08/47] accel/tcg: Make page_alloc_target_data allocation constant, Richard Henderson, 2022/10/25
- [PULL 07/47] include/qemu/thread: Use qatomic_* functions, Richard Henderson, 2022/10/25
- [PULL 09/47] accel/tcg: Remove disabled debug in translate-all.c, Richard Henderson, 2022/10/25
- [PULL 10/47] accel/tcg: Split out PageDesc to internal.h, Richard Henderson, 2022/10/25
- [PULL 12/47] accel/tcg: Move assert_no_pages_locked to internal.h, Richard Henderson, 2022/10/25
- [PULL 11/47] accel/tcg: Split out tb-maint.c, Richard Henderson, 2022/10/25
- [PULL 13/47] accel/tcg: Drop cpu_get_tb_cpu_state from TARGET_HAS_PRECISE_SMC,
Richard Henderson <=
- [PULL 14/47] accel/tcg: Remove duplicate store to tb->page_addr[], Richard Henderson, 2022/10/25
- [PULL 15/47] accel/tcg: Introduce tb_{set_}page_addr{0,1}, Richard Henderson, 2022/10/25
- [PULL 16/47] accel/tcg: Rename tb_invalidate_phys_page, Richard Henderson, 2022/10/25
- [PULL 17/47] accel/tcg: Rename tb_invalidate_phys_page_range and drop end parameter, Richard Henderson, 2022/10/25
- [PULL 18/47] accel/tcg: Unify declarations of tb_invalidate_phys_range, Richard Henderson, 2022/10/25
- [PULL 19/47] accel/tcg: Use tb_invalidate_phys_page in page_set_flags, Richard Henderson, 2022/10/25
- [PULL 20/47] accel/tcg: Call tb_invalidate_phys_page for PAGE_RESET, Richard Henderson, 2022/10/25
- [PULL 21/47] accel/tcg: Use page_reset_target_data in page_set_flags, Richard Henderson, 2022/10/25
- [PULL 22/47] accel/tcg: Use tb_invalidate_phys_range in page_set_flags, Richard Henderson, 2022/10/25
- [PULL 23/47] accel/tcg: Move TARGET_PAGE_DATA_SIZE impl to user-exec.c, Richard Henderson, 2022/10/25