Skip to content
  1. Apr 22, 2019
    • Guo Ren's avatar
      csky/syscall_trace: Fixup return processing flow · a691f333
      Guo Ren authored
      
      
      The function tracehook_report_syscall_entry's return value is
      __must_check attribute. We should add return processing flow in
      ptrace.c and set the syscall number to -1 when failed just like
      riscv's.
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      2 tags
      a691f333
    • Guo Ren's avatar
      csky: Fixup compile warning · 1a23710c
      Guo Ren authored
      
      
      The function of __va() will return "void *", but the pgd_base is
      unsigned long.
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      1a23710c
    • Mao Han's avatar
      csky: Add support for perf registers sampling · daac95e7
      Mao Han authored
      
      
      This patch implements the perf registers sampling and validation API
      for csky arch. The valid registers and their register ID are defined in
      perf_regs.h. Perf tool can backtrace in userspace with unwind library
      and the registers/user stack dump support.
      
      Signed-off-by: default avatarMao Han <han_mao@c-sky.com>
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      daac95e7
    • Mao Han's avatar
      csky: add page fault perf event support · 0eaf50de
      Mao Han authored
      
      
      This patch add support for page fault count, major fault count
      and minorfault count. Without this patch page faults are not
      sampled for perf event.
      
      Performance counter stats for '/usr/lib/perf-test/callchain_test':
      	0      page-faults               #    0.000 K/sec
      
      Signed-off-by: default avatarMao Han <han_mao@c-sky.com>
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      0eaf50de
    • Guo Ren's avatar
      csky: Use va_pa_offset instead of phys_offset · 683fafeb
      Guo Ren authored
      
      
      The name of phys_offset is so common for global export and it may
      conflict with some local name. So change phys_offset to va_pa_offset
      which also used by riscv.
      
      Also use __pa() and __va() instead of using phys_offset directly.
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      683fafeb
    • Guo Ren's avatar
      csky: Support vmlinux bootup with MMU off · 205353fa
      Guo Ren authored
      
      
      Modify SETUP_MMU macro to fit on both MMU-on or MMU-off enviornment
      and vmlinux could bootup from MMU off enviornment for some cases.
      
      Unify the style of _start and _start_smp_secondary in head.S to make
      head.S looks more concise and easy to understand.
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      205353fa
    • Mao Han's avatar
      csky: Add perf_arch_fetch_caller_regs support · b4bf2741
      Mao Han authored
      
      
      In trace events as tracepoints context are not able to
      be retrieve with task_pt_regs. Without arch caller regs
      support the pt_regs context will be all zero, perf can
      not parsing the callchain and resolving the symbols
      correctly, some time will even get into deadlock
      while handling the page fault, eg:
      
      perf kmem —page record ls
      
      Changelog
       - Add test case cmd in comment
       - Use regs_fp(regs) which is defined in abi/regdef.h
      
      Signed-off-by: default avatarMao Han <han_mao@c-sky.com>
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      b4bf2741
    • Guo Ren's avatar
      csky: Fixup wrong update_mmu_cache implementation · 981bbf27
      Guo Ren authored
      
      
      In our stress test, we found some crash problem caused by:
      
      if (!(vma->vm_flags & VM_EXEC))
      	return;
      
      in update_mmu_cache().
      
      Seems current update_mmu_cache implementation is wrong and we retread
      to the conservative implementation.
      
      Also the usage of kmap_atomic in update_mmu_cache is risky, page-virtual
      may be scheduled out and changed, so we must use preempt_disable &
      pagefault_disable which is called by kmap_atomic().
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      981bbf27
    • Guo Ren's avatar
      csky: Support dynamic start physical address · f62e3162
      Guo Ren authored
      
      
      Before this patch csky-linux need CONFIG_RAM_BASE to determine start
      physical address. Now we use phys_offset variable to replace the macro
      of PHYS_OFFSET and we setup phys_offset with real physical address which
      is determined during startup in head.S.
      
      With this patch we needn't re-compile kernel for different start
      physical address. ie: 0x0 / 0xc0000000 start physical address could use
      the same vmlinux, be care different start address must be 512MB aligned.
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      f62e3162
    • Guo Ren's avatar
      csky: Reconstruct signal processing · bf241682
      Guo Ren authored
      
      
      Linux kernel has provided some apis for arch signal's implementation.
      For example:
      	restore_saved_sigmask()
      	set_current_blocked()
      	restore_altstack()
      
      But in last version of csky signal.c didn't use them and some codes are
      confusing, so reconstruct signal.c with reference to riscv's code.
      
      Now csky signal.c implementation are very close to riscv and we can
      get the following benefits:
       - Clear code structure
       - The signal code of riscv and csky can be reviewed together
       - Promoting the unification of arch's signal implementation
      
      Also modified the related code in entry.S
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      bf241682
    • Guo Ren's avatar
      csky: Use in_syscall & forget_syscall instead of r11_sig · f4625ee0
      Guo Ren authored
      
      
      We could use regs->sr 16-24 bits to detect syscall: VEC_TRAP0 and
      r11_sig is no necessary for current implementation.
      
      In this patch, we implement the in_syscall and forget_syscall which are
      inspired from arm & nds32, but csky pt_regs has no syscall_num element
      and we just set zero to regs->sr's vector-bits-field instead.
      
      For ret_from_fork, current task was forked from parent which is in syscall
      progress and its regs->sr has been already setted with VEC_TRAP0. See:
      arch/csky/kernel/process.c: copy_thread()
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      f4625ee0
    • Guo Ren's avatar
      csky: Add non-uapi asm/ptrace.h namespace · f335b10f
      Guo Ren authored
      
      
      Move #ifdef __KERNEL__ code in the uapi namespace to non-uapi
      include/asm/ptrace.h namespace and remove #ifdef __KERNEL__ in
      include/asm/ptrace.h. Seperate ptrace.h in uapi and non-uapi is more
      common and clear.
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Dmitry V. Levin <ldv@altlinux.org>
      f335b10f
    • Jagadeesh Pagadala's avatar
      csky: mm/fault.c: Remove duplicate header · ce63cd5b
      Jagadeesh Pagadala authored
      
      
      Remove duplicate header which is included twice.
      
      Signed-off-by: default avatarJagadeesh Pagadala <jagdsh.linux@gmail.com>
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      ce63cd5b
    • Masahiro Yamada's avatar
      csky: remove redundant generic-y · 1b2707fb
      Masahiro Yamada authored
      
      
      Since commit 7cbbbb8b ("kbuild: warn redundant generic-y"),
      redundant generic-y is reported. I missed to delete this one.
      
      scripts/Makefile.asm-generic:25: redundant generic-y found in arch/csky/include/asm/Kbuild: ftrace.h
      
      In this case, csky-specific implementation exists in
      arch/csky/include/asm/ftrace.h
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      1b2707fb
    • Guo Ren's avatar
      csky: Update syscall_trace_enter/exit implementation · 2f7932b0
      Guo Ren authored
      
      
      Previous syscall_trace implementation couldn't support AUDITSYSCALL and
      SYSCALL_TRACEPOINTS. Now we redesign it to support audit_syscall
      and syscall_tracepoints just like other archs'.
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Dmitry V. Levin <ldv@altlinux.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      2f7932b0
    • Mao Han's avatar
      csky: Add perf callchain support · cfa4d93b
      Mao Han authored
      
      
      This patch add support for perf callchain sampling on csky platform.
      As fp is used to unwind the stack, the program being sampled and the
      C library need to be compiled with -mbacktrace for user callchains,
      kernel callchains require CONFIG_STACKTRACE = y.
      
      Changelog:
       - Coding convention with Christoph's advice for riscv's.
      
      Signed-off-by: default avatarMao Han <han_mao@c-sky.com>
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      cfa4d93b
    • Guo Ren's avatar
      csky/ftrace: Add dynamic function tracer (include graph tracer) · 28bb030f
      Guo Ren authored
      
      
      Support dynamic ftrace including dynamic graph tracer. Gcc-csky with -pg
      will produce call site in every function prologue and we can use these
      call site to hook trace function.
      
      gcc with -pg origin call site:
      	push	lr
      	jbsr	_mcount
      	nop32
      	nop32
      
      If the (callee - caller)'s offset is in range of bsr instruction, we'll
      modify code with:
      	push	lr
      	bsr	_mcount
      	nop32
      	nop32
      Else if the (callee - caller)'s offset is out of bsr instrunction, we'll
      modify code with:
      	push	lr
      	movih	r26, ...
      	ori	r26, ...
      	jsr	r26
      
      (r26 is reserved for jsr link reg in csky abiv2 spec.)
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      28bb030f
    • Guo Ren's avatar
      csky: Fixup vdsp&fpu issues in kernel · 3dfc242f
      Guo Ren authored
      
      
      This fixup is continue to commit 35ff802a (csky: fixup remove
      vdsp implement for kernel.) and in that patch I didn't finish the
      job. We must forbid gcc to generate any vdsp & fpu instructions
      and remove vdsp asm in memmove.S.
      
      eg: For GCC it's -mcpu=ck860 and For AS it's -Wa,-mcpu=ck860fv
      
      Signed-off-by: default avatarGuo Ren <ren_guo@c-sky.com>
      3dfc242f
    • Linus Torvalds's avatar
      Linux 5.1-rc6 · 085b7755
      Linus Torvalds authored
      085b7755
  2. Apr 21, 2019
  3. Apr 20, 2019
    • Linus Torvalds's avatar
      Merge branch 'for-5.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 371dd432
      Linus Torvalds authored
      Pull cgroup fix from Tejun Heo:
       "A patch to fix a RCU imbalance error in the devices cgroup
        configuration error path"
      
      * 'for-5.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        device_cgroup: fix RCU imbalance in error case
      371dd432
    • Linus Torvalds's avatar
      Merge branch 'for-5.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu · 4c3f49ae
      Linus Torvalds authored
      Pull percpu fixlet from Dennis Zhou:
       "This stops printing the base address of percpu memory on
        initialization"
      
      * 'for-5.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/dennis/percpu:
        percpu: stop printing kernel addresses
      4c3f49ae
    • Linus Torvalds's avatar
      Merge tag 'tty-5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 55e3a6ba
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are five small fixes for some tty/serial/vt issues that have been
        reported.
      
        The vt one has been around for a while, it is good to finally get that
        resolved. The others fix a build warning that showed up in 5.1-rc1,
        and resolve a problem in the sh-sci driver.
      
        Note, the second patch for build warning fix for the sc16is7xx driver
        was just applied to the tree, as it resolves a problem with the
        previous patch to try to solve the issue. It has not shown up in
        linux-next yet, unlike all of the other patches, but it has passed
        0-day testing and everyone seems to agree that it is correct"
      
      * tag 'tty-5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        sc16is7xx: put err_spi and err_i2c into correct #ifdef
        vt: fix cursor when clearing the screen
        sc16is7xx: move label 'err_spi' to correct section
        serial: sh-sci: Fix HSCIF RX sampling point adjustment
        serial: sh-sci: Fix HSCIF RX sampling point calculation
      55e3a6ba
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 3ecafda9
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "16 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping
        mm/kmemleak.c: fix unused-function warning
        init: initialize jump labels before command line option parsing
        kernel/watchdog_hld.c: hard lockup message should end with a newline
        kcov: improve CONFIG_ARCH_HAS_KCOV help text
        mm: fix inactive list balancing between NUMA nodes and cgroups
        mm/hotplug: treat CMA pages as unmovable
        proc: fixup proc-pid-vm test
        proc: fix map_files test on F29
        mm/vmstat.c: fix /proc/vmstat format for CONFIG_DEBUG_TLBFLUSH=y CONFIG_SMP=n
        mm/memory_hotplug: do not unlock after failing to take the device_hotplug_lock
        mm: swapoff: shmem_unuse() stop eviction without igrab()
        mm: swapoff: take notice of completion sooner
        mm: swapoff: remove too limiting SWAP_UNUSE_MAX_TRIES
        mm: swapoff: shmem_find_swap_entries() filter out other types
        slab: store tagged freelist for off-slab slabmgmt
      3ecafda9
    • Linus Torvalds's avatar
      Merge tag 'staging-5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · b222e9af
      Linus Torvalds authored
      Pull staging and IIO fixes from Greg KH:
       "Here is a bunch of IIO driver fixes, and some smaller staging driver
        fixes, for 5.1-rc6. The IIO fixes were delayed due to my vacation, but
        all resolve a number of reported issues and have been in linux-next
        for a few weeks with no reported issues.
      
        The other staging driver fixes are all tiny, resolving some reported
        issues in the comedi and most drivers, as well as some erofs fixes.
      
        All of these patches have been in linux-next with no reported issues"
      
      * tag 'staging-5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (24 commits)
        staging: comedi: ni_usb6501: Fix possible double-free of ->usb_rx_buf
        staging: comedi: ni_usb6501: Fix use of uninitialized mutex
        staging: erofs: fix unexpected out-of-bound data access
        staging: comedi: vmk80xx: Fix possible double-free of ->usb_rx_buf
        staging: comedi: vmk80xx: Fix use of uninitialized semaphore
        staging: most: core: use device description as name
        iio: core: fix a possible circular locking dependency
        iio: ad_sigma_delta: select channel when reading register
        iio: pms7003: select IIO_TRIGGERED_BUFFER
        iio: cros_ec: Fix the maths for gyro scale calculation
        iio: adc: xilinx: prevent touching unclocked h/w on remove
        iio: adc: xilinx: fix potential use-after-free on probe
        iio: adc: xilinx: fix potential use-after-free on remove
        iio: dac: mcp4725: add missing powerdown bits in store eeprom
        io: accel: kxcjk1013: restore the range after resume.
        iio:chemical:bme680: Fix SPI read interface
        iio:chemical:bme680: Fix, report temperature in millidegrees
        iio: chemical: fix missing Kconfig block for sgp30
        iio: adc: at91: disable adc channel interrupt in timeout case
        iio: gyro: mpu3050: fix chip ID reading
        ...
      b222e9af
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · f9764dd4
      Linus Torvalds authored
      Pull char/misc fixes from Greg KH:
       "Here are four small misc driver fixes for 5.1-rc6.
      
        Nothing major at all, they fix up a Kconfig issues, a SPDX invalid
        license tag, and two tiny bugfixes.
      
        All have been in linux-next for a while with no reported issues"
      
      * tag 'char-misc-5.1-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        drivers: power: supply: goldfish_battery: Fix bogus SPDX identifier
        extcon: ptn5150: fix COMPILE_TEST dependencies
        misc: fastrpc: add checked value for dma_set_mask
        habanalabs: remove low credit limit of DMA #0
      f9764dd4
    • Ming Lei's avatar
      block: make sure that bvec length can't be overflow · 6bedf00e
      Ming Lei authored
      
      
      bvec->bv_offset may be bigger than PAGE_SIZE sometimes, such as,
      when one bio is splitted in the middle of one bvec via bio_split(),
      and bi_iter.bi_bvec_done is used to build offset of the 1st bvec of
      remained bio. And the remained bio's bvec may be re-submitted to fs
      layer via ITER_IBVEC, such as loop and nvme-loop.
      
      So we have to make sure that every bvec's offset is less than
      PAGE_SIZE from bio_for_each_segment_all() because some drivers(loop,
      nvme-loop) passes the splitted bvec to fs layer via ITER_BVEC.
      
      This patch fixes this issue reported by Zhang Yi When running nvme/011.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Yi Zhang <yi.zhang@redhat.com>
      Reported-by: default avatarYi Zhang <yi.zhang@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Fixes: 6dc4f100 ("block: allow bio_for_each_segment_all() to iterate over multi-page bvec")
      Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6bedf00e
    • Hou Tao's avatar
      block: kill all_q_node in request_queue · b40fabc0
      Hou Tao authored
      
      
      all_q_node has not been used since commit 4b855ad3 ("blk-mq: Create
      hctx for each present CPU"), so remove it.
      
      Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
      Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b40fabc0
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 240206fc
      Linus Torvalds authored
      Pull input updates from Dmitry Torokhov:
      
       - several new key mappings for HID
      
       - a host of new ACPI IDs used to identify Elan touchpads in Lenovo
         laptops
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: snvs_pwrkey - initialize necessary driver data before enabling IRQ
        HID: input: add mapping for "Toggle Display" key
        HID: input: add mapping for "Full Screen" key
        HID: input: add mapping for keyboard Brightness Up/Down/Toggle keys
        HID: input: add mapping for Expose/Overview key
        HID: input: fix mapping of aspect ratio key
        [media] doc-rst: switch to new names for Full Screen/Aspect keys
        Input: document meanings of KEY_SCREEN and KEY_ZOOM
        Input: elan_i2c - add hardware ID for multiple Lenovo laptops
      240206fc
    • Hans de Goede's avatar
      x86/cpu/intel: Lower the "ENERGY_PERF_BIAS: Set to normal" message's log priority · 2ee27796
      Hans de Goede authored
      
      
      The "ENERGY_PERF_BIAS: Set to 'normal', was 'performance'" message triggers
      on pretty much every Intel machine. The purpose of log messages with
      a warning level is to notify the user of something which potentially is
      a problem, or at least somewhat unexpected.
      
      This message clearly does not match those criteria, so lower its log
      priority from warning to info.
      
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Link: http://lkml.kernel.org/r/20181230172715.17469-1-hdegoede@redhat.com
      
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      2ee27796
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo-5.1-20190419' of... · 7579dfc4
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo-5.1-20190419' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
       into perf/urgent
      
      Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
      
      perf top:
      
        Jiri Olsa:
      
        - Fix 'perf top --pid', it needs PERF_SAMPLE_TIME since we switched to using
          a different thread to sort the events and then even for just a single
          thread we now need timestamps.
      
      BPF:
      
        Jiri Olsa:
      
        - Fix bpf_prog and btf lookup functions failure path to to properly return
          NULL.
      
        - Fix side band thread draining, used to process PERF_RECORD_BPF_EVENT
          metadata records.
      
      core:
      
        Jiri Olsa:
      
        - Fix map lookup by name to get a refcount when the name is already in
          the tree. Found
      
        Song Liu:
      
        - Fix __map__is_kmodule() by taking into account recently added BPF
          maps.
      
      UAPI:
      
        Arnaldo Carvalho de Melo:
      
        - Sync sound/asound.h copy
      
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      7579dfc4