From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47960 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q0319-0004Ix-Ra for qemu-devel@nongnu.org; Wed, 16 Mar 2011 22:32:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q0318-0003OX-TA for qemu-devel@nongnu.org; Wed, 16 Mar 2011 22:32:51 -0400 Received: from ozlabs.org ([203.10.76.45]:45157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q0318-0003Mw-G9 for qemu-devel@nongnu.org; Wed, 16 Mar 2011 22:32:50 -0400 Date: Thu, 17 Mar 2011 13:09:52 +1100 From: David Gibson Subject: Re: [Qemu-devel] [PATCH 22/26] Implement sPAPR Virtual LAN (ibmveth) Message-ID: <20110317020952.GH1105@yookeroo> References: <1300251423-6715-1-git-send-email-david@gibson.dropbear.id.au> <1300251423-6715-23-git-send-email-david@gibson.dropbear.id.au> <4D8139DC.2030803@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D8139DC.2030803@codemonkey.ws> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: paulus@samba.org, agraf@suse.de, anton@samba.org, qemu-devel@nongnu.org On Wed, Mar 16, 2011 at 05:29:48PM -0500, Anthony Liguori wrote: > On 03/15/2011 11:56 PM, David Gibson wrote: [snip] > >+ lbuf = qemu_mallocz(total_len); > >+ p = lbuf; > >+ for (i = 0; i< nbufs; i++) { > >+ ret = spapr_tce_dma_read(sdev, VLAN_BD_ADDR(bufs[i]), > >+ p, VLAN_BD_LEN(bufs[i])); > >+ if (ret< 0) { > >+ goto out; > >+ } > >+ > >+ p += VLAN_BD_LEN(bufs[i]); > >+ } > > I don't like the idea that there's a guest driven allocation that > can reach 100mb here. I'd suggest that we at least limit total_len > to 64k to be on the safe side since a packet can't be larger than > that anyway. Ah, a very good point. Done. -- 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