exec.c: Drop TARGET_HAS_ICE define and checks

The TARGET_HAS_ICE #define is intended to indicate whether a target-*
guest CPU implementation supports the breakpoint handling. However,
all our guest CPUs have that support (the only two which do not
define TARGET_HAS_ICE are unicore32 and openrisc, and in both those
cases the bp support is present and the lack of the #define is just
a bug). So remove the #define entirely: all new guest CPU support
should include breakpoint handling as part of the basic implementation.

Backports commit ec53b45bcd1f74f7a4c31331fa6d50b402cd6d26 from qemu
This commit is contained in:
Peter Maydell 2018-02-18 18:13:48 -05:00 committed by Lioncash
parent f64e3d4931
commit e07cd2542c
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
7 changed files with 2 additions and 27 deletions

View file

@ -451,7 +451,6 @@ void cpu_exec_init(CPUState *cpu, void *opaque)
uc->cpu = cpu; uc->cpu = cpu;
} }
#if defined(TARGET_HAS_ICE)
#if defined(CONFIG_USER_ONLY) #if defined(CONFIG_USER_ONLY)
static void breakpoint_invalidate(CPUState *cpu, target_ulong pc) static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
{ {
@ -469,7 +468,6 @@ static void breakpoint_invalidate(CPUState *cpu, target_ulong pc)
} }
} }
#endif #endif
#endif /* TARGET_HAS_ICE */
#if defined(CONFIG_USER_ONLY) #if defined(CONFIG_USER_ONLY)
void cpu_watchpoint_remove_all(CPUState *cpu, int mask) void cpu_watchpoint_remove_all(CPUState *cpu, int mask)
@ -587,7 +585,6 @@ static inline bool cpu_watchpoint_address_matches(CPUWatchpoint *wp,
int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags, int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
CPUBreakpoint **breakpoint) CPUBreakpoint **breakpoint)
{ {
#if defined(TARGET_HAS_ICE)
CPUBreakpoint *bp; CPUBreakpoint *bp;
bp = g_malloc(sizeof(*bp)); bp = g_malloc(sizeof(*bp));
@ -608,15 +605,11 @@ int cpu_breakpoint_insert(CPUState *cpu, vaddr pc, int flags,
*breakpoint = bp; *breakpoint = bp;
} }
return 0; return 0;
#else
return -ENOSYS;
#endif
} }
/* Remove a specific breakpoint. */ /* Remove a specific breakpoint. */
int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags) int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags)
{ {
#if defined(TARGET_HAS_ICE)
CPUBreakpoint *bp; CPUBreakpoint *bp;
QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) { QTAILQ_FOREACH(bp, &cpu->breakpoints, entry) {
@ -626,27 +619,21 @@ int cpu_breakpoint_remove(CPUState *cpu, vaddr pc, int flags)
} }
} }
return -ENOENT; return -ENOENT;
#else
return -ENOSYS;
#endif
} }
/* Remove a specific breakpoint by reference. */ /* Remove a specific breakpoint by reference. */
void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint) void cpu_breakpoint_remove_by_ref(CPUState *cpu, CPUBreakpoint *breakpoint)
{ {
#if defined(TARGET_HAS_ICE)
QTAILQ_REMOVE(&cpu->breakpoints, breakpoint, entry); QTAILQ_REMOVE(&cpu->breakpoints, breakpoint, entry);
breakpoint_invalidate(cpu, breakpoint->pc); breakpoint_invalidate(cpu, breakpoint->pc);
g_free(breakpoint); g_free(breakpoint);
#endif
} }
/* Remove all matching breakpoints. */ /* Remove all matching breakpoints. */
void cpu_breakpoint_remove_all(CPUState *cpu, int mask) void cpu_breakpoint_remove_all(CPUState *cpu, int mask)
{ {
#if defined(TARGET_HAS_ICE)
CPUBreakpoint *bp, *next; CPUBreakpoint *bp, *next;
QTAILQ_FOREACH_SAFE(bp, &cpu->breakpoints, entry, next) { QTAILQ_FOREACH_SAFE(bp, &cpu->breakpoints, entry, next) {
@ -654,21 +641,18 @@ void cpu_breakpoint_remove_all(CPUState *cpu, int mask)
cpu_breakpoint_remove_by_ref(cpu, bp); cpu_breakpoint_remove_by_ref(cpu, bp);
} }
} }
#endif
} }
/* enable or disable single step mode. EXCP_DEBUG is returned by the /* enable or disable single step mode. EXCP_DEBUG is returned by the
CPU loop after each instruction */ CPU loop after each instruction */
void cpu_single_step(CPUState *cpu, int enabled) void cpu_single_step(CPUState *cpu, int enabled)
{ {
#if defined(TARGET_HAS_ICE)
if (cpu->singlestep_enabled != enabled) { if (cpu->singlestep_enabled != enabled) {
cpu->singlestep_enabled = enabled; cpu->singlestep_enabled = enabled;
/* must flush all the translated code to avoid inconsistencies */ /* must flush all the translated code to avoid inconsistencies */
/* XXX: only flush what is necessary */ /* XXX: only flush what is necessary */
tb_flush(cpu); tb_flush(cpu);
} }
#endif
} }
void cpu_abort(CPUState *cpu, const char *fmt, ...) void cpu_abort(CPUState *cpu, const char *fmt, ...)

View file

@ -39,8 +39,6 @@
#include "fpu/softfloat.h" #include "fpu/softfloat.h"
#define TARGET_HAS_ICE 1
#define EXCP_UDEF 1 /* undefined instruction */ #define EXCP_UDEF 1 /* undefined instruction */
#define EXCP_SWI 2 /* software interrupt */ #define EXCP_SWI 2 /* software interrupt */
#define EXCP_PREFETCH_ABORT 3 #define EXCP_PREFETCH_ABORT 3

View file

@ -35,8 +35,6 @@
close to the modifying instruction */ close to the modifying instruction */
#define TARGET_HAS_PRECISE_SMC #define TARGET_HAS_PRECISE_SMC
#define TARGET_HAS_ICE 1
#ifdef TARGET_X86_64 #ifdef TARGET_X86_64
#define I386_ELF_MACHINE EM_X86_64 #define I386_ELF_MACHINE EM_X86_64
#define ELF_MACHINE_UNAME "x86_64" #define ELF_MACHINE_UNAME "x86_64"

View file

@ -32,8 +32,6 @@
#define MAX_QREGS 32 #define MAX_QREGS 32
#define TARGET_HAS_ICE 1
#define EXCP_ACCESS 2 /* Access (MMU) error. */ #define EXCP_ACCESS 2 /* Access (MMU) error. */
#define EXCP_ADDRESS 3 /* Address error. */ #define EXCP_ADDRESS 3 /* Address error. */
#define EXCP_ILLEGAL 4 /* Illegal instruction. */ #define EXCP_ILLEGAL 4 /* Illegal instruction. */

View file

@ -4,7 +4,6 @@
//#define DEBUG_OP //#define DEBUG_OP
#define ALIGNED_ONLY #define ALIGNED_ONLY
#define TARGET_HAS_ICE 1
#define CPUArchState struct CPUMIPSState #define CPUArchState struct CPUMIPSState

View file

@ -31,8 +31,6 @@
#include "fpu/softfloat.h" #include "fpu/softfloat.h"
#define TARGET_HAS_ICE 1
/*#define EXCP_INTERRUPT 0x100*/ /*#define EXCP_INTERRUPT 0x100*/
/* trap definitions */ /* trap definitions */

View file

@ -1655,7 +1655,7 @@ static TranslationBlock *tb_find_pc(struct uc_struct *uc, uintptr_t tc_ptr)
return &tcg_ctx->tb_ctx.tbs[m_max]; return &tcg_ctx->tb_ctx.tbs[m_max];
} }
#if defined(TARGET_HAS_ICE) && !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)
void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr) void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr)
{ {
ram_addr_t ram_addr; ram_addr_t ram_addr;
@ -1671,7 +1671,7 @@ void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr)
+ addr); + addr);
tb_invalidate_phys_page_range(as->uc, ram_addr, ram_addr + 1, 0); tb_invalidate_phys_page_range(as->uc, ram_addr, ram_addr + 1, 0);
} }
#endif /* TARGET_HAS_ICE && !defined(CONFIG_USER_ONLY) */ #endif /* !defined(CONFIG_USER_ONLY) */
void tb_check_watchpoint(CPUState *cpu) void tb_check_watchpoint(CPUState *cpu)
{ {