Received: from eggs.gnu.org ([208.118.235.92]:46112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIdb3-000276-Q4 for qemu-devel@nongnu.org; Thu, 21 Mar 2013 07:23:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIdax-0006uK-0R for qemu-devel@nongnu.org; Thu, 21 Mar 2013 07:23:49 -0400 Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: Date: Thu, 21 Mar 2013 12:05:00 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1360823521-32306-1-git-send-email-scottwood@freescale.com> <1360823521-32306-4-git-send-email-scottwood@freescale.com> <6C8C9D12-4ACE-466B-A970-58D7FD78930B@suse.de> Subject: Re: [Qemu-devel] [RFC ppc-next PATCH 3/6] memory: add memory_region_to_address() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Scott Wood , "qemu-ppc@nongnu.org list:PowerPC" , qemu-devel qemu-devel On 21.03.2013, at 12:01, Peter Maydell wrote: > On 21 March 2013 10:59, Alexander Graf wrote: >> On 21.03.2013, at 11:53, Peter Maydell wrote: >>> Check kvm_arm_register_device() in target-arm/kvm.c. Basically >>> the VGIC device model calls this function to say "tell the kernel >>> where this MemoryRegion is in the system address space, when it >>> eventually gets mapped". The code in kvm.c uses the memory system's >>> Notifier API to get a callback when the region is mapped into >>> an address space, which it uses to track the offset in the >>> address space. Finally, we use a machine init notifier so that >>> just before everything finally starts we can make the KVM ioctls >>> to say "here is where everything lives". >>=20 >> Same thing here. The question is how the kvm-vgic code in QEMU >> finds out where it got mapped to. Scott adds this patch to do >> this, but I'd assume you have some other way :) >=20 > Hmm? The kvm-vgic code in QEMU doesn't need to know where it > lives. We have to tell the kernel so it can map its bits of > registers in at the right place, that's all. The kvm-vgic code in QEMU needs to tell the kernel, no? For that, it = needs to know what to tell the kernel. This patch adds a function that allows kvm-openpic to fetch its base = flat address from the MemoryListener. I was wondering whether either = this patch is superfluous or you guys had an awkward MemoryListener = handler :) Alex