From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REXJD-000460-DK for qemu-devel@nongnu.org; Thu, 13 Oct 2011 22:15:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1REXJB-0003mC-8H for qemu-devel@nongnu.org; Thu, 13 Oct 2011 22:15:39 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:50678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REXJA-0003ls-Mu for qemu-devel@nongnu.org; Thu, 13 Oct 2011 22:15:37 -0400 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp02.au.ibm.com (8.14.4/8.13.1) with ESMTP id p9E28lsa032761 for ; Fri, 14 Oct 2011 13:08:47 +1100 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9E2CwE82068534 for ; Fri, 14 Oct 2011 13:13:02 +1100 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p9E2FLTj006180 for ; Fri, 14 Oct 2011 13:15:21 +1100 Date: Fri, 14 Oct 2011 13:15:08 +1100 From: David Gibson Message-ID: <20111014021508.GC4580@truffala.fritz.box> References: <1315197304-22469-1-git-send-email-david@gibson.dropbear.id.au> <1315197304-22469-4-git-send-email-david@gibson.dropbear.id.au> <20111002114528.GJ30747@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111002114528.GJ30747@redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/9] eepro100: Use PCI DMA stub functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: aliguori@us.ibm.com, kraxel@redhat.com, joerg.roedel@amd.com, qemu-devel@nongnu.org, agraf@suse.de, avi@redhat.com, eduard.munteanu@linux360.ro, rth@twiddle.net On Sun, Oct 02, 2011 at 01:45:28PM +0200, Michael S. Tsirkin wrote: > On Mon, Sep 05, 2011 at 02:34:58PM +1000, David Gibson wrote: > > From: Eduard - Gabriel Munteanu > > @@ -744,21 +713,22 @@ static void dump_statistics(EEPRO100State * s) > > * values which really matter. > > * Number of data should check configuration!!! > > */ > > - cpu_physical_memory_write(s->statsaddr, &s->statistics, s->stats_size); > > - e100_stl_le_phys(s->statsaddr + 0, s->statistics.tx_good_frames); > > - e100_stl_le_phys(s->statsaddr + 36, s->statistics.rx_good_frames); > > - e100_stl_le_phys(s->statsaddr + 48, s->statistics.rx_resource_errors); > > - e100_stl_le_phys(s->statsaddr + 60, s->statistics.rx_short_frame_errors); > > + pci_dma_write(&s->dev, s->statsaddr, > > + (uint8_t *) & s->statistics, s->stats_size); > > + stl_pci_dma(&s->dev, s->statsaddr + 0, s->statistics.tx_good_frames); > > + stl_pci_dma(&s->dev, s->statsaddr + 36, s->statistics.rx_good_frames); > > + stl_pci_dma(&s->dev, s->statsaddr + 48, s->statistics.rx_resource_errors); > > + stl_pci_dma(&s->dev, s->statsaddr + 60, s->statistics.rx_short_frame_errors); > > At least old stl macros assumed an aligned address. > Not sure it's still the case but for e100 address might > not be aligned I think. The new macros, being implemented in terms of cpu_physical_memory_rw() with small lengths, do not require aligned addresses. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson