Page MenuHomeFreeBSD

D3325.id7782.diff
No OneTemporary

D3325.id7782.diff

Index: sys/dev/xen/netfront/netfront.c
===================================================================
--- sys/dev/xen/netfront/netfront.c
+++ sys/dev/xen/netfront/netfront.c
@@ -280,8 +280,6 @@
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 @@
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 @@
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 @@
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 @@
#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 @@
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 @@
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);
Index: sys/xen/gnttab.h
===================================================================
--- sys/xen/gnttab.h
+++ sys/xen/gnttab.h
@@ -126,10 +126,8 @@
{
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 @@
{
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 @@
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;
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 7:23 AM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14880975
Default Alt Text
D3325.id7782.diff (4 KB)

Event Timeline