diff --git a/qemu/exec.c b/qemu/exec.c index f340b667..6b56eb6a 100644 --- a/qemu/exec.c +++ b/qemu/exec.c @@ -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) diff --git a/qemu/include/exec/exec-all.h b/qemu/include/exec/exec-all.h index d50912a1..cd556395 100644 --- a/qemu/include/exec/exec-all.h +++ b/qemu/include/exec/exec-all.h @@ -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 */