Re: [PATCH 1/4] cpu: free cpu->tb_jmp_cache with RCU

2023-01-09 Thread Emilio Cota
On Sun, Jan 08, 2023 at 11:19:53 -0800, Richard Henderson wrote: > On 1/8/23 08:39, Emilio Cota wrote: (snip) > > diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c > > index 356fe348de..ca95d21528 100644 > > --- a/accel/tcg/cpu-exec.c > > +++ b/accel/tcg/cpu-exec.c > > @@ -1070,7 +1070,6 @@

Re: [PATCH 1/4] cpu: free cpu->tb_jmp_cache with RCU

2023-01-08 Thread Richard Henderson
On 1/8/23 08:39, Emilio Cota wrote: Fixes the appended use-after-free. The root cause is that during tb invalidation we use CPU_FOREACH, and therefore to safely free a vCPU we must wait for an RCU grace period to elapse. $ x86_64-linux-user/qemu-x86_64 tests/tcg/x86_64-linux-user/munmap-pthread

[PATCH 1/4] cpu: free cpu->tb_jmp_cache with RCU

2023-01-08 Thread Emilio Cota
Fixes the appended use-after-free. The root cause is that during tb invalidation we use CPU_FOREACH, and therefore to safely free a vCPU we must wait for an RCU grace period to elapse. $ x86_64-linux-user/qemu-x86_64 tests/tcg/x86_64-linux-user/munmap-pthread ==