From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZ1Vg-0003yz-DS for qemu-devel@nongnu.org; Thu, 15 Nov 2012 10:37:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TZ1Vd-0003D0-BW for qemu-devel@nongnu.org; Thu, 15 Nov 2012 10:37:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TZ1Vd-0003Ct-3c for qemu-devel@nongnu.org; Thu, 15 Nov 2012 10:37:41 -0500 Message-ID: <50A50C3F.80604@redhat.com> Date: Thu, 15 Nov 2012 16:37:35 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1352992746-8767-1-git-send-email-stefanha@redhat.com> <1352992746-8767-4-git-send-email-stefanha@redhat.com> In-Reply-To: <1352992746-8767-4-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/7] dataplane: add virtqueue vring code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , Anthony Liguori , "Michael S. Tsirkin" , qemu-devel@nongnu.org, khoa@us.ibm.com, Asias He Il 15/11/2012 16:19, Stefan Hajnoczi ha scritto: > +/* Map target physical address to host address > + */ > +static inline void *phys_to_host(Vring *vring, hwaddr phys) > +{ > + /* Adjust for 3.6-4 GB PCI memory range */ > + if (phys >= 0x100000000) { > + phys -= 0x100000000 - 0xe0000000; > + } else if (phys >= 0xe0000000) { > + fprintf(stderr, "phys_to_host bad physical address in " > + "PCI range %#lx\n", phys); > + exit(1); > + } > + return vring->phys_mem_zero_host_ptr + phys; > +} > + Hmm, perhaps *this* is not quite ready. :) What we want is lockless address_space_map. We're not far from it, but not there either. Can you add, at least for now, a weak function that does a 1:1 mapping, and override it with the above code in hw/pc.c? The prototype then would be static inline void *dataplane_phys_to_host(void *base, hwaddr phys) { } or something like that. Paolo