From owner-svn-src-head@freebsd.org Fri Aug 14 18:38:40 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD9169B95A8; Fri, 14 Aug 2015 18:38:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C320512A0; Fri, 14 Aug 2015 18:38:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7EIceH8094105; Fri, 14 Aug 2015 18:38:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7EIceUl094102; Fri, 14 Aug 2015 18:38:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201508141838.t7EIceUl094102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 14 Aug 2015 18:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286786 - in head/sys: dev/xen/netfront xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2015 18:38:41 -0000 Author: jhb Date: Fri Aug 14 18:38:39 2015 New Revision: 286786 URL: https://svnweb.freebsd.org/changeset/base/286786 Log: Remove another remnant of PV domU support and assume that we always run with an automatically translated physmap under XEN. Reviewed by: royger (earlier version) Differential Revision: https://reviews.freebsd.org/D3325 Modified: head/sys/dev/xen/netfront/netfront.c head/sys/xen/gnttab.h Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Fri Aug 14 18:01:40 2015 (r286785) +++ head/sys/dev/xen/netfront/netfront.c Fri Aug 14 18:38:39 2015 (r286786) @@ -280,8 +280,6 @@ struct netfront_info { struct callout xn_stat_ch; u_long rx_pfn_array[NET_RX_RING_SIZE]; - multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1]; - mmu_update_t rx_mmu[NET_RX_RING_SIZE]; struct ifmedia sc_media; bool xn_resume; @@ -882,13 +880,6 @@ refill: gnttab_grant_foreign_transfer_ref(ref, otherend_id, pfn); sc->rx_pfn_array[nr_flips] = pfn; - if (!xen_feature(XENFEAT_auto_translated_physmap)) { - /* Remove this page before passing - * back to Xen. - */ - MULTI_update_va_mapping(&sc->rx_mcl[i], - vaddr, 0, 0); - } nr_flips++; } else { gnttab_grant_foreign_access_ref(ref, @@ -918,25 +909,6 @@ refill: reservation.extent_order = 0; reservation.address_bits = 0; reservation.domid = DOMID_SELF; - - if (!xen_feature(XENFEAT_auto_translated_physmap)) { - /* After all PTEs have been zapped, flush the TLB. */ - sc->rx_mcl[i-1].args[MULTI_UVMFLAGS_INDEX] = - UVMF_TLB_FLUSH|UVMF_ALL; - - /* Give away a batch of pages. */ - sc->rx_mcl[i].op = __HYPERVISOR_memory_op; - sc->rx_mcl[i].args[0] = XENMEM_decrease_reservation; - sc->rx_mcl[i].args[1] = (u_long)&reservation; - /* Zap PTEs and give away pages in one big multicall. */ - (void)HYPERVISOR_multicall(sc->rx_mcl, i+1); - - if (__predict_false(sc->rx_mcl[i].result != i || - HYPERVISOR_memory_op(XENMEM_decrease_reservation, - &reservation) != i)) - panic("%s: unable to reduce memory " - "reservation\n", __func__); - } } else { wmb(); } @@ -961,7 +933,6 @@ xn_rxeof(struct netfront_info *np) struct netif_rx_response *rx = &rinfo.rx; struct netif_extra_info *extras = rinfo.extras; RING_IDX i, rp; - multicall_entry_t *mcl; struct mbuf *m; struct mbufq rxq, errq; int err, pages_flipped = 0, work_to_do; @@ -1022,19 +993,6 @@ xn_rxeof(struct netfront_info *np) #ifdef notyet balloon_update_driver_allowance(-pages_flipped); #endif - /* Do all the remapping work, and M->P updates, in one big - * hypercall. - */ - if (!!xen_feature(XENFEAT_auto_translated_physmap)) { - mcl = np->rx_mcl + pages_flipped; - mcl->op = __HYPERVISOR_mmu_update; - mcl->args[0] = (u_long)np->rx_mmu; - mcl->args[1] = pages_flipped; - mcl->args[2] = 0; - mcl->args[3] = DOMID_SELF; - (void)HYPERVISOR_multicall(np->rx_mcl, - pages_flipped + 1); - } } mbufq_drain(&errq); @@ -1273,8 +1231,6 @@ xennet_get_responses(struct netfront_inf int *pages_flipped_p) { int pages_flipped = *pages_flipped_p; - struct mmu_update *mmu; - struct multicall_entry *mcl; struct netif_rx_response *rx = &rinfo->rx; struct netif_extra_info *extras = rinfo->extras; struct mbuf *m, *m0, *m_prev; @@ -1346,22 +1302,6 @@ xennet_get_responses(struct netfront_inf goto next; } - if (!xen_feature( XENFEAT_auto_translated_physmap)) { - /* Remap the page. */ - void *vaddr = mtod(m, void *); - uint32_t pfn; - - mcl = np->rx_mcl + pages_flipped; - mmu = np->rx_mmu + pages_flipped; - - MULTI_update_va_mapping(mcl, (u_long)vaddr, - (((vm_paddr_t)mfn) << PAGE_SHIFT) | PG_RW | - PG_V | PG_M | PG_A, 0); - pfn = (uintptr_t)m->m_ext.ext_arg1; - mmu->ptr = ((vm_paddr_t)mfn << PAGE_SHIFT) | - MMU_MACHPHYS_UPDATE; - mmu->val = pfn; - } pages_flipped++; } else { ret = gnttab_end_foreign_access_ref(ref); Modified: head/sys/xen/gnttab.h ============================================================================== --- head/sys/xen/gnttab.h Fri Aug 14 18:01:40 2015 (r286785) +++ head/sys/xen/gnttab.h Fri Aug 14 18:38:39 2015 (r286786) @@ -126,10 +126,8 @@ gnttab_set_map_op(struct gnttab_map_gran { if (flags & GNTMAP_contains_pte) map->host_addr = addr; - else if (xen_feature(XENFEAT_auto_translated_physmap)) - map->host_addr = vtophys(addr); else - map->host_addr = addr; + map->host_addr = vtophys(addr); map->flags = flags; map->ref = ref; @@ -142,10 +140,8 @@ gnttab_set_unmap_op(struct gnttab_unmap_ { if (flags & GNTMAP_contains_pte) unmap->host_addr = addr; - else if (xen_feature(XENFEAT_auto_translated_physmap)) - unmap->host_addr = vtophys(addr); else - unmap->host_addr = addr; + unmap->host_addr = vtophys(addr); unmap->handle = handle; unmap->dev_bus_addr = 0; @@ -155,13 +151,8 @@ static inline void gnttab_set_replace_op(struct gnttab_unmap_and_replace *unmap, vm_paddr_t addr, vm_paddr_t new_addr, grant_handle_t handle) { - if (xen_feature(XENFEAT_auto_translated_physmap)) { - unmap->host_addr = vtophys(addr); - unmap->new_addr = vtophys(new_addr); - } else { - unmap->host_addr = addr; - unmap->new_addr = new_addr; - } + unmap->host_addr = vtophys(addr); + unmap->new_addr = vtophys(new_addr); unmap->handle = handle; }