From: Tristan Gingold Subject: PATCH: multicall and auto_translated in netfront.c Date: Fri, 18 Aug 2006 16:02:22 +0200 Message-ID: <200608181602.22811.Tristan.Gingold@bull.net> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_uhc5EWT7PSzFq2a" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com, Keir Fraser List-Id: xen-devel@lists.xenproject.org --Boundary-00=_uhc5EWT7PSzFq2a Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, If auto_translated is set (by default on ia64), netfront does multicall with not initialized entries. This patch fixes this bug. [It may be simpler to do an hypercall instead of the multicall in this case. Tell me if I should rewrite the patch this way.] Tristan. --Boundary-00=_uhc5EWT7PSzFq2a Content-Type: text/x-diff; charset="us-ascii"; name="xen-netfront.diffs" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen-netfront.diffs" # HG changeset patch # User gingold@virtu10 # Node ID ee4aef404bce05efa3570bc39cd8c9130e10c37b # Parent bef360142b62e969a34087bac3e0a658a4c7b3bd Bug fix: correctly set length of multicall if !auto_translated. Signed-off-by: Tristan Gingold diff -r bef360142b62 -r ee4aef404bce linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Mon Aug 14 14:21:21 2006 -0600 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Fri Aug 18 14:00:37 2006 +0200 @@ -1220,13 +1220,20 @@ err: /* Do all the remapping work, and M2P updates, in one big hypercall. */ if (likely(pages_done)) { - mcl = np->rx_mcl + pages_done; + unsigned int mcl_off; + + if (!xen_feature(XENFEAT_auto_translated_physmap)) + mcl_off = pages_done; + else + mcl_off = 0; + + mcl = np->rx_mcl + mcl_off; mcl->op = __HYPERVISOR_mmu_update; mcl->args[0] = (unsigned long)np->rx_mmu; mcl->args[1] = pages_done; mcl->args[2] = 0; mcl->args[3] = DOMID_SELF; - (void)HYPERVISOR_multicall(np->rx_mcl, pages_done + 1); + (void)HYPERVISOR_multicall(np->rx_mcl, mcl_off + 1); } while ((skb = __skb_dequeue(&errq))) --Boundary-00=_uhc5EWT7PSzFq2a Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_uhc5EWT7PSzFq2a--