From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIdFo-0006Bt-TQ for qemu-devel@nongnu.org; Thu, 21 Mar 2013 07:01:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIdFj-0006bh-EE for qemu-devel@nongnu.org; Thu, 21 Mar 2013 07:01:52 -0400 Received: from mail-la0-x234.google.com ([2a00:1450:4010:c03::234]:47813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIdFj-0006bM-7L for qemu-devel@nongnu.org; Thu, 21 Mar 2013 07:01:47 -0400 Received: by mail-la0-f52.google.com with SMTP id fs12so4895674lab.11 for ; Thu, 21 Mar 2013 04:01:46 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <6C8C9D12-4ACE-466B-A970-58D7FD78930B@suse.de> 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> From: Peter Maydell Date: Thu, 21 Mar 2013 11:01:25 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 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: Alexander Graf Cc: Scott Wood , "qemu-ppc@nongnu.org list:PowerPC" , qemu-devel qemu-devel 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". > > 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 :) 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. -- PMM