Received: from [140.186.70.92] (port=35632 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq42R-0001Qn-Ka for qemu-devel@nongnu.org; Mon, 30 Aug 2010 09:04:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq42Q-0008Li-5s for qemu-devel@nongnu.org; Mon, 30 Aug 2010 09:04:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16579) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq42P-0008LZ-Vq for qemu-devel@nongnu.org; Mon, 30 Aug 2010 09:04:38 -0400 Date: Mon, 30 Aug 2010 10:04:30 -0300 From: Glauber Costa Message-ID: <20100830130430.GD17084@mothafucka.localdomain> References: <4C7B64D7.2020703@redhat.com> <20100830083520.GA7402@valinux.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100830083520.GA7402@valinux.co.jp> Subject: [Qemu-devel] Re: [PATCH 0/5] RFC: distinguish warm reset from cold reset. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Isaku Yamahata Cc: blauwirbel@gmail.com, alex.williamson@redhat.com, Avi Kivity , qemu-devel@nongnu.org On Mon, Aug 30, 2010 at 05:35:20PM +0900, Isaku Yamahata wrote: > On Mon, Aug 30, 2010 at 10:59:19AM +0300, Avi Kivity wrote: > > On 08/30/2010 10:49 AM, Isaku Yamahata wrote: > >> This patch set distinguish warm reset from cold reset by > >> introducing warm reset callback handler. > >> The first 4 patches are trivial clean up patches. The last patch of 5/5 > >> is RFC patch. > >> > >> The following thread arose cold reset vs warm reset issues. > >> http://lists.nongnu.org/archive/html/qemu-devel/2010-08/msg00186.html > >> The summary is > >> - warm reset is wanted in qemu > >> - Pressing the reset button is a warm reset on real machines > >> - Sparc64 CPU uses different reset vector for warm and cold reset, > >> so system_reset acts like a reset button > >> - Bus reset can be implemented utilizing qdev frame work instead of > >> implemeting it each bus layer independently. > >> - The modification should be incremental. > >> Anthony would like to see that as an incremental addition to what we have > >> today (like introducing a propagating warm reset callback) and thinking > >> through what the actual behavior should and shouldn't be. > >> > >> > >> If the direction is okay, The next step would be a patch(set) for qdev which > >> would introduce qdev_cold_reset(), qdev_warm_reset(), > >> DeviceInfo::cold_reset and DeviceInfo::warm_reset > >> and would obsolete qdev_reset() and DeviceInfo::reset. > >> > > > > What would be the difference between warm and cold reset? Former called > > on any reset, while the latter called on power up only? > > What I have in mind at the moment is, > warm reset callback is called on warm reset, not called on power up. > cold reset callback is called only on power up (and power cycle). > > Hmm, should warm reset handler be called on power up? > Each cold reset callbacks can call corresponding warm reset handler > if necessary. So it would be redundant to call qdev_warm_reset() on power up. > Or would it be more robust to call warm reset in addition to cold reset > on power on? I guess a good way to do that would be making "reset" just mean warm reset, and keep a single list. Those would be called on every kind of reset. Alternatively, cards that want to have a different power-on code could then be added to an amendment list, interfaced by a cold-reset API.