1. 24 5月, 2020 4 次提交
  2. 23 5月, 2020 1 次提交
    • J
      x86/unwind/orc: Fix unwind_get_return_address_ptr() for inactive tasks · 187b96db
      Josh Poimboeuf 提交于
      Normally, show_trace_log_lvl() scans the stack, looking for text
      addresses to print.  In parallel, it unwinds the stack with
      unwind_next_frame().  If the stack address matches the pointer returned
      by unwind_get_return_address_ptr() for the current frame, the text
      address is printed normally without a question mark.  Otherwise it's
      considered a breadcrumb (potentially from a previous call path) and it's
      printed with a question mark to indicate that the address is unreliable
      and typically can be ignored.
      
      Since the following commit:
      
        f1d9a2ab ("x86/unwind/orc: Don't skip the first frame for inactive tasks")
      
      ... for inactive tasks, show_trace_log_lvl() prints *only* unreliable
      addresses (prepended with '?').
      
      That happens because, for the first frame of an inactive task,
      unwind_get_return_address_ptr() returns the wrong return address
      pointer: one word *below* the task stack pointer.  show_trace_log_lvl()
      starts scanning at the stack pointer itself, so it never finds the first
      'reliable' address, causing only guesses to being printed.
      
      The first frame of an inactive task isn't a normal stack frame.  It's
      actually just an instance of 'struct inactive_task_frame' which is left
      behind by __switch_to_asm().  Now that this inactive frame is actually
      exposed to callers, fix unwind_get_return_address_ptr() to interpret it
      properly.
      
      Fixes: f1d9a2ab ("x86/unwind/orc: Don't skip the first frame for inactive tasks")
      Reported-by: NTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: https://lkml.kernel.org/r/20200522135435.vbxs7umku5pyrdbk@treble
      187b96db
  3. 22 5月, 2020 2 次提交
  4. 21 5月, 2020 2 次提交
    • M
      powerpc/64s: Disable STRICT_KERNEL_RWX · 8659a0e0
      Michael Ellerman 提交于
      Several strange crashes have been eventually traced back to
      STRICT_KERNEL_RWX and its interaction with code patching.
      
      Various paths in our ftrace, kprobes and other patching code need to
      be hardened against patching failures, otherwise we can end up running
      with partially/incorrectly patched ftrace paths, kprobes or jump
      labels, which can then cause strange crashes.
      
      Although fixes for those are in development, they're not -rc material.
      
      There also seem to be problems with the underlying strict RWX logic,
      which needs further debugging.
      
      So for now disable STRICT_KERNEL_RWX on 64-bit to prevent people from
      enabling the option and tripping over the bugs.
      
      Fixes: 1e0fc9d1 ("powerpc/Kconfig: Enable STRICT_KERNEL_RWX for some configs")
      Cc: stable@vger.kernel.org # v4.13+
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20200520133605.972649-1-mpe@ellerman.id.au
      8659a0e0
    • K
      riscv: Fix print_vm_layout build error if NOMMU · 8fa3cdff
      Kefeng Wang 提交于
      arch/riscv/mm/init.c: In function ‘print_vm_layout’:
      arch/riscv/mm/init.c:68:37: error: ‘FIXADDR_START’ undeclared (first use in this function);
      arch/riscv/mm/init.c:69:20: error: ‘FIXADDR_TOP’ undeclared
      arch/riscv/mm/init.c:70:37: error: ‘PCI_IO_START’ undeclared
      arch/riscv/mm/init.c:71:20: error: ‘PCI_IO_END’ undeclared
      arch/riscv/mm/init.c:72:38: error: ‘VMEMMAP_START’ undeclared
      arch/riscv/mm/init.c:73:20: error: ‘VMEMMAP_END’ undeclared (first use in this function);
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Signed-off-by: NKefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: NPalmer Dabbelt <palmerdabbelt@google.com>
      8fa3cdff
  5. 20 5月, 2020 5 次提交
  6. 16 5月, 2020 1 次提交
  7. 15 5月, 2020 11 次提交
    • D
      bpf: Restrict bpf_probe_read{, str}() only to archs where they work · 0ebeea8c
      Daniel Borkmann 提交于
      Given the legacy bpf_probe_read{,str}() BPF helpers are broken on archs
      with overlapping address ranges, we should really take the next step to
      disable them from BPF use there.
      
      To generally fix the situation, we've recently added new helper variants
      bpf_probe_read_{user,kernel}() and bpf_probe_read_{user,kernel}_str().
      For details on them, see 6ae08ae3 ("bpf: Add probe_read_{user, kernel}
      and probe_read_{user,kernel}_str helpers").
      
      Given bpf_probe_read{,str}() have been around for ~5 years by now, there
      are plenty of users at least on x86 still relying on them today, so we
      cannot remove them entirely w/o breaking the BPF tracing ecosystem.
      
      However, their use should be restricted to archs with non-overlapping
      address ranges where they are working in their current form. Therefore,
      move this behind a CONFIG_ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE and
      have x86, arm64, arm select it (other archs supporting it can follow-up
      on it as well).
      
      For the remaining archs, they can workaround easily by relying on the
      feature probe from bpftool which spills out defines that can be used out
      of BPF C code to implement the drop-in replacement for old/new kernels
      via: bpftool feature probe macro
      Suggested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Reviewed-by: NMasami Hiramatsu <mhiramat@kernel.org>
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Link: https://lore.kernel.org/bpf/20200515101118.6508-2-daniel@iogearbox.net
      0ebeea8c
    • B
      x86: Fix early boot crash on gcc-10, third try · a9a3ed1e
      Borislav Petkov 提交于
      ... or the odyssey of trying to disable the stack protector for the
      function which generates the stack canary value.
      
      The whole story started with Sergei reporting a boot crash with a kernel
      built with gcc-10:
      
        Kernel panic — not syncing: stack-protector: Kernel stack is corrupted in: start_secondary
        CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.6.0-rc5—00235—gfffb08b3 #139
        Hardware name: Gigabyte Technology Co., Ltd. To be filled by O.E.M./H77M—D3H, BIOS F12 11/14/2013
        Call Trace:
          dump_stack
          panic
          ? start_secondary
          __stack_chk_fail
          start_secondary
          secondary_startup_64
        -—-[ end Kernel panic — not syncing: stack—protector: Kernel stack is corrupted in: start_secondary
      
      This happens because gcc-10 tail-call optimizes the last function call
      in start_secondary() - cpu_startup_entry() - and thus emits a stack
      canary check which fails because the canary value changes after the
      boot_init_stack_canary() call.
      
      To fix that, the initial attempt was to mark the one function which
      generates the stack canary with:
      
        __attribute__((optimize("-fno-stack-protector"))) ... start_secondary(void *unused)
      
      however, using the optimize attribute doesn't work cumulatively
      as the attribute does not add to but rather replaces previously
      supplied optimization options - roughly all -fxxx options.
      
      The key one among them being -fno-omit-frame-pointer and thus leading to
      not present frame pointer - frame pointer which the kernel needs.
      
      The next attempt to prevent compilers from tail-call optimizing
      the last function call cpu_startup_entry(), shy of carving out
      start_secondary() into a separate compilation unit and building it with
      -fno-stack-protector, was to add an empty asm("").
      
      This current solution was short and sweet, and reportedly, is supported
      by both compilers but we didn't get very far this time: future (LTO?)
      optimization passes could potentially eliminate this, which leads us
      to the third attempt: having an actual memory barrier there which the
      compiler cannot ignore or move around etc.
      
      That should hold for a long time, but hey we said that about the other
      two solutions too so...
      Reported-by: NSergei Trofimovich <slyfox@gentoo.org>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Tested-by: NKalle Valo <kvalo@codeaurora.org>
      Cc: <stable@vger.kernel.org>
      Link: https://lkml.kernel.org/r/20200314164451.346497-1-slyfox@gentoo.org
      a9a3ed1e
    • R
      ARM: dts: iwg20d-q7-dbcm-ca: Remove unneeded properties in hdmi@39 · c8e233bf
      Ricardo Cañuelo 提交于
      Remove the adi,input-style and adi,input-justification properties of
      hdmi@39 to make it compliant with the "adi,adv7511w" DT binding.
      Signed-off-by: NRicardo Cañuelo <ricardo.canuelo@collabora.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Link: https://lore.kernel.org/r/20200511110611.3142-6-ricardo.canuelo@collabora.comSigned-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      c8e233bf
    • R
      ARM: dts: renesas: Make hdmi encoder nodes compliant with DT bindings · 572f36d4
      Ricardo Cañuelo 提交于
      Small fixes to make these DTs compliant with the adi,adv7511w and
      adi,adv7513 bindings:
      
        r8a7745-iwg22d-sodimm-dbhd-ca.dts
        r8a7790-lager.dts
        r8a7790-stout.dts
        r8a7791-koelsch.dts
        r8a7791-porter.dts
        r8a7792-blanche.dts
        r8a7793-gose.dts
        r8a7794-silk.dts:
          Remove the adi,input-style and adi,input-justification properties.
      
        r8a7792-wheat.dts:
          Reorder the I2C slave addresses of hdmi@3d and hdmi@39 and remove
          the adi,input-style and adi,input-justification properties.
      Signed-off-by: NRicardo Cañuelo <ricardo.canuelo@collabora.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Link: https://lore.kernel.org/r/20200511110611.3142-3-ricardo.canuelo@collabora.comSigned-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      572f36d4
    • R
      arm64: dts: renesas: Make hdmi encoder nodes compliant with DT bindings · 72676ecf
      Ricardo Cañuelo 提交于
      Small fixes to make these DTs compliant with the adi,adv7511w binding.
      
        r8a77970-eagle.dts,
        r8a77970-v3msk.dts,
        r8a77980-condor.dts,
        r8a77980-v3hsk.dts,
        r8a77990-ebisu.dts:
          Remove the adi,input-style and adi,input-justification properties.
      
        r8a77995-draak.dts:
          Reorder the I2C slave addresses of the hdmi-encoder@39 node and
          remove the adi,input-style and adi,input-justification properties.
      Signed-off-by: NRicardo Cañuelo <ricardo.canuelo@collabora.com>
      Reviewed-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Link: https://lore.kernel.org/r/20200511110611.3142-2-ricardo.canuelo@collabora.comSigned-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      72676ecf
    • J
      x86/unwind/orc: Fix error handling in __unwind_start() · 71c95825
      Josh Poimboeuf 提交于
      The unwind_state 'error' field is used to inform the reliable unwinding
      code that the stack trace can't be trusted.  Set this field for all
      errors in __unwind_start().
      
      Also, move the zeroing out of the unwind_state struct to before the ORC
      table initialization check, to prevent the caller from reading
      uninitialized data if the ORC table is corrupted.
      
      Fixes: af085d90 ("stacktrace/x86: add function for detecting reliable stack traces")
      Fixes: d3a09104 ("x86/unwinder/orc: Dont bail on stack overflow")
      Fixes: 98d0c8eb ("x86/unwind/orc: Prevent unwinding before ORC initialization")
      Reported-by: NPavel Machek <pavel@denx.de>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: https://lkml.kernel.org/r/d6ac7215a84ca92b895fdd2e1aa546729417e6e6.1589487277.git.jpoimboe@redhat.com
      71c95825
    • V
      ARC: show_regs: avoid extra line of output · 79155023
      Vineet Gupta 提交于
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      79155023
    • P
      s390/kexec_file: fix initrd location for kdump kernel · 70b69054
      Philipp Rudo 提交于
      initrd_start must not point at the location the initrd is loaded into
      the crashkernel memory but at the location it will be after the
      crashkernel memory is swapped with the memory at 0.
      
      Fixes: ee337f54 ("s390/kexec_file: Add crash support to image loader")
      Reported-by: NLianbo Jiang <lijiang@redhat.com>
      Signed-off-by: NPhilipp Rudo <prudo@linux.ibm.com>
      Tested-by: NLianbo Jiang <lijiang@redhat.com>
      Link: https://lore.kernel.org/r/20200512193956.15ae3f23@laptop2-ibm.localSigned-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      70b69054
    • N
      s390/pci: Fix s390_mmio_read/write with MIO · f058599e
      Niklas Schnelle 提交于
      The s390_mmio_read/write syscalls are currently broken when running with
      MIO.
      
      The new pcistb_mio/pcstg_mio/pcilg_mio instructions are executed
      similiarly to normal load/store instructions and do address translation
      in the current address space. That means inside the kernel they are
      aware of mappings into kernel address space while outside the kernel
      they use user space mappings (usually created through mmap'ing a PCI
      device file).
      
      Now when existing user space applications use the s390_pci_mmio_write
      and s390_pci_mmio_read syscalls, they pass I/O addresses that are mapped
      into user space so as to be usable with the new instructions without
      needing a syscall. Accessing these addresses with the old instructions
      as done currently leads to a kernel panic.
      
      Also, for such a user space mapping there may not exist an equivalent
      kernel space mapping which means we can't just use the new instructions
      in kernel space.
      
      Instead of replicating user mappings in the kernel which then might
      collide with other mappings, we can conceptually execute the new
      instructions as if executed by the user space application using the
      secondary address space. This even allows us to directly store to the
      user pointer without the need for copy_to/from_user().
      
      Cc: stable@vger.kernel.org
      Fixes: 71ba41c9 ("s390/pci: provide support for MIO instructions")
      Signed-off-by: NNiklas Schnelle <schnelle@linux.ibm.com>
      Reviewed-by: NSven Schnelle <svens@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      f058599e
    • A
      csky: Fixup raw_copy_from_user() · 51bb38cb
      Al Viro 提交于
      If raw_copy_from_user(to, from, N) returns K, callers expect
      the first N - K bytes starting at to to have been replaced with
      the contents of corresponding area starting at from and the last
      K bytes of destination *left* *unmodified*.
      
      What arch/sky/lib/usercopy.c is doing is broken - it can lead to e.g.
      data corruption on write(2).
      
      raw_copy_to_user() is inaccurate about return value, which is a bug,
      but consequences are less drastic than for raw_copy_from_user().
      And just what are those access_ok() doing in there?  I mean, look into
      linux/uaccess.h; that's where we do that check (as well as zero tail
      on failure in the callers that need zeroing).
      
      AFAICS, all of that shouldn't be hard to fix; something like a patch
      below might make a useful starting point.
      
      I would suggest moving these macros into usercopy.c (they are never
      used anywhere else) and possibly expanding them there; if you leave
      them alive, please at least rename __copy_user_zeroing(). Again,
      it must not zero anything on failed read.
      
      Said that, I'm not sure we won't be better off simply turning
      usercopy.c into usercopy.S - all that is left there is a couple of
      functions, each consisting only of inline asm.
      
      Guo Ren reply:
      
      Yes, raw_copy_from_user is wrong, it's no need zeroing code.
      
      unsigned long _copy_from_user(void *to, const void __user *from,
      unsigned long n)
      {
              unsigned long res = n;
              might_fault();
              if (likely(access_ok(from, n))) {
                      kasan_check_write(to, n);
                      res = raw_copy_from_user(to, from, n);
              }
              if (unlikely(res))
                      memset(to + (n - res), 0, res);
              return res;
      }
      EXPORT_SYMBOL(_copy_from_user);
      
      You are right and access_ok() should be removed.
      
      but, how about:
      do {
      ...
              "2:     stw     %3, (%1, 0)     \n"             \
      +       "       subi    %0, 4          \n"               \
              "9:     stw     %4, (%1, 4)     \n"             \
      +       "       subi    %0, 4          \n"               \
              "10:    stw     %5, (%1, 8)     \n"             \
      +       "       subi    %0, 4          \n"               \
              "11:    stw     %6, (%1, 12)    \n"             \
      +       "       subi    %0, 4          \n"               \
              "       addi    %2, 16          \n"             \
              "       addi    %1, 16          \n"             \
      
      Don't expand __ex_table
      
      AI Viro reply:
      
      Hey, I've no idea about the instruction scheduling on csky -
      if that doesn't slow the things down, all the better.  It's just
      that copy_to_user() and friends are on fairly hot codepaths,
      and in quite a few situations they will dominate the speed of
      e.g. read(2).  So I tried to keep the fast path unchanged.
      Up to the architecture maintainers, obviously.  Which would be
      you...
      
      As for the fixups size increase (__ex_table size is unchanged)...
      You have each of those macros expanded exactly once.
      So the size is not a serious argument, IMO - useless complexity
      would be, if it is, in fact, useless; the size... not really,
      especially since those extra subi will at least offset it.
      
      Again, up to you - asm optimizations of (essentially)
      memcpy()-style loops are tricky and can depend upon the
      fairly subtle details of architecture.  So even on something
      I know reasonably well I would resort to direct experiments
      if I can't pass the buck to architecture maintainers.
      
      It *is* worth optimizing - this is where read() from a file
      that is already in page cache spends most of the time, etc.
      
      Guo Ren reply:
      
      Thx, after fixup some typo “sub %0, 4”, apply the patch.
      
      TODO:
       - user copy/from codes are still need optimizing.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      51bb38cb
    • G
      csky: Fixup gdbmacros.txt with name sp in thread_struct · 67002814
      Guo Ren 提交于
      The gdbmacros.txt use sp in thread_struct, but csky use ksp. This
      cause bttnobp fail to excute.
      
      TODO:
       - Still couldn't display the contents of stack.
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      67002814
  8. 14 5月, 2020 7 次提交
  9. 13 5月, 2020 7 次提交
    • B
      KVM: x86: Fix pkru save/restore when guest CR4.PKE=0, move it to x86.c · 37486135
      Babu Moger 提交于
      Though rdpkru and wrpkru are contingent upon CR4.PKE, the PKRU
      resource isn't. It can be read with XSAVE and written with XRSTOR.
      So, if we don't set the guest PKRU value here(kvm_load_guest_xsave_state),
      the guest can read the host value.
      
      In case of kvm_load_host_xsave_state, guest with CR4.PKE clear could
      potentially use XRSTOR to change the host PKRU value.
      
      While at it, move pkru state save/restore to common code and the
      host_pkru field to kvm_vcpu_arch.  This will let SVM support protection keys.
      
      Cc: stable@vger.kernel.org
      Reported-by: NJim Mattson <jmattson@google.com>
      Signed-off-by: NBabu Moger <babu.moger@amd.com>
      Message-Id: <158932794619.44260.14508381096663848853.stgit@naples-babu.amd.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      37486135
    • V
      x86/hyperv: Properly suspend/resume reenlightenment notifications · 38dce419
      Vitaly Kuznetsov 提交于
      Errors during hibernation with reenlightenment notifications enabled were
      reported:
      
       [   51.730435] PM: hibernation entry
       [   51.737435] PM: Syncing filesystems ...
       ...
       [   54.102216] Disabling non-boot CPUs ...
       [   54.106633] smpboot: CPU 1 is now offline
       [   54.110006] unchecked MSR access error: WRMSR to 0x40000106 (tried to
           write 0x47c72780000100ee) at rIP: 0xffffffff90062f24
           native_write_msr+0x4/0x20)
       [   54.110006] Call Trace:
       [   54.110006]  hv_cpu_die+0xd9/0xf0
       ...
      
      Normally, hv_cpu_die() just reassigns reenlightenment notifications to some
      other CPU when the CPU receiving them goes offline. Upon hibernation, there
      is no other CPU which is still online so cpumask_any_but(cpu_online_mask)
      returns >= nr_cpu_ids and using it as hv_vp_index index is incorrect.
      Disable the feature when cpumask_any_but() fails.
      
      Also, as we now disable reenlightenment notifications upon hibernation we
      need to restore them on resume. Check if hv_reenlightenment_cb was
      previously set and restore from hv_resume().
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Reviewed-by: NDexuan Cui <decui@microsoft.com>
      Reviewed-by: NTianyu Lan <Tianyu.Lan@microsoft.com>
      Link: https://lore.kernel.org/r/20200512160153.134467-1-vkuznets@redhat.comSigned-off-by: NWei Liu <wei.liu@kernel.org>
      38dce419
    • G
      csky: Fixup remove unnecessary save/restore PSR code · 9e2ca153
      Guo Ren 提交于
      All processes' PSR could success from SETUP_MMU, so need set it
      in INIT_THREAD again.
      
      And use a3 instead of r7 in __switch_to for code convention.
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      9e2ca153
    • L
      csky: Fixup remove duplicate irq_disable · 6633a5aa
      Liu Yibin 提交于
      Interrupt has been disabled in __schedule() with local_irq_disable()
      and enabled in finish_task_switch->finish_lock_switch() with
      local_irq_enabled(), So needn't to disable irq here.
      Signed-off-by: NLiu Yibin <jiulong@linux.alibaba.com>
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      6633a5aa
    • G
      csky: Fixup calltrace panic · 18c07d23
      Guo Ren 提交于
      The implementation of show_stack will panic with wrong fp:
      
      addr    = *fp++;
      
      because the fp isn't checked properly.
      
      The current implementations of show_stack, wchan and stack_trace
      haven't been designed properly, so just deprecate them.
      
      This patch is a reference to riscv's way, all codes are modified from
      arm's. The patch is passed with:
      
       - cat /proc/<pid>/stack
       - cat /proc/<pid>/wchan
       - echo c > /proc/sysrq-trigger
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      18c07d23
    • M
      csky: Fixup perf callchain unwind · 229a0dde
      Mao Han 提交于
       [ 5221.974084] Unable to handle kernel paging request at virtual address 0xfffff000, pc: 0x8002c18e
       [ 5221.985929] Oops: 00000000
       [ 5221.989488]
       [ 5221.989488] CURRENT PROCESS:
       [ 5221.989488]
       [ 5221.992877] COMM=callchain_test PID=11962
       [ 5221.995213] TEXT=00008000-000087e0 DATA=00009f1c-0000a018 BSS=0000a018-0000b000
       [ 5221.999037] USER-STACK=7fc18e20  KERNEL-STACK=be204680
       [ 5221.999037]
       [ 5222.003292] PC: 0x8002c18e (perf_callchain_kernel+0x3e/0xd4)
       [ 5222.007957] LR: 0x8002c198 (perf_callchain_kernel+0x48/0xd4)
       [ 5222.074873] Call Trace:
       [ 5222.074873] [<800a248e>] get_perf_callchain+0x20a/0x29c
       [ 5222.074873] [<8009d964>] perf_callchain+0x64/0x80
       [ 5222.074873] [<8009dc1c>] perf_prepare_sample+0x29c/0x4b8
       [ 5222.074873] [<8009de6e>] perf_event_output_forward+0x36/0x98
       [ 5222.074873] [<800497e0>] search_exception_tables+0x20/0x44
       [ 5222.074873] [<8002cbb6>] do_page_fault+0x92/0x378
       [ 5222.074873] [<80098608>] __perf_event_overflow+0x54/0xdc
       [ 5222.074873] [<80098778>] perf_swevent_hrtimer+0xe8/0x164
       [ 5222.074873] [<8002ddd0>] update_mmu_cache+0x0/0xd8
       [ 5222.074873] [<8002c014>] user_backtrace+0x58/0xc4
       [ 5222.074873] [<8002c0b4>] perf_callchain_user+0x34/0xd0
       [ 5222.074873] [<800a2442>] get_perf_callchain+0x1be/0x29c
       [ 5222.074873] [<8009d964>] perf_callchain+0x64/0x80
       [ 5222.074873] [<8009d834>] perf_output_sample+0x78c/0x858
       [ 5222.074873] [<8009dc1c>] perf_prepare_sample+0x29c/0x4b8
       [ 5222.074873] [<8009de94>] perf_event_output_forward+0x5c/0x98
       [ 5222.097846]
       [ 5222.097846] [<800a0300>] perf_event_exit_task+0x58/0x43c
       [ 5222.097846] [<8006c874>] hrtimer_interrupt+0x104/0x2ec
       [ 5222.097846] [<800a0300>] perf_event_exit_task+0x58/0x43c
       [ 5222.097846] [<80437bb6>] dw_apb_clockevent_irq+0x2a/0x4c
       [ 5222.097846] [<8006c770>] hrtimer_interrupt+0x0/0x2ec
       [ 5222.097846] [<8005f2e4>] __handle_irq_event_percpu+0xac/0x19c
       [ 5222.097846] [<80437bb6>] dw_apb_clockevent_irq+0x2a/0x4c
       [ 5222.097846] [<8005f408>] handle_irq_event_percpu+0x34/0x88
       [ 5222.097846] [<8005f480>] handle_irq_event+0x24/0x64
       [ 5222.097846] [<8006218c>] handle_level_irq+0x68/0xdc
       [ 5222.097846] [<8005ec76>] __handle_domain_irq+0x56/0xa8
       [ 5222.097846] [<80450e90>] ck_irq_handler+0xac/0xe4
       [ 5222.097846] [<80029012>] csky_do_IRQ+0x12/0x24
       [ 5222.097846] [<8002a3a0>] csky_irq+0x70/0x80
       [ 5222.097846] [<800ca612>] alloc_set_pte+0xd2/0x238
       [ 5222.097846] [<8002ddd0>] update_mmu_cache+0x0/0xd8
       [ 5222.097846] [<800a0340>] perf_event_exit_task+0x98/0x43c
      
      The original fp check doesn't base on the real kernal stack region.
      Invalid fp address may cause kernel panic.
      Signed-off-by: NMao Han <han_mao@linux.alibaba.com>
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      229a0dde
    • L
      csky: Fixup msa highest 3 bits mask · 165f2d28
      Liu Yibin 提交于
      Just as comment mentioned, the msa format:
      
       cr<30/31, 15> MSA register format:
       31 - 29 | 28 - 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
         BA     Reserved  SH  WA  B   SO SEC  C   D   V
      
      So we should shift 29 bits not 28 bits for mask
      Signed-off-by: NLiu Yibin <jiulong@linux.alibaba.com>
      Signed-off-by: NGuo Ren <guoren@linux.alibaba.com>
      165f2d28