Re: [PATCH] util/interval-tree: Avoid race conditions without optimization

2023-07-13 Thread Richard Henderson
On 7/13/23 12:32, Peter Maydell wrote: On Fri, 7 Jul 2023 at 11:30, Richard Henderson wrote: Read the left and right trees once, so that the gating tests are meaningful. This was only a problem at -O0, where the compiler didn't CSE the two reads. Cc: qemu-sta...@nongnu.org Signed-off-by: Ric

Re: [PATCH] util/interval-tree: Avoid race conditions without optimization

2023-07-13 Thread Peter Maydell
On Fri, 7 Jul 2023 at 11:30, Richard Henderson wrote: > > Read the left and right trees once, so that the gating > tests are meaningful. This was only a problem at -O0, > where the compiler didn't CSE the two reads. > > Cc: qemu-sta...@nongnu.org > Signed-off-by: Richard Henderson Reviewed-by:

[PATCH] util/interval-tree: Avoid race conditions without optimization

2023-07-07 Thread Richard Henderson
Read the left and right trees once, so that the gating tests are meaningful. This was only a problem at -O0, where the compiler didn't CSE the two reads. Cc: qemu-sta...@nongnu.org Signed-off-by: Richard Henderson --- util/interval-tree.c | 13 + 1 file changed, 9 insertions(+), 4 d