[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] exec: flush CPU TB cache in breakpoint_invalidate
From: |
Richard Henderson |
Subject: |
Re: [PATCH 1/2] exec: flush CPU TB cache in breakpoint_invalidate |
Date: |
Sun, 1 Dec 2019 15:48:55 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 |
On 11/27/19 10:06 PM, Max Filippov wrote:
> When a breakpoint is inserted at location for which there's currently no
> virtual to physical translation no action is taken on CPU TB cache. If a
> TB for that virtual address already exists but is not visible ATM the
> breakpoint won't be hit next time an instruction at that address will be
> executed.
>
> Flush entire CPU TB cache in breakpoint_invalidate to force
> re-translation of all TBs for the breakpoint address.
>
> This change fixes the following scenario:
> - linux user application is running
> - a breakpoint is inserted from QEMU gdbstub for a user address that is
> not currently present in the target CPU TLB
> - an instruction at that address is executed, but the external debugger
> doesn't get control.
>
> Signed-off-by: Max Filippov <address@hidden>
> ---
> Changes RFC->v1:
> - do tb_flush in breakpoint_invalidate unconditionally
Unlike Paolo, I don't think this is a good idea.
If I was going to change anything here, I'd change this to not use
cpu_get_phys_page_attrs_debug but using the caching available from the actual
cputlb, using cc->tlb_fill() in probe mode -- something akin to probe_access(),
but not returning a host address, nor handling watchpoints nor notdirty.
This would help flushing too much by distinguishing different tbs for the same
virtual address mapping to a different physical address.
r~
- Re: [PATCH 1/2] exec: flush CPU TB cache in breakpoint_invalidate,
Richard Henderson <=