Skip to contentSkip to conversation

IRQ: no IRQ affinity patch

PATCH New Eial Czerwacki 1 participant 1 message Oct 25, 2011 2 messages not in the archive x86

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 9B14D1490DDECA4E974F6B9FC9EBAB3140CD274368@VMBX108.ihostexchange.net

#2 lore raw

PATCH 1/1 IRQ: no IRQ affinity patch

Tell vSMP Foundation to ignore IOAPIC irq routing and make the kernel work in this mode by setting vector_allocation for all CPUs, so IDT on all processors will accept this interrupt.

Author: Ravikiran Thirumalai<[email protected]>
---

arch/x86/kernel/vsmp_64.c +10 -4
Index: b/arch/x86/kernel/vsmp_64.c
===================================================================
@@ -15,6 +15,7 @@
  #include<linux/init.h>
  #include<linux/pci_ids.h>
  #include<linux/pci_regs.h>
+#include<linux/irq.h>
 
  #include<asm/apic.h>
  #include<asm/pci-direct.h>
@@ -92,6 +93,12 @@ static void __init set_vsmp_pv_ops(void)
  	ctl = readl(address + 4);
  	printk(KERN_INFO "vSMP CTL: capabilities:0x%08x  control:0x%08x\n",
  	       cap, ctl);
+	/* Set irqrouting to ignore since this vsmp */
+	if (cap&   ctl&   (1<<   8)) {
+		ctl&= ~(1<<   8);
+		no_irq_affinity = 1;
+	}
+
  	if (cap&   ctl&   (1<<   4)) {
  		/* Setup irq ops and turn on vSMP  IRQ fastpath handling */
  		pv_irq_ops.irq_disable = PV_CALLEE_SAVE(vsmp_irq_disable);
@@ -99,12 +106,11 @@ static void __init set_vsmp_pv_ops(void)
  		pv_irq_ops.save_fl  = PV_CALLEE_SAVE(vsmp_save_fl);
  		pv_irq_ops.restore_fl  = PV_CALLEE_SAVE(vsmp_restore_fl);
  		pv_init_ops.patch = vsmp_patch;
-
  		ctl&= ~(1<<   4);
-		writel(ctl, address + 4);
-		ctl = readl(address + 4);
-		printk(KERN_INFO "vSMP CTL: control set to:0x%08x\n", ctl);
  	}
+	writel(ctl, address + 4);
+	ctl = readl(address + 4);
+	printk(KERN_INFO "vSMP CTL: control set to:0x%08x\n", ctl);
 
  	early_iounmap(address, 8);
  }
arch/x86/kernel/apic/apic_flat_64.c +8 -2
Index: b/arch/x86/kernel/apic/apic_flat_64.c
===================================================================
@@ -52,7 +52,10 @@
  	 * hyperthread was specified in the interrupt desitination.
  	 */
  	cpumask_clear(retmask);
-	cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
+	if(is_vsmp_box())
+		cpumask_setall(retmask);
+	else
+		cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
  }
 
  /*
@@ -263,7 +266,10 @@
  static void physflat_vector_allocation_domain(int cpu, struct cpumask *retmask)
  {
  	cpumask_clear(retmask);
-	cpumask_set_cpu(cpu, retmask);
+	if(is_vsmp_box())
+		cpumask_setall(retmask);
+	else
+		cpumask_set_cpu(cpu, retmask);
  }
 
  static void physflat_send_IPI_mask(const struct cpumask *cpumask, int vector)
arch/x86/include/asm/x2apic.h +4 -1
Index: b/arch/x86/include/asm/x2apic.h
===================================================================
@@ -29,7 +29,10 @@
  static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)
  {
  	cpumask_clear(retmask);
-	cpumask_set_cpu(cpu, retmask);
+	if(is_vsmp_box())
+		cpumask_setall(retmask);
+	else
+		cpumask_set_cpu(cpu, retmask);
  }
 
  static void