diff options
author | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2016-04-19 12:39:32 +0000 |
---|---|---|
committer | Mike Belopuhov <mikeb@cvs.openbsd.org> | 2016-04-19 12:39:32 +0000 |
commit | 02487e6d12461ba9dc1a743d1fcc2ee19263715a (patch) | |
tree | 925cd5bfaf37332bf350e60d0e5789f97d8b9581 | |
parent | 7843b916faa6070f2eb5cbd2c594b56c1e94055d (diff) |
Remove the ds_offset hack since object offset within a page
is the same for both virtual and physical addresses.
-rw-r--r-- | sys/dev/pv/if_xnf.c | 4 | ||||
-rw-r--r-- | sys/dev/pv/xen.c | 10 | ||||
-rw-r--r-- | sys/dev/pv/xenvar.h | 11 |
3 files changed, 4 insertions, 21 deletions
diff --git a/sys/dev/pv/if_xnf.c b/sys/dev/pv/if_xnf.c index d17166b55de..4f23c6fe616 100644 --- a/sys/dev/pv/if_xnf.c +++ b/sys/dev/pv/if_xnf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_xnf.c,v 1.18 2016/04/13 11:36:00 mpi Exp $ */ +/* $OpenBSD: if_xnf.c,v 1.19 2016/04/19 12:39:31 mikeb Exp $ */ /* * Copyright (c) 2015, 2016 Mike Belopuhov @@ -567,7 +567,7 @@ xnf_encap(struct xnf_softc *sc, struct mbuf *m_head, uint32_t *prod) txd->txd_req.txq_flags |= XNF_TXF_CHUNK; txd->txd_req.txq_ref = dmap->dm_segs[0].ds_addr; - txd->txd_req.txq_offset = dmap->dm_segs[0].ds_offset; + txd->txd_req.txq_offset = mtod(m, vaddr_t) & PAGE_MASK; sc->sc_tx_buf[i] = m; (*prod)++; } diff --git a/sys/dev/pv/xen.c b/sys/dev/pv/xen.c index 92fba3cd210..d5d0a5523b3 100644 --- a/sys/dev/pv/xen.c +++ b/sys/dev/pv/xen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xen.c,v 1.51 2016/04/01 15:41:12 mikeb Exp $ */ +/* $OpenBSD: xen.c,v 1.52 2016/04/19 12:39:31 mikeb Exp $ */ /* * Copyright (c) 2015 Mike Belopuhov @@ -1169,10 +1169,6 @@ xen_bus_dmamap_load(bus_dma_tag_t t, bus_dmamap_t map, void *buf, xen_grant_table_enter(sc, gm[i].gm_ref, map->dm_segs[i].ds_addr, flags & BUS_DMA_WRITE ? GTF_readonly : 0); gm[i].gm_paddr = map->dm_segs[i].ds_addr; - map->dm_segs[i].ds_offset = map->dm_segs[i].ds_addr & - PAGE_MASK; - KASSERT(map->dm_segs[i].ds_offset + - map->dm_segs[i].ds_len <= PAGE_SIZE); map->dm_segs[i].ds_addr = gm[i].gm_ref; } return (0); @@ -1193,10 +1189,6 @@ xen_bus_dmamap_load_mbuf(bus_dma_tag_t t, bus_dmamap_t map, struct mbuf *m0, xen_grant_table_enter(sc, gm[i].gm_ref, map->dm_segs[i].ds_addr, flags & BUS_DMA_WRITE ? GTF_readonly : 0); gm[i].gm_paddr = map->dm_segs[i].ds_addr; - map->dm_segs[i].ds_offset = map->dm_segs[i].ds_addr & - PAGE_MASK; - KASSERT(map->dm_segs[i].ds_offset + - map->dm_segs[i].ds_len <= PAGE_SIZE); map->dm_segs[i].ds_addr = gm[i].gm_ref; } return (0); diff --git a/sys/dev/pv/xenvar.h b/sys/dev/pv/xenvar.h index 34f381b78a7..afd60063045 100644 --- a/sys/dev/pv/xenvar.h +++ b/sys/dev/pv/xenvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: xenvar.h,v 1.29 2016/02/02 17:52:46 mikeb Exp $ */ +/* $OpenBSD: xenvar.h,v 1.30 2016/04/19 12:39:31 mikeb Exp $ */ /* * Copyright (c) 2015 Mike Belopuhov @@ -93,15 +93,6 @@ struct xen_attach_args { }; /* - * Grant table references don't convey the information about an actual - * offset of the data within the page, however Xen needs to know it. - * We (ab)use bus_dma_segment's _ds_boundary member to store it. Please - * note that we don't save or restore it's original value atm because - * neither i386 nor amd64 bus_dmamap_unload(9) code needs it. - */ -#define ds_offset _ds_boundary - -/* * Hypercalls */ #define XC_MEMORY 12 |