1. 03 6月, 2021 4 次提交
    • G
      arm32: kaslr: Bugfix of fiq when enabled kaslr · 06b8b107
      Gaosheng Cui 提交于
      hulk inclusion
      category: bugfix
      bugzilla: 51838
      CVE: NA
      
      ------------------------------------------------------------------------
      
      Fix vector fiq offset when enabled kaslr, we need to get the real symbol
      address according to __kaslr_offset, otherwise the fiq interrupt will
      fail to register.
      Signed-off-by: NGaosheng Cui <cuigaosheng1@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      06b8b107
    • L
      perf kmem: Do not pass additional arguments to 'perf record' · 3c17e7f0
      Li Huafei 提交于
      hulk inclusion
      category: bugfix
      bugzilla: 51797
      CVE: NA
      
      --------------------------------
      
      The commit be8299e4 passes additional arguments directly to the
      'perf record' to support the '-o' option. If used in the current
      format of the'perf kmem --help' command, there is no problem. But
      we're used to using this: 'perf kmem record --slab --page', where the
      subcommand is placed before the option. After the commit be8299e4,
      there is a problem with this use:
      
        # perf kmem record --slab --page
         Error: unknown option `slab'
      
        Usage: perf record [<options>] [<command>]
           or: perf record [<options>] -- <command> [<options>]
      
           -a, --all-cpus        system-wide collection from all CPUs
           -b, --branch-any      sample any taken branches
           -B, --no-buildid      do not collect buildids in perf.data
           -c, --count <n>       event period to sample
           -C, --cpu <cpu>       list of cpus to monitor
           -d, --data            Record the sample addresses
           ...
      
      This is because we pass all the options directly to 'perf record', but
      these options are 'perf kmem' options. In order to be able to use the
      format 'perf kmem {record|stat} [option]', we revert the commit be8299e4.
      In order to still support the '-o' option, we first process the '-o' option
      in 'perf kmem' and then add it to the list of options in'perf record'.
      
      Fixes: be8299e4("perf kmem: Pass additional arguments to 'perf record'")
      Signed-off-by: NLi Huafei <lihuafei1@huawei.com>
      Reviewed-by: NYang Jihong <yangjihong1@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      3c17e7f0
    • Y
      arm_pmu: Fix write counter error in ARMv7 big-endian mode · fbdb75a8
      Yang Jihong 提交于
      hulk inclusion
      category: bugfix
      bugzilla: 51829
      CVE: NA
      
      --------------------------------
      
      Commit 3a95200d ("arm_pmu: Change API to support 64bit counter values")
      changes the input "value" type from 32-bit to 64-bit,
      which introduces the following problem:
      ARMv7 PMU counters is 32-bit width, in big-endian mode, write counter uses
      high 32-bit, which writes an incorrect value.
      
      Before:
      
       Performance counter stats for 'ls':
      
                    2.22 msec task-clock                #    0.675 CPUs utilized
                       0      context-switches          #    0.000 K/sec
                       0      cpu-migrations            #    0.000 K/sec
                      49      page-faults               #    0.022 M/sec
              2150476593      cycles                    #  966.663 GHz
              2148588788      instructions              #    1.00  insn per cycle
              2147745484      branches                  # 965435.074 M/sec
              2147508540      branch-misses             #   99.99% of all branches
      
      None of the above hw event counters are correct.
      
      After:
      
       Performance counter stats for 'ls':
      
                    2.09 msec task-clock                #    0.681 CPUs utilized
                       0      context-switches          #    0.000 K/sec
                       0      cpu-migrations            #    0.000 K/sec
                      46      page-faults               #    0.022 M/sec
                 2807301      cycles                    #    1.344 GHz
                 1060159      instructions              #    0.38  insn per cycle
                  250496      branches                  #  119.914 M/sec
                   23192      branch-misses             #    9.26% of all branches
      
      Solution:
      
      "value" is forcibly converted to 32-bit type before being written to PMU register.
      
      Fixes: 3a95200d ("arm_pmu: Change API to support 64bit counter values")
      Signed-off-by: NYang Jihong <yangjihong1@huawei.com>
      Reviewed-by: NKuohai Xu <xukuohai@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      fbdb75a8
    • C
      kdump: replace memblock_phys_alloc_range() with memblock_find_in_range() + memblock_reserve() · d23c9a9b
      Chen Zhou 提交于
      hulk inclusion
      category: bugfix
      bugzilla: 47954
      CVE: NA
      
      ---------------------------------------
      
      When kdump and kmemleak are enabled at the same time, the system may
      oops.
      Replace memblock_phys_alloc_range() with memblock_find_in_range() +
      memblock_reserve() to fix this.
      Signed-off-by: NChen Zhou <chenzhou10@huawei.com>
      Reviewed-by: NJing Xiangfeng <jingxiangfeng@huawei.com>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      d23c9a9b
  2. 26 4月, 2021 36 次提交