summaryrefslogtreecommitdiffstats
path: root/drivers/pci/dmar.c
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2009-10-02 20:01:21 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-10-05 08:55:22 +0200
commitee34b32d8c2950f66038c8975747ef9aec855289 (patch)
tree572eef281a2b41b3e5ca5d6889752f5e7736526b /drivers/pci/dmar.c
parentintel-iommu: Yet another BIOS workaround: Isoch DMAR unit with no TLB space (diff)
downloadlinux-ee34b32d8c2950f66038c8975747ef9aec855289.tar.xz
linux-ee34b32d8c2950f66038c8975747ef9aec855289.zip
dmar: support for parsing Remapping Hardware Static Affinity structure
Add support for parsing Remapping Hardware Static Affinity (RHSA) structure. This enables identifying the association between remapping hardware units and the corresponding proximity domain. This enables to allocate transalation structures closer to the remapping hardware unit. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/dmar.c')
-rw-r--r--drivers/pci/dmar.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/pci/dmar.c b/drivers/pci/dmar.c
index 22b02c6df854..577956566a0b 100644
--- a/drivers/pci/dmar.c
+++ b/drivers/pci/dmar.c
@@ -348,6 +348,26 @@ found:
}
#endif
+static int __init
+dmar_parse_one_rhsa(struct acpi_dmar_header *header)
+{
+ struct acpi_dmar_rhsa *rhsa;
+ struct dmar_drhd_unit *drhd;
+
+ rhsa = (struct acpi_dmar_rhsa *)header;
+ for_each_drhd_unit(drhd)
+ if (drhd->reg_base_addr == rhsa->base_address) {
+ int node = acpi_map_pxm_to_node(rhsa->proximity_domain);
+
+ if (!node_online(node))
+ node = -1;
+ drhd->iommu->node = node;
+ return 0;
+ }
+
+ return -ENODEV;
+}
+
static void __init
dmar_table_print_dmar_entry(struct acpi_dmar_header *header)
{
@@ -467,7 +487,7 @@ parse_dmar_table(void)
#endif
break;
case ACPI_DMAR_HARDWARE_AFFINITY:
- /* We don't do anything with RHSA (yet?) */
+ ret = dmar_parse_one_rhsa(entry_header);
break;
default:
printk(KERN_WARNING PREFIX
@@ -677,6 +697,8 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
iommu->agaw = agaw;
iommu->msagaw = msagaw;
+ iommu->node = -1;
+
/* the registers might be more than one page */
map_size = max_t(int, ecap_max_iotlb_offset(iommu->ecap),
cap_max_fault_reg_offset(iommu->cap));