From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55882) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qyo8w-00015Q-De for qemu-devel@nongnu.org; Wed, 31 Aug 2011 13:00:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qyo8u-0001jL-U4 for qemu-devel@nongnu.org; Wed, 31 Aug 2011 13:00:02 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:52108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qyo8u-0001jA-Rn for qemu-devel@nongnu.org; Wed, 31 Aug 2011 13:00:00 -0400 Received: by qyk31 with SMTP id 31so662501qyk.4 for ; Wed, 31 Aug 2011 10:00:00 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4E5DF096.6070207@redhat.com> References: <4E58FC3F.6080809@web.de> <4E5BE7C5.60705@us.ibm.com> <4E5BFF51.9010503@web.de> <4E5C00F0.9070103@redhat.com> <4E5DF096.6070207@redhat.com> From: Blue Swirl Date: Wed, 31 Aug 2011 16:59:40 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] pc: Clean up PIC-to-APIC IRQ path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Lucas Meneghel Rodrigues , Anthony Liguori , Marcelo Tosatti , qemu-devel , Jan Kiszka , Gerd Hoffmann On Wed, Aug 31, 2011 at 8:28 AM, Avi Kivity wrote: > On 08/30/2011 10:19 PM, Blue Swirl wrote: >> >> > >> > =C2=A0We need some kind of two phase restore. In the first phase all s= tate is >> > =C2=A0restored; since some of that state drivers outputs that are inpu= t to >> > other >> > =C2=A0devices, they may experience an edge, and we need to supress tha= t. =C2=A0In >> > the >> > =C2=A0second phase edge detection is unsupressed and the device goes l= ive. >> >> No. Devices may not perform any externally visible activities (like >> toggle a qemu_irq) during or after load because 1) qemu_irq is >> stateless and 2) since the receiving end is also freshly loaded, both >> states are already in synch without any calls or toggling. > > That makes it impossible to migrate level-triggered irq lines. =C2=A0Or a= t least, > the receiver has to remember the state, instead of (or in addition to) th= e > sender. Both ends probably need to remember the state. That should work without any multiphase restores and transient suppressors. It might be also possible to introduce stateful signal lines which save and restore their state, then the receiving end could check what is the current level. However, if you consider that the devices may be restored in random order, if the IRQ line device happens to be restored later, the receiver would still get wrong information. Adding priorities could solve this, but I think stateless IRQs are the only sane way.