From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=56025 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PAkTd-00045Q-6O for qemu-devel@nongnu.org; Tue, 26 Oct 2010 10:26:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PAkTb-0004la-HF for qemu-devel@nongnu.org; Tue, 26 Oct 2010 10:26:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PAkTb-0004lS-9b for qemu-devel@nongnu.org; Tue, 26 Oct 2010 10:26:11 -0400 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.13.8/8.13.8) with ESMTP id o9QEQAeB030433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Oct 2010 10:26:10 -0400 Date: Tue, 26 Oct 2010 16:26:09 +0200 From: Gleb Natapov Subject: Re: [Qemu-devel] [PATCH] initialize unit id of IDE bus Message-ID: <20101026142609.GB2764@redhat.com> References: <20101024162315.GG2343@redhat.com> <20101025154236.GH2343@redhat.com> <20101026072843.GK2343@redhat.com> <20101026101549.GM2343@redhat.com> <1288102552.5129.86.camel@x201> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1288102552.5129.86.camel@x201> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: Markus Armbruster , qemu-devel@nongnu.org On Tue, Oct 26, 2010 at 08:15:52AM -0600, Alex Williamson wrote: > On Tue, 2010-10-26 at 13:20 +0200, Markus Armbruster wrote: > > >> How to tell whether it's primary or secondary? Primary uses I/O ports > > >> 0x1f0..0x1ff,0x3f0..0x3ff and IRQ 14. IRQ could be easier to check, > > >> because it should be right in ISADevice member isairq[0]. > > >> Alternatively, upcast to ISAIDEState and check members iobase or isairq. > > > Again idebus_dev_path() should not care about what device IDEBus resides on. > > > > We really need to define what qbus's get_dev_path() callback is supposed > > to do before we continue. Alex, you created it. What's your take on > > its semantics? > > Perhaps going into too much detail, but the idea of get_dev_path() is > that it's a recursive call up the device try, where each level adds a > string to come up with a unique description. We currently only have > this of PCI because it's device path is obvious, while others are not, > particularly ISA. > > To start, I'd think IDE could easily implement a get_dev_path(), where > the IDE qbus calls up to it's parent bus, then appends IDE channel and > slot. So for a PCI IDE controller, we get something like > PCI:0000:00:03.0/piix3-IDE0.master (change this to match qdev info > strings, I'm just making it up here). > If we will do it like you suggest device path will be meaningless outside of qemu internals. I would like get_dev_path() to build device path that can be used in a guest to locate the device. In your example above piix3-IDE0 does not provide any additional information anyway since PCI:0000:00:03.0 already point at a device that can be easily identified as piix3-ede0 by looking into PCI config space. So for IDE I would like it to be like that: PCI@0000:00:03.0/IDE@0:1 > An ISA IDE controller is harder since ISA doesn't have a bus enumeration > mechanism. IIRC, there we some suggestions to use ioports and/or irqs > to define a path on ISA, but not all ISA qdev devices expose these. So > perhaps we'd want something like isa.irq14/piix3-IDE0.master. Doing ISA > correctly probably means standardizing some portion of the qdev info for > all the ISA devices. Thanks, Have you looked at my isabus_get_dev_path() patch? It keeps track of ioports used by ISA device at ISADevice level. -- Gleb.