1. 27 12月, 2015 3 次提交
    • M
      powerpc/powernv: Only delay opal_rtc_read() retry when necessary · 57a90390
      Michael Neuling 提交于
      Only delay opal_rtc_read() when busy and are going to retry.
      
      This has the advantage of possibly saving a massive 10ms off booting!
      
      Kudos to Stewart for noticing.
      Signed-off-by: NMichael Neuling <mikey@neuling.org>
      Reviewed-by: NStewart Smith <stewart@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      57a90390
    • R
      powerpc/powernv: Add a kmsg_dumper that flushes console output on panic · affddff6
      Russell Currey 提交于
      On BMC machines, console output is controlled by the OPAL firmware and is
      only flushed when its pollers are called.  When the kernel is in a panic
      state, it no longer calls these pollers and thus console output does not
      completely flush, causing some output from the panic to be lost.
      
      Output is only actually lost when the kernel is configured to not power off
      or reboot after panic (i.e. CONFIG_PANIC_TIMEOUT is set to 0) since OPAL
      flushes the console buffer as part of its power down routines.  Before this
      patch, however, only partial output would be printed during the timeout wait.
      
      This patch adds a new kmsg_dumper which gets called at panic time to ensure
      panic output is not lost.  It accomplishes this by calling OPAL_CONSOLE_FLUSH
      in the OPAL API, and if that is not available, the pollers are called enough
      times to (hopefully) completely flush the buffer.
      
      The flushing mechanism will only affect output printed at and before the
      kmsg_dump call in kernel/panic.c:panic().  As such, the "end Kernel panic"
      message may still be truncated as follows:
      
      >Call Trace:
      >[c000000f1f603b00] [c0000000008e9458] dump_stack+0x90/0xbc (unreliable)
      >[c000000f1f603b30] [c0000000008e7e78] panic+0xf8/0x2c4
      >[c000000f1f603bc0] [c000000000be4860] mount_block_root+0x288/0x33c
      >[c000000f1f603c80] [c000000000be4d14] prepare_namespace+0x1f4/0x254
      >[c000000f1f603d00] [c000000000be43e8] kernel_init_freeable+0x318/0x350
      >[c000000f1f603dc0] [c00000000000bd74] kernel_init+0x24/0x130
      >[c000000f1f603e30] [c0000000000095b0] ret_from_kernel_thread+0x5c/0xac
      >---[ end Kernel panic - not
      
      This functionality is implemented as a kmsg_dumper as it seems to be the
      most sensible way to introduce platform-specific functionality to the
      panic function.
      Signed-off-by: NRussell Currey <ruscur@russell.cc>
      Reviewed-by: NAndrew Donnellan <andrew.donnellan@au1.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      affddff6
    • M
      powerpc: Copy only required pieces of the mm_context_t to the paca · 2fc251a8
      Michael Neuling 提交于
      Currently we copy the whole mm_context_t to the paca but only access a
      few bits of it.  This is wasteful of space paca and also takes quite
      some time in the hot path of context switching.
      
      This patch pulls in only the required bits from the mm_context_t to
      the paca and on context switch, copies only those.
      
      Benchmarking this (On top of Anton's recent MSR context switching
      changes [1]) using processes and yield shows an improvement of almost
      3% on POWER8:
      
        http://ozlabs.org/~anton/junkcode/context_switch2.c
        ./context_switch2 --test=yield --process 0 0
      
      1. https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-October/135700.htmlSigned-off-by: NMichael Neuling <mikey@neuling.org>
      [mpe: Rename paca fields to be mm_ctx_foo rather than context_foo]
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      2fc251a8
  2. 19 12月, 2015 1 次提交
  3. 17 12月, 2015 31 次提交
  4. 16 12月, 2015 1 次提交
    • D
      powerpc: Remove broken GregorianDay() · 00b912b0
      Daniel Axtens 提交于
      GregorianDay() is supposed to calculate the day of the week
      (tm->tm_wday) for a given day/month/year. In that calcuation it
      indexed into an array called MonthOffset using tm->tm_mon-1. However
      tm_mon is zero-based, not one-based, so this is off-by-one. It also
      means that every January, GregoiranDay() will access element -1 of
      the MonthOffset array.
      
      It also doesn't appear to be a correct algorithm either: see in
      contrast kernel/time/timeconv.c's time_to_tm function.
      
      It's been broken forever, which suggests no-one in userland uses
      this. It looks like no-one in the kernel uses tm->tm_wday either
      (see e.g. drivers/rtc/rtc-ds1305.c:319).
      
      tm->tm_wday is conventionally set to -1 when not available in
      hardware so we can simply set it to -1 and drop the function.
      (There are over a dozen other drivers in drivers/rtc that do
      this.)
      
      Found using UBSAN.
      
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Andrew Morton <akpm@linux-foundation.org> # as an example of what UBSan finds.
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
      Cc: rtc-linux@googlegroups.com
      Signed-off-by: NDaniel Axtens <dja@axtens.net>
      Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      00b912b0
  5. 14 12月, 2015 4 次提交
    • R
      selftests/powerpc: Add test to check if VSRs are corrupted · 5f337e3e
      Rashmica Gupta 提交于
      When a transaction is aborted, VSR values should rollback to the
      checkpointed values before the transaction began. VSRs used elsewhere in
      the kernel during a transaction, or while the transaction is suspended
      should not affect the checkpointed values.
      
      Prior to the bug fix in commit d31626f7 ("powerpc: Don't corrupt
      transactional state when using FP/VMX in kernel") when VMX was requested
      by the kernel the .vr_state (which held the checkpointed state of VSRs
      before the transaction) was overwritten with the current state from
      outside the transation. Thus if the transaction did not complete, the
      VSR values would be "rolled back" to potentially incorrect values.
      Signed-off-by: NRashmica Gupta <rashmicy@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      5f337e3e
    • R
      powerpc/xmon: Append linux_banner to exception information in xmon. · eb925d64
      Rashmica Gupta 提交于
      Currently if you are in xmon without an oops etc. to view the kernel
      version you have to type "d $linux_banner" - not necessarily obvious. As
      this is useful information, append to the output of "e" command.
      
      Example output:
        $mon> e
        cpu 0x1: Vector: 0  at [c0000000f879ba80]
            pc: c000000000081718: sysrq_handle_xmon+0x68/0x80
            lr: c000000000081718: sysrq_handle_xmon+0x68/0x80
            sp: c0000000f879bbe0
           msr: 8000000000009033
          current = 0xc0000000f604d5c0
          paca    = 0xc00000000fdc0480	 softe: 0	 irq_happened: 0x01
            pid   = 2467, comm = bash
        Linux version 4.4.0-rc2-00008-gc51af91c3ab3-dirty (rashmica@circle) (gcc
        version 5.1.1 20150629 (GCC) ) #45 SMP Wed Nov 25 10:25:12 AEDT 2015
      Signed-off-by: NRashmica Gupta <rashmicy@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      eb925d64
    • R
      powerpc/cell: Remove the Cell QPACE code · 24ad1648
      Rashmica Gupta 提交于
      All users of QPACE have upgraded to QPACE2 so remove the Cell QPACE code.
      Signed-off-by: NRashmica Gupta <rashmicy@gmail.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      24ad1648
    • V
      powerpc/pseries: Limit EPOW reset event warnings · b4af279a
      Vipin K Parashar 提交于
      Kernel prints respective warnings about various EPOW events for
      user information/action after parsing EPOW interrupts. At times
      below EPOW reset event warning is seen to be flooding kernel log
      over a period of time.
      
      May 25 03:46:34 alp kernel: Non critical power or cooling issue cleared
      May 25 03:46:52 alp kernel: Non critical power or cooling issue cleared
      May 25 03:53:48 alp kernel: Non critical power or cooling issue cleared
      May 25 03:55:46 alp kernel: Non critical power or cooling issue cleared
      May 25 03:56:34 alp kernel: Non critical power or cooling issue cleared
      May 25 03:59:04 alp kernel: Non critical power or cooling issue cleared
      May 25 04:02:01 alp kernel: Non critical power or cooling issue cleared
      
      These EPOW reset events are spurious in nature and are triggered by
      firmware without an actual EPOW event being reset. This patch avoids these
      multiple EPOW reset warnings by using a counter variable. This variable
      is incremented every time an EPOW event is reported. Upon receiving a EPOW
      reset event the same variable is checked to filter out spurious events and
      decremented accordingly.
      
      This patch also improves log messages to better describe EPOW event being
      reported. Merged adjacent log messages into single one to reduce number of
      lines printed per event.
      Signed-off-by: NKamalesh Babulal <kamalesh@linux.vnet.ibm.com>
      Signed-off-by: NVipin K Parashar <vipin@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      b4af279a