From 76d93e146768dde7e38b6e5e43c27e478ccb580e Mon Sep 17 00:00:00 2001 From: jianchunfu Date: Fri, 21 Jul 2023 15:37:34 +0800 Subject: target/ppc: Fix the order of kvm_enable judgment about kvmppc_set_interrupt() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's unnecessary for non-KVM accelerators(TCG, for example), to call this function, so change the order of kvm_enable() judgment. The static inline function that returns -1 directly does not work in TCG's situation. Signed-off-by: jianchunfu Tested-by: Gautam Menghani Signed-off-by: Cédric Le Goater --- hw/ppc/ppc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'hw/ppc/ppc.c') diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index ace8f4e..aeb116d 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -59,7 +59,9 @@ void ppc_set_irq(PowerPCCPU *cpu, int irq, int level) if (old_pending != env->pending_interrupts) { ppc_maybe_interrupt(env); - kvmppc_set_interrupt(cpu, irq, level); + if (kvm_enabled()) { + kvmppc_set_interrupt(cpu, irq, level); + } } trace_ppc_irq_set_exit(env, irq, level, env->pending_interrupts, @@ -1532,5 +1534,7 @@ void ppc_irq_reset(PowerPCCPU *cpu) CPUPPCState *env = &cpu->env; env->irq_input_state = 0; - kvmppc_set_interrupt(cpu, PPC_INTERRUPT_EXT, 0); + if (kvm_enabled()) { + kvmppc_set_interrupt(cpu, PPC_INTERRUPT_EXT, 0); + } } -- cgit v1.1