summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-04-29 10:23:55 +0200
committerPhilippe Mathieu-Daudé2020-12-13 16:00:58 +0100
commit11cb076b26ff25a909f07c593f9a4e0416ac147f (patch)
treee30055b87291842f114d21b864fc33bfb23cd528 /target
parentMAINTAINERS: chenhc@lemote.com -> chenhuacai@kernel.org (diff)
downloadqemu-11cb076b26ff25a909f07c593f9a4e0416ac147f.tar.gz
qemu-11cb076b26ff25a909f07c593f9a4e0416ac147f.tar.xz
qemu-11cb076b26ff25a909f07c593f9a4e0416ac147f.zip
target/mips/kvm: Assert unreachable code is not used
This code must not be used outside of KVM. Abort if it is. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Huacai Chen <chenhc@lemote.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200429082916.10669-3-f4bug@amsat.org>
Diffstat (limited to 'target')
-rw-r--r--target/mips/kvm.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/target/mips/kvm.c b/target/mips/kvm.c
index 72637a1e02..cbd0cb8faa 100644
--- a/target/mips/kvm.c
+++ b/target/mips/kvm.c
@@ -198,9 +198,7 @@ int kvm_mips_set_interrupt(MIPSCPU *cpu, int irq, int level)
CPUState *cs = CPU(cpu);
struct kvm_mips_interrupt intr;
- if (!kvm_enabled()) {
- return 0;
- }
+ assert(kvm_enabled());
intr.cpu = -1;
@@ -221,9 +219,7 @@ int kvm_mips_set_ipi_interrupt(MIPSCPU *cpu, int irq, int level)
CPUState *dest_cs = CPU(cpu);
struct kvm_mips_interrupt intr;
- if (!kvm_enabled()) {
- return 0;
- }
+ assert(kvm_enabled());
intr.cpu = dest_cs->cpu_index;