qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 3/3] accel/tcg: Fix jump cache set in cpu_exec_loop


From: Richard Henderson
Subject: Re: [PATCH 3/3] accel/tcg: Fix jump cache set in cpu_exec_loop
Date: Sat, 1 Apr 2023 13:46:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 4/1/23 04:03, liweiwei wrote:
                  mmap_unlock();
+
Blank line.

Yes, adding separation.

                  /*
                   * We add the TB in the virtual pc hash table
                   * for the fast lookup
                   */
                  h = tb_jmp_cache_hash_func(pc);
-                /* Use the pc value already stored in tb->pc. */
-                qatomic_set(&cpu->tb_jmp_cache->array[h].tb, tb);
+                jc = cpu->tb_jmp_cache;
+                if (cflags & CF_PCREL) {
+                    jc->array[h].pc = pc;
+                    /* Ensure pc is written first. */
+                    qatomic_store_release(&jc->array[h].tb, tb);

Whether we should add a qatomic_load_require() before this?

The load_acquire is already present in tb_lookup.


r~



reply via email to

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