diff options
author | rstone <rstone@FreeBSD.org> | 2014-04-01 14:51:45 +0000 |
---|---|---|
committer | rstone <rstone@FreeBSD.org> | 2014-04-01 14:51:45 +0000 |
commit | eabfe8df7a0fc73c404f7673f0a79c09ef6e81bf (patch) | |
tree | 9f365cec81012e1720028df9f368a9c111a4bbff /sys/x86/iommu/intel_utils.c | |
parent | 9a7903aa5852d14a1316439199fa9d78ea9ad06a (diff) | |
download | FreeBSD-src-eabfe8df7a0fc73c404f7673f0a79c09ef6e81bf.zip FreeBSD-src-eabfe8df7a0fc73c404f7673f0a79c09ef6e81bf.tar.gz |
Re-implement the DMAR I/O MMU code in terms of PCI RIDs
Under the hood the VT-d spec is really implemented in terms of
PCI RIDs instead of bus/slot/function, even though the spec makes
pains to convert back to bus/slot/function in examples. However
working with bus/slot/function is not correct when PCI ARI is
in use, so convert to using RIDs in most cases. bus/slot/function
will only be used when reporting errors to a user.
Reviewed by: kib
Sponsored by: Sandvine Inc.
Diffstat (limited to 'sys/x86/iommu/intel_utils.c')
-rw-r--r-- | sys/x86/iommu/intel_utils.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/x86/iommu/intel_utils.c b/sys/x86/iommu/intel_utils.c index d81ec04..e221a1e 100644 --- a/sys/x86/iommu/intel_utils.c +++ b/sys/x86/iommu/intel_utils.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/taskqueue.h> #include <sys/tree.h> +#include <dev/pci/pcivar.h> #include <vm/vm.h> #include <vm/vm_extern.h> #include <vm/vm_kern.h> @@ -129,8 +130,10 @@ ctx_set_agaw(struct dmar_ctx *ctx, int mgaw) } device_printf(ctx->dmar->dev, "context request mgaw %d for pci%d:%d:%d:%d, " - "no agaw found, sagaw %x\n", mgaw, ctx->dmar->segment, ctx->bus, - ctx->slot, ctx->func, sagaw); + "no agaw found, sagaw %x\n", mgaw, ctx->dmar->segment, + pci_get_bus(ctx->ctx_tag.owner), + pci_get_slot(ctx->ctx_tag.owner), + pci_get_function(ctx->ctx_tag.owner), sagaw); return (EINVAL); } |