[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] convert more literal uses of cpumask_t to pointers



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1316301777 -3600
# Node ID 39d450853a3895fb50467997f029c698d5e5edb9
# Parent  cd730c6982998364eadb7ebbefd08b71d2cd8673
convert more literal uses of cpumask_t to pointers

This is particularly relevant as the number of CPUs to be supported
increases (as recently happened for the default thereof).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---


diff -r cd730c698299 -r 39d450853a38 xen/arch/ia64/linux-xen/iosapic.c
--- a/xen/arch/ia64/linux-xen/iosapic.c Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/arch/ia64/linux-xen/iosapic.c Sun Sep 18 00:22:57 2011 +0100
@@ -352,7 +352,7 @@
 
 
 static void
-iosapic_set_affinity (unsigned int irq, cpumask_t mask)
+iosapic_set_affinity (unsigned int irq, const cpumask_t *mask)
 {
 #ifdef CONFIG_SMP
        unsigned long flags;
@@ -366,10 +366,10 @@
        irq &= (~IA64_IRQ_REDIRECTED);
        vec = irq_to_vector(irq);
 
-       if (cpus_empty(mask))
+       if (cpumask_empty(mask))
                return;
 
-       dest = cpu_physical_id(first_cpu(mask));
+       dest = cpu_physical_id(cpumask_first(mask));
 
        if (list_empty(&iosapic_intr_info[vec].rtes))
                return;                 /* not an IOSAPIC interrupt */
diff -r cd730c698299 -r 39d450853a38 xen/arch/ia64/linux-xen/mca.c
--- a/xen/arch/ia64/linux-xen/mca.c     Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/arch/ia64/linux-xen/mca.c     Sun Sep 18 00:22:57 2011 +0100
@@ -1312,7 +1312,7 @@
 #ifndef XEN    /* XXX FIXME */
                        schedule_work(&cmc_disable_work);
 #else
-                       cpumask_raise_softirq(cpu_online_map,
+                       cpumask_raise_softirq(&cpu_online_map,
                                              CMC_DISABLE_SOFTIRQ);
 #endif
 
@@ -1383,7 +1383,7 @@
 #ifndef XEN    /* XXX FIXME */
                        schedule_work(&cmc_enable_work);
 #else
-                       cpumask_raise_softirq(cpu_online_map,
+                       cpumask_raise_softirq(&cpu_online_map,
                                              CMC_ENABLE_SOFTIRQ);
 #endif
                        cmc_polling_enabled = 0;
@@ -1904,7 +1904,7 @@
 #ifndef XEN    /* XXX FIXME */
        schedule_work(&cmc_enable_work);
 #else
-       cpumask_raise_softirq(cpu_online_map, CMC_ENABLE_SOFTIRQ);
+       cpumask_raise_softirq(&cpu_online_map, CMC_ENABLE_SOFTIRQ);
 #endif
 
        IA64_MCA_DEBUG("%s: CMCI/P setup and enabled.\n", __FUNCTION__);
diff -r cd730c698299 -r 39d450853a38 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c       Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/arch/x86/hpet.c       Sun Sep 18 00:22:57 2011 +0100
@@ -154,16 +154,16 @@
     return ret;
 }
 
-static void evt_do_broadcast(cpumask_t mask)
+static void evt_do_broadcast(cpumask_t *mask)
 {
     unsigned int cpu = smp_processor_id();
 
-    if ( cpu_test_and_clear(cpu, mask) )
+    if ( cpumask_test_and_clear_cpu(cpu, mask) )
         raise_softirq(TIMER_SOFTIRQ);
 
-    cpuidle_wakeup_mwait(&mask);
+    cpuidle_wakeup_mwait(mask);
 
-    if ( !cpus_empty(mask) )
+    if ( !cpumask_empty(mask) )
        cpumask_raise_softirq(mask, TIMER_SOFTIRQ);
 }
 
@@ -202,7 +202,7 @@
     }
 
     /* wakeup the cpus which have an expired event. */
-    evt_do_broadcast(mask);
+    evt_do_broadcast(&mask);
 
     if ( next_event != STIME_MAX )
     {
@@ -305,14 +305,14 @@
 {
 }
 
-static void hpet_msi_set_affinity(unsigned int irq, cpumask_t mask)
+static void hpet_msi_set_affinity(unsigned int irq, const cpumask_t *mask)
 {
     struct msi_msg msg;
     unsigned int dest;
     struct irq_desc * desc = irq_to_desc(irq);
     struct irq_cfg *cfg= desc->chip_data;
 
-    dest = set_desc_affinity(desc, &mask);
+    dest = set_desc_affinity(desc, mask);
     if (dest == BAD_APICID)
         return;
 
@@ -471,9 +471,7 @@
     if ( ch->cpu != cpu )
         return;
 
-    /* set irq affinity */
-    irq_desc[ch->irq].handler->
-        set_affinity(ch->irq, cpumask_of_cpu(ch->cpu));
+    hpet_msi_set_affinity(ch->irq, cpumask_of(ch->cpu));
 }
 
 static void hpet_detach_channel(unsigned int cpu,
@@ -495,9 +493,7 @@
     }
 
     ch->cpu = first_cpu(ch->cpumask);
-    /* set irq affinity */
-    irq_desc[ch->irq].handler->
-        set_affinity(ch->irq, cpumask_of_cpu(ch->cpu));
+    hpet_msi_set_affinity(ch->irq, cpumask_of(ch->cpu));
 }
 
 #include <asm/mc146818rtc.h>
diff -r cd730c698299 -r 39d450853a38 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c    Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/arch/x86/io_apic.c    Sun Sep 18 00:22:57 2011 +0100
@@ -697,13 +697,13 @@
 }
 
 static void
-set_ioapic_affinity_irq(unsigned int irq, const struct cpumask mask)
+set_ioapic_affinity_irq(unsigned int irq, const struct cpumask *mask)
 {
     struct irq_desc *desc;
 
     desc = irq_to_desc(irq);
 
-    set_ioapic_affinity_irq_desc(desc, &mask);
+    set_ioapic_affinity_irq_desc(desc, mask);
 }
 #endif /* CONFIG_SMP */
 
@@ -802,7 +802,7 @@
             irq = pin_2_irq(irq_entry, ioapic, pin);
             cfg = irq_cfg(irq);
             BUG_ON(cpus_empty(cfg->cpu_mask));
-            set_ioapic_affinity_irq(irq, cfg->cpu_mask);
+            set_ioapic_affinity_irq(irq, &cfg->cpu_mask);
         }
 
     }
@@ -2063,7 +2063,7 @@
     vector = FIRST_HIPRIORITY_VECTOR;
     clear_irq_vector(0);
 
-    if ((ret = bind_irq_vector(0, vector, mask_all)))
+    if ((ret = bind_irq_vector(0, vector, &mask_all)))
         printk(KERN_ERR"..IRQ0 is not set correctly with ioapic!!!, err:%d\n", 
ret);
     
     irq_desc[0].status &= ~IRQ_DISABLED;
diff -r cd730c698299 -r 39d450853a38 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/arch/x86/irq.c        Sun Sep 18 00:22:57 2011 +0100
@@ -108,7 +108,7 @@
     trace_var(event, 1, sizeof(d), &d);
 }
 
-static int __init __bind_irq_vector(int irq, int vector, cpumask_t cpu_mask)
+static int __init __bind_irq_vector(int irq, int vector, const cpumask_t 
*cpu_mask)
 {
     cpumask_t online_mask;
     int cpu;
@@ -117,7 +117,7 @@
     BUG_ON((unsigned)irq >= nr_irqs);
     BUG_ON((unsigned)vector >= NR_VECTORS);
 
-    cpus_and(online_mask, cpu_mask, cpu_online_map);
+    cpus_and(online_mask, *cpu_mask, cpu_online_map);
     if (cpus_empty(online_mask))
         return -EINVAL;
     if ((cfg->vector == vector) && cpus_equal(cfg->cpu_mask, online_mask))
@@ -140,7 +140,7 @@
     return 0;
 }
 
-int __init bind_irq_vector(int irq, int vector, cpumask_t cpu_mask)
+int __init bind_irq_vector(int irq, int vector, const cpumask_t *cpu_mask)
 {
     unsigned long flags;
     int ret;
@@ -583,7 +583,7 @@
      * For correct operation this depends on the caller masking the irqs.
      */
     if (likely(cpus_intersects(desc->pending_mask, cpu_online_map)))
-        desc->handler->set_affinity(irq, desc->pending_mask);
+        desc->handler->set_affinity(irq, &desc->pending_mask);
 
     cpus_clear(desc->pending_mask);
 }
@@ -1410,7 +1410,7 @@
         /* Attempt to bind the interrupt target to the correct CPU. */
         cpu_set(v->processor, cpumask);
         if ( !opt_noirqbalance && (desc->handler->set_affinity != NULL) )
-            desc->handler->set_affinity(irq, cpumask);
+            desc->handler->set_affinity(irq, &cpumask);
     }
     else if ( !will_share || !action->shareable )
     {
@@ -1964,7 +1964,7 @@
             desc->handler->disable(irq);
 
         if ( desc->handler->set_affinity )
-            desc->handler->set_affinity(irq, affinity);
+            desc->handler->set_affinity(irq, &affinity);
         else if ( !(warned++) )
             set_affinity = 0;
 
diff -r cd730c698299 -r 39d450853a38 xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c        Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/arch/x86/msi.c        Sun Sep 18 00:22:57 2011 +0100
@@ -266,7 +266,7 @@
     }
 }
 
-void set_msi_affinity(unsigned int irq, cpumask_t mask)
+void set_msi_affinity(unsigned int irq, const cpumask_t *mask)
 {
     struct msi_msg msg;
     unsigned int dest;
@@ -274,7 +274,7 @@
     struct msi_desc *msi_desc = desc->msi_desc;
     struct irq_cfg *cfg = desc->chip_data;
 
-    dest = set_desc_affinity(desc, &mask);
+    dest = set_desc_affinity(desc, mask);
     if (dest == BAD_APICID || !msi_desc)
         return;
 
diff -r cd730c698299 -r 39d450853a38 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/arch/x86/time.c       Sun Sep 18 00:22:57 2011 +0100
@@ -195,7 +195,7 @@
 
     if ( !cpus_empty(mask) )
     {
-        cpumask_raise_softirq(mask, TIMER_SOFTIRQ);
+        cpumask_raise_softirq(&mask, TIMER_SOFTIRQ);
     }
 }
 
diff -r cd730c698299 -r 39d450853a38 xen/common/keyhandler.c
--- a/xen/common/keyhandler.c   Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/common/keyhandler.c   Sun Sep 18 00:22:57 2011 +0100
@@ -207,10 +207,10 @@
     .desc = "reboot machine"
 };
 
-static void cpuset_print(char *set, int size, cpumask_t mask)
+static void cpuset_print(char *set, int size, const cpumask_t *mask)
 {
     *set++ = '{';
-    set += cpulist_scnprintf(set, size-2, mask);
+    set += cpulist_scnprintf(set, size-2, *mask);
     *set++ = '}';
     *set++ = '\0';
 }
@@ -244,7 +244,7 @@
     {
         unsigned int i;
         printk("General information for domain %u:\n", d->domain_id);
-        cpuset_print(tmpstr, sizeof(tmpstr), *d->domain_dirty_cpumask);
+        cpuset_print(tmpstr, sizeof(tmpstr), d->domain_dirty_cpumask);
         printk("    refcnt=%d dying=%d nr_pages=%d xenheap_pages=%d "
                "dirty_cpus=%s max_pages=%u\n",
                atomic_read(&d->refcnt), d->is_dying,
@@ -278,9 +278,9 @@
                    v->pause_flags, v->poll_evtchn,
                    vcpu_info(v, evtchn_upcall_pending),
                    vcpu_info(v, evtchn_upcall_mask));
-            cpuset_print(tmpstr, sizeof(tmpstr), *v->vcpu_dirty_cpumask);
+            cpuset_print(tmpstr, sizeof(tmpstr), v->vcpu_dirty_cpumask);
             printk("dirty_cpus=%s ", tmpstr);
-            cpuset_print(tmpstr, sizeof(tmpstr), *v->cpu_affinity);
+            cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_affinity);
             printk("cpu_affinity=%s\n", tmpstr);
             arch_dump_vcpu_info(v);
             periodic_timer_print(tmpstr, sizeof(tmpstr), v->periodic_period);
diff -r cd730c698299 -r 39d450853a38 xen/common/rcupdate.c
--- a/xen/common/rcupdate.c     Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/common/rcupdate.c     Sun Sep 18 00:22:57 2011 +0100
@@ -117,7 +117,7 @@
          */
         cpumask = rcp->cpumask;
         cpu_clear(rdp->cpu, cpumask);
-        cpumask_raise_softirq(cpumask, SCHEDULE_SOFTIRQ);
+        cpumask_raise_softirq(&cpumask, SCHEDULE_SOFTIRQ);
     }
 }
 
diff -r cd730c698299 -r 39d450853a38 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/common/sched_credit.c Sun Sep 18 00:22:57 2011 +0100
@@ -310,7 +310,7 @@
 
     /* Send scheduler interrupts to designated CPUs */
     if ( !cpus_empty(mask) )
-        cpumask_raise_softirq(mask, SCHEDULE_SOFTIRQ);
+        cpumask_raise_softirq(&mask, SCHEDULE_SOFTIRQ);
 }
 
 static void
diff -r cd730c698299 -r 39d450853a38 xen/common/softirq.c
--- a/xen/common/softirq.c      Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/common/softirq.c      Sun Sep 18 00:22:57 2011 +0100
@@ -68,15 +68,16 @@
     softirq_handlers[nr] = handler;
 }
 
-void cpumask_raise_softirq(cpumask_t mask, unsigned int nr)
+void cpumask_raise_softirq(const cpumask_t *mask, unsigned int nr)
 {
     int cpu;
+    cpumask_t send_mask = CPU_MASK_NONE;
 
-    for_each_cpu_mask(cpu, mask)
-        if ( test_and_set_bit(nr, &softirq_pending(cpu)) )
-            cpu_clear(cpu, mask);
+    for_each_cpu_mask(cpu, *mask)
+        if ( !test_and_set_bit(nr, &softirq_pending(cpu)) )
+            cpu_set(cpu, send_mask);
 
-    smp_send_event_check_mask(&mask);
+    smp_send_event_check_mask(&send_mask);
 }
 
 void cpu_raise_softirq(unsigned int cpu, unsigned int nr)
diff -r cd730c698299 -r 39d450853a38 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c  Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/drivers/passthrough/amd/iommu_init.c  Sun Sep 18 00:22:57 2011 +0100
@@ -344,7 +344,7 @@
     set_iommu_event_log_control(iommu, IOMMU_CONTROL_ENABLED);
 }
 
-static void iommu_msi_set_affinity(unsigned int irq, cpumask_t mask)
+static void iommu_msi_set_affinity(unsigned int irq, const cpumask_t *mask)
 {
     struct msi_msg msg;
     unsigned int dest;
@@ -355,7 +355,7 @@
     u8 dev = PCI_SLOT(iommu->bdf & 0xff);
     u8 func = PCI_FUNC(iommu->bdf & 0xff);
 
-    dest = set_desc_affinity(desc, &mask);
+    dest = set_desc_affinity(desc, mask);
 
     if ( dest == BAD_APICID )
     {
@@ -591,7 +591,7 @@
     register_iommu_event_log_in_mmio_space(iommu);
     register_iommu_exclusion_range(iommu);
 
-    iommu_msi_set_affinity(iommu->irq, cpu_online_map);
+    iommu_msi_set_affinity(iommu->irq, &cpu_online_map);
     amd_iommu_msi_enable(iommu, IOMMU_CONTROL_ENABLED);
 
     set_iommu_command_buffer_control(iommu, IOMMU_CONTROL_ENABLED);
diff -r cd730c698299 -r 39d450853a38 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Sun Sep 18 00:22:57 2011 +0100
@@ -998,7 +998,7 @@
     ack_APIC_irq();
 }
 
-static void dma_msi_set_affinity(unsigned int irq, cpumask_t mask)
+static void dma_msi_set_affinity(unsigned int irq, const cpumask_t *mask)
 {
     struct msi_msg msg;
     unsigned int dest;
@@ -1009,7 +1009,7 @@
     struct irq_cfg *cfg = desc->chip_data;
 
 #ifdef CONFIG_X86
-    dest = set_desc_affinity(desc, &mask);
+    dest = set_desc_affinity(desc, mask);
     if (dest == BAD_APICID){
         dprintk(XENLOG_ERR VTDPREFIX, "Set iommu interrupt affinity error!\n");
         return;
@@ -1984,7 +1984,7 @@
         iommu = drhd->iommu;
 
         cfg = irq_cfg(iommu->irq);
-        dma_msi_set_affinity(iommu->irq, cfg->cpu_mask);
+        dma_msi_set_affinity(iommu->irq, &cfg->cpu_mask);
 
         clear_fault_bits(iommu);
 
diff -r cd730c698299 -r 39d450853a38 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/include/asm-x86/irq.h Sun Sep 18 00:22:57 2011 +0100
@@ -176,7 +176,7 @@
 
 int __assign_irq_vector(int irq, struct irq_cfg *, const cpumask_t *);
 
-int bind_irq_vector(int irq, int vector, cpumask_t domain);
+int bind_irq_vector(int irq, int vector, const cpumask_t *);
 
 void irq_set_affinity(struct irq_desc *, const cpumask_t *mask);
 
diff -r cd730c698299 -r 39d450853a38 xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/include/asm-x86/msi.h Sun Sep 18 00:22:57 2011 +0100
@@ -78,7 +78,7 @@
 /* Helper functions */
 extern void mask_msi_irq(unsigned int irq);
 extern void unmask_msi_irq(unsigned int irq);
-extern void set_msi_affinity(unsigned int vector, cpumask_t mask);
+extern void set_msi_affinity(unsigned int vector, const cpumask_t *);
 extern int pci_enable_msi(struct msi_info *msi, struct msi_desc **desc);
 extern void pci_disable_msi(struct msi_desc *desc);
 extern void pci_cleanup_msi(struct pci_dev *pdev);
diff -r cd730c698299 -r 39d450853a38 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h     Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/include/xen/irq.h     Sun Sep 18 00:22:57 2011 +0100
@@ -45,7 +45,7 @@
     void (*disable)(unsigned int irq);
     void (*ack)(unsigned int irq);
     void (*end)(unsigned int irq, u8 vector);
-    void (*set_affinity)(unsigned int irq, cpumask_t mask);
+    void (*set_affinity)(unsigned int irq, const cpumask_t *);
 };
 
 typedef const struct hw_interrupt_type hw_irq_controller;
@@ -176,11 +176,6 @@
     irq_desc[irq].affinity = *mask;
 }
 
-static inline void set_irq_info(int irq, cpumask_t mask)
-{
-    set_native_irq_info(irq, &mask);
-}
-
 unsigned int set_desc_affinity(struct irq_desc *, const cpumask_t *);
 
 #endif /* __XEN_IRQ_H__ */
diff -r cd730c698299 -r 39d450853a38 xen/include/xen/softirq.h
--- a/xen/include/xen/softirq.h Sun Sep 18 00:21:23 2011 +0100
+++ b/xen/include/xen/softirq.h Sun Sep 18 00:22:57 2011 +0100
@@ -27,7 +27,7 @@
 void open_softirq(int nr, softirq_handler handler);
 void softirq_init(void);
 
-void cpumask_raise_softirq(cpumask_t mask, unsigned int nr);
+void cpumask_raise_softirq(const cpumask_t *, unsigned int nr);
 void cpu_raise_softirq(unsigned int cpu, unsigned int nr);
 void raise_softirq(unsigned int nr);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.