From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPpUq-0005j6-DI for qemu-devel@nongnu.org; Fri, 05 Sep 2014 05:08:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPpUi-0006oH-VL for qemu-devel@nongnu.org; Fri, 05 Sep 2014 05:07:56 -0400 Message-ID: <54097D64.8010506@suse.de> Date: Fri, 05 Sep 2014 11:07:48 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1409769375-22286-1-git-send-email-bogdan.purcareata@freescale.com> In-Reply-To: <1409769375-22286-1-git-send-email-bogdan.purcareata@freescale.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 0/2] PPC: kvm: Fix incorrect remapping of in-kernel MPIC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bogdan Purcareata , qemu-ppc@nongnu.org Cc: qemu-devel@nongnu.org On 03.09.14 20:36, Bogdan Purcareata wrote: > On target-ppc, the kvm-openpic memory region is part of the E500-CCSR memory > region. On the kernel side, the MPIC is mapped at the same offset as the > kvm-openpic within the address space. > > When adding the PCI BAR0 memory region, an alias is created to point to the > E500-CCSR memory region. This results in firing the kvm_openpic_region_add once > more, since kvm-openpic is part of the latter. Only this time, the offset is > wrong - it's part of the PCI memory region. This leads to the in-kernel MPIC to > be remapped at a wrong address, and thus all traps to the kvm-openpic > address to be emulated in userspace. > > The fix consists in an additional filter in kvm_openpic_region_{add,del} to > consider only addresses matching the start of the kvm-openpic memory region. If this is true, wouldn't vhost and vfio be broken too? Alex