Add a per-each macro IOMMU_DOMAIN_UNLOAD_SLEEP which allows to sleep
during iommu guest address space entries unload. Suggested by: kib Sponsored by: Innovate DSbD Differential Revision: https://reviews.freebsd.org/D26722
This commit is contained in:
parent
cffe0e0f9d
commit
6e9127d838
@ -888,7 +888,7 @@ iommu_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map1)
|
|||||||
struct bus_dmamap_iommu *map;
|
struct bus_dmamap_iommu *map;
|
||||||
struct iommu_ctx *ctx;
|
struct iommu_ctx *ctx;
|
||||||
struct iommu_domain *domain;
|
struct iommu_domain *domain;
|
||||||
#if defined(__amd64__)
|
#ifndef IOMMU_DOMAIN_UNLOAD_SLEEP
|
||||||
struct iommu_map_entries_tailq entries;
|
struct iommu_map_entries_tailq entries;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -898,13 +898,13 @@ iommu_bus_dmamap_unload(bus_dma_tag_t dmat, bus_dmamap_t map1)
|
|||||||
domain = ctx->domain;
|
domain = ctx->domain;
|
||||||
atomic_add_long(&ctx->unloads, 1);
|
atomic_add_long(&ctx->unloads, 1);
|
||||||
|
|
||||||
#if defined(__i386__)
|
#if defined(IOMMU_DOMAIN_UNLOAD_SLEEP)
|
||||||
IOMMU_DOMAIN_LOCK(domain);
|
IOMMU_DOMAIN_LOCK(domain);
|
||||||
TAILQ_CONCAT(&domain->unload_entries, &map->map_entries, dmamap_link);
|
TAILQ_CONCAT(&domain->unload_entries, &map->map_entries, dmamap_link);
|
||||||
IOMMU_DOMAIN_UNLOCK(domain);
|
IOMMU_DOMAIN_UNLOCK(domain);
|
||||||
taskqueue_enqueue(domain->iommu->delayed_taskqueue,
|
taskqueue_enqueue(domain->iommu->delayed_taskqueue,
|
||||||
&domain->unload_task);
|
&domain->unload_task);
|
||||||
#else /* defined(__amd64__) */
|
#else
|
||||||
TAILQ_INIT(&entries);
|
TAILQ_INIT(&entries);
|
||||||
IOMMU_DOMAIN_LOCK(domain);
|
IOMMU_DOMAIN_LOCK(domain);
|
||||||
TAILQ_CONCAT(&entries, &map->map_entries, dmamap_link);
|
TAILQ_CONCAT(&entries, &map->map_entries, dmamap_link);
|
||||||
|
@ -4,3 +4,5 @@
|
|||||||
/* $FreeBSD$ */
|
/* $FreeBSD$ */
|
||||||
|
|
||||||
#include <x86/iommu.h>
|
#include <x86/iommu.h>
|
||||||
|
|
||||||
|
#define IOMMU_DOMAIN_UNLOAD_SLEEP
|
||||||
|
Loading…
x
Reference in New Issue
Block a user