Pull pvops into release branch
authorTony Luck <tony.luck@intel.com>
Thu, 17 Jul 2008 17:53:37 +0000 (10:53 -0700)
committerTony Luck <tony.luck@intel.com>
Thu, 17 Jul 2008 17:53:37 +0000 (10:53 -0700)
1  2 
arch/ia64/Makefile
arch/ia64/kernel/iosapic.c
arch/ia64/kernel/setup.c
arch/ia64/kernel/smpboot.c
arch/ia64/kernel/time.c
include/asm-ia64/smp.h

diff --combined arch/ia64/Makefile
index e67ee3f276988d4ad2681359c572e309b4327916,3b9c8cadfd34ff47ff42a086fdfad88a54494480..905d25b13d5a10a9a988f2c546e5c968e99c38de
@@@ -57,7 -57,6 +57,7 @@@ core-$(CONFIG_IA64_GENERIC)   += arch/ia
  core-$(CONFIG_IA64_HP_ZX1)    += arch/ia64/dig/
  core-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/dig/
  core-$(CONFIG_IA64_SGI_SN2)   += arch/ia64/sn/
 +core-$(CONFIG_IA64_SGI_UV)    += arch/ia64/uv/
  core-$(CONFIG_KVM)            += arch/ia64/kvm/
  
  drivers-$(CONFIG_PCI)         += arch/ia64/pci/
@@@ -100,3 -99,9 +100,9 @@@ define archhel
    echo '  boot                - Build vmlinux and bootloader for Ski simulator'
    echo '* unwcheck    - Check vmlinux for invalid unwind info'
  endef
+ archprepare: make_nr_irqs_h FORCE
+ PHONY += make_nr_irqs_h FORCE
+ make_nr_irqs_h: FORCE
+       $(Q)$(MAKE) $(build)=arch/ia64/kernel include/asm-ia64/nr-irqs.h
index 39752cdef6ffd342210c237f60aa7c32782cbd87,587196dd84fde005a83cf103d8f2e3cf362df0f0..3bc2fa64f87f7f55047646e600614150d6b3c0eb
@@@ -558,6 -558,8 +558,6 @@@ static struct iosapic_rte_info * __init
        if (!iosapic_kmalloc_ok && list_empty(&free_rte_list)) {
                rte = alloc_bootmem(sizeof(struct iosapic_rte_info) *
                                    NR_PREALLOCATE_RTE_ENTRIES);
 -              if (!rte)
 -                      return NULL;
                for (i = 0; i < NR_PREALLOCATE_RTE_ENTRIES; i++, rte++)
                        list_add(&rte->rte_list, &free_rte_list);
        }
@@@ -585,6 -587,15 +585,15 @@@ static inline int irq_is_shared (int ir
        return (iosapic_intr_info[irq].count > 1);
  }
  
+ struct irq_chip*
+ ia64_native_iosapic_get_irq_chip(unsigned long trigger)
+ {
+       if (trigger == IOSAPIC_EDGE)
+               return &irq_type_iosapic_edge;
+       else
+               return &irq_type_iosapic_level;
+ }
  static int
  register_intr (unsigned int gsi, int irq, unsigned char delivery,
               unsigned long polarity, unsigned long trigger)
        iosapic_intr_info[irq].dmode    = delivery;
        iosapic_intr_info[irq].trigger  = trigger;
  
-       if (trigger == IOSAPIC_EDGE)
-               irq_type = &irq_type_iosapic_edge;
-       else
-               irq_type = &irq_type_iosapic_level;
+       irq_type = iosapic_get_irq_chip(trigger);
  
        idesc = irq_desc + irq;
-       if (idesc->chip != irq_type) {
+       if (irq_type != NULL && idesc->chip != irq_type) {
                if (idesc->chip != &no_irq_type)
                        printk(KERN_WARNING
                               "%s: changing vector %d from %s to %s\n",
@@@ -973,6 -981,22 +979,22 @@@ iosapic_override_isa_irq (unsigned int 
        set_rte(gsi, irq, dest, 1);
  }
  
+ void __init
+ ia64_native_iosapic_pcat_compat_init(void)
+ {
+       if (pcat_compat) {
+               /*
+                * Disable the compatibility mode interrupts (8259 style),
+                * needs IN/OUT support enabled.
+                */
+               printk(KERN_INFO
+                      "%s: Disabling PC-AT compatible 8259 interrupts\n",
+                      __func__);
+               outb(0xff, 0xA1);
+               outb(0xff, 0x21);
+       }
+ }
  void __init
  iosapic_system_init (int system_pcat_compat)
  {
        }
  
        pcat_compat = system_pcat_compat;
-       if (pcat_compat) {
-               /*
-                * Disable the compatibility mode interrupts (8259 style),
-                * needs IN/OUT support enabled.
-                */
-               printk(KERN_INFO
-                      "%s: Disabling PC-AT compatible 8259 interrupts\n",
-                      __func__);
-               outb(0xff, 0xA1);
-               outb(0xff, 0x21);
-       }
+       if (pcat_compat)
+               iosapic_pcat_compat_init();
  }
  
  static inline int
diff --combined arch/ia64/kernel/setup.c
index 632cda8f2e7667fab870c85dd97af1fb2ed118f7,750749551e860bc633f38246ac5f3e698ba66a88..e5c2de9b29a5738484af3265f5713b286bbc8906
@@@ -51,6 -51,7 +51,7 @@@
  #include <asm/mca.h>
  #include <asm/meminit.h>
  #include <asm/page.h>
+ #include <asm/paravirt.h>
  #include <asm/patch.h>
  #include <asm/pgtable.h>
  #include <asm/processor.h>
@@@ -341,6 -342,8 +342,8 @@@ reserve_memory (void
        rsvd_region[n].end   = (unsigned long) ia64_imva(_end);
        n++;
  
+       n += paravirt_reserve_memory(&rsvd_region[n]);
  #ifdef CONFIG_BLK_DEV_INITRD
        if (ia64_boot_param->initrd_start) {
                rsvd_region[n].start = (unsigned long)__va(ia64_boot_param->initrd_start);
@@@ -519,6 -522,8 +522,8 @@@ setup_arch (char **cmdline_p
  {
        unw_init();
  
+       paravirt_arch_setup_early();
        ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
  
        *cmdline_p = __va(ia64_boot_param->command_line);
  # ifdef CONFIG_ACPI_NUMA
        acpi_numa_init();
        per_cpu_scan_finalize((cpus_weight(early_cpu_possible_map) == 0 ?
 -              32 : cpus_weight(early_cpu_possible_map)), additional_cpus);
 +              32 : cpus_weight(early_cpu_possible_map)),
 +              additional_cpus > 0 ? additional_cpus : 0);
  # endif
  #else
  # ifdef CONFIG_SMP
        cpu_init();     /* initialize the bootstrap CPU */
        mmu_context_init();     /* initialize context_id bitmap */
  
 -      check_sal_cache_flush();
 -
  #ifdef CONFIG_ACPI
        acpi_boot_init();
  #endif
  
+       paravirt_banner();
+       paravirt_arch_setup_console(cmdline_p);
  #ifdef CONFIG_VT
        if (!conswitchp) {
  # if defined(CONFIG_DUMMY_CONSOLE)
  #endif
  
        /* enable IA-64 Machine Check Abort Handling unless disabled */
+       if (paravirt_arch_setup_nomca())
+               nomca = 1;
        if (!nomca)
                ia64_mca_init();
  
        platform_setup(cmdline_p);
 +      check_sal_cache_flush();
        paging_init();
  }
  
index 9d1d429c6c59a6c7b8f111cd43abeaa0b50ca6ae,933f38811528169f71682925caae2e3f8872be09..03f1a9908afc6a3bb547674362cdda704b2ebcc0
@@@ -50,6 -50,7 +50,7 @@@
  #include <asm/machvec.h>
  #include <asm/mca.h>
  #include <asm/page.h>
+ #include <asm/paravirt.h>
  #include <asm/pgalloc.h>
  #include <asm/pgtable.h>
  #include <asm/processor.h>
@@@ -317,7 -318,7 +318,7 @@@ ia64_sync_itc (unsigned int master
  
        go[MASTER] = 1;
  
 -      if (smp_call_function_single(master, sync_master, NULL, 1, 0) < 0) {
 +      if (smp_call_function_single(master, sync_master, NULL, 0) < 0) {
                printk(KERN_ERR "sync_itc: failed to get attention of CPU %u!\n", master);
                return;
        }
@@@ -395,14 -396,14 +396,14 @@@ smp_callin (void
  
        fix_b0_for_bsp();
  
 -      lock_ipi_calllock();
 +      ipi_call_lock_irq();
        spin_lock(&vector_lock);
        /* Setup the per cpu irq handling data structures */
        __setup_vector_irq(cpuid);
        cpu_set(cpuid, cpu_online_map);
        per_cpu(cpu_state, cpuid) = CPU_ONLINE;
        spin_unlock(&vector_lock);
 -      unlock_ipi_calllock();
 +      ipi_call_unlock_irq();
  
        smp_setup_percpu_timer();
  
@@@ -642,6 -643,7 +643,7 @@@ void __devinit smp_prepare_boot_cpu(voi
        cpu_set(smp_processor_id(), cpu_online_map);
        cpu_set(smp_processor_id(), cpu_callin_map);
        per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
+       paravirt_post_smp_prepare_boot_cpu();
  }
  
  #ifdef CONFIG_HOTPLUG_CPU
diff --combined arch/ia64/kernel/time.c
index aad1b7b1fff95e19ee19d3175ce3f9a5a7c8c1a6,046ca89efc053f660e444869bcd9112a518f99a2..65c10a42c88f37fbb998012a8f293bd4003f1485
@@@ -24,6 -24,7 +24,7 @@@
  #include <asm/machvec.h>
  #include <asm/delay.h>
  #include <asm/hw_irq.h>
+ #include <asm/paravirt.h>
  #include <asm/ptrace.h>
  #include <asm/sal.h>
  #include <asm/sections.h>
@@@ -48,6 -49,15 +49,15 @@@ EXPORT_SYMBOL(last_cli_ip)
  
  #endif
  
+ #ifdef CONFIG_PARAVIRT
+ static void
+ paravirt_clocksource_resume(void)
+ {
+       if (pv_time_ops.clocksource_resume)
+               pv_time_ops.clocksource_resume();
+ }
+ #endif
  static struct clocksource clocksource_itc = {
        .name           = "itc",
        .rating         = 350,
@@@ -56,6 -66,9 +66,9 @@@
        .mult           = 0, /*to be calculated*/
        .shift          = 16,
        .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
+ #ifdef CONFIG_PARAVIRT
+       .resume         = paravirt_clocksource_resume,
+ #endif
  };
  static struct clocksource *itc_clocksource;
  
@@@ -117,7 -130,6 +130,7 @@@ void account_system_vtime(struct task_s
  
        local_irq_restore(flags);
  }
 +EXPORT_SYMBOL_GPL(account_system_vtime);
  
  /*
   * Called from the timer interrupt handler to charge accumulated user time
@@@ -157,6 -169,9 +170,9 @@@ timer_interrupt (int irq, void *dev_id
  
        profile_tick(CPU_PROFILING);
  
+       if (paravirt_do_steal_accounting(&new_itm))
+               goto skip_process_time_accounting;
        while (1) {
                update_process_times(user_mode(get_irq_regs()));
  
                local_irq_disable();
        }
  
+ skip_process_time_accounting:
        do {
                /*
                 * If we're too close to the next clock tick for
@@@ -335,6 -352,11 +353,11 @@@ ia64_init_itm (void
                 */
                clocksource_itc.rating = 50;
  
+       paravirt_init_missing_ticks_accounting(smp_processor_id());
+       /* avoid softlock up message when cpu is unplug and plugged again. */
+       touch_softlockup_watchdog();
        /* Setup the CPU local timer tick */
        ia64_cpu_local_tick();
  
diff --combined include/asm-ia64/smp.h
index 27731e032ee999be767993dbdb47b8c3a7334086,2984e262fc6c2e3b1e18d201d8cd296ce2b5c918..12d96e0cd5134d9d95e01e6714b5b75179dcfcf7
@@@ -15,6 -15,7 +15,7 @@@
  #include <linux/kernel.h>
  #include <linux/cpumask.h>
  #include <linux/bitops.h>
+ #include <linux/irqreturn.h>
  
  #include <asm/io.h>
  #include <asm/param.h>
@@@ -38,6 -39,9 +39,6 @@@ ia64_get_lid (void
        return lid.f.id << 8 | lid.f.eid;
  }
  
 -extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *),
 -                                void *info, int wait);
 -
  #define hard_smp_processor_id()               ia64_get_lid()
  
  #ifdef CONFIG_SMP
@@@ -120,13 -124,13 +121,14 @@@ extern void __init smp_build_cpu_map(vo
  extern void __init init_smp_config (void);
  extern void smp_do_timer (struct pt_regs *regs);
  
+ extern irqreturn_t handle_IPI(int irq, void *dev_id);
  extern void smp_send_reschedule (int cpu);
 -extern void lock_ipi_calllock(void);
 -extern void unlock_ipi_calllock(void);
  extern void identify_siblings (struct cpuinfo_ia64 *);
  extern int is_multithreading_enabled(void);
  
 +extern void arch_send_call_function_single_ipi(int cpu);
 +extern void arch_send_call_function_ipi(cpumask_t mask);
 +
  #else /* CONFIG_SMP */
  
  #define cpu_logical_id(i)             0