diff options
author | Suresh Siddha <suresh.b.siddha@intel.com> | 2009-10-02 14:01:21 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-10-05 02:55:22 -0400 |
commit | ee34b32d8c2950f66038c8975747ef9aec855289 (patch) | |
tree | 572eef281a2b41b3e5ca5d6889752f5e7736526b /drivers/pci | |
parent | e0fc7e0b4b5e69616f10a894ab9afff3c64be74e (diff) |
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')
-rw-r--r-- | drivers/pci/dmar.c | 24 |
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: | |||
348 | } | 348 | } |
349 | #endif | 349 | #endif |
350 | 350 | ||
351 | static int __init | ||
352 | dmar_parse_one_rhsa(struct acpi_dmar_header *header) | ||
353 | { | ||
354 | struct acpi_dmar_rhsa *rhsa; | ||
355 | struct dmar_drhd_unit *drhd; | ||
356 | |||
357 | rhsa = (struct acpi_dmar_rhsa *)header; | ||
358 | for_each_drhd_unit(drhd) | ||
359 | if (drhd->reg_base_addr == rhsa->base_address) { | ||
360 | int node = acpi_map_pxm_to_node(rhsa->proximity_domain); | ||
361 | |||
362 | if (!node_online(node)) | ||
363 | node = -1; | ||
364 | drhd->iommu->node = node; | ||
365 | return 0; | ||
366 | } | ||
367 | |||
368 | return -ENODEV; | ||
369 | } | ||
370 | |||
351 | static void __init | 371 | static void __init |
352 | dmar_table_print_dmar_entry(struct acpi_dmar_header *header) | 372 | dmar_table_print_dmar_entry(struct acpi_dmar_header *header) |
353 | { | 373 | { |
@@ -467,7 +487,7 @@ parse_dmar_table(void) | |||
467 | #endif | 487 | #endif |
468 | break; | 488 | break; |
469 | case ACPI_DMAR_HARDWARE_AFFINITY: | 489 | case ACPI_DMAR_HARDWARE_AFFINITY: |
470 | /* We don't do anything with RHSA (yet?) */ | 490 | ret = dmar_parse_one_rhsa(entry_header); |
471 | break; | 491 | break; |
472 | default: | 492 | default: |
473 | printk(KERN_WARNING PREFIX | 493 | printk(KERN_WARNING PREFIX |
@@ -677,6 +697,8 @@ int alloc_iommu(struct dmar_drhd_unit *drhd) | |||
677 | iommu->agaw = agaw; | 697 | iommu->agaw = agaw; |
678 | iommu->msagaw = msagaw; | 698 | iommu->msagaw = msagaw; |
679 | 699 | ||
700 | iommu->node = -1; | ||
701 | |||
680 | /* the registers might be more than one page */ | 702 | /* the registers might be more than one page */ |
681 | map_size = max_t(int, ecap_max_iotlb_offset(iommu->ecap), | 703 | map_size = max_t(int, ecap_max_iotlb_offset(iommu->ecap), |
682 | cap_max_fault_reg_offset(iommu->cap)); | 704 | cap_max_fault_reg_offset(iommu->cap)); |