mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [patch 1/4] dmar: support for parsing Remapping Hardware Static Affinity structure
@ 2009-10-02 18:01 Suresh Siddha
  2009-10-02 18:01 ` [patch 2/4] dmar: Allocate queued invalidation structure using numa locality info Suresh Siddha
  2009-10-02 18:01 ` [patch 3/4] intr_remap: Allocate intr-remapping table " Suresh Siddha
  0 siblings, 2 replies; 4+ messages in thread
From: Suresh Siddha @ 2009-10-02 18:01 UTC (permalink / raw)
  To: dwmw2; +Cc: jbarnes, len.brown, linux-kernel, rdreier, Suresh Siddha

[-- Attachment #1: parse_rhsa_struct.patch --]
[-- Type: text/plain, Size: 2162 bytes --]

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>
---
 drivers/pci/dmar.c          |   24 +++++++++++++++++++++++-
 include/linux/intel-iommu.h |    1 +
 2 files changed, 24 insertions(+), 1 deletion(-)

Index: iommu-2.6/drivers/pci/dmar.c
===================================================================
--- iommu-2.6.orig/drivers/pci/dmar.c
+++ iommu-2.6/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 *d
 	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));
Index: iommu-2.6/include/linux/intel-iommu.h
===================================================================
--- iommu-2.6.orig/include/linux/intel-iommu.h
+++ iommu-2.6/include/linux/intel-iommu.h
@@ -332,6 +332,7 @@ struct intel_iommu {
 #ifdef CONFIG_INTR_REMAP
 	struct ir_table *ir_table;	/* Interrupt remapping info */
 #endif
+	int		node;
 };
 
 static inline void __iommu_flush_cache(



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 2/4] dmar: Allocate queued invalidation structure using numa locality info
  2009-10-02 18:01 [patch 1/4] dmar: support for parsing Remapping Hardware Static Affinity structure Suresh Siddha
@ 2009-10-02 18:01 ` Suresh Siddha
  2009-10-02 18:01 ` [patch 3/4] intr_remap: Allocate intr-remapping table " Suresh Siddha
  1 sibling, 0 replies; 4+ messages in thread
From: Suresh Siddha @ 2009-10-02 18:01 UTC (permalink / raw)
  To: dwmw2; +Cc: jbarnes, len.brown, linux-kernel, rdreier, Suresh Siddha

[-- Attachment #1: qi_use_affinity_info.patch --]
[-- Type: text/plain, Size: 1096 bytes --]

Allocate queued invalidation descriptor structures using numa locality info.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
 drivers/pci/dmar.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: iommu-2.6/drivers/pci/dmar.c
===================================================================
--- iommu-2.6.orig/drivers/pci/dmar.c
+++ iommu-2.6/drivers/pci/dmar.c
@@ -1040,6 +1040,7 @@ static void __dmar_enable_qi(struct inte
 int dmar_enable_qi(struct intel_iommu *iommu)
 {
 	struct q_inval *qi;
+	struct page *desc_page;
 
 	if (!ecap_qis(iommu->ecap))
 		return -ENOENT;
@@ -1056,13 +1057,16 @@ int dmar_enable_qi(struct intel_iommu *i
 
 	qi = iommu->qi;
 
-	qi->desc = (void *)(get_zeroed_page(GFP_ATOMIC));
-	if (!qi->desc) {
+
+	desc_page = alloc_pages_node(iommu->node, GFP_ATOMIC | __GFP_ZERO, 0);
+	if (!desc_page) {
 		kfree(qi);
 		iommu->qi = 0;
 		return -ENOMEM;
 	}
 
+	qi->desc = page_address(desc_page);
+
 	qi->desc_status = kmalloc(QI_LENGTH * sizeof(int), GFP_ATOMIC);
 	if (!qi->desc_status) {
 		free_page((unsigned long) qi->desc);



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 3/4] intr_remap: Allocate intr-remapping table using numa locality info
  2009-10-02 18:01 [patch 1/4] dmar: support for parsing Remapping Hardware Static Affinity structure Suresh Siddha
  2009-10-02 18:01 ` [patch 2/4] dmar: Allocate queued invalidation structure using numa locality info Suresh Siddha
@ 2009-10-02 18:01 ` Suresh Siddha
  1 sibling, 0 replies; 4+ messages in thread
From: Suresh Siddha @ 2009-10-02 18:01 UTC (permalink / raw)
  To: dwmw2; +Cc: jbarnes, len.brown, linux-kernel, rdreier, Suresh Siddha

[-- Attachment #1: intr_remap_use_affinity_info.patch --]
[-- Type: text/plain, Size: 913 bytes --]

Allocate intr-remapping table using numa locality info. On platforms
having remapping hardware units span different nodes, this enables
optimized intr-remapping table entry access by remapping hardware.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
 drivers/pci/intr_remapping.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: iommu-2.6/drivers/pci/intr_remapping.c
===================================================================
--- iommu-2.6.orig/drivers/pci/intr_remapping.c
+++ iommu-2.6/drivers/pci/intr_remapping.c
@@ -548,7 +548,8 @@ static int setup_intr_remapping(struct i
 	if (!iommu->ir_table)
 		return -ENOMEM;
 
-	pages = alloc_pages(GFP_ATOMIC | __GFP_ZERO, INTR_REMAP_PAGE_ORDER);
+	pages = alloc_pages_node(iommu->node, GFP_ATOMIC | __GFP_ZERO,
+				 INTR_REMAP_PAGE_ORDER);
 
 	if (!pages) {
 		printk(KERN_ERR "failed to allocate pages of order %d\n",



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [patch 3/4] intr_remap: Allocate intr-remapping table using numa locality info
  2009-10-01 23:06 [patch 1/4] dmar: support for parsing Remapping Hardware Static Affinity structure Suresh Siddha
@ 2009-10-01 23:06 ` Suresh Siddha
  0 siblings, 0 replies; 4+ messages in thread
From: Suresh Siddha @ 2009-10-01 23:06 UTC (permalink / raw)
  To: dwmw2; +Cc: jbarnes, len.brown, linux-kernel, Suresh Siddha

[-- Attachment #1: intr_remap_use_affinity_info.patch --]
[-- Type: text/plain, Size: 895 bytes --]

Allocate intr-remapping table using numa locality info. On platforms
having remapping hardware units span different nodes, this enables
optimized intr-remapping table entry access by remapping hardware.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---
 drivers/pci/intr_remapping.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: tip/drivers/pci/intr_remapping.c
===================================================================
--- tip.orig/drivers/pci/intr_remapping.c
+++ tip/drivers/pci/intr_remapping.c
@@ -590,7 +590,8 @@ static int setup_intr_remapping(struct i
 	if (!iommu->ir_table)
 		return -ENOMEM;
 
-	pages = alloc_pages(GFP_ATOMIC | __GFP_ZERO, INTR_REMAP_PAGE_ORDER);
+	pages = alloc_pages_node(iommu->node, GFP_ATOMIC | __GFP_ZERO,
+				 INTR_REMAP_PAGE_ORDER);
 
 	if (!pages) {
 		printk(KERN_ERR "failed to allocate pages of order %d\n",



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-02 18:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-02 18:01 [patch 1/4] dmar: support for parsing Remapping Hardware Static Affinity structure Suresh Siddha
2009-10-02 18:01 ` [patch 2/4] dmar: Allocate queued invalidation structure using numa locality info Suresh Siddha
2009-10-02 18:01 ` [patch 3/4] intr_remap: Allocate intr-remapping table " Suresh Siddha
  -- strict thread matches above, loose matches on Subject: below --
2009-10-01 23:06 [patch 1/4] dmar: support for parsing Remapping Hardware Static Affinity structure Suresh Siddha
2009-10-01 23:06 ` [patch 3/4] intr_remap: Allocate intr-remapping table using numa locality info Suresh Siddha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®