[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1538152913-3036-1-git-send-email-penghao122@sina.com.cn>
Date: Fri, 28 Sep 2018 12:41:53 -0400
From: Peng Hao <penghao122@...a.com.cn>
To: pbonzini@...hat.com, rkrcmar@...hat.com, tglx@...utronix.de,
mingo@...hat.com, hpa@...or.com
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org, x86@...nel.org,
Peng Hao <peng.hao2@....com.cn>
Subject: [PATCH] kvm/x86 : set meaningful return value
From: Peng Hao <peng.hao2@....com.cn>
kvm_irq_delivery_to_apic_fast()-->
kvm_apic_map_get_dest_lapic()-->
kvm_apic_disabled_lapic_found()
kvm_apic_map_get_dest_lapic return with bitmap==0 and dst[i]==NULL,
then (*r == -1) will be returned to qemu and "KVM: injection failed,
MSI lost(Operation not permitted)" will be recorded in qemu log. The
output is puzzling.
Signed-off-by: Peng Hao <peng.hao2@....com.cn>
---
arch/x86/kvm/lapic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index fbb0e6d..a8896b3 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -944,7 +944,7 @@ bool kvm_irq_delivery_to_apic_fast(struct kvm *kvm, struct kvm_lapic *src,
int i;
bool ret;
- *r = -1;
+ *r = -ENXIO;
if (irq->shorthand == APIC_DEST_SELF) {
*r = kvm_apic_set_irq(src->vcpu, irq, dest_map);
--
1.8.3.1
Powered by blists - more mailing lists