Revert "exec.c: Fix breakpoint invalidation race"

Now that we have proper locking after MTTCG patches have landed, we
can revert the commit. This reverts commit

a9353fe897ca2687e5b3385ed39e3db3927a90e0.

Backports commit 406bc339b0505fcfc2ffcbca1f05a3756e338a65 from qemu
This commit is contained in:
Pranith Kumar 2018-03-03 22:14:22 -05:00 committed by Lioncash
parent 7b337b9c07
commit d0a70720a3
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 17 additions and 0 deletions

View file

@ -603,6 +603,7 @@ void cpu_exec_init(CPUState *cpu, void *opaque)
#endif
}
#if defined(CONFIG_USER_ONLY)
static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
{
/* Flush the whole TB as this will not have race conditions
@ -612,6 +613,19 @@ static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
*/
tb_flush(cpu);
}
#else
static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
{
MemTxAttrs attrs;
hwaddr phys = cpu_get_phys_page_attrs_debug(cpu, pc, &attrs);
int asidx = cpu_asidx_from_attrs(cpu, attrs);
if (phys != -1) {
/* Locks grabbed by tb_invalidate_phys_addr */
tb_invalidate_phys_addr(cpu->cpu_ases[asidx].as,
phys | (pc & ~TARGET_PAGE_MASK));
}
}
#endif
#if defined(CONFIG_USER_ONLY)
void cpu_watchpoint_remove_all(CPUState *cpu, int mask)

View file

@ -192,6 +192,9 @@ static inline void tlb_flush_page_by_mmuidx(CPUState *cpu,
static inline void tlb_flush_by_mmuidx(CPUState *cpu, uint16_t idxmap)
{
}
static inline void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr)
{
}
#endif
#define CODE_GEN_ALIGN 16 /* must be >= of the size of a icache line */