1. 13 4月, 2014 1 次提交
  2. 09 4月, 2014 2 次提交
  3. 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
  4. 24 3月, 2014 4 次提交
  5. 20 3月, 2014 9 次提交
    • 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
    • T
      powerpc/book3e: initialize crit/mc/dbg kernel stack pointers · 160c7324
      Tiejun Chen 提交于
      We already allocated critical/machine/debug check exceptions, but
      we also should initialize those associated kernel stack pointers
      for use by special exceptions in the PACA.
      Signed-off-by: NTiejun Chen <tiejun.chen@windriver.com>
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      160c7324
  6. 13 3月, 2014 1 次提交
  7. 07 3月, 2014 7 次提交
  8. 05 3月, 2014 9 次提交