提交 ee34b32d 编写于 作者: S Suresh Siddha 提交者: David Woodhouse

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: NSuresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 e0fc7e0b
...@@ -348,6 +348,26 @@ int dmar_find_matched_atsr_unit(struct pci_dev *dev) ...@@ -348,6 +348,26 @@ int dmar_find_matched_atsr_unit(struct pci_dev *dev)
} }
#endif #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 static void __init
dmar_table_print_dmar_entry(struct acpi_dmar_header *header) dmar_table_print_dmar_entry(struct acpi_dmar_header *header)
{ {
...@@ -467,7 +487,7 @@ parse_dmar_table(void) ...@@ -467,7 +487,7 @@ parse_dmar_table(void)
#endif #endif
break; break;
case ACPI_DMAR_HARDWARE_AFFINITY: case ACPI_DMAR_HARDWARE_AFFINITY:
/* We don't do anything with RHSA (yet?) */ ret = dmar_parse_one_rhsa(entry_header);
break; break;
default: default:
printk(KERN_WARNING PREFIX printk(KERN_WARNING PREFIX
...@@ -677,6 +697,8 @@ int alloc_iommu(struct dmar_drhd_unit *drhd) ...@@ -677,6 +697,8 @@ int alloc_iommu(struct dmar_drhd_unit *drhd)
iommu->agaw = agaw; iommu->agaw = agaw;
iommu->msagaw = msagaw; iommu->msagaw = msagaw;
iommu->node = -1;
/* the registers might be more than one page */ /* the registers might be more than one page */
map_size = max_t(int, ecap_max_iotlb_offset(iommu->ecap), map_size = max_t(int, ecap_max_iotlb_offset(iommu->ecap),
cap_max_fault_reg_offset(iommu->cap)); cap_max_fault_reg_offset(iommu->cap));
......
...@@ -332,6 +332,7 @@ struct intel_iommu { ...@@ -332,6 +332,7 @@ struct intel_iommu {
#ifdef CONFIG_INTR_REMAP #ifdef CONFIG_INTR_REMAP
struct ir_table *ir_table; /* Interrupt remapping info */ struct ir_table *ir_table; /* Interrupt remapping info */
#endif #endif
int node;
}; };
static inline void __iommu_flush_cache( static inline void __iommu_flush_cache(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册