From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpxeF-0000WG-Md for qemu-devel@nongnu.org; Mon, 09 Dec 2013 05:01:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VpxeA-0004JX-T4 for qemu-devel@nongnu.org; Mon, 09 Dec 2013 05:01:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20152) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VpxeA-0004JO-LN for qemu-devel@nongnu.org; Mon, 09 Dec 2013 05:01:02 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB9A0xDv018165 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Dec 2013 05:01:00 -0500 Message-ID: <1386583256.8684.43.camel@nilsson.home.kraxel.org> From: Gerd Hoffmann Date: Mon, 09 Dec 2013 11:00:56 +0100 In-Reply-To: <1386581052.10879.22.camel@localhost.localdomain> References: <1386329080-28836-1-git-send-email-kraxel@redhat.com> <20131208113138.GC6841@redhat.com> <1386573270.8684.11.camel@nilsson.home.kraxel.org> <1386581052.10879.22.camel@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pci: fix pci bridge fw path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" On Mo, 2013-12-09 at 11:24 +0200, Marcel Apfelbaum wrote: > On Mon, 2013-12-09 at 08:14 +0100, Gerd Hoffmann wrote: > > On So, 2013-12-08 at 13:31 +0200, Michael S. Tsirkin wrote: > > > On Fri, Dec 06, 2013 at 12:24:40PM +0100, Gerd Hoffmann wrote: > > > > qemu uses "pci" as name for pci bridges in the firmware device path. > > > > seabios expects "pci-bridge". Result is that bootorder is broken for > > > > devices behind pci bridges. > > > > > > > > Some googling suggests that "pci-bridge" is the correct one. At least > > > > PPC-based Apple machines are using this. See question "How do I boot > > > > from a device attached to a PCI card" here: > > > > http://www.netbsd.org/ports/macppc/faq.html > > > > > > > > So lets change qemu to use "pci-bridge" too. > > > > > > > > Signed-off-by: Gerd Hoffmann > > > > > > Sounds good but this needs to be enabled for > > > new machine types only - otherwise guest will read > > > corrupted data since bootindex is in FW CFG. > > > > Come on, that is seriously over-engineering. > Does this change affects migration in any way? If you live-migrate from a machine without the fix to a machine with the fix *and* you have bootorder configured for a device behind the pci bridge then size of the etc/bootorder fw_cfg file will change. So, in case of the following event sequence ... (a) firmware reads fw_fg directory index (with file sizes) (b) live migration (c) firmware reads etc/bootorder ... the firmware will read the new content with old size, i.e. it will miss a few bytes or have trailing garbage (or zeros? Not sure what qemu emulation does if you read over the end of a fw_cfg files). Result might be that bootorder isn't applied correctly. But that is the case _anyway_ on the machine with the unfixed qemu version. So making this machine type dependent buys us nothing but churn for no reason. cheers, Gerd