1. 15 1月, 2016 13 次提交
  2. 20 12月, 2015 1 次提交
  3. 07 11月, 2015 1 次提交
    • V
      x86/irq: Probe for PIC presence before allocating descs for legacy IRQs · 8c058b0b
      Vitaly Kuznetsov 提交于
      Commit d32932d0 ("x86/irq: Convert IOAPIC to use hierarchical irqdomain
      interfaces") brought a regression for Hyper-V Gen2 instances. These
      instances don't have i8259 legacy PIC but they use legacy IRQs for serial
      port, rtc, and acpi. With this commit included we end up with these IRQs
      not initialized. Earlier, there was a special workaround for legacy IRQs
      in mp_map_pin_to_irq() doing mp_irqdomain_map() without looking at
      nr_legacy_irqs() and now we fail in __irq_domain_alloc_irqs() when
      irq_domain_alloc_descs() returns -EEXIST.
      
      The essence of the issue seems to be that early_irq_init() calls
      arch_probe_nr_irqs() to figure out the number of legacy IRQs before
      we probe for i8259 and gets 16. Later when init_8259A() is called we switch
      to NULL legacy PIC and nr_legacy_irqs() starts to return 0 but we already
      have 16 descs allocated.
      
      Solve the issue by separating i8259 probe from init and calling it in
      arch_probe_nr_irqs() before we actually use nr_legacy_irqs() information.
      
      Fixes: d32932d0 ("x86/irq: Convert IOAPIC to use hierarchical irqdomain interfaces")
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Cc: Jiang Liu <jiang.liu@linux.intel.com>
      Cc: K. Y. Srinivasan <kys@microsoft.com>
      Cc: stable@vger.kernel.org
      Link: http://lkml.kernel.org/r/1446543614-3621-1-git-send-email-vkuznets@redhat.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      8c058b0b
  4. 16 9月, 2015 1 次提交
  5. 19 8月, 2015 1 次提交
  6. 06 8月, 2015 3 次提交
  7. 14 7月, 2015 2 次提交
  8. 07 7月, 2015 1 次提交
    • T
      x86/irq: Plug irq vector hotplug race · 5a3f75e3
      Thomas Gleixner 提交于
      Jin debugged a nasty cpu hotplug race which results in leaking a irq
      vector on the newly hotplugged cpu.
      
      cpu N				cpu M
      native_cpu_up                   device_shutdown
        do_boot_cpu			  free_msi_irqs
        start_secondary                   arch_teardown_msi_irqs
          smp_callin                        default_teardown_msi_irqs
             setup_vector_irq                  arch_teardown_msi_irq
              __setup_vector_irq		   native_teardown_msi_irq
                lock(vector_lock)		     destroy_irq 
                install vectors
                unlock(vector_lock)
      					       lock(vector_lock)
      --->                                  	       __clear_irq_vector
                                          	       unlock(vector_lock)
          lock(vector_lock)
          set_cpu_online
          unlock(vector_lock)
      
      This leaves the irq vector(s) which are torn down on CPU M stale in
      the vector array of CPU N, because CPU M does not see CPU N online
      yet. There is a similar issue with concurrent newly setup interrupts.
      
      The alloc/free protection of irq descriptors does not prevent the
      above race, because it merily prevents interrupt descriptors from
      going away or changing concurrently.
      
      Prevent this by moving the call to setup_vector_irq() into the
      vector_lock held region which protects set_cpu_online():
      
      cpu N				cpu M
      native_cpu_up                   device_shutdown
        do_boot_cpu			  free_msi_irqs
        start_secondary                   arch_teardown_msi_irqs
          smp_callin                        default_teardown_msi_irqs
             lock(vector_lock)                arch_teardown_msi_irq
             setup_vector_irq()
              __setup_vector_irq		   native_teardown_msi_irq
                install vectors		     destroy_irq 
             set_cpu_online
             unlock(vector_lock)
      					       lock(vector_lock)
                                        	       __clear_irq_vector
                                          	       unlock(vector_lock)
      
      So cpu M either sees the cpu N online before clearing the vector or
      cpu N installs the vectors after cpu M has cleared it.
      Reported-by: Nxiao jin <jin.xiao@intel.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Joerg Roedel <jroedel@suse.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Yanmin Zhang <yanmin_zhang@linux.intel.com>
      Link: http://lkml.kernel.org/r/20150705171102.141898931@linutronix.de
      5a3f75e3
  9. 15 5月, 2015 1 次提交
  10. 13 5月, 2015 1 次提交
  11. 10 5月, 2015 1 次提交
  12. 05 5月, 2015 1 次提交
  13. 24 4月, 2015 13 次提交