Split the DMAR unit domains and contexts. Domains carry address space
authorkib <kib@FreeBSD.org>
Fri, 26 Jun 2015 07:01:29 +0000 (07:01 +0000)
committerkib <kib@FreeBSD.org>
Fri, 26 Jun 2015 07:01:29 +0000 (07:01 +0000)
commit6b3dcf6ce0a202b704c8fb3d03951cc2cb909c67
treedfe9131ecf9660d6f20cddc79cc1ac3c97e40d8c
parentbd7f5ebf0a3fb96ae6d9bcf47516400eb19cd01e
Split the DMAR unit domains and contexts.  Domains carry address space
and related data structures.  Contexts attach requests initiators to
domains.  There is still 1:1 correspondence between contexts and
domains on the running system, since only busdma currently allocates
them, using dmar_get_ctx_for_dev().

Large part of the change is formal rename of the ctx to domain, but
patch also reworks the context allocation and free to allow for
independent domain creation.

The helper dmar_move_ctx_to_domain() is introduced for future use, to
reassign request initiator from one domain to another.  The hard issue
which is not yet resolved with the context move is proper handling (or
reserving) RMRR entries in the destination domain as required by ACPI
DMAR table for moved context.

Tested by: pho
Sponsored by: The FreeBSD Foundation
sys/x86/iommu/busdma_dmar.c
sys/x86/iommu/intel_ctx.c
sys/x86/iommu/intel_dmar.h
sys/x86/iommu/intel_drv.c
sys/x86/iommu/intel_gas.c
sys/x86/iommu/intel_idpgtbl.c
sys/x86/iommu/intel_qi.c
sys/x86/iommu/intel_utils.c