1. 04 Oct, 2022 1 commit
    • Li Huafei's avatar
      ARM: 9233/1: stacktrace: Skip frame pointer boundary check for call_with_stack() · 5854e4d8
      Li Huafei authored
      When using the frame pointer unwinder, it was found that the stack trace
      output of stack_trace_save() is incomplete if the stack contains
      call_with_stack():
      
       [0x7f00002c] dump_stack_task+0x2c/0x90 [hrtimer]
       [0x7f0000a0] hrtimer_hander+0x10/0x18 [hrtimer]
       [0x801a67f0] __hrtimer_run_queues+0x1b0/0x3b4
       [0x801a7350] hrtimer_run_queues+0xc4/0xd8
       [0x801a597c] update_process_times+0x3c/0x88
       [0x801b5a98] tick_periodic+0x50/0xd8
       [0x801b5bf4] tick_handle_periodic+0x24/0x84
       [0x8010ffc4] twd_handler+0x38/0x48
       [0x8017d220] handle_percpu_devid_irq+0xa8/0x244
       [0x80176e9c] generic_handle_domain_irq+0x2c/0x3c
       [0x8052e3a8] gic_handle_irq+0x7c/0x90
       [0x808ab15c] generic_handle_arch_irq+0x60/0x80
       [0x8051191c] call_with_stack+0x1c/0x20
      
      For the frame pointer unwinder, unwind_frame() checks stackframe::fp by
      stackframe::sp. Since call_with_stack() switches the SP from one stack
      to another, stackframe::fp and stackframe: :sp will point to different
      stacks, so we can no longer check stackframe::fp by stackframe::sp. Skip
      checking stackframe::fp at this point to avoid this problem.
      Signed-off-by: default avatarLi Huafei <lihuafei1@huawei.com>
      Reviewed-by: default avatarLinus Waleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      5854e4d8
  2. 22 Sep, 2022 1 commit
    • Zhen Lei's avatar
      ARM: 9224/1: Dump the stack traces based on the parameter 'regs' of show_regs() · 09cffeca
      Zhen Lei authored
      Function show_regs() is usually called in interrupt handler or exception
      handler, it prints the registers specified by the parameter 'regs', then
      dump the stack traces. Although not explicitly documented, dump the stack
      traces based on'regs' seems to make the most sense. Although dump_stack()
      can finally dump the desired content, because 'regs' are saved by the
      entry of current interrupt or exception. In the following example we can
      see: 1) The backtrace of interrupt or exception handler is not expected,
      it causes confusion. 2) Something is printed repeatedly. The line with
      the kernel version "CPU: 0 PID: 70 Comm: test0 Not tainted 5.19.0+ #8",
      the registers saved in "Exception stack" which 'regs' actually point to.
      
      For example:
      rcu: INFO: rcu_sched self-detected stall on CPU
      rcu:    0-....: (499 ticks this GP) idle=379/1/0x40000002 softirq=91/91 fqs=249
              (t=500 jiffies g=-911 q=13 ncpus=4)
      CPU: 0 PID: 70 Comm: test0 Not tainted 5.19.0+ #8
      Hardware name: ARM-Versatile Express
      PC is at ktime_get+0x4c/0xe8
      LR is at ktime_get+0x4c/0xe8
      pc : 8019a474  lr : 8019a474  psr: 60000013
      sp : cabd1f28  ip : 00000001  fp : 00000005
      r10: 527bf1b8  r9 : 431bde82  r8 : d7b634db
      r7 : 0000156e  r6 : 61f234f8  r5 : 00000001  r4 : 80ca86c0
      r3 : ffffffff  r2 : fe5bce0b  r1 : 00000000  r0 : 01a431f4
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
      Control: 10c5387d  Table: 6121406a  DAC: 00000051
      CPU: 0 PID: 70 Comm: test0 Not tainted 5.19.0+ #8  <-----------start----------
      Hardware name: ARM-Versatile Express                                          |
       unwind_backtrace from show_stack+0x10/0x14                                   |
       show_stack from dump_stack_lvl+0x40/0x4c                                     |
       dump_stack_lvl from rcu_dump_cpu_stacks+0x10c/0x134                          |
       rcu_dump_cpu_stacks from rcu_sched_clock_irq+0x780/0xaf4                     |
       rcu_sched_clock_irq from update_process_times+0x54/0x74                      |
       update_process_times from tick_periodic+0x3c/0xd4                            |
       tick_periodic from tick_handle_periodic+0x20/0x80                       worthless
       tick_handle_periodic from twd_handler+0x30/0x40                             or
       twd_handler from handle_percpu_devid_irq+0x8c/0x1c8                    duplicated
       handle_percpu_devid_irq from generic_handle_domain_irq+0x24/0x34             |
       generic_handle_domain_irq from gic_handle_irq+0x74/0x88                      |
       gic_handle_irq from generic_handle_arch_irq+0x34/0x44                        |
       generic_handle_arch_irq from call_with_stack+0x18/0x20                       |
       call_with_stack from __irq_svc+0x98/0xb0                                     |
      Exception stack(0xcabd1ed8 to 0xcabd1f20)                                     |
      1ec0:                                                       01a431f4 00000000 |
      1ee0: fe5bce0b ffffffff 80ca86c0 00000001 61f234f8 0000156e d7b634db 431bde82 |
      1f00: 527bf1b8 00000005 00000001 cabd1f28 8019a474 8019a474 60000013 ffffffff |
       __irq_svc from ktime_get+0x4c/0xe8                 <---------end--------------
       ktime_get from test_task+0x44/0x110
       test_task from kthread+0xd8/0xf4
       kthread from ret_from_fork+0x14/0x2c
      Exception stack(0xcabd1fb0 to 0xcabd1ff8)
      1fa0:                                     00000000 00000000 00000000 00000000
      1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
      
      After replacing dump_stack() with dump_backtrace():
      rcu: INFO: rcu_sched self-detected stall on CPU
      rcu:    0-....: (500 ticks this GP) idle=8f7/1/0x40000002 softirq=129/129 fqs=241
              (t=500 jiffies g=-915 q=13 ncpus=4)
      CPU: 0 PID: 69 Comm: test0 Not tainted 5.19.0+ #9
      Hardware name: ARM-Versatile Express
      PC is at ktime_get+0x4c/0xe8
      LR is at ktime_get+0x4c/0xe8
      pc : 8019a494  lr : 8019a494  psr: 60000013
      sp : cabddf28  ip : 00000001  fp : 00000002
      r10: 0779cb48  r9 : 431bde82  r8 : d7b634db
      r7 : 00000a66  r6 : e835ab70  r5 : 00000001  r4 : 80ca86c0
      r3 : ffffffff  r2 : ff337d39  r1 : 00000000  r0 : 00cc82c6
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
      Control: 10c5387d  Table: 611d006a  DAC: 00000051
       ktime_get from test_task+0x44/0x110
       test_task from kthread+0xd8/0xf4
       kthread from ret_from_fork+0x14/0x2c
      Exception stack(0xcabddfb0 to 0xcabddff8)
      dfa0:                                     00000000 00000000 00000000 00000000
      dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
      Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
      Signed-off-by: default avatarRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
      09cffeca
  3. 31 Aug, 2022 3 commits
  4. 30 Aug, 2022 1 commit
  5. 28 Aug, 2022 25 commits
  6. 27 Aug, 2022 9 commits
    • Linus Torvalds's avatar
      Merge tag 'thermal-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 10d4879f
      Linus Torvalds authored
      Pull thermal control fixes from Rafael Wysocki:
       "Fix two issues introduced recently and one driver problem leading to a
        NULL pointer dereference in some cases.
      
        Specifics:
      
         - Add missing EXPORT_SYMBOL_GPL in the thermal core and add back the
           required 'trips' property to the thermal zone DT bindings (Daniel
           Lezcano)
      
         - Prevent the int340x_thermal driver from crashing when a package
           with a buffer of 0 length is returned by an ACPI control method
           evaluated by it (Lee, Chun-Yi)"
      
      * tag 'thermal-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        thermal/int340x_thermal: handle data_vault when the value is ZERO_SIZE_PTR
        dt-bindings: thermal: Fix missing required property
        thermal/core: Add missing EXPORT_SYMBOL_GPL
      10d4879f
    • Linus Torvalds's avatar
      Merge tag 'pm-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · b98f602d
      Linus Torvalds authored
      Pull power management fix from Rafael Wysocki:
       "Make __resolve_freq() check the presence of the frequency table
        instead of checking whether or not the ->target_index() callback is
        implemented by the driver, because that need not be the case when
        __resolve_freq() is used (Lukasz Luba)"
      
      * tag 'pm-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: check only freq_table in __resolve_freq()
      b98f602d
    • Linus Torvalds's avatar
      Merge tag 'acpi-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 2b1ddb59
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix issues introduced by recent changes related to the handling
        of ACPI device properties and a coding mistake in the exit path of the
        ACPI processor driver.
      
        Specifics:
      
         - Prevent acpi_thermal_cpufreq_exit() from attempting to remove
           the same frequency QoS request multiple times (Riwen Lu)
      
         - Fix type detection for integer ACPI device properties (Stefan
           Binding)
      
         - Avoid emitting false-positive warnings when processing ACPI
           device properties and drop the useless default case from the
           acpi_copy_property_array_uint() macro (Sakari Ailus)"
      
      * tag 'acpi-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: property: Remove default association from integer maximum values
        ACPI: property: Ignore already existing data node tags
        ACPI: property: Fix type detection of unified integer reading functions
        ACPI: processor: Remove freq Qos request for all CPUs
      2b1ddb59
    • Linus Torvalds's avatar
      Merge tag 's390-6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · dee18737
      Linus Torvalds authored
      Pull s390 fixes from Vasily Gorbik:
      
       - Fix double free of guarded storage and runtime instrumentation
         control blocks on fork() failure
      
       - Fix triggering write fault when VMA does not allow VM_WRITE
      
      * tag 's390-6.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/mm: do not trigger write fault when vma does not allow VM_WRITE
        s390: fix double free of GS and RI CBs on fork() failure
      dee18737
    • Linus Torvalds's avatar
      Merge tag 'for-linus-6.0-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · 05519f24
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
      
       - two minor cleanups
      
       - a fix of the xen/privcmd driver avoiding a possible NULL dereference
         in an error case
      
      * tag 'for-linus-6.0-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen/privcmd: fix error exit of privcmd_ioctl_dm_op()
        xen: move from strlcpy with unused retval to strscpy
        xen: x86: remove setting the obsolete config XEN_MAX_DOMAIN_MEMORY
      05519f24
    • Linus Torvalds's avatar
      Merge tag 'audit-pr-20220826' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit · 17b28d42
      Linus Torvalds authored
      Pull audit fix from Paul Moore:
       "Another small audit patch, this time to fix a bug where the return
        codes were not properly set before the audit filters were run,
        potentially resulting in missed audit records"
      
      * tag 'audit-pr-20220826' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit:
        audit: move audit_return_fixup before the filters
      17b28d42
    • Linus Torvalds's avatar
      Merge tag 'fbdev-for-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev · 89b749d8
      Linus Torvalds authored
      Pull fbdev fixes and updates from Helge Deller:
       "Mostly just small patches, with the exception of the bigger indenting
        cleanups in the sisfb and radeonfb drivers.
      
        Two patches should be mentioned though: A fix-up for fbdev if the
        screen resize fails (by Shigeru Yoshida), and a potential divide by
        zero fix in fb_pm2fb (by Letu Ren).
      
        Summary:
      
        Major fixes:
         - Revert the changes for fbcon console when vc_resize() fails
           [Shigeru Yoshida]
         - Avoid a potential divide by zero error in fb_pm2fb [Letu Ren]
      
        Minor fixes:
         - Add missing pci_disable_device() in chipsfb_pci_init() [Yang
           Yingliang]
         - Fix tests for platform_get_irq() failure in omapfb [Yu Zhe]
         - Destroy mutex on freeing struct fb_info in fbsysfs [Shigeru
           Yoshida]
      
        Cleanups:
         - Move fbdev drivers from strlcpy to strscpy [Wolfram Sang]
         - Indenting fixes, comment fixes, ... [Jiapeng Chong & Jilin Yuan]"
      
      * tag 'fbdev-for-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
        fbdev: fbcon: Properly revert changes when vc_resize() failed
        fbdev: Move fbdev drivers from strlcpy to strscpy
        fbdev: omap: Remove unnecessary print function dev_err()
        fbdev: chipsfb: Add missing pci_disable_device() in chipsfb_pci_init()
        fbdev: fbcon: Destroy mutex on freeing struct fb_info
        fbdev: radeon: Clean up some inconsistent indenting
        fbdev: sisfb: Clean up some inconsistent indenting
        fbdev: fb_pm2fb: Avoid potential divide by zero error
        fbdev: ssd1307fb: Fix repeated words in comments
        fbdev: omapfb: Fix tests for platform_get_irq() failure
      89b749d8
    • Mikulas Patocka's avatar
      provide arch_test_bit_acquire for architectures that define test_bit · d6ffe606
      Mikulas Patocka authored
      Some architectures define their own arch_test_bit and they also need
      arch_test_bit_acquire, otherwise they won't compile.  We also clean up
      the code by using the generic test_bit if that is equivalent to the
      arch-specific version.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Cc: stable@vger.kernel.org
      Fixes: 8238b457 ("wait_on_bit: add an acquire memory barrier")
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d6ffe606
    • Zhengjun Xing's avatar
      perf stat: Capitalize topdown metrics' names · 48648548
      Zhengjun Xing authored
      Capitalize topdown metrics' names to follow the intel SDM.
      
      Before:
      
       # ./perf stat -a  sleep 1
      
       Performance counter stats for 'system wide':
      
              228,094.05 msec cpu-clock                        #  225.026 CPUs utilized
                     842      context-switches                 #    3.691 /sec
                     224      cpu-migrations                   #    0.982 /sec
                      70      page-faults                      #    0.307 /sec
              23,164,105      cycles                           #    0.000 GHz
              29,403,446      instructions                     #    1.27  insn per cycle
               5,268,185      branches                         #   23.097 K/sec
                  33,239      branch-misses                    #    0.63% of all branches
             136,248,990      slots                            #  597.337 K/sec
              32,976,450      topdown-retiring                 #     24.2% retiring
               4,651,918      topdown-bad-spec                 #      3.4% bad speculation
              26,148,695      topdown-fe-bound                 #     19.2% frontend bound
              72,515,776      topdown-be-bound                 #     53.2% backend bound
               6,008,540      topdown-heavy-ops                #      4.4% heavy operations       #     19.8% light operations
               3,934,049      topdown-br-mispredict            #      2.9% branch mispredict      #      0.5% machine clears
              16,655,439      topdown-fetch-lat                #     12.2% fetch latency          #      7.0% fetch bandwidth
              41,635,972      topdown-mem-bound                #     30.5% memory bound           #     22.7% Core bound
      
             1.013634593 seconds time elapsed
      
      After:
      
       # ./perf stat -a  sleep 1
      
       Performance counter stats for 'system wide':
      
              228,081.94 msec cpu-clock                        #  225.003 CPUs utilized
                     824      context-switches                 #    3.613 /sec
                     224      cpu-migrations                   #    0.982 /sec
                      67      page-faults                      #    0.294 /sec
              22,647,423      cycles                           #    0.000 GHz
              28,870,551      instructions                     #    1.27  insn per cycle
               5,167,099      branches                         #   22.655 K/sec
                  32,383      branch-misses                    #    0.63% of all branches
             133,411,074      slots                            #  584.926 K/sec
              32,352,607      topdown-retiring                 #     24.3% Retiring
               4,456,977      topdown-bad-spec                 #      3.3% Bad Speculation
              25,626,487      topdown-fe-bound                 #     19.2% Frontend Bound
              70,955,316      topdown-be-bound                 #     53.2% Backend Bound
               5,834,844      topdown-heavy-ops                #      4.4% Heavy Operations       #     19.9% Light Operations
               3,738,781      topdown-br-mispredict            #      2.8% Branch Mispredict      #      0.5% Machine Clears
              16,286,803      topdown-fetch-lat                #     12.2% Fetch Latency          #      7.0% Fetch Bandwidth
              40,802,069      topdown-mem-bound                #     30.6% Memory Bound           #     22.6% Core Bound
      
             1.013683125 seconds time elapsed
      Reviewed-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Signed-off-by: default avatarXing Zhengjun <zhengjun.xing@linux.intel.com>
      Acked-by: default avatarIan Rogers <irogers@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: https://lore.kernel.org/r/20220825015458.3252239-1-zhengjun.xing@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      48648548