1. 08 5月, 2012 1 次提交
    • D
      KVM: PPC: Book3S HV: Fix refcounting of hugepages · de6c0b02
      David Gibson 提交于
      The H_REGISTER_VPA hcall implementation in HV Power KVM needs to pin some
      guest memory pages into host memory so that they can be safely accessed
      from usermode.  It does this used get_user_pages_fast().  When the VPA is
      unregistered, or the VCPUs are cleaned up, these pages are released using
      put_page().
      
      However, the get_user_pages() is invoked on the specific memory are of the
      VPA which could lie within hugepages.  In case the pinned page is huge,
      we explicitly find the head page of the compound page before calling
      put_page() on it.
      
      At least with the latest kernel, this is not correct.  put_page() already
      handles finding the correct head page of a compound, and also deals with
      various counts on the individual tail page which are important for
      transparent huge pages.  We don't support transparent hugepages on Power,
      but even so, bypassing this count maintenance can lead (when the VM ends)
      to a hugepage being released back to the pool with a non-zero mapcount on
      one of the tail pages.  This can then lead to a bad_page() when the page
      is released from the hugepage pool.
      
      This removes the explicit compound_head() call to correct this bug.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      Acked-by: NAlexander Graf <agraf@suse.de>
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      de6c0b02
  2. 23 4月, 2012 4 次提交
    • B
      powerpc/mpic: Properly set default triggers · 446f6d06
      Benjamin Herrenschmidt 提交于
      This gets rid of the unused default senses array, and replaces the
      incorrect use of IRQ_TYPE_NONE with the new IRQ_TYPE_DEFAULT for
      the initial set_trigger() call when mapping an interrupt.
      
      This in turn makes us read the HW state and update the irq desc
      accordingly.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      446f6d06
    • B
      powerpc/mpic: Fix confusion between hw_irq and virq · 3a2b4f7c
      Benjamin Herrenschmidt 提交于
      mpic_is_ipi() takes a virq and immediately converts it to a hw_irq.
      
      However, one of the two call sites calls it with a ... hw_irq. The
      other call site also happens to have the hw_irq at hand, so let's
      change it to just take that as an argument. Also change mpic_is_tm()
      for consistency.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3a2b4f7c
    • B
      powerpc/pmac: Don't add_timer() twice · 3027691e
      Benjamin Herrenschmidt 提交于
      If the interrupt and the timeout happen roughly at the same
      time, we can get into a situation where the timer function
      is run while the interrupt has already been processed. In
      this case, the timer function might end up doing an add_timer
      on an already pending timer, causing a BUG_ON() to trigger.
      
      Instead, just skip the whole timeout operation if we see that
      the timer is pending. The spinlock ensures that the only way
      that happens is if we already started a new operation and thus
      the timeout can be ignored.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3027691e
    • G
      powerpc/eeh: Fix crash caused by null eeh_dev · 2ef822c5
      Gavin Shan 提交于
      The problem was reported by Anton Blanchard. While EEH error
      happened to the PCI device without the corresponding device
      driver, kernel crash was seen. Eventually, I successfully
      reproduced the problem on Firebird-L machine with utility
      "errinjct". Initially, the device driver for Emulex ethernet
      MAC has been disabled from .config and force data parity on
      the Emulex ethernet MAC with help of "errinjct". Eventually,
      I saw the kernel crash after issueing couple of "lspci -v"
      command.
      
      The root cause behind is that the PCI device, including the
      reference to the corresponding eeh device, will be removed
      from the system while EEH does recovery. Afterwards, the
      PCI device will be probed again and added into the system
      accordingly. So it's not safe to retrieve the eeh device from
      the corresponding PCI device after the PCI device has been removed
      and not added again.
      
      The patch fixes the issue and retrieve the eeh device from OF node
      instead of PCI device after the PCI device has been removed.
      Signed-off-by: NGavin Shan <shangw@linux.vnet.ibm.com>
      Tested-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2ef822c5
  3. 20 4月, 2012 6 次提交
  4. 12 4月, 2012 1 次提交
    • G
      irq_domain: Move irq_virq_count into NOMAP revmap · 6fa6c8e2
      Grant Likely 提交于
      This patch replaces the old global setting of irq_virq_count that is only
      used by the NOMAP mapping and instead uses a revmap_data property so that
      the maximum NOMAP allocation can be set per NOMAP irq_domain.
      
      There is exactly one user of irq_virq_count in-tree right now: PS3.
      Also, irq_virq_count is only useful for the NOMAP mapping.  So,
      instead of having a single global irq_virq_count values, this change
      drops it entirely and added a max_irq argument to irq_domain_add_nomap().
      That makes it a property of an individual nomap irq domain instead of
      a global system settting.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Tested-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Milton Miller <miltonm@bga.com>
      6fa6c8e2
  5. 11 4月, 2012 2 次提交
  6. 10 4月, 2012 1 次提交
    • B
      powerpc: Fix page fault with lockdep regression · 08f1ec8a
      Benjamin Herrenschmidt 提交于
      commit a546498f
      introduced a regression on 32-bit when irq tracing
      is enabled by exposing an old bug in our irq tracing
      code for exception entry.
      
      The code would save and restore some GPRs around the
      calls to the C lockdep code, however, it tries to be
      too smart for its own good and restores some of the
      GPRs from the exception frame (as saved there on
      exception entry).
      
      However, for page faults, we do replace those GPRs with
      arguments to do_page_fault before we call transfer_to_handler
      and so restoring from the exception frame is plain wrong in
      this case.
      
      This was fine as long as we didn't touch the interrupt state
      when taking page fault, but when I started doing it, it would
      trigger the lockdep calls and the bug.
      
      This fixes it by cleaning up that code a bit. It did create
      a small stack frame for the sake of backtraces, so let's
      make it a bit bigger and use it to save and restore the
      stuff we care about.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      08f1ec8a
  7. 03 4月, 2012 5 次提交
  8. 02 4月, 2012 5 次提交
  9. 30 3月, 2012 2 次提交
  10. 29 3月, 2012 9 次提交
  11. 28 3月, 2012 4 次提交