1. 28 4月, 2014 17 次提交
    • A
      powerpc/pci: Use of_pci_range_parser helper in pci_process_bridge_OF_ranges · 654837e8
      Andrew Murray 提交于
      This patch updates the implementation of pci_process_bridge_OF_ranges to use
      the of_pci_range_parser helpers.
      Signed-off-by: NAndrew Murray <amurray@embedded-bits.co.uk>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      654837e8
    • S
      powerpc/legacy_serial: Support MVME5100 UARTS with shifted registers · 13ae4037
      Stephen Chivers 提交于
      This patch adds support to legacy serial for
      UARTS with shifted registers.
      
      The MVME5100 Single Board Computer is a PowerPC platform
      that has 16550 style UARTS with register addresses that are
      16 bytes apart (shifted by 4).
      
      Commit 	30925748
      "powerpc: Cleanup udbg_16550 and add support for LPC PIO-only UARTs"
      added support to udbg_16550 for shifted registers by adding a "stride"
      parameter to the initialisation operations for Programmed IO and
      Memory Mapped IO.
      
      As a consequence it is now possible to use the services of legacy serial
      to provide early serial console messages for the MVME5100.
      
      An added benefit of this is that the serial console will always be
      "ttyS0" irrespective of whether the computer is fitted with extra
      PCI 8250 interface boards or not.
      
      I have tested this patch using the four PowerPC platforms available to me:
      
      	MVME5100 - shifted registers,
      	SAM440EP - unshifted registers,
      	MPC8349 - unshifted registers,
      	MVME4100 - unshifted registers.
      Signed-off-by: NStephen Chivers <schivers@csc.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      13ae4037
    • G
      powerpc/prom: Stop scanning dev-tree for fdump early · a7d04317
      Gavin Shan 提交于
      Function early_init_dt_scan_fw_dump() is called to scan the device
      tree for fdump properties under node "rtas". Any one of them is
      invalid, we can stop scanning the device tree early by returning
      "1". It would save a bit time during boot.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a7d04317
    • G
      powerpc/eeh: Can't recover from non-PE-reset case · 35845a78
      Gavin Shan 提交于
      When PCI_ERS_RESULT_CAN_RECOVER returned from device drivers, the
      EEH core should enable I/O and DMA for the affected PE. However,
      it was missed to have DMA enabled in eeh_handle_normal_event().
      Besides, the frozen state of the affected PE should be cleared
      after successful recovery, but we didn't.
      
      The patch fixes both of the issues as above.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      35845a78
    • G
      powerpc/pci: Mask linkDown on resetting PCI bus · d92a208d
      Gavin Shan 提交于
      The problem was initially reported by Wendy who tried pass through
      IPR adapter, which was connected to PHB root port directly, to KVM
      based guest. When doing that, pci_reset_bridge_secondary_bus() was
      called by VFIO driver and linkDown was detected by the root port.
      That caused all PEs to be frozen.
      
      The patch fixes the issue by routing the reset for the secondary bus
      of root port to underly firmware. For that, one more weak function
      pci_reset_secondary_bus() is introduced so that the individual platforms
      can override that and do specific reset for bridge's secondary bus.
      Reported-by: NWendy Xiong <wenxiong@linux.vnet.ibm.com>
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d92a208d
    • G
      powerpc/eeh: Make the delay for PE reset unified · 26833a50
      Gavin Shan 提交于
      Basically, we have 3 types of resets to fulfil PE reset: fundamental,
      hot and PHB reset. For the later 2 cases, we need PCI bus reset hold
      and settlement delay as specified by PCI spec. PowerNV and pSeries
      platforms are running on top of different firmware and some of the
      delays have been covered by underly firmware (PowerNV).
      
      The patch makes the delays unified to be done in backend, instead of
      EEH core.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      26833a50
    • G
      powerpc/eeh: No hotplug on permanently removed dev · d2b0f6f7
      Gavin Shan 提交于
      The issue was detected in a bit complicated test case where
      we have multiple hierarchical PEs shown as following figure:
      
                      +-----------------+
                      | PE#3     p2p#0  |
                      |          p2p#1  |
                      +-----------------+
                              |
                      +-----------------+
                      | PE#4     pdev#0 |
                      |          pdev#1 |
                      +-----------------+
      
      PE#4 (have 2 PCI devices) is the child of PE#3, which has 2 p2p
      bridges. We accidentally had less-known scenario: PE#4 was removed
      permanently from the system because of permanent failure (e.g.
      exceeding the max allowd failure times in last hour), then we detects
      EEH errors on PE#3 and tried to recover it. However, eeh_dev instances
      for pdev#0/1 were not detached from PE#4, which was still connected to
      PE#3. All of that was because of the fact that we rely on count-based
      pcibios_release_device(), which isn't reliable enough. When doing
      recovery for PE#3, we still apply hotplug on PE#4 and pdev#0/1, which
      are not valid any more. Eventually, we run into kernel crash.
      
      The patch fixes above issue from two aspects. For unplug, we simply
      skip those permanently removed PE, whose state is (EEH_PE_STATE_ISOLATED
      && !EEH_PE_STATE_RECOVERING) and its frozen count should be greater
      than EEH_MAX_ALLOWED_FREEZES. For plug, we marked all permanently
      removed EEH devices with EEH_DEV_REMOVED and return 0xFF's on read
      its PCI config so that PCI core will omit them.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d2b0f6f7
    • G
      powerpc/eeh: Allow to disable EEH · 7f52a526
      Gavin Shan 提交于
      The patch introduces bootarg "eeh=off" to disable EEH functinality.
      Also, it creates /sys/kerenl/debug/powerpc/eeh_enable to disable
      or enable EEH functionality. By default, we have the functionality
      enabled.
      
      For PowerNV platform, we will restore to have the conventional
      mechanism of clearing frozen PE during PCI config access if we're
      going to disable EEH functionality. Conversely, we will rely on
      EEH for error recovery.
      
      The patch also fixes the issue that we missed to cover the case
      of disabled EEH functionality in function ioda_eeh_event(). Those
      events driven by interrupt should be cleared to avoid endless
      reporting.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7f52a526
    • G
      powerpc/eeh: Cleanup EEH subsystem variables · 8a5ad356
      Gavin Shan 提交于
      There're 2 EEH subsystem variables: eeh_subsystem_enabled and
      eeh_probe_mode. We needn't maintain 2 variables and we can just
      have one variable and introduce different flags. The patch also
      introduces additional flag EEH_FORCE_DISABLE, which will be used
      to disable EEH subsystem via boot parameter ("eeh=off") in future.
      Besides, the patch also introduces flag EEH_ENABLED, which is
      changed to disable or enable EEH functionality on the fly through
      debugfs entry in future.
      
      With the patch applied, the creteria to check the enabled EEH
      functionality is changed to:
      
      !EEH_FORCE_DISABLED && EEH_ENABLED : Enabled
                             Other cases : Disabled
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8a5ad356
    • G
      powerpc/eeh: Use cached capability for log dump · 2a18dfc6
      Gavin Shan 提交于
      When calling into eeh_gather_pci_data() on pSeries platform, we
      possiblly don't have pci_dev instance yet, but eeh_dev is always
      ready. So we use cached capability from eeh_dev instead of pci_dev
      for log dump there. In order to keep things unified, we also cache
      PCI capability positions to eeh_dev for PowerNV as well.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2a18dfc6
    • G
      powerpc/eeh: Cleanup eeh_gather_pci_data() · 2d86c385
      Gavin Shan 提交于
      The patch replaces printk(KERN_WARNING ...) with pr_warn() in the
      function eeh_gather_pci_data().
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      2d86c385
    • G
      powerpc/eeh: Avoid I/O access during PE reset · 78954700
      Gavin Shan 提交于
      We have suffered recrusive frozen PE a lot, which was caused
      by IO accesses during the PE reset. Ben came up with the good
      idea to keep frozen PE until recovery (BAR restore) gets done.
      With that, IO accesses during PE reset are dropped by hardware
      and wouldn't incur the recrusive frozen PE any more.
      
      The patch implements the idea. We don't clear the frozen state
      until PE reset is done completely. During the period, the EEH
      core expects unfrozen state from backend to keep going. So we
      have to reuse EEH_PE_RESET flag, which has been set during PE
      reset, to return normal state from backend. The side effect is
      we have to clear frozen state for towice (PE reset and clear it
      explicitly), but that's harmless.
      
      We have some limitations on pHyp. pHyp doesn't allow to enable
      IO or DMA for unfrozen PE. So we don't enable them on unfrozen PE
      in eeh_pci_enable(). We have to enable IO before grabbing logs on
      pHyp. Otherwise, 0xFF's is always returned from PCI config space.
      Also, we had wrong return value from eeh_pci_enable() for
      EEH_OPT_THAW_DMA case. The patch fixes it too.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      78954700
    • G
      powerpc/eeh: Block PCI-CFG access during PE reset · d0914f50
      Gavin Shan 提交于
      We've observed multiple PE reset failures because of PCI-CFG
      access during that period. Potentially, some device drivers
      can't support EEH very well and they can't put the device to
      motionless state before PE reset. So those device drivers might
      produce PCI-CFG accesses during PE reset. Also, we could have
      PCI-CFG access from user space (e.g. "lspci"). Since access to
      frozen PE should return 0xFF's, we can block PCI-CFG access
      during the period of PE reset so that we won't get recrusive EEH
      errors.
      
      The patch adds flag EEH_PE_RESET, which is kept during PE reset.
      The PowerNV/pSeries PCI-CFG accessors reuse the flag to block
      PCI-CFG accordingly.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      d0914f50
    • G
      powerpc/eeh: EEH_PE_ISOLATED not reflect HW state · 7b401850
      Gavin Shan 提交于
      When doing PE reset, EEH_PE_ISOLATED is cleared unconditionally.
      However, We should remove that if the PE reset has cleared the
      frozen state successfully. Otherwise, the flag should be kept.
      The patch fixes the issue.
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7b401850
    • G
      powerpc/eeh: Remove EEH_PE_PHB_DEAD · 9e049375
      Gavin Shan 提交于
      The PE state (for eeh_pe instance) EEH_PE_PHB_DEAD is duplicate to
      EEH_PE_ISOLATED. Originally, those PHBs (PHB PE) with EEH_PE_PHB_DEAD
      would be removed from the system. However, it's safe to replace
      that with EEH_PE_ISOLATED.
      
      The patch also clear EEH_PE_RECOVERING after fenced PHB has been handled,
      either failure or success. It makes the PHB PE state consistent with:
      
      	PHB functions normally		  NONE
      	PHB has been removed		  EEH_PE_ISOLATED
      	PHB fenced, recovery in progress  EEH_PE_ISOLATED | RECOVERING
      Signed-off-by: NGavin Shan <gwshan@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      9e049375
    • A
      powerpc: Fix error return in rtas_flash module init · 0c930692
      Anton Blanchard 提交于
      module_init should return 0 or a negative errno.
      Signed-off-by: NAnton Blanchard <anton@samba.org>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0c930692
    • J
      powerpc: Export flush_icache_range · 28ea3c75
      Jeff Mahoney 提交于
      Commit aac416fc (lkdtm: flush icache and report actions) calls
      flush_icache_range from a module. It's exported on most architectures
      that implement it, but not on powerpc. This patch exports it to fix
      the module link failure.
      Signed-off-by: NJeff Mahoney <jeffm@suse.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      28ea3c75
  2. 15 4月, 2014 1 次提交
    • M
      powerpc/PCI: Fix NULL dereference in sys_pciconfig_iobase() list traversal · 140ab645
      Mike Qiu 提交于
      3bc95598 ("powerpc/PCI: Use list_for_each_entry() for bus traversal")
      caused a NULL pointer dereference because the loop body set the iterator to
      NULL:
      
        Unable to handle kernel paging request for data at address 0x00000000
        Faulting instruction address: 0xc000000000041d78
        Oops: Kernel access of bad area, sig: 11 [#1]
        ...
        NIP [c000000000041d78] .sys_pciconfig_iobase+0x68/0x1f0
        LR [c000000000041e0c] .sys_pciconfig_iobase+0xfc/0x1f0
        Call Trace:
        [c0000003b4787db0] [c000000000041e0c] .sys_pciconfig_iobase+0xfc/0x1f0 (unreliable)
        [c0000003b4787e30] [c000000000009ed8] syscall_exit+0x0/0x98
      
      Fix it by using a temporary variable for the iterator.
      
      [bhelgaas: changelog, drop tmp_bus initialization]
      Fixes: 3bc95598 powerpc/PCI: Use list_for_each_entry() for bus traversal
      Signed-off-by: NMike Qiu <qiudayu@linux.vnet.ibm.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      140ab645
  3. 13 4月, 2014 1 次提交
  4. 09 4月, 2014 2 次提交
  5. 07 4月, 2014 7 次提交
    • B
      powerpc/ppc64: Do not turn AIL (reloc-on interrupts) too early · 8f619b54
      Benjamin Herrenschmidt 提交于
      Turn them on at the same time as we allow MSR_IR/DR in the paca
      kernel MSR, ie, after the MMU has been setup enough to be able
      to handle relocated access to the linear mapping.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      8f619b54
    • B
      powerpc/ppc64: Gracefully handle early interrupts · a944a9c4
      Benjamin Herrenschmidt 提交于
      If we take an interrupt such as a trap caused by a BUG_ON before the
      MMU has been setup, the interrupt handlers try to enable virutal mode
      and cause a recursive crash, making the original problem very hard
      to debug.
      
      This fixes it by adjusting the "kernel_msr" value in the PACA so that
      it only has MSR_IR and MSR_DR (translation for instruction and data)
      set after the MMU has been initialized for the processor.
      
      We may still not have a console yet but at least we don't get into
      a recursive fault (and early debug console or memory dump via JTAG
      of the kernel buffer *will* give us the proper error).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a944a9c4
    • B
      powerpc/prom: early_init_dt_scan_cpus() updates cpu features only once · 7222f779
      Benjamin Herrenschmidt 提交于
      All our cpu feature updates were done for every CPU in the device-tree,
      thus overwriting the cputable bits over and over again. Instead do them
      only for the boot CPU.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      7222f779
    • B
      powerpc: Make boot_cpuid common between 32 and 64-bit · 36ae37e3
      Benjamin Herrenschmidt 提交于
      Move the definition to setup-common.c and set the init value
      to -1 on both 32 and 64-bit (it was 0 on 64-bit).
      
      Additionally add a check to prom.c to garantee that the init
      value has been udpated after the DT scan.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      36ae37e3
    • B
      powerpc: Adjust CPU_FTR_SMT on all platforms · 4a85b31d
      Benjamin Herrenschmidt 提交于
      For historical reasons that code was under #ifdef CONFIG_PPC_PSERIES
      but it applies equally to all 64-bit platforms.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      4a85b31d
    • M
      powerpc/tm: Disable IRQ in tm_recheckpoint · e6b8fd02
      Michael Neuling 提交于
      We can't take an IRQ when we're about to do a trechkpt as our GPR state is set
      to user GPR values.
      
      We've hit this when running some IBM Java stress tests in the lab resulting in
      the following dump:
      
        cpu 0x3f: Vector: 700 (Program Check) at [c000000007eb3d40]
            pc: c000000000050074: restore_gprs+0xc0/0x148
            lr: 00000000b52a8184
            sp: ac57d360
           msr: 8000000100201030
          current = 0xc00000002c500000
          paca    = 0xc000000007dbfc00     softe: 0     irq_happened: 0x00
            pid   = 34535, comm = Pooled Thread #
        R00 = 00000000b52a8184   R16 = 00000000b3e48fda
        R01 = 00000000ac57d360   R17 = 00000000ade79bd8
        R02 = 00000000ac586930   R18 = 000000000fac9bcc
        R03 = 00000000ade60000   R19 = 00000000ac57f930
        R04 = 00000000f6624918   R20 = 00000000ade79be8
        R05 = 00000000f663f238   R21 = 00000000ac218a54
        R06 = 0000000000000002   R22 = 000000000f956280
        R07 = 0000000000000008   R23 = 000000000000007e
        R08 = 000000000000000a   R24 = 000000000000000c
        R09 = 00000000b6e69160   R25 = 00000000b424cf00
        R10 = 0000000000000181   R26 = 00000000f66256d4
        R11 = 000000000f365ec0   R27 = 00000000b6fdcdd0
        R12 = 00000000f66400f0   R28 = 0000000000000001
        R13 = 00000000ada71900   R29 = 00000000ade5a300
        R14 = 00000000ac2185a8   R30 = 00000000f663f238
        R15 = 0000000000000004   R31 = 00000000f6624918
        pc  = c000000000050074 restore_gprs+0xc0/0x148
        cfar= c00000000004fe28 dont_restore_vec+0x1c/0x1a4
        lr  = 00000000b52a8184
        msr = 8000000100201030   cr  = 24804888
        ctr = 0000000000000000   xer = 0000000000000000   trap =  700
      
      This moves tm_recheckpoint to a C function and moves the tm_restore_sprs into
      that function.  It then adds IRQ disabling over the trechkpt critical section.
      It also sets the TEXASR FS in the signals code to ensure this is never set now
      that we explictly write the TM sprs in tm_recheckpoint.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      cc: stable@vger.kernel.org
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      e6b8fd02
    • G
      powerpc/le: Enable RTAS events support · a08a53ea
      Greg Kurz 提交于
      The current kernel code assumes big endian and parses RTAS events all
      wrong. The most visible effect is that we cannot honor EPOW events,
      meaning, for example, we cannot shut down a guest properly from the
      hypervisor.
      
      This new patch is largely inspired by Nathan's work: we get rid of all
      the bit fields in the RTAS event structures (even the unused ones, for
      consistency). We also introduce endian safe accessors for the fields used
      by the kernel (trivial rtas_error_type() accessor added for consistency).
      
      Cc: Nathan Fontenot <nfont@linux.vnet.ibm.com>
      Signed-off-by: NGreg Kurz <gkurz@linux.vnet.ibm.com>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      a08a53ea
  6. 24 3月, 2014 4 次提交
  7. 20 3月, 2014 8 次提交
    • S
      powerpc, sysfs: Fix CPU hotplug callback registration · d1a55113
      Srivatsa S. Bhat 提交于
      Subsystems that want to register CPU hotplug callbacks, as well as perform
      initialization for the CPUs that are already online, often do it as shown
      below:
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	put_online_cpus();
      
      This is wrong, since it is prone to ABBA deadlocks involving the
      cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
      with CPU hotplug operations).
      
      Instead, the correct and race-free way of performing the callback
      registration is:
      
      	cpu_notifier_register_begin();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	/* Note the use of the double underscored version of the API */
      	__register_cpu_notifier(&foobar_cpu_notifier);
      
      	cpu_notifier_register_done();
      
      Fix the sysfs code in powerpc by using this latter form of callback
      registration.
      
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Wang Dongsheng <dongsheng.wang@freescale.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Acked-by: NMadhavan Srinivasan <maddy@linux.vnet.ibm.com>
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d1a55113
    • S
      powerpc/booke64: Critical and machine check exception support · 609af38f
      Scott Wood 提交于
      Add special state saving for critical and machine check exceptions.
      
      Most of this code could be used to handle debug exceptions taken from
      kernel space, but actually doing so is outside the scope of this patch.
      
      The various critical and machine check exceptions now point to their
      real handlers, rather than hanging the kernel.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      609af38f
    • S
      powerpc/booke64: Add crit/mc/debug support to EXCEPTION_COMMON · 31f71248
      Scott Wood 提交于
      Use the proper scratch SPRG and PACA region.  Introduce level-specific
      macros to simplify usage and avoid needing to do a bunch of token
      pasting throughout EXCEPTION_COMMON().
      
      Now that EXCEPTION_COMMON_DBG() is properly using the debug scratch
      register, there's no more need for the caller to move the value to the
      GEN scratch first.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      31f71248
    • S
      powerpc/booke64: Remove ints from EXCEPTION_COMMON · 28a3ded1
      Scott Wood 提交于
      The ints parameter was used to optionally insert RECONCILE_IRQ_STATE
      into EXCEPTION_COMMON.  However, since it came at the end of
      EXCEPTION_COMMON, there was no real benefit for it to be there as
      opposed to being called separately by the caller of EXCEPTION_COMMON.
      
      The ints parameter was causing some hassle when trying to add an extra
      macro layer.  Besides avoiding that, moving "ints" to the caller makes
      the code simpler by:
       - avoiding the asymmetry where INTS_RESTORE_HARD is called separately
      by the individual exception, but INTS_DISABLE was not
       - removing the no-op INTS_KEEP
       - not having an unnecessary macro parameter
      
      It also turned out to be necessary to delay the INTS_DISABLE
      in the case of special level exceptions until after we saved the
      old value of PACAIRQHAPPENED.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      28a3ded1
    • S
      powerpc/booke64: Use SPRG7 for VDSO · 9d378dfa
      Scott Wood 提交于
      Previously SPRG3 was marked for use by both VDSO and critical
      interrupts (though critical interrupts were not fully implemented).
      
      In commit 8b64a9df ("powerpc/booke64:
      Use SPRG0/3 scratch for bolted TLB miss & crit int"), Mihai Caraman
      made an attempt to resolve this conflict by restoring the VDSO value
      early in the critical interrupt, but this has some issues:
      
       - It's incompatible with EXCEPTION_COMMON which restores r13 from the
         by-then-overwritten scratch (this cost me some debugging time).
       - It forces critical exceptions to be a special case handled
         differently from even machine check and debug level exceptions.
       - It didn't occur to me that it was possible to make this work at all
         (by doing a final "ld r13, PACA_EXCRIT+EX_R13(r13)") until after
         I made (most of) this patch. :-)
      
      It might be worth investigating using a load rather than SPRG on return
      from all exceptions (except TLB misses where the scratch never leaves
      the SPRG) -- it could save a few cycles.  Until then, let's stick with
      SPRG for all exceptions.
      
      Since we cannot use SPRG4-7 for scratch without corrupting the state of
      a KVM guest, move VDSO to SPRG7 on book3e.  Since neither SPRG4-7 nor
      critical interrupts exist on book3s, SPRG3 is still used for VDSO
      there.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Cc: Mihai Caraman <mihai.caraman@freescale.com>
      Cc: Anton Blanchard <anton@samba.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: kvm-ppc@vger.kernel.org
      9d378dfa
    • S
      powerpc/e6500: Make TLB lock recursive · 82d86de2
      Scott Wood 提交于
      Once special level interrupts are supported, we may take nested TLB
      misses -- so allow the same thread to acquire the lock recursively.
      
      The lock will not be effective against the nested TLB miss handler
      trying to write the same entry as the interrupted TLB miss handler, but
      that's also a problem on non-threaded CPUs that lack TLB write
      conditional.  This will be addressed in the patch that enables crit/mc
      support by invalidating the TLB on return from level exceptions.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      82d86de2
    • S
      powerpc/booke64: Fix exception numbers · c4787d1e
      Scott Wood 提交于
      altivec_unavailable was commented as 0xf20 but the code uses 0x200.
      Note that 0xf20 is also used by ap_unavailable.
      
      altivec_assist was commented as 0x1700 but the code uses 0x220.
      
      critical_input was commented as 0x580 but the code uses 0x100.
      
      machine_check was commented and implemented as 0x200, which conflicts
      with altivec_assist (it only builds because MC_EXCEPTION_PROLOG is
      commented out).  Changed to the fixed IVOR value of 0x000.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      c4787d1e
    • T
      powerpc/book3e: store crit/mc/dbg exception thread info · 19007b34
      Tiejun Chen 提交于
      We need to store thread info to these exception thread info like something
      we already did for PPC32.
      Signed-off-by: NTiejun Chen <tiejun.chen@windriver.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      19007b34