qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-2.8] exec.c: Fix breakpoint invalidation rac


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH for-2.8] exec.c: Fix breakpoint invalidation race
Date: Tue, 6 Dec 2016 20:21:51 +0000
User-agent: Mutt/1.7.1 (2016-10-04)

On Tue, Dec 06, 2016 at 06:07:09PM +0000, Peter Maydell wrote:
> A bug (1647683) was reported showing a crash when removing
> breakpoints.  The reproducer was bisected to 3359baad when tb_flush
> was finally made thread safe.  While in MTTCG the locking in
> breakpoint_invalidate would have prevented any problems, but
> currently tb_lock() is a NOP for system emulation.
> 
> The race is between a tb_flush from the gdbstub and the
> tb_invalidate_phys_addr() in breakpoint_invalidate().
> 
> Ideally we'd have actual locking here; for the moment the
> simple fix is to do a full tb_flush() for a bp invalidate,
> since that is thread-safe even if no lock is taken.
> 
> Reported-by: Julian Brown <address@hidden>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> This is quite similar to Alex's patch
> http://patchwork.ozlabs.org/patch/703188/
> ("exec.c: simplify the breakpoint invalidation logic").
> The difference is that this patch doesn't drop the
> breakpoint_invalidate() function entirely. I think this
> is better both for a future "correct fix" and as a
> minimal "just fix this for 2.8 release" change.
> ---
>  exec.c | 25 ++++++-------------------
>  1 file changed, 6 insertions(+), 19 deletions(-)

Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

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