From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRe1n-0003DO-Ii for qemu-devel@nongnu.org; Wed, 10 Sep 2014 05:17:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRe1g-0000gh-Qv for qemu-devel@nongnu.org; Wed, 10 Sep 2014 05:17:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12548) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRe1g-0000fk-IL for qemu-devel@nongnu.org; Wed, 10 Sep 2014 05:17:20 -0400 Date: Wed, 10 Sep 2014 13:20:36 +0300 From: "Michael S. Tsirkin" Message-ID: <20140910102036.GD7902@redhat.com> References: <1410265809-27247-1-git-send-email-pbonzini@redhat.com> <1410265809-27247-10-git-send-email-pbonzini@redhat.com> <20140909135424.GA13212@redhat.com> <540F35E3.7060207@redhat.com> <20140909205122.GB15637@redhat.com> <54100E16.1040306@redhat.com> <54101463.2010609@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54101463.2010609@redhat.com> Subject: Re: [Qemu-devel] [PATCH 09/10] piix: do not raise irq while loading vmstate List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Peter Maydell , Juan Quintela , QEMU Developers , "Dr. David Alan Gilbert" , Pavel Dovgaluk , Amit Shah On Wed, Sep 10, 2014 at 11:05:39AM +0200, Paolo Bonzini wrote: > Il 10/09/2014 10:51, Peter Maydell ha scritto: > > > What is not okay (and I think it should be a rule) is to touch other > > > devices from post_load, unless you know that they are deserialized > > > first. For example it's okay for a PCI device to talk to the parent > > > bridge in its post_load function. > > > > I don't think it's right to talk to another device even if you do > > know it's deserialized first. Talking to it might make it change > > its state, which would be wrong (since its correct state is > > the state it's just deserialized). I would suggest the rule should > > be "never do something that can change the state of another > > device in post-load". > > That's harder to do, but if it is possible to do it, it would be great > as well. > > It would not surprise me to find a case where the parent device actually > _expects_ the children's post_load to inform it about something, instead > of serializing that part of state on its own. > > Paolo Absolutely, I don't think we can require that. For example, at the moment, for PCI bridges, we serialize the state of all interrupt lines, but that's just a function of all devices connected to each line. So we are transmitting redundant information, and I have plans to discard that and recompute parent state based on child state. > > (We have similar issues with reset, except worse in that we > > don't have a coherent rule to cause everything to come out > > of reset in the right state.)