[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 14/33] accel/tcg: Raise PROT_EXEC exception early
From: |
Richard Henderson |
Subject: |
[PATCH v2 14/33] accel/tcg: Raise PROT_EXEC exception early |
Date: |
Tue, 16 Aug 2022 15:33:41 -0500 |
We currently ignore PROT_EXEC on the initial lookup, and
defer raising the exception until cpu_ld*_code().
It makes more sense to raise the exception early.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/cpu-exec.c | 2 +-
accel/tcg/translate-all.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 7887af6f45..7b8977a0a4 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -222,7 +222,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu,
target_ulong pc,
desc.cflags = cflags;
desc.trace_vcpu_dstate = *cpu->trace_dstate;
desc.pc = pc;
- phys_pc = get_page_addr_code(desc.env, pc);
+ phys_pc = get_page_addr_code_hostp(desc.env, pc, false, NULL);
if (phys_pc == -1) {
return NULL;
}
diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c
index 596029b26d..a5ca424f13 100644
--- a/accel/tcg/translate-all.c
+++ b/accel/tcg/translate-all.c
@@ -1343,7 +1343,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu,
assert_memory_lock();
qemu_thread_jit_write();
- phys_pc = get_page_addr_code(env, pc);
+ phys_pc = get_page_addr_code_hostp(env, pc, false, NULL);
if (phys_pc == -1) {
/* Generate a one-shot TB with 1 insn in it */
--
2.34.1
- [PATCH v2 23/33] accel/tcg: Introduce TARGET_TB_PCREL, (continued)
- [PATCH v2 23/33] accel/tcg: Introduce TARGET_TB_PCREL, Richard Henderson, 2022/08/16
- [PATCH v2 19/33] accel/tcg: Use DisasContextBase in plugin_gen_tb_start, Richard Henderson, 2022/08/16
- [PATCH v2 29/33] target/arm: Change gen_exception_internal to work on displacements, Richard Henderson, 2022/08/16
- [PATCH v2 26/33] target/arm: Change gen_goto_tb to work on displacements, Richard Henderson, 2022/08/16
- [PATCH v2 28/33] target/arm: Change gen_exception_insn* to work on displacements, Richard Henderson, 2022/08/16
- [PATCH v2 30/33] target/arm: Change gen_jmp* to work on displacements, Richard Henderson, 2022/08/16
- [PATCH v2 27/33] target/arm: Change gen_*set_pc_im to gen_*update_pc, Richard Henderson, 2022/08/16
- [PATCH v2 33/33] target/arm: Enable TARGET_TB_PCREL, Richard Henderson, 2022/08/16
- [PATCH v2 32/33] target/arm: Introduce gen_pc_plus_diff for aarch32, Richard Henderson, 2022/08/16
- [PATCH v2 14/33] accel/tcg: Raise PROT_EXEC exception early,
Richard Henderson <=
- [PATCH v2 31/33] target/arm: Introduce gen_pc_plus_diff for aarch64, Richard Henderson, 2022/08/16