From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Wang Subject: Re: [question] e1000 interrupt storm happened becauseof its corresponding ioapic->irr bit always set Date: Mon, 25 Aug 2014 15:32:59 +0800 Message-ID: <53FAE6AB.9050601@redhat.com> References: <201408231836387399956@sangfor.com>, <53FAA874.70703@redhat.com> <201408251517235889695@sangfor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit To: Zhang Haoyu , qemu-devel , kvm Return-path: Received: from mx1.redhat.com ([209.132.183.28]:5271 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753887AbaHYHdO (ORCPT ); Mon, 25 Aug 2014 03:33:14 -0400 In-Reply-To: <201408251517235889695@sangfor.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/25/2014 03:17 PM, Zhang Haoyu wrote: >>> Hi, all >>> >> >>> >> I use a qemu-1.4.1/qemu-2.0.0 to run win7 guest, and encounter e1000 NIC interrupt storm, >>> >> because "if (!ent->fields.mask && (ioapic->irr & (1 << i)))" is always true in __kvm_ioapic_update_eoi(). >>> >> >>> >> Any ideas? >> > >> >We meet this several times: search the autoneg patches for an example of >> >workaround for this in qemu, and patch kvm: ioapic: conditionally delay >> >irq delivery during eoi broadcast for an workaround in kvm (rejected). >> > > Thanks, Jason, > I searched "e1000 autoneg" in gmane.comp.emulators.qemu, and found below patches, > http://thread.gmane.org/gmane.comp.emulators.qemu/143001/focus=143007 > http://thread.gmane.org/gmane.comp.emulators.qemu/284105/focus=284765 > http://thread.gmane.org/gmane.comp.emulators.qemu/186159/focus=187351 > which one tries to fix this problem, or all of them? > >> >That was probably caused by something wrong in e1000 emulation which >> >causes interrupt to be injected into windows guest before its interrupt >> >handler is registered. And Windows guest does not have a mechanism to >> >detect and disable irq in such condition. >> > > Sorry, I don't understand, > I think one interrupt should not been enabled before its handler is successfully registered, > is it possible that e1000 emulation inject the interrupt before the interrupt is succesfully enabled? There's no way for qemu to know whether or not the irq handler was registered in guest. So if qemu behaves differently with a physical card, it may lead the interrupt to be injected into guest too early. You can search redhat bugzilla for lots of related bugs, some even with in-depth analysis. Thanks > > Thanks, > Zhang Haoyu > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLom4-0000jd-6s for qemu-devel@nongnu.org; Mon, 25 Aug 2014 03:33:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLolz-0004lP-5h for qemu-devel@nongnu.org; Mon, 25 Aug 2014 03:33:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLoly-0004lD-ST for qemu-devel@nongnu.org; Mon, 25 Aug 2014 03:33:03 -0400 Message-ID: <53FAE6AB.9050601@redhat.com> Date: Mon, 25 Aug 2014 15:32:59 +0800 From: Jason Wang MIME-Version: 1.0 References: <201408231836387399956@sangfor.com>, <53FAA874.70703@redhat.com> <201408251517235889695@sangfor.com> In-Reply-To: <201408251517235889695@sangfor.com> Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [question] e1000 interrupt storm happened becauseof its corresponding ioapic->irr bit always set List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhang Haoyu , qemu-devel , kvm On 08/25/2014 03:17 PM, Zhang Haoyu wrote: >>> Hi, all >>> >> >>> >> I use a qemu-1.4.1/qemu-2.0.0 to run win7 guest, and encounter e1000 NIC interrupt storm, >>> >> because "if (!ent->fields.mask && (ioapic->irr & (1 << i)))" is always true in __kvm_ioapic_update_eoi(). >>> >> >>> >> Any ideas? >> > >> >We meet this several times: search the autoneg patches for an example of >> >workaround for this in qemu, and patch kvm: ioapic: conditionally delay >> >irq delivery during eoi broadcast for an workaround in kvm (rejected). >> > > Thanks, Jason, > I searched "e1000 autoneg" in gmane.comp.emulators.qemu, and found below patches, > http://thread.gmane.org/gmane.comp.emulators.qemu/143001/focus=143007 > http://thread.gmane.org/gmane.comp.emulators.qemu/284105/focus=284765 > http://thread.gmane.org/gmane.comp.emulators.qemu/186159/focus=187351 > which one tries to fix this problem, or all of them? > >> >That was probably caused by something wrong in e1000 emulation which >> >causes interrupt to be injected into windows guest before its interrupt >> >handler is registered. And Windows guest does not have a mechanism to >> >detect and disable irq in such condition. >> > > Sorry, I don't understand, > I think one interrupt should not been enabled before its handler is successfully registered, > is it possible that e1000 emulation inject the interrupt before the interrupt is succesfully enabled? There's no way for qemu to know whether or not the irq handler was registered in guest. So if qemu behaves differently with a physical card, it may lead the interrupt to be injected into guest too early. You can search redhat bugzilla for lots of related bugs, some even with in-depth analysis. Thanks > > Thanks, > Zhang Haoyu >