Skip to content

Commit f725245

Browse files
philmdrth7680
authored andcommitted
target/ppc: Restrict cpu_exec_interrupt() handler to sysemu
Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Warner Losh <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Acked-by: David Gibson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent 250ae6d commit f725245

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

target/ppc/cpu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,8 +1254,6 @@ DECLARE_OBJ_CHECKERS(PPCVirtualHypervisor, PPCVirtualHypervisorClass,
12541254
PPC_VIRTUAL_HYPERVISOR, TYPE_PPC_VIRTUAL_HYPERVISOR)
12551255
#endif /* CONFIG_USER_ONLY */
12561256

1257-
void ppc_cpu_do_interrupt(CPUState *cpu);
1258-
bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req);
12591257
void ppc_cpu_dump_state(CPUState *cpu, FILE *f, int flags);
12601258
hwaddr ppc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
12611259
int ppc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
@@ -1271,6 +1269,8 @@ int ppc64_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs,
12711269
int ppc32_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs,
12721270
int cpuid, void *opaque);
12731271
#ifndef CONFIG_USER_ONLY
1272+
void ppc_cpu_do_interrupt(CPUState *cpu);
1273+
bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req);
12741274
void ppc_cpu_do_system_reset(CPUState *cs);
12751275
void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector);
12761276
extern const VMStateDescription vmstate_ppc_cpu;

target/ppc/cpu_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9014,10 +9014,10 @@ static const struct SysemuCPUOps ppc_sysemu_ops = {
90149014

90159015
static const struct TCGCPUOps ppc_tcg_ops = {
90169016
.initialize = ppc_translate_init,
9017-
.cpu_exec_interrupt = ppc_cpu_exec_interrupt,
90189017
.tlb_fill = ppc_cpu_tlb_fill,
90199018

90209019
#ifndef CONFIG_USER_ONLY
9020+
.cpu_exec_interrupt = ppc_cpu_exec_interrupt,
90219021
.do_interrupt = ppc_cpu_do_interrupt,
90229022
.cpu_exec_enter = ppc_cpu_exec_enter,
90239023
.cpu_exec_exit = ppc_cpu_exec_exit,

target/ppc/excp_helper.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,8 @@
4040

4141
/*****************************************************************************/
4242
/* Exception processing */
43-
#if defined(CONFIG_USER_ONLY)
44-
void ppc_cpu_do_interrupt(CPUState *cs)
45-
{
46-
PowerPCCPU *cpu = POWERPC_CPU(cs);
47-
CPUPPCState *env = &cpu->env;
48-
49-
cs->exception_index = POWERPC_EXCP_NONE;
50-
env->error_code = 0;
51-
}
52-
53-
static void ppc_hw_interrupt(CPUPPCState *env)
54-
{
55-
CPUState *cs = env_cpu(env);
43+
#if !defined(CONFIG_USER_ONLY)
5644

57-
cs->exception_index = POWERPC_EXCP_NONE;
58-
env->error_code = 0;
59-
}
60-
#else /* defined(CONFIG_USER_ONLY) */
6145
static inline void dump_syscall(CPUPPCState *env)
6246
{
6347
qemu_log_mask(CPU_LOG_INT, "syscall r0=%016" PRIx64
@@ -1113,7 +1097,6 @@ void ppc_cpu_do_fwnmi_machine_check(CPUState *cs, target_ulong vector)
11131097

11141098
powerpc_set_excp_state(cpu, vector, msr);
11151099
}
1116-
#endif /* !CONFIG_USER_ONLY */
11171100

11181101
bool ppc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
11191102
{
@@ -1130,6 +1113,8 @@ bool ppc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
11301113
return false;
11311114
}
11321115

1116+
#endif /* !CONFIG_USER_ONLY */
1117+
11331118
#if defined(DEBUG_OP)
11341119
static void cpu_dump_rfi(target_ulong RA, target_ulong msr)
11351120
{

0 commit comments

Comments
 (0)