summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/loongarch/kvm/interrupt.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/loongarch/kvm/interrupt.c b/arch/loongarch/kvm/interrupt.c
index 32930959f7c2..53dac8ab8fb1 100644
--- a/arch/loongarch/kvm/interrupt.c
+++ b/arch/loongarch/kvm/interrupt.c
@@ -33,13 +33,12 @@ static int kvm_irq_deliver(struct kvm_vcpu *vcpu, unsigned int priority)
if (priority < EXCCODE_INT_NUM)
irq = priority_to_irq[priority];
- if (kvm_guest_has_msgint(&vcpu->arch) && (priority == INT_AVEC)) {
- dmsintc_inject_irq(vcpu);
- set_gcsr_estat(irq);
- return 1;
- }
-
switch (priority) {
+ case INT_AVEC:
+ if (!kvm_guest_has_msgint(&vcpu->arch))
+ break;
+ dmsintc_inject_irq(vcpu);
+ fallthrough;
case INT_TI:
case INT_IPI:
case INT_SWI0:
@@ -66,12 +65,11 @@ static int kvm_irq_clear(struct kvm_vcpu *vcpu, unsigned int priority)
if (priority < EXCCODE_INT_NUM)
irq = priority_to_irq[priority];
- if (kvm_guest_has_msgint(&vcpu->arch) && (priority == INT_AVEC)) {
- clear_gcsr_estat(irq);
- return 1;
- }
-
switch (priority) {
+ case INT_AVEC:
+ if (!kvm_guest_has_msgint(&vcpu->arch))
+ break;
+ fallthrough;
case INT_TI:
case INT_IPI:
case INT_SWI0: