1. 19 Oct, 2017 10 commits
  2. 16 Oct, 2017 3 commits
  3. 25 Sep, 2017 13 commits
    • Thomas Gleixner's avatar
      genirq/matrix: Add tracepoints · ec0f7cd2
      Thomas Gleixner authored
      Add tracepoints for the irq bitmap matrix allocator.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213153.279468022@linutronix.de
      ec0f7cd2
    • Thomas Gleixner's avatar
      genirq: Implement bitmap matrix allocator · 2f75d9e1
      Thomas Gleixner authored
      Implement the infrastructure for a simple bitmap based allocator, which
      will replace the x86 vector allocator. It's in the core code as other
      architectures might be able to reuse/extend it. For now it only implements
      allocations for single CPUs, but it's simple to add multi CPU allocation
      support if required.
      
      The concept is rather simple:
      
       Global information:
       	system_vector bitmap
      	global accounting
      
       PerCPU information:
       	allocation bitmap
      	managed allocation bitmap
      	local accounting
      
      The system vector bitmap is used to exclude vectors system wide from the
      allocation space.
      
      The allocation bitmap is used to keep track of per cpu used vectors.
      
      The managed allocation bitmap is used to reserve vectors for managed
      interrupts.
      
      When a regular (non managed) interrupt allocation happens then the
      following rule applies:
      
            tmpmap = system_map | alloc_map | managed_map
            find_zero_bit(tmpmap)
      
      Oring the bitmaps together gives the real available space. The same rule
      applies for reserving a managed interrupt vector. But contrary to the
      regular interrupts the reservation only marks the bit in the managed map
      and therefor excludes it from the regular allocations. The managed map is
      only cleaned out when the a managed interrupt is completely released and it
      stays alive accross CPU offline/online operations.
      
      For managed interrupt allocations the rule is:
      
            tmpmap = managed_map & ~alloc_map
            find_first_bit(tmpmap)
      
      This returns the first bit which is in the managed map, but not yet
      allocated in the allocation map. The allocation marks it in the allocation
      map and hands it back to the caller for use.
      
      The rest of the code are helper functions to handle the various
      requirements and the accounting which are necessary to replace the x86
      vector allocation code. The result is a single patch as the evolution of
      this infrastructure cannot be represented in bits and pieces.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Chris Metcalf <cmetcalf@mellanox.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213153.185437174@linutronix.de
      2f75d9e1
    • Thomas Gleixner's avatar
      genirq/irqdomain: Add force reactivation flag to irq domains · 22d0b12f
      Thomas Gleixner authored
      Allow irqdomains to tell the core code, that after early activation the
      interrupt needs to be reactivated at request_irq() time.
      
      This allows reservation of vectors at early activation time and actual
      vector assignment at request_irq() time.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213153.106242536@linutronix.de
      22d0b12f
    • Thomas Gleixner's avatar
      genirq/irqdomain: Propagate early activation · 42e1cc2d
      Thomas Gleixner authored
      Propagate the early activation mode to the irqdomain activate()
      callbacks. This is required for the upcoming reservation, late vector
      assignment scheme, so that the early activation call can act accordingly.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213153.028353660@linutronix.de
      42e1cc2d
    • Thomas Gleixner's avatar
      genirq/irqdomain: Allow irq_domain_activate_irq() to fail · bb9b428a
      Thomas Gleixner authored
      Allow irq_domain_activate_irq() to fail. This is required to support a
      reservation and late vector assignment scheme.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213152.933882227@linutronix.de
      bb9b428a
    • Thomas Gleixner's avatar
      genirq/irqdomain: Update irq_domain_ops.activate() signature · 72491643
      Thomas Gleixner authored
      The irq_domain_ops.activate() callback has no return value and no way to
      tell the function that the activation is early.
      
      The upcoming changes to support a reservation scheme which allows to assign
      interrupt vectors on x86 only when the interrupt is actually requested
      requires:
      
        - A return value, so activation can fail at request_irq() time
        
        - Information that the activate invocation is early, i.e. before
          request_irq().
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213152.848490816@linutronix.de
      72491643
    • Thomas Gleixner's avatar
      genirq: Separate activation and startup · c942cee4
      Thomas Gleixner authored
      Activation of an interrupt and startup are currently a combo
      functionlity. That works so far, but upcoming changes require a strict
      separation because the activation can fail in future.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213152.754334077@linutronix.de
      c942cee4
    • Thomas Gleixner's avatar
      genirq: Set managed shut down flag at init · 239306fe
      Thomas Gleixner authored
      Managed interrupts should start up in managed shutdown mode. Set the status
      flag when initialising the irq descriptor.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213152.669687742@linutronix.de
      239306fe
    • Thomas Gleixner's avatar
      genirq: Make state consistent for !IRQ_DOMAIN_HIERARCHY · 457f6d35
      Thomas Gleixner authored
      In the !IRQ_DOMAIN_HIERARCHY cas the activation stubs are not
      setting/clearing the activation status bits. This is not a problem at the
      moment, but upcoming changes require a correct status.
      
      Add the set/clear incovations to the stub functions and move them to the
      core internal header to avoid duplication and visibility outside the core.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213152.591985591@linutronix.de
      457f6d35
    • Thomas Gleixner's avatar
      irqdomain/debugfs: Provide domain specific debug callback · c3e7239a
      Thomas Gleixner authored
      Some interrupt domains like the X86 vector domain has special requirements
      for debugging, like showing the vector usage on the CPUs.
      
      Add a callback to the irqdomain ops which can be filled in by domains which
      require it and add conditional invocations to the irqdomain and the per irq
      debug files.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213152.512937505@linutronix.de
      c3e7239a
    • Thomas Gleixner's avatar
      genirq/msi: Capture device name for debugfs · 07557ccb
      Thomas Gleixner authored
      For debugging the allocation of unused or potentially leaked interrupt
      descriptor it's helpful to have some information about the site which
      allocated them. In case of MSI this is simple because the caller hands the
      device struct pointer into the domain allocation function.
      
      Duplicate the device name and show it in the debugfs entry of the interrupt
      descriptor.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213152.433038426@linutronix.de
      07557ccb
    • Thomas Gleixner's avatar
      genirq/debugfs: Show debug information for all irq descriptors · e0b47794
      Thomas Gleixner authored
      Currently the debugfs shows only information about actively used interrupts
      like /proc/irq/ does. That's fine for most cases, but not helpful when
      internals of allocated, but unused interrupt descriptors have to
      debugged. It's also useful to provide information about all descriptors so
      leaks can be debugged in a simpler way.
      
      Move the debugfs registration to the descriptor allocation code.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Tested-by: default avatarJuergen Gross <jgross@suse.com>
      Tested-by: default avatarYu Chen <yu.c.chen@intel.com>
      Acked-by: default avatarJuergen Gross <jgross@suse.com>
      Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Alok Kataria <akataria@vmware.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Link: https://lkml.kernel.org/r/20170913213152.355525908@linutronix.de
      e0b47794
    • Alexandru Moise's avatar
      genirq: Check __free_irq() return value for NULL · 2827a418
      Alexandru Moise authored
      __free_irq() can return a NULL irqaction for example when trying to free
      already-free IRQ, but the callsite unconditionally dereferences the
      returned pointer.
      
      Fix this by adding a check and return NULL.
      Signed-off-by: default avatarAlexandru Moise <00moses.alexander00@gmail.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Link: https://lkml.kernel.org/r/20170919200412.GA29985@gmail.com
      2827a418
  4. 24 Sep, 2017 14 commits