diff options
-rw-r--r-- | drivers/pci/dmar.c | 24 | ||||
-rw-r--r-- | include/linux/intel-iommu.h | 1 |
2 files changed, 24 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)); |
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 4f0a72a9740c..9310c699a37d 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
@@ -332,6 +332,7 @@ struct intel_iommu { | |||
332 | #ifdef CONFIG_INTR_REMAP | 332 | #ifdef CONFIG_INTR_REMAP |
333 | struct ir_table *ir_table; /* Interrupt remapping info */ | 333 | struct ir_table *ir_table; /* Interrupt remapping info */ |
334 | #endif | 334 | #endif |
335 | int node; | ||
335 | }; | 336 | }; |
336 | 337 | ||
337 | static inline void __iommu_flush_cache( | 338 | static inline void __iommu_flush_cache( |