From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Michael S. Tsirkin" Subject: Re: pci: is reset incomplete? Date: Mon, 14 Sep 2009 20:36:25 +0300 Message-ID: <20090914173625.GA3859@redhat.com> References: <20090914154822.GA3745@redhat.com> <4AAE7A31.9080600@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paul Brook , Avi Kivity , qemu-devel@nongnu.org, Carsten Otte , kvm@vger.kernel.org, Rusty Russell , virtualization@lists.linux-foundation.org, Christian Borntraeger , Gerd Hoffmann To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19128 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbZINRjp (ORCPT ); Mon, 14 Sep 2009 13:39:45 -0400 Content-Disposition: inline In-Reply-To: <4AAE7A31.9080600@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Sep 14, 2009 at 12:15:29PM -0500, Anthony Liguori wrote: > Michael S. Tsirkin wrote: >> Hi! >> pci bus reset does not seem to clear pci config registers, such as BAR >> registers, or memory space enable, of the attached devices: it only >> clears the interrupt state. >> >> This seems wrong, but easy to fix. >> > > I don't think most pci devices reset their config space in their reset > callbacks. For things like BAR registers, they really must. The PCI spec is quite specific on this point. > I would think that making most of the config space (if not the entire) > qdev properties would make sense. You can then get reset for free and > it's possible for users to tweak things like class codes universally. class codes are read only registers. Your proposal might be correct for some of these. But PCI registers that are reset, change as a result of guest activity, and reset values are typically specified by guest spec. So I don't think we should let users tweak these. > Regards, > > Anthony Liguori > >> Comments? >> >>