diff mbox

[RFC,04/38] translate-all: remove volatile from have_tb_lock

Message ID 1440375847-17603-5-git-send-email-cota@braap.org
State New
Headers show

Commit Message

Emilio Cota Aug. 24, 2015, 12:23 a.m. UTC
This is a thread-local variable and therefore all changes
to it will be seen in order by the owning thread. There is
no need for it to be volatile.

Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 translate-all.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Bennée Sept. 7, 2015, 3:50 p.m. UTC | #1
Emilio G. Cota <cota@braap.org> writes:

> This is a thread-local variable and therefore all changes
> to it will be seen in order by the owning thread. There is
> no need for it to be volatile.
>
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>  translate-all.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/translate-all.c b/translate-all.c
> index 901a35e..31239db 100644
> --- a/translate-all.c
> +++ b/translate-all.c
> @@ -130,7 +130,7 @@ static void *l1_map[V_L1_SIZE];
>  TCGContext tcg_ctx;
>  
>  /* translation block context */
> -__thread volatile int have_tb_lock;
> +__thread int have_tb_lock;

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

but really should be folded into the original patches.

>  
>  void tb_lock(void)
>  {
Paolo Bonzini Sept. 7, 2015, 4:12 p.m. UTC | #2
On 07/09/2015 17:50, Alex Bennée wrote:
>> >  /* translation block context */
>> > -__thread volatile int have_tb_lock;
>> > +__thread int have_tb_lock;
> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
> 
> but really should be folded into the original patches.
> 

Yup, v2 will come soon.

Paolo
diff mbox

Patch

diff --git a/translate-all.c b/translate-all.c
index 901a35e..31239db 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -130,7 +130,7 @@  static void *l1_map[V_L1_SIZE];
 TCGContext tcg_ctx;
 
 /* translation block context */
-__thread volatile int have_tb_lock;
+__thread int have_tb_lock;
 
 void tb_lock(void)
 {