From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOQcM-0007ef-97 for qemu-devel@nongnu.org; Tue, 24 Sep 2013 07:17:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOQcF-0004ck-DW for qemu-devel@nongnu.org; Tue, 24 Sep 2013 07:17:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60619) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOQcF-0004bk-5l for qemu-devel@nongnu.org; Tue, 24 Sep 2013 07:17:15 -0400 Message-ID: <1380021445.2050.99.camel@localhost.localdomain> From: Marcel Apfelbaum Date: Tue, 24 Sep 2013 14:17:25 +0300 In-Reply-To: References: <20130923112744.GC544@redhat.com> <1379939863.2050.35.camel@localhost.localdomain> <20130923134512.GD1278@redhat.com> <1379947418.2050.47.camel@localhost.localdomain> <20130923151014.GB2899@redhat.com> <1379958593.2050.58.camel@localhost.localdomain> <20130923184513.GB8717@redhat.com> <1380010039.2050.69.camel@localhost.localdomain> <20130924082936.GA18673@redhat.com> <1380012297.2050.78.camel@localhost.localdomain> <20130924085845.GA18980@redhat.com> <1380019471.2050.87.camel@localhost.localdomain> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] hw/pci: completed master-abort emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Anthony Liguori , "Michael S. Tsirkin" On Tue, 2013-09-24 at 19:55 +0900, Peter Maydell wrote: > On 24 September 2013 19:44, Marcel Apfelbaum wrote: > > We need to check all the bridges on each bus encountered > > for their address range; if it corresponds to the transaction address, > > we pass the bridge to the other bus(depending on transaction's direction). > > I haven't looked at all at the details, but you can probably rephrase > this kind of "check address against range and pass recursively > to other bridge" algorithm in terms of appropriate statically > constructed memory regions. Since "transaction aborted" is > definitely not a fast path, the only argument for doing it that way > would be if the code worked out more neatly -- maybe worth > thinking about whether it would do so? I didn't fully understand your comment, please let me explain: A PCI Device issues a transaction to an unassigned address, which is in a range corresponding to a bridge on some "upper" (close to CPU) bus. The region that will "catch" this access is a background region "behind" the "target" memory region (bus_master_enable_region). At this point we know: 1. The PCI device that initiated the transaction 2. The transaction's address I was suggesting an algorithm to find the MA device in order to set MA Received Bit in its Status(Sec_Status) register. The algorithm was to traverse the PCI buses for finding the MA device using the transaction address. Marcel > > -- PMM