[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 31/35] target/ppc: Fix the order of kvm_enable judgment about kvmp
From: |
Cédric Le Goater |
Subject: |
[PULL 31/35] target/ppc: Fix the order of kvm_enable judgment about kvmppc_set_interrupt() |
Date: |
Mon, 4 Sep 2023 11:06:26 +0200 |
From: jianchunfu <chunfu.jian@shingroup.cn>
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 <chunfu.jian@shingroup.cn>
Tested-by: Gautam Menghani <gautam@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
hw/ppc/ppc.c | 8 ++++++--
target/ppc/kvm.c | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index 87df91460026..c70882649a7d 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,
@@ -1533,5 +1535,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);
+ }
}
diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c
index 769850174385..51112bd3670d 100644
--- a/target/ppc/kvm.c
+++ b/target/ppc/kvm.c
@@ -1320,7 +1320,7 @@ int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int
level)
return 0;
}
- if (!kvm_enabled() || !cap_interrupt_unset) {
+ if (!cap_interrupt_unset) {
return 0;
}
--
2.41.0
- [PULL 23/35] spapr: Fix machine reset deadlock from replay-record, (continued)
- [PULL 23/35] spapr: Fix machine reset deadlock from replay-record, Cédric Le Goater, 2023/09/04
- [PULL 25/35] tests/avocado: boot ppc64 pseries replay-record test to Linux VFS mount, Cédric Le Goater, 2023/09/04
- [PULL 24/35] spapr: Fix record-replay machine reset consuming too many events, Cédric Le Goater, 2023/09/04
- [PULL 22/35] target/ppc: Fix timebase reset with record-replay, Cédric Le Goater, 2023/09/04
- [PULL 27/35] tests/avocado: ppc64 reverse debugging tests for pseries and powernv, Cédric Le Goater, 2023/09/04
- [PULL 26/35] tests/avocado: reverse-debugging cope with re-executing breakpoints, Cédric Le Goater, 2023/09/04
- [PULL 28/35] target/ppc: Fix LQ, STQ register-pair order for big-endian, Cédric Le Goater, 2023/09/04
- [PULL 29/35] target/ppc: Flush inputs to zero with NJ in ppc_store_vscr, Cédric Le Goater, 2023/09/04
- [PULL 30/35] hw/ppc/e500: fix broken snapshot replay, Cédric Le Goater, 2023/09/04
- [PULL 32/35] ppc/xive: Use address_space routines to access the machine RAM, Cédric Le Goater, 2023/09/04
- [PULL 31/35] target/ppc: Fix the order of kvm_enable judgment about kvmppc_set_interrupt(),
Cédric Le Goater <=
- [PULL 33/35] ppc/xive: Introduce a new XiveRouter end_notify() handler, Cédric Le Goater, 2023/09/04
- [PULL 35/35] ppc/xive: Add support for the PC MMIOs, Cédric Le Goater, 2023/09/04
- [PULL 34/35] ppc/xive: Handle END triggers between chips with MMIOs, Cédric Le Goater, 2023/09/04
- Re: [PULL 00/35] ppc queue, Cédric Le Goater, 2023/09/06