[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] target/hppa: Optimize ldcw/ldcd instruction translation
From: |
Richard Henderson |
Subject: |
Re: [PATCH] target/hppa: Optimize ldcw/ldcd instruction translation |
Date: |
Wed, 13 Sep 2023 09:55:55 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 |
On 9/13/23 07:47, Helge Deller wrote:
+ haddr = (uint32_t *)((uintptr_t)vaddr);
+ old = *haddr;
This is horribly incorrect, both for user-only and system mode.
+ /* if already zero, do not write 0 again to reduce memory presssure */
+ if (old == 0) {
+ return 0;
+ }
+ old = qatomic_xchg(haddr, (uint32_t) 0);
You're also dropping the required host memory barrier.
Frankly, the current tcg_gen_atomic_xchg_reg is as optimized as you'll be able to do. I
really doubt the "avoid write 0" is measurable at all.
r~