aboutsummaryrefslogtreecommitdiff
path: root/tcg/tci.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-01-27 20:04:43 -1000
committerRichard Henderson <richard.henderson@linaro.org>2021-02-05 10:24:14 -1000
commit53f405569cf84eb08756a53ad722d4dbe07023ec (patch)
treec8054c07fb0ca96503a9d85c637afbdfc07101ea /tcg/tci.c
parent90be4dde247064082ab96c51a44b7bba30afb262 (diff)
downloadqemu-53f405569cf84eb08756a53ad722d4dbe07023ec.zip
qemu-53f405569cf84eb08756a53ad722d4dbe07023ec.tar.gz
qemu-53f405569cf84eb08756a53ad722d4dbe07023ec.tar.bz2
tcg/tci: Move stack bounds check to compile-time
The existing check was incomplete: (1) Only applied to two of the 7 stores, and not to the loads at all. (2) Only checked the upper, but not the lower bound of the stack. Doing this at compile time means that we don't need to do it at runtime as well. Tested-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tci.c')
-rw-r--r--tcg/tci.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/tcg/tci.c b/tcg/tci.c
index fe935e7..ee2cd7d 100644
--- a/tcg/tci.c
+++ b/tcg/tci.c
@@ -628,7 +628,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env,
t0 = tci_read_r32(regs, &tb_ptr);
t1 = tci_read_r(regs, &tb_ptr);
t2 = tci_read_s32(&tb_ptr);
- tci_assert(t1 != sp_value || (int32_t)t2 < 0);
*(uint32_t *)(t1 + t2) = t0;
break;
@@ -884,7 +883,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env,
t0 = tci_read_r64(regs, &tb_ptr);
t1 = tci_read_r(regs, &tb_ptr);
t2 = tci_read_s32(&tb_ptr);
- tci_assert(t1 != sp_value || (int32_t)t2 < 0);
*(uint64_t *)(t1 + t2) = t0;
break;