Received: from eggs.gnu.org ([2001:4830:134:3::10]:59398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPx9w-0006yV-I0 for qemu-devel@nongnu.org; Fri, 05 Sep 2014 13:18:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPx9n-0001Rb-O2 for qemu-devel@nongnu.org; Fri, 05 Sep 2014 13:18:52 -0400 Message-ID: <1409932036.24184.198.camel@snotra.buserror.net> From: Scott Wood Date: Fri, 5 Sep 2014 10:47:16 -0500 In-Reply-To: <1409769375-22286-3-git-send-email-bogdan.purcareata@freescale.com> References: <1409769375-22286-1-git-send-email-bogdan.purcareata@freescale.com> <1409769375-22286-3-git-send-email-bogdan.purcareata@freescale.com> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 2/2] PPC: openpic_kvm: Filter region callbacks based on memory region offset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bogdan Purcareata Cc: Mihai Caraman , qemu-ppc@nongnu.org, qemu-devel@nongnu.org On Wed, 2014-09-03 at 14:36 -0400, Bogdan Purcareata wrote: > This is done due to the fact that the kvm-openpic region_{add,del} callbacks > can be invoked for sections generated from other memory regions as well. These > callbacks should handle only requests for the kvm-openpic memory region. > > The patch fixes a bug on target-ppc occuring when the "e500-pci-bar0" memory > region is added. This memory region registers an alias to the "e500-ccsr" memory > region, which further contains the "kvm-openpic" subregion. Due to this alias, > the kvm_openpic_region_add is called once more, with an offset within the > "e500-pci-bar" memory region. This generates the remapping of the > in-kernel MPIC at a wrong offset. OK, so the problem is that we really do have the MPIC mapped in two locations (and the kernel API only lets us map one of them). It would be nice if the MemoryRegionSection struct indicated the alias being represented rather than needing to recalculate the non-aliased address. -Scott