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~