From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Zhang Haoyu" Subject: Re: [Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery during eoi broadcast Date: Thu, 11 Sep 2014 20:56:32 +0800 Message-ID: <201409112056298025699@sangfor.com> References: <201409111647023813822@sangfor.com>, <33183CC9F5247A488A2544077AF1902086DC96FD@SZXEMA503-MBS.china.huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit Cc: "Paolo Bonzini" , "qemu-devel" To: "Gonglei (Arei)" , "kvm" , "Jason Wang" , "Jan Kiszka" , "Michael S.Tsirkin" Return-path: Received: from smtp.sanfor.com ([58.251.49.30]:56325 "EHLO mail.sangfor.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1750899AbaIKM4y (ORCPT ); Thu, 11 Sep 2014 08:56:54 -0400 Sender: kvm-owner@vger.kernel.org List-ID: >> Subject: [Qemu-devel] [PATCH] kvm: ioapic: conditionally delay irq delivery >> duringeoi broadcast >> >> Currently, we call ioapic_service() immediately when we find the irq is still >> active during eoi broadcast. But for real hardware, there's some dealy between >> the EOI writing and irq delivery (system bus latency?). So we need to emulate >> this behavior. Otherwise, for a guest who haven't register a proper irq handler >> , it would stay in the interrupt routine as this irq would be re-injected >> immediately after guest enables interrupt. This would lead guest can't move >> forward and may miss the possibility to get proper irq handler registered (one >> example is windows guest resuming from hibernation). >> >> As there's no way to differ the unhandled irq from new raised ones, this patch >> solve this problems by scheduling a delayed work when the count of irq injected >> during eoi broadcast exceeds a threshold value. After this patch, the guest can >> move a little forward when there's no suitable irq handler in case it may >> register one very soon and for guest who has a bad irq detection routine ( such >> as note_interrupt() in linux ), this bad irq would be recognized soon as in the >> past. >> >> Cc: Michael S. Tsirkin >> Signed-off-by: Jason Wang >> Signed-off-by: Zhang Haoyu >> --- >> include/trace/events/kvm.h | 20 +++++++++++++++++++ >> virt/kvm/ioapic.c | 50 >> ++++++++++++++++++++++++++++++++++++++++++++-- >> virt/kvm/ioapic.h | 6 ++++++ >> 3 files changed, 74 insertions(+), 2 deletions(-) >> >If this is a new version, please add a v2/v3 suffix and describe the changes at >those different versions . > >You can get more information from: >http://wiki.qemu.org/Contribute/SubmitAPatch > Okay, thanks. >Best regards, >-Gonglei