x86/irq: Save destination CPU ID in irq_cfg
authorJiang Liu <jiang.liu@linux.intel.com>
Mon, 13 Apr 2015 06:11:23 +0000 (14:11 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 24 Apr 2015 13:36:47 +0000 (15:36 +0200)
Cache destination CPU APIC ID into struct irq_cfg when assigning vector
for interrupt. Upper layer just needs to read the cached APIC ID instead
of calling apic->cpu_mask_to_apicid_and(), it helps to hide APIC driver
details from IOAPIC/HPET/MSI drivers..

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Cohen <david.a.cohen@linux.intel.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Link: http://lkml.kernel.org/r/1428905519-23704-2-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/include/asm/hw_irq.h
arch/x86/kernel/apic/vector.c

index e9571ddabc4feb821ae04d47c9d6c3b509178344..cda96954cbbf01b1472dfd846ffad14caa53dc7d 100644 (file)
@@ -116,6 +116,7 @@ struct irq_data;
 struct irq_cfg {
        cpumask_var_t           domain;
        cpumask_var_t           old_domain;
+       unsigned int            dest_apicid;
        u8                      vector;
        u8                      move_in_progress : 1;
 #ifdef CONFIG_IRQ_REMAP
index 6cedd79145813cc792c891573ac03b3e18d9e529..c724ef6b218cff90363c6397c0cdf307e75f9bf7 100644 (file)
@@ -188,6 +188,12 @@ next:
        }
        free_cpumask_var(tmp_mask);
 
+       if (!err) {
+               /* cache destination APIC IDs into cfg->dest_apicid */
+               err = apic->cpu_mask_to_apicid_and(mask, cfg->domain,
+                                                  &cfg->dest_apicid);
+       }
+
        return err;
 }