Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Suresh Siddha and committed by
David Woodhouse
ee34b32d e0fc7e0b

+24 -1
+23 -1
drivers/pci/dmar.c
··· 348 348 } 349 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 371 static void __init 352 372 dmar_table_print_dmar_entry(struct acpi_dmar_header *header) 353 373 { ··· 487 467 #endif 488 468 break; 489 469 case ACPI_DMAR_HARDWARE_AFFINITY: 490 - /* We don't do anything with RHSA (yet?) */ 470 + ret = dmar_parse_one_rhsa(entry_header); 491 471 break; 492 472 default: 493 473 printk(KERN_WARNING PREFIX ··· 696 676 #endif 697 677 iommu->agaw = agaw; 698 678 iommu->msagaw = msagaw; 679 + 680 + iommu->node = -1; 699 681 700 682 /* the registers might be more than one page */ 701 683 map_size = max_t(int, ecap_max_iotlb_offset(iommu->ecap),
+1
include/linux/intel-iommu.h
··· 332 332 #ifdef CONFIG_INTR_REMAP 333 333 struct ir_table *ir_table; /* Interrupt remapping info */ 334 334 #endif 335 + int node; 335 336 }; 336 337 337 338 static inline void __iommu_flush_cache(