mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eial Czerwacki <eial@scalemp.com>
To: linux-kernel@vger.kernel.org
Cc: "Shai Fultheim (Shai@ScaleMP.com)" <Shai@scalemp.com>
Subject: [PATCH] IRQ: no IRQ affinity patch
Date: Tue, 25 Oct 2011 13:49:17 +0200	[thread overview]
Message-ID: <4EA6A23D.3080605@scalemp.com> (raw)
In-Reply-To: <9B14D1490DDECA4E974F6B9FC9EBAB3140CD274368@VMBX108.ihostexchange.net>

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.

Signed-off-by: Eial Czerwacki<eial@scalemp.com>
Signed-off-by: Shai Fultheim<shai@scalemp.com>
Author: Ravikiran Thirumalai<kiran@scalemp.com>
---

Index: b/arch/x86/kernel/vsmp_64.c
===================================================================
--- a/arch/x86/kernel/vsmp_64.c	2010-05-12 14:59:32.000000000 -0700
+++ b/arch/x86/kernel/vsmp_64.c	2010-05-24 11:58:28.000000000 -0700
@@ -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);
   }

Index: b/arch/x86/kernel/apic/apic_flat_64.c
===================================================================
--- a/arch/x86/kernel/apic/apic_flat_64.c	2010-05-12 14:59:32.000000000 -0700
+++ b/arch/x86/kernel/apic/apic_flat_64.c	2010-05-24 11:58:28.000000000 -0700
@@ -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)

Index: b/arch/x86/include/asm/x2apic.h
===================================================================
--- a/arch/x86/include/asm/x2apic.h 	2010-05-12 14:59:32.000000000 -0700
+++ b/arch/x86/include/asm/x2apic.h 	2010-05-24 11:58:28.000000000 -0700
@@ -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




           reply	other threads:[~2011-10-25 11:49 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <9B14D1490DDECA4E974F6B9FC9EBAB3140CD274368@VMBX108.ihostexchange.net>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EA6A23D.3080605@scalemp.com \
    --to=eial@scalemp.com \
    --cc=Shai@scalemp.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome