qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH for-7.2 16/21] accel/tcg: Raise PROT_EXEC exception early


From: Richard Henderson
Subject: [PATCH for-7.2 16/21] accel/tcg: Raise PROT_EXEC exception early
Date: Fri, 12 Aug 2022 11:08:01 -0700

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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 5278d1837b..6a3ca8224f 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -376,7 +376,7 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env)
         cpu_loop_exit(cpu);
     }
 
-    phys_pc = get_page_addr_code(env, pc);
+    phys_pc = get_page_addr_code_hostp(env, pc, false, NULL);
     if (phys_pc == -1) {
         return tcg_code_gen_epilogue;
     }
@@ -509,7 +509,7 @@ void cpu_exec_step_atomic(CPUState *cpu)
          */
 
         mmap_lock();
-        phys_pc = get_page_addr_code_hostp(env, pc, true, &host_pc);
+        phys_pc = get_page_addr_code_hostp(env, pc, false, &host_pc);
         if (phys_pc == -1) {
             tb = NULL;
         } else {
@@ -983,7 +983,7 @@ int cpu_exec(CPUState *cpu)
 
             mmap_lock();
             phys_pc = get_page_addr_code_hostp(cpu->env_ptr, pc,
-                                               true, &host_pc);
+                                               false, &host_pc);
             if (phys_pc == -1) {
                 tb = NULL;
             } else {
-- 
2.34.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]