Date: Tue, 11 Apr 2006 22:15:44 GMT From: John-Mark Gurney <jmg@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95032 for review Message-ID: <200604112215.k3BMFiIh000979@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95032 Change 95032 by jmg@jmg_arlene on 2006/04/11 22:15:38 remove the entire mapping, not just part of it... and assert that va and len are page aligned... Affected files ... .. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hviommu.c#12 edit Differences ... ==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hviommu.c#12 (text+ko) ==== @@ -233,7 +233,6 @@ return him; } -/* XXX - vm_size_t better be signed */ static void hviommu_remove(struct hviommu *him, vm_offset_t va, vm_size_t len) { @@ -244,8 +243,8 @@ ("%s: va 0x%lx not in DVMA space", __func__, (u_long)va)); KASSERT(va + len >= va, ("%s: va 0x%lx + len 0x%lx wraps", __func__, (long)va, (long)len)); - len = round_page(len + (va & IO_PAGE_MASK)); - va = trunc_io_page(va); + KASSERT((va & IO_PAGE_MASK) == 0 && (len & IO_PAGE_MASK) == 0, + ("%s: va %#lx or len %#lx not page aligned", __func__, va, len)); while (len > 0) { if ((error = hvio_iommu_demap(him->him_handle, VA_TO_TSBID(him, va), len >> IO_PAGE_SHIFT, &demapped))) { @@ -306,7 +305,7 @@ struct bus_dmamap_res *r; SLIST_FOREACH(r, &map->dm_reslist, dr_link) { - hviommu_remove(him, BDR_START(r) + r->dr_offset, r->dr_used); + hviommu_remove(him, BDR_START(r), BDR_SIZE(r)); r->dr_used = 0; } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604112215.k3BMFiIh000979>