qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 22/26] Implement sPAPR Virtual LAN (ibmveth)


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH 22/26] Implement sPAPR Virtual LAN (ibmveth)
Date: Thu, 17 Mar 2011 13:09:52 +1100
User-agent: Mutt/1.5.20 (2009-06-14)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]