1. 05 12月, 2013 8 次提交
    • G
      powerpc/powernv: Move PHB-diag dump functions around · 93aef2a7
      Gavin Shan 提交于
      Prior to the completion of PCI enumeration, we actively detects
      EEH errors on PCI config cycles and dump PHB diag-data if necessary.
      The EEH backend also dumps PHB diag-data in case of frozen PE or
      fenced PHB. However, we are using different functions to dump the
      PHB diag-data for those 2 cases.
      
      The patch merges the functions for dumping PHB diag-data to one so
      that we can avoid duplicate code. Also, we never dump PHB3 diag-data
      during PCI config cycles with frozen PE. The patch fixes it as well.
      Signed-off-by: NGavin Shan <shangw@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      93aef2a7
    • A
      PPC: POWERNV: move iommu_add_device earlier · d905c5df
      Alexey Kardashevskiy 提交于
      The current implementation of IOMMU on sPAPR does not use iommu_ops
      and therefore does not call IOMMU API's bus_set_iommu() which
      1) sets iommu_ops for a bus
      2) registers a bus notifier
      Instead, PCI devices are added to IOMMU groups from
      subsys_initcall_sync(tce_iommu_init) which does basically the same
      thing without using iommu_ops callbacks.
      
      However Freescale PAMU driver (https://lkml.org/lkml/2013/7/1/158)
      implements iommu_ops and when tce_iommu_init is called, every PCI device
      is already added to some group so there is a conflict.
      
      This patch does 2 things:
      1. removes the loop in which PCI devices were added to groups and
      adds explicit iommu_add_device() calls to add devices as soon as they get
      the iommu_table pointer assigned to them.
      2. moves a bus notifier to powernv code in order to avoid conflict with
      the notifier from Freescale driver.
      
      iommu_add_device() and iommu_del_device() are public now.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d905c5df
    • V
      powerpc/powernv: Move SG list structure to header file · 7e1ce5a4
      Vasant Hegde 提交于
      Move SG list and entry structure to header file so that
      it can be used in other places as well.
      Signed-off-by: NVasant Hegde <hegdevasant@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7e1ce5a4
    • M
      powerpc/powernv: Infrastructure to read opal messages in generic format. · 24366360
      Mahesh Salgaonkar 提交于
      Opal now has a new messaging infrastructure to push the messages to
      linux in a generic format for different type of messages using only one
      event bit. The format of the opal message is as below:
      
      struct opal_msg {
              uint32_t msg_type;
      	uint32_t reserved;
      	uint64_t params[8];
      };
      
      This patch allows clients to subscribe for notification for specific
      message type. It is upto the subscriber to decipher the messages who showed
      interested in receiving specific message type.
      
      The interface to subscribe for notification is:
      
      	int opal_message_notifier_register(enum OpalMessageType msg_type,
                                              struct notifier_block *nb)
      
      The notifier will fetch the opal message when available and notify the
      subscriber with message type and the opal message. It is subscribers
      responsibility to copy the message data before returning from notifier
      callback.
      Signed-off-by: NMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      24366360
    • M
      powerpc/powernv: Machine check exception handling. · b63a0ffe
      Mahesh Salgaonkar 提交于
      Add basic error handling in machine check exception handler.
      
      - If MSR_RI isn't set, we can not recover.
      - Check if disposition set to OpalMCE_DISPOSITION_RECOVERED.
      - Check if address at fault is inside kernel address space, if not then send
        SIGBUS to process if we hit exception when in userspace.
      - If address at fault is not provided then and if we get a synchronous machine
        check while in userspace then kill the task.
      Signed-off-by: NMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b63a0ffe
    • M
      powerpc/powernv: Remove machine check handling in OPAL. · 28446de2
      Mahesh Salgaonkar 提交于
      Now that we are ready to handle machine check directly in linux, do not
      register with firmware to handle machine check exception.
      Signed-off-by: NMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      28446de2
    • M
      powerpc/book3s: Queue up and process delayed MCE events. · b5ff4211
      Mahesh Salgaonkar 提交于
      When machine check real mode handler can not continue into host kernel
      in V mode, it returns from the interrupt and we loose MCE event which
      never gets logged. In such a situation queue up the MCE event so that
      we can log it later when we get back into host kernel with r1 pointing to
      kernel stack e.g. during syscall exit.
      Signed-off-by: NMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b5ff4211
    • M
      powerpc/book3s: Decode and save machine check event. · 36df96f8
      Mahesh Salgaonkar 提交于
      Now that we handle machine check in linux, the MCE decoding should also
      take place in linux host. This info is crucial to log before we go down
      in case we can not handle the machine check errors. This patch decodes
      and populates a machine check event which contain high level meaning full
      MCE information.
      
      We do this in real mode C code with ME bit on. The MCE information is still
      available on emergency stack (in pt_regs structure format). Even if we take
      another exception at this point the MCE early handler will allocate a new
      stack frame on top of current one. So when we return back here we still have
      our MCE information safe on current stack.
      
      We use per cpu buffer to save high level MCE information. Each per cpu buffer
      is an array of machine check event structure indexed by per cpu counter
      mce_nest_count. The mce_nest_count is incremented every time we enter
      machine check early handler in real mode to get the current free slot
      (index = mce_nest_count - 1). The mce_nest_count is decremented once the
      MCE info is consumed by virtual mode machine exception handler.
      
      This patch provides save_mce_event(), get_mce_event() and release_mce_event()
      generic routines that can be used by machine check handlers to populate and
      retrieve the event. The routine release_mce_event() will free the event slot so
      that it can be reused. Caller can invoke get_mce_event() with a release flag
      either to release the event slot immediately OR keep it so that it can be
      fetched again. The event slot can be also released anytime by invoking
      release_mce_event().
      
      This patch also updates kvm code to invoke get_mce_event to retrieve generic
      mce event rather than paca->opal_mce_evt.
      
      The KVM code always calls get_mce_event() with release flags set to false so
      that event is available for linus host machine
      
      If machine check occurs while we are in guest, KVM tries to handle the error.
      If KVM is able to handle MC error successfully, it enters the guest and
      delivers the machine check to guest. If KVM is not able to handle MC error, it
      exists the guest and passes the control to linux host machine check handler
      which then logs MC event and decides how to handle it in linux host. In failure
      case, KVM needs to make sure that the MC event is available for linux host to
      consume. Hence KVM always calls get_mce_event() with release flags set to false
      and later it invokes release_mce_event() only if it succeeds to handle error.
      Signed-off-by: NMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      36df96f8
  2. 02 12月, 2013 1 次提交
  3. 21 11月, 2013 1 次提交
    • M
      powerpc: Make cpu_to_chip_id() available when SMP=n · 3eb906c6
      Michael Ellerman 提交于
      Up until now we have only used cpu_to_chip_id() in the topology code,
      which is only used on SMP builds. However my recent commit a4da0d50
      "Implement arch_get_random_long/int() for powernv" added a usage when
      SMP=n, breaking the build.
      
      Move cpu_to_chip_id() into prom.c so it is available for SMP=n builds.
      
      We would move the extern to prom.h, but that breaks the include in
      topology.h. Instead we leave it in smp.h, but move it out of the
      CONFIG_SMP #ifdef. We also need to include asm/smp.h in rng.c, because
      the linux version skips asm/smp.h on UP. What a mess.
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      3eb906c6
  4. 06 11月, 2013 4 次提交
  5. 30 10月, 2013 4 次提交
  6. 11 10月, 2013 20 次提交
  7. 10 10月, 2013 1 次提交
    • R
      powerpc: add explicit OF includes · 26a2056e
      Rob Herring 提交于
      When removing prom.h include by of.h, several OF headers will no longer
      be implicitly included. Add explicit includes of of_*.h as needed.
      Signed-off-by: NRob Herring <rob.herring@calxeda.com>
      Acked-by: NGrant Likely <grant.likely@linaro.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Anatolij Gustschin <agust@denx.de>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: linuxppc-dev@lists.ozlabs.org
      26a2056e
  8. 27 8月, 2013 1 次提交