From 71b5b012c470799caab3128c9b365585d08aa7e2 Mon Sep 17 00:00:00 2001 From: alc Date: Mon, 20 Aug 2018 15:57:27 +0000 Subject: [PATCH] Eliminate kmem_alloc_contig()'s unused arena parameter. Reviewed by: hselasky, kib, markj Discussed with: jeff Differential Revision: https://reviews.freebsd.org/D16799 --- sys/arm/allwinner/a10_fb.c | 4 ++-- sys/arm/arm/busdma_machdep-v4.c | 5 ++--- sys/arm/arm/busdma_machdep-v6.c | 5 ++--- sys/arm/arm/pmap-v6.c | 5 ++--- sys/arm/freescale/imx/imx6_sdma.c | 14 ++++++-------- sys/arm/nvidia/drm2/tegra_dc.c | 6 +++--- sys/arm/nvidia/tegra_pcie.c | 4 ++-- sys/arm/nvidia/tegra_xhci.c | 4 ++-- sys/arm/samsung/exynos/exynos5_fimd.c | 4 ++-- sys/arm64/arm64/busdma_bounce.c | 7 +++---- .../linuxkpi/common/include/linux/dma-mapping.h | 4 ++-- sys/compat/linuxkpi/common/src/linux_page.c | 5 ++--- sys/compat/ndis/subr_ntoskrnl.c | 4 ++-- sys/dev/agp/agp.c | 6 +++--- sys/dev/agp/agp_i810.c | 5 ++--- sys/dev/liquidio/lio_network.h | 4 ++-- sys/dev/xdma/controller/pl330.c | 4 ++-- sys/kern/kern_malloc.c | 4 ++-- sys/mips/ingenic/jz4780_lcd.c | 4 ++-- sys/mips/mips/busdma_machdep.c | 5 ++--- sys/powerpc/powerpc/busdma_machdep.c | 6 +++--- sys/vm/vm_extern.h | 2 +- sys/vm/vm_kern.c | 8 ++------ sys/x86/iommu/intel_intrmap.c | 2 +- sys/x86/iommu/intel_qi.c | 4 ++-- 25 files changed, 56 insertions(+), 69 deletions(-) diff --git a/sys/arm/allwinner/a10_fb.c b/sys/arm/allwinner/a10_fb.c index 4beb0d276062..ef3899b3c368 100644 --- a/sys/arm/allwinner/a10_fb.c +++ b/sys/arm/allwinner/a10_fb.c @@ -178,8 +178,8 @@ static struct resource_spec a10fb_spec[] = { static int a10fb_allocfb(struct a10fb_softc *sc) { - sc->vaddr = kmem_alloc_contig(kernel_arena, sc->fbsize, - M_NOWAIT | M_ZERO, 0, ~0, FB_ALIGN, 0, VM_MEMATTR_WRITE_COMBINING); + sc->vaddr = kmem_alloc_contig(sc->fbsize, M_NOWAIT | M_ZERO, 0, ~0, + FB_ALIGN, 0, VM_MEMATTR_WRITE_COMBINING); if (sc->vaddr == 0) { device_printf(sc->dev, "failed to allocate FB memory\n"); return (ENOMEM); diff --git a/sys/arm/arm/busdma_machdep-v4.c b/sys/arm/arm/busdma_machdep-v4.c index be1d0b78d0a7..e6e863ad9ca6 100644 --- a/sys/arm/arm/busdma_machdep-v4.c +++ b/sys/arm/arm/busdma_machdep-v4.c @@ -750,9 +750,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags, *vaddr = (void *)kmem_alloc_attr(dmat->maxsize, mflags, 0, dmat->lowaddr, memattr); } else { - *vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->maxsize, - mflags, 0, dmat->lowaddr, dmat->alignment, dmat->boundary, - memattr); + *vaddr = (void *)kmem_alloc_contig(dmat->maxsize, mflags, 0, + dmat->lowaddr, dmat->alignment, dmat->boundary, memattr); } if (*vaddr == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", diff --git a/sys/arm/arm/busdma_machdep-v6.c b/sys/arm/arm/busdma_machdep-v6.c index 3eb31b959f21..3ab34fb3322a 100644 --- a/sys/arm/arm/busdma_machdep-v6.c +++ b/sys/arm/arm/busdma_machdep-v6.c @@ -815,9 +815,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void **vaddr, int flags, *vaddr = (void *)kmem_alloc_attr(dmat->maxsize, mflags, 0, dmat->lowaddr, memattr); } else { - *vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->maxsize, - mflags, 0, dmat->lowaddr, dmat->alignment, dmat->boundary, - memattr); + *vaddr = (void *)kmem_alloc_contig(dmat->maxsize, mflags, 0, + dmat->lowaddr, dmat->alignment, dmat->boundary, memattr); } if (*vaddr == NULL) { CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d", diff --git a/sys/arm/arm/pmap-v6.c b/sys/arm/arm/pmap-v6.c index 2d3c4f534faa..e62c74d987ff 100644 --- a/sys/arm/arm/pmap-v6.c +++ b/sys/arm/arm/pmap-v6.c @@ -2219,9 +2219,8 @@ pmap_pinit(pmap_t pmap) */ if (pmap->pm_pt1 == NULL) { - pmap->pm_pt1 = (pt1_entry_t *)kmem_alloc_contig(kernel_arena, - NB_IN_PT1, M_NOWAIT | M_ZERO, 0, -1UL, NB_IN_PT1, 0, - pt_memattr); + pmap->pm_pt1 = (pt1_entry_t *)kmem_alloc_contig(NB_IN_PT1, + M_NOWAIT | M_ZERO, 0, -1UL, NB_IN_PT1, 0, pt_memattr); if (pmap->pm_pt1 == NULL) return (0); } diff --git a/sys/arm/freescale/imx/imx6_sdma.c b/sys/arm/freescale/imx/imx6_sdma.c index 7bb99c8ae124..6566151e68a4 100644 --- a/sys/arm/freescale/imx/imx6_sdma.c +++ b/sys/arm/freescale/imx/imx6_sdma.c @@ -179,9 +179,8 @@ sdma_alloc(void) chn = i; /* Allocate area for buffer descriptors */ - channel->bd = (void *)kmem_alloc_contig(kernel_arena, - PAGE_SIZE, M_ZERO, 0, ~0, PAGE_SIZE, 0, - VM_MEMATTR_UNCACHEABLE); + channel->bd = (void *)kmem_alloc_contig(PAGE_SIZE, M_ZERO, 0, ~0, + PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); return (chn); } @@ -392,8 +391,8 @@ boot_firmware(struct sdma_softc *sc) sz = SDMA_N_CHANNELS * sizeof(struct sdma_channel_control) + \ sizeof(struct sdma_context_data); - sc->ccb = (void *)kmem_alloc_contig(kernel_arena, - sz, M_ZERO, 0, ~0, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); + sc->ccb = (void *)kmem_alloc_contig(sz, M_ZERO, 0, ~0, PAGE_SIZE, 0, + VM_MEMATTR_UNCACHEABLE); sc->ccb_phys = vtophys(sc->ccb); sc->context = (void *)((char *)sc->ccb + \ @@ -411,9 +410,8 @@ boot_firmware(struct sdma_softc *sc) /* Channel 0 is used for booting firmware */ chn = 0; - sc->bd0 = (void *)kmem_alloc_contig(kernel_arena, - PAGE_SIZE, M_ZERO, 0, ~0, PAGE_SIZE, 0, - VM_MEMATTR_UNCACHEABLE); + sc->bd0 = (void *)kmem_alloc_contig(PAGE_SIZE, M_ZERO, 0, ~0, PAGE_SIZE, + 0, VM_MEMATTR_UNCACHEABLE); bd0 = sc->bd0; sc->ccb[chn].base_bd_ptr = vtophys(bd0); sc->ccb[chn].current_bd_ptr = vtophys(bd0); diff --git a/sys/arm/nvidia/drm2/tegra_dc.c b/sys/arm/nvidia/drm2/tegra_dc.c index 401f7cabaa4e..2b761b3fa2aa 100644 --- a/sys/arm/nvidia/drm2/tegra_dc.c +++ b/sys/arm/nvidia/drm2/tegra_dc.c @@ -1234,9 +1234,9 @@ dc_init_client(device_t dev, device_t host1x, struct tegra_drm *drm) } /* allocate memory for cursor cache */ - sc->tegra_crtc.cursor_vbase = kmem_alloc_contig(kernel_arena, - 256 * 256 * 4, M_WAITOK | M_ZERO, - 0, -1UL, PAGE_SIZE, 0, VM_MEMATTR_WRITE_COMBINING); + sc->tegra_crtc.cursor_vbase = kmem_alloc_contig(256 * 256 * 4, + M_WAITOK | M_ZERO, 0, -1UL, PAGE_SIZE, 0, + VM_MEMATTR_WRITE_COMBINING); sc->tegra_crtc.cursor_pbase = vtophys(sc->tegra_crtc.cursor_vbase); return (0); } diff --git a/sys/arm/nvidia/tegra_pcie.c b/sys/arm/nvidia/tegra_pcie.c index cea0d47c2747..ffe454734eb9 100644 --- a/sys/arm/nvidia/tegra_pcie.c +++ b/sys/arm/nvidia/tegra_pcie.c @@ -1395,8 +1395,8 @@ tegra_pcib_attach_msi(device_t dev) sc = device_get_softc(dev); - sc->msi_page = kmem_alloc_contig(kernel_arena, PAGE_SIZE, M_WAITOK, - 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + sc->msi_page = kmem_alloc_contig(PAGE_SIZE, M_WAITOK, 0, + BUS_SPACE_MAXADDR, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); /* MSI BAR */ tegra_pcib_set_bar(sc, 9, vtophys(sc->msi_page), vtophys(sc->msi_page), diff --git a/sys/arm/nvidia/tegra_xhci.c b/sys/arm/nvidia/tegra_xhci.c index 64bf889cb942..f3d96752cc87 100644 --- a/sys/arm/nvidia/tegra_xhci.c +++ b/sys/arm/nvidia/tegra_xhci.c @@ -808,8 +808,8 @@ load_fw(struct tegra_xhci_softc *sc) fw_hdr = (const struct tegra_xusb_fw_hdr *)fw->data; fw_size = fw_hdr->fwimg_len; - fw_vaddr = kmem_alloc_contig(kernel_arena, fw_size, - M_WAITOK, 0, -1UL, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); + fw_vaddr = kmem_alloc_contig(fw_size, M_WAITOK, 0, -1UL, PAGE_SIZE, 0, + VM_MEMATTR_UNCACHEABLE); fw_paddr = vtophys(fw_vaddr); fw_hdr = (const struct tegra_xusb_fw_hdr *)fw_vaddr; memcpy((void *)fw_vaddr, fw->data, fw_size); diff --git a/sys/arm/samsung/exynos/exynos5_fimd.c b/sys/arm/samsung/exynos/exynos5_fimd.c index 2a02074ec1f1..377d149f0a26 100644 --- a/sys/arm/samsung/exynos/exynos5_fimd.c +++ b/sys/arm/samsung/exynos/exynos5_fimd.c @@ -356,8 +356,8 @@ fimd_attach(device_t dev) sc->sc_info.fb_stride = sc->sc_info.fb_width * 2; sc->sc_info.fb_bpp = sc->sc_info.fb_depth = 16; sc->sc_info.fb_size = sc->sc_info.fb_height * sc->sc_info.fb_stride; - sc->sc_info.fb_vbase = (intptr_t)kmem_alloc_contig(kernel_arena, - sc->sc_info.fb_size, M_ZERO, 0, ~0, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); + sc->sc_info.fb_vbase = (intptr_t)kmem_alloc_contig(sc->sc_info.fb_size, + M_ZERO, 0, ~0, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); sc->sc_info.fb_pbase = (intptr_t)vtophys(sc->sc_info.fb_vbase); #if 0 diff --git a/sys/arm64/arm64/busdma_bounce.c b/sys/arm64/arm64/busdma_bounce.c index c6561e43c084..0459fbc08a93 100644 --- a/sys/arm64/arm64/busdma_bounce.c +++ b/sys/arm64/arm64/busdma_bounce.c @@ -495,10 +495,9 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, 0ul, dmat->common.lowaddr, attr); dmat->bounce_flags |= BF_KMEM_ALLOC; } else { - *vaddr = (void *)kmem_alloc_contig(kernel_arena, - dmat->common.maxsize, mflags, 0ul, dmat->common.lowaddr, - dmat->common.alignment != 0 ? dmat->common.alignment : 1ul, - dmat->common.boundary, attr); + *vaddr = (void *)kmem_alloc_contig(dmat->common.maxsize, mflags, + 0ul, dmat->common.lowaddr, dmat->common.alignment != 0 ? + dmat->common.alignment : 1ul, dmat->common.boundary, attr); dmat->bounce_flags |= BF_KMEM_ALLOC; } if (*vaddr == NULL) { diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 8b57f01cbbc9..bae94a4fbc5a 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -134,8 +134,8 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, else high = BUS_SPACE_MAXADDR; align = PAGE_SIZE << get_order(size); - mem = (void *)kmem_alloc_contig(kmem_arena, size, flag, 0, high, align, - 0, VM_MEMATTR_DEFAULT); + mem = (void *)kmem_alloc_contig(size, flag, 0, high, align, 0, + VM_MEMATTR_DEFAULT); if (mem) *dma_handle = vtophys(mem); else diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c index c22a871279e7..9670be68ae75 100644 --- a/sys/compat/linuxkpi/common/src/linux_page.c +++ b/sys/compat/linuxkpi/common/src/linux_page.c @@ -167,9 +167,8 @@ linux_alloc_kmem(gfp_t flags, unsigned int order) if ((flags & GFP_DMA32) == 0) { addr = kmem_malloc(kmem_arena, size, flags & GFP_NATIVE_MASK); } else { - addr = kmem_alloc_contig(kmem_arena, size, - flags & GFP_NATIVE_MASK, 0, BUS_SPACE_MAXADDR_32BIT, - PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + addr = kmem_alloc_contig(size, flags & GFP_NATIVE_MASK, 0, + BUS_SPACE_MAXADDR_32BIT, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); } return (addr); } diff --git a/sys/compat/ndis/subr_ntoskrnl.c b/sys/compat/ndis/subr_ntoskrnl.c index 5bf3e7aeee49..574889f202c6 100644 --- a/sys/compat/ndis/subr_ntoskrnl.c +++ b/sys/compat/ndis/subr_ntoskrnl.c @@ -2491,8 +2491,8 @@ MmAllocateContiguousMemorySpecifyCache(size, lowest, highest, break; } - ret = (void *)kmem_alloc_contig(kernel_arena, size, M_ZERO | M_NOWAIT, - lowest, highest, PAGE_SIZE, boundary, memattr); + ret = (void *)kmem_alloc_contig(size, M_ZERO | M_NOWAIT, lowest, + highest, PAGE_SIZE, boundary, memattr); if (ret != NULL) malloc_type_allocated(M_DEVBUF, round_page(size)); return (ret); diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c index 208cb395118e..fca63f9666ae 100644 --- a/sys/dev/agp/agp.c +++ b/sys/dev/agp/agp.c @@ -154,9 +154,9 @@ agp_alloc_gatt(device_t dev) return 0; gatt->ag_entries = entries; - gatt->ag_virtual = (void *)kmem_alloc_contig(kernel_arena, - entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, - 0, VM_MEMATTR_WRITE_COMBINING); + gatt->ag_virtual = (void *)kmem_alloc_contig(entries * + sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, 0, + VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_virtual) { if (bootverbose) device_printf(dev, "contiguous allocation failed\n"); diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index bb57bfa02cbb..59028f0533d8 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -1189,9 +1189,8 @@ agp_i810_install_gatt(device_t dev) sc->dcache_size = 0; /* According to the specs the gatt on the i810 must be 64k. */ - sc->gatt->ag_virtual = (void *)kmem_alloc_contig(kernel_arena, - 64 * 1024, M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, - 0, VM_MEMATTR_WRITE_COMBINING); + sc->gatt->ag_virtual = (void *)kmem_alloc_contig(64 * 1024, M_NOWAIT | + M_ZERO, 0, ~0, PAGE_SIZE, 0, VM_MEMATTR_WRITE_COMBINING); if (sc->gatt->ag_virtual == NULL) { if (bootverbose) device_printf(dev, "contiguous allocation failed\n"); diff --git a/sys/dev/liquidio/lio_network.h b/sys/dev/liquidio/lio_network.h index beba634bb51a..b8cdcde76626 100644 --- a/sys/dev/liquidio/lio_network.h +++ b/sys/dev/liquidio/lio_network.h @@ -198,8 +198,8 @@ lio_dma_alloc(size_t size, vm_paddr_t *dma_handle) void *mem; align = PAGE_SIZE << lio_get_order(size); - mem = (void *)kmem_alloc_contig(kmem_arena, size, M_WAITOK, 0, ~0ul, - align, 0, VM_MEMATTR_DEFAULT); + mem = (void *)kmem_alloc_contig(size, M_WAITOK, 0, ~0ul, align, 0, + VM_MEMATTR_DEFAULT); if (mem != NULL) *dma_handle = vtophys(mem); else diff --git a/sys/dev/xdma/controller/pl330.c b/sys/dev/xdma/controller/pl330.c index 016b3e994943..3e0b6368cd72 100644 --- a/sys/dev/xdma/controller/pl330.c +++ b/sys/dev/xdma/controller/pl330.c @@ -392,8 +392,8 @@ pl330_channel_alloc(device_t dev, struct xdma_channel *xchan) chan->sc = sc; chan->used = 1; - chan->ibuf = (void *)kmem_alloc_contig(kernel_arena, - PAGE_SIZE*8, M_ZERO, 0, ~0, PAGE_SIZE, 0, + chan->ibuf = (void *)kmem_alloc_contig(PAGE_SIZE * 8, + M_ZERO, 0, ~0, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); chan->ibuf_phys = vtophys(chan->ibuf); diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 3bc0e6ee0d11..0269298b6a0e 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -443,8 +443,8 @@ contigmalloc(unsigned long size, struct malloc_type *type, int flags, { void *ret; - ret = (void *)kmem_alloc_contig(kernel_arena, size, flags, low, high, - alignment, boundary, VM_MEMATTR_DEFAULT); + ret = (void *)kmem_alloc_contig(size, flags, low, high, alignment, + boundary, VM_MEMATTR_DEFAULT); if (ret != NULL) malloc_type_allocated(type, round_page(size)); return (ret); diff --git a/sys/mips/ingenic/jz4780_lcd.c b/sys/mips/ingenic/jz4780_lcd.c index 7b023f541a8b..506c23e60121 100644 --- a/sys/mips/ingenic/jz4780_lcd.c +++ b/sys/mips/ingenic/jz4780_lcd.c @@ -115,8 +115,8 @@ static struct resource_spec jzlcd_spec[] = { static int jzlcd_allocfb(struct jzlcd_softc *sc) { - sc->vaddr = kmem_alloc_contig(kernel_arena, sc->fbsize, - M_NOWAIT | M_ZERO, 0, ~0, FB_ALIGN, 0, VM_MEMATTR_WRITE_COMBINING); + sc->vaddr = kmem_alloc_contig(sc->fbsize, M_NOWAIT | M_ZERO, 0, ~0, + FB_ALIGN, 0, VM_MEMATTR_WRITE_COMBINING); if (sc->vaddr == 0) { device_printf(sc->dev, "failed to allocate FB memory\n"); return (ENOMEM); diff --git a/sys/mips/mips/busdma_machdep.c b/sys/mips/mips/busdma_machdep.c index 4d62a586cb98..46ad2c248633 100644 --- a/sys/mips/mips/busdma_machdep.c +++ b/sys/mips/mips/busdma_machdep.c @@ -717,9 +717,8 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddrp, int flags, vaddr = (void *)kmem_alloc_attr(dmat->maxsize, mflags, 0, dmat->lowaddr, memattr); } else { - vaddr = (void *)kmem_alloc_contig(kernel_arena, dmat->maxsize, - mflags, 0, dmat->lowaddr, dmat->alignment, dmat->boundary, - memattr); + vaddr = (void *)kmem_alloc_contig(dmat->maxsize, mflags, 0, + dmat->lowaddr, dmat->alignment, dmat->boundary, memattr); } if (vaddr == NULL) { _busdma_free_dmamap(newmap); diff --git a/sys/powerpc/powerpc/busdma_machdep.c b/sys/powerpc/powerpc/busdma_machdep.c index ba5c608982af..78c3568785c6 100644 --- a/sys/powerpc/powerpc/busdma_machdep.c +++ b/sys/powerpc/powerpc/busdma_machdep.c @@ -542,9 +542,9 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, * multi-seg allocations yet though. * XXX Certain AGP hardware does. */ - *vaddr = (void *)kmem_alloc_contig(kmem_arena, dmat->maxsize, - mflags, 0ul, dmat->lowaddr, dmat->alignment ? - dmat->alignment : 1ul, dmat->boundary, attr); + *vaddr = (void *)kmem_alloc_contig(dmat->maxsize, mflags, 0ul, + dmat->lowaddr, dmat->alignment ? dmat->alignment : 1ul, + dmat->boundary, attr); (*mapp)->contigalloc = 1; } if (*vaddr == NULL) { diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h index 8de581b7e6df..eda0c6f161af 100644 --- a/sys/vm/vm_extern.h +++ b/sys/vm/vm_extern.h @@ -58,7 +58,7 @@ vm_offset_t kmem_alloc_attr(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); vm_offset_t kmem_alloc_attr_domain(int domain, vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr); -vm_offset_t kmem_alloc_contig(struct vmem *, vm_size_t size, int flags, +vm_offset_t kmem_alloc_contig(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); vm_offset_t kmem_alloc_contig_domain(int domain, vm_size_t size, int flags, diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 17c681451612..d5c7fde48640 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -304,17 +304,13 @@ retry: } vm_offset_t -kmem_alloc_contig(struct vmem *vmem, vm_size_t size, int flags, vm_paddr_t low, - vm_paddr_t high, u_long alignment, vm_paddr_t boundary, - vm_memattr_t memattr) +kmem_alloc_contig(vm_size_t size, int flags, vm_paddr_t low, vm_paddr_t high, + u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) { struct vm_domainset_iter di; vm_offset_t addr; int domain; - KASSERT(vmem == kernel_arena, - ("kmem_alloc_contig: Only kernel_arena is supported.")); - vm_domainset_iter_malloc_init(&di, kernel_object, &domain, &flags); do { addr = kmem_alloc_contig_domain(domain, size, flags, low, high, diff --git a/sys/x86/iommu/intel_intrmap.c b/sys/x86/iommu/intel_intrmap.c index 745e617d4ce1..6bb2355fb205 100644 --- a/sys/x86/iommu/intel_intrmap.c +++ b/sys/x86/iommu/intel_intrmap.c @@ -338,7 +338,7 @@ dmar_init_irt(struct dmar_unit *unit) return (0); } unit->irte_cnt = clp2(NUM_IO_INTS); - unit->irt = (dmar_irte_t *)(uintptr_t)kmem_alloc_contig(kernel_arena, + unit->irt = (dmar_irte_t *)(uintptr_t)kmem_alloc_contig( unit->irte_cnt * sizeof(dmar_irte_t), M_ZERO | M_WAITOK, 0, dmar_high, PAGE_SIZE, 0, DMAR_IS_COHERENT(unit) ? VM_MEMATTR_DEFAULT : VM_MEMATTR_UNCACHEABLE); diff --git a/sys/x86/iommu/intel_qi.c b/sys/x86/iommu/intel_qi.c index 1954d42765ed..e2c923c4b3e9 100644 --- a/sys/x86/iommu/intel_qi.c +++ b/sys/x86/iommu/intel_qi.c @@ -398,8 +398,8 @@ dmar_init_qi(struct dmar_unit *unit) unit->inv_queue_avail = unit->inv_queue_size - DMAR_IQ_DESCR_SZ; /* The invalidation queue reads by DMARs are always coherent. */ - unit->inv_queue = kmem_alloc_contig(kernel_arena, unit->inv_queue_size, - M_WAITOK | M_ZERO, 0, dmar_high, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + unit->inv_queue = kmem_alloc_contig(unit->inv_queue_size, M_WAITOK | + M_ZERO, 0, dmar_high, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); unit->inv_waitd_seq_hw_phys = pmap_kextract( (vm_offset_t)&unit->inv_waitd_seq_hw);