From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V47Pn-0004nU-Kt for qemu-devel@nongnu.org; Tue, 30 Jul 2013 06:44:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V47Pg-0002x2-3E for qemu-devel@nongnu.org; Tue, 30 Jul 2013 06:44:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46543) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V47Pf-0002wx-Sg for qemu-devel@nongnu.org; Tue, 30 Jul 2013 06:44:20 -0400 Date: Tue, 30 Jul 2013 12:44:12 +0200 From: Stefan Hajnoczi Message-ID: <20130730104412.GD14452@stefanha-thinkpad.redhat.com> References: <1374850970-4851-1-git-send-email-v.maffione@gmail.com> <20130729142310.GB4467@stefanha-thinkpad.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v3] e1000: add interrupt mitigation support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vincenzo Maffione Cc: Anthony Liguori , "Michael S. Tsirkin" , Luigi Rizzo , Jason Wang , qemu-devel@nongnu.org, Paolo Bonzini , Giuseppe Lettieri , lersek@redhat.com, Andreas =?iso-8859-1?Q?F=E4rber?= On Mon, Jul 29, 2013 at 04:46:22PM +0200, Vincenzo Maffione wrote: > Actually it's not always zero because > > - presave() calls e1000_mit_timer(), which sets mit_timer_on to 0 and > calls set_interrupt_cause(ICR); > > - if there are pending events, set_interrupt_cause(ICR) detects a > raising edge, and doesn't filter out the interrupt since mit_timer_on > == 0. Therefore, the timer is reloaded and mit_timer_on is set to 1. > > However, I've just realized that this is a mistake, since it would > need the post_load() to call qemu_mod_timer() when > mit_timer_on is migrated as "1", otherwise the interrupt delivery > would deadlock on the migrated system. > > I think it's way better not to migrate mit_timer_on, so that the > migrated system sees mit_timer_on==0 and doesn't need to call > qemu_mod_timer() in post_load(). The first interrupt request > (set_interrupt_cause()) will cause an immediate interrupt. Thanks for explaining. I agree that it's simpler to avoid migrating mit_timer_on. Stefan