diff mbox series

[16/33] accel/tcg/cpu-exec: Use RCU_READ_LOCK_GUARD

Message ID 20240128044213.316480-17-richard.henderson@linaro.org
State Superseded
Headers show
Series tcg patch queue, pre-pull | expand

Commit Message

Richard Henderson Jan. 28, 2024, 4:41 a.m. UTC
From: Philippe Mathieu-Daudé <philmd@linaro.org>

Replace the manual rcu_read_(un)lock calls in cpu_exec().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240124074201.8239-2-philmd@linaro.org>
[rth: Use RCU_READ_LOCK_GUARD not WITH_RCU_READ_LOCK_GUARD]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/cpu-exec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Philippe Mathieu-Daudé Jan. 28, 2024, 4:27 p.m. UTC | #1
On 28/1/24 05:41, Richard Henderson wrote:
> From: Philippe Mathieu-Daudé <philmd@linaro.org>
> 
> Replace the manual rcu_read_(un)lock calls in cpu_exec().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Message-Id: <20240124074201.8239-2-philmd@linaro.org>
> [rth: Use RCU_READ_LOCK_GUARD not WITH_RCU_READ_LOCK_GUARD]

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   accel/tcg/cpu-exec.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
> index 40c268bfa1..950dad63cb 100644
> --- a/accel/tcg/cpu-exec.c
> +++ b/accel/tcg/cpu-exec.c
> @@ -1050,7 +1050,7 @@ int cpu_exec(CPUState *cpu)
>           return EXCP_HALTED;
>       }
>   
> -    rcu_read_lock();
> +    RCU_READ_LOCK_GUARD();
>       cpu_exec_enter(cpu);
>   
>       /*
> @@ -1064,8 +1064,6 @@ int cpu_exec(CPUState *cpu)
>       ret = cpu_exec_setjmp(cpu, &sc);
>   
>       cpu_exec_exit(cpu);
> -    rcu_read_unlock();
> -
>       return ret;
>   }
>
diff mbox series

Patch

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 40c268bfa1..950dad63cb 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -1050,7 +1050,7 @@  int cpu_exec(CPUState *cpu)
         return EXCP_HALTED;
     }
 
-    rcu_read_lock();
+    RCU_READ_LOCK_GUARD();
     cpu_exec_enter(cpu);
 
     /*
@@ -1064,8 +1064,6 @@  int cpu_exec(CPUState *cpu)
     ret = cpu_exec_setjmp(cpu, &sc);
 
     cpu_exec_exit(cpu);
-    rcu_read_unlock();
-
     return ret;
 }