25 Aug, 2022

6 commits

  • commit fd0c153daad135d0ec1a53c5dbe6936a724d6ae1 upstream.

    If we use the ancient SysV syscall ABI, we'd better have tell the
    kernel how to claim that a negative return value is a success.
    Use ->orig_r2 for that - it's inaccessible via ptrace, so it's
    a fair game for changes and it's normally[*] non-negative on return
    from syscall. Set to -1; syscall is not going to be restart-worthy
    by definition, so we won't interfere with that use either.

    [*] the only exception is rt_sigreturn(), where we skip the entire
    messing with r1/r2 anyway.

    Fixes: 82ed08dd1b0e ("nios2: Exception handling")
    Signed-off-by: Al Viro
    Signed-off-by: Dinh Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Al Viro
     
  • commit 411a76b7219555c55867466c82d70ce928d6c9e1 upstream.

    Fixes: b53e906d255d ("nios2: Signal handling support")
    Signed-off-by: Al Viro
    Signed-off-by: Dinh Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Al Viro
     
  • commit 2d631bd58fe0ea3e3350212e23c9aba1fb606514 upstream.

    sys_foo() returns -512 (aka -ERESTARTSYS) => do_signal() sees
    512 in r2 and 1 in r1.

    sys_foo() returns 512 => do_signal() sees 512 in r2 and 0 in r1.

    The former is restart-worthy; the latter obviously isn't.

    Fixes: b53e906d255d ("nios2: Signal handling support")
    Signed-off-by: Al Viro
    Signed-off-by: Dinh Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Al Viro
     
  • commit 25ba820ef36bdbaf9884adeac69b6e1821a7df76 upstream.

    all checks done before letting the tracer modify the register
    state are worthless...

    Fixes: 82ed08dd1b0e ("nios2: Exception handling")
    Signed-off-by: Al Viro
    Signed-off-by: Dinh Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Al Viro
     
  • commit 45ec746c65097c25e77d24eae8fee0def5b6cc5d upstream.

    fill the gaps in there with sys_ni_syscall, as everyone does...

    Fixes: 82ed08dd1b0e ("nios2: Exception handling")
    Signed-off-by: Al Viro
    Signed-off-by: Dinh Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Al Viro
     
  • commit 8535c239ac674f7ead0f2652932d35c52c4123b2 upstream.

    make sure that ->orig_r2 is negative for everything except
    the syscalls.

    Fixes: 82ed08dd1b0e ("nios2: Exception handling")
    Signed-off-by: Al Viro
    Signed-off-by: Dinh Nguyen
    Signed-off-by: Greg Kroah-Hartman

    Al Viro
     

30 May, 2022

1 commit

  • commit c04e72700f2293013dab40208e809369378f224c upstream.

    In the event that random_get_entropy() can't access a cycle counter or
    similar, falling back to returning 0 is really not the best we can do.
    Instead, at least calling random_get_entropy_fallback() would be
    preferable, because that always needs to return _something_, even
    falling back to jiffies eventually. It's not as though
    random_get_entropy_fallback() is super high precision or guaranteed to
    be entropic, but basically anything that's not zero all the time is
    better than returning zero all the time.

    Cc: Thomas Gleixner
    Cc: Arnd Bergmann
    Acked-by: Dinh Nguyen
    Signed-off-by: Jason A. Donenfeld
    Signed-off-by: Greg Kroah-Hartman

    Jason A. Donenfeld
     

08 Apr, 2022

2 commits

  • [ Upstream commit 23fc539e81295b14b50c6ccc5baeb4f3d59d822d ]

    On some architectures, access_ok() does not do any argument type
    checking, so replacing the definition with a generic one causes
    a few warnings for harmless issues that were never caught before.

    Fix the ones that I found either through my own test builds or
    that were reported by the 0-day bot.

    Reported-by: kernel test robot
    Reviewed-by: Christoph Hellwig
    Acked-by: Dinh Nguyen
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     
  • [ Upstream commit a97b693c3712f040c5802f32b2d685352e08cefa ]

    These two architectures implement 8-byte get_user() through
    a memcpy() into a four-byte variable, which won't fit.

    Use a temporary 64-bit variable instead here, and use a double
    cast the way that risc-v and openrisc do to avoid compile-time
    warnings.

    Fixes: 6a090e97972d ("arch/microblaze: support get_user() of size 8 bytes")
    Fixes: 5ccc6af5e88e ("nios2: Memory management")
    Reviewed-by: Christoph Hellwig
    Acked-by: Dinh Nguyen
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Sasha Levin

    Arnd Bergmann
     

27 Oct, 2021

1 commit

  • nios2:allmodconfig builds fail with

    make[1]: *** No rule to make target 'arch/nios2/boot/dts/""',
    needed by 'arch/nios2/boot/dts/built-in.a'. Stop.
    make: [Makefile:1868: arch/nios2/boot/dts] Error 2 (ignored)

    This is seen with compile tests since those enable NIOS2_DTB_SOURCE_BOOL,
    which in turn enables NIOS2_DTB_SOURCE. This causes the build error
    because the default value for NIOS2_DTB_SOURCE is an empty string.
    Disable NIOS2_DTB_SOURCE_BOOL for compile tests to avoid the error.

    Fixes: 2fc8483fdcde ("nios2: Build infrastructure")
    Signed-off-by: Guenter Roeck
    Reviewed-by: Randy Dunlap
    Signed-off-by: Dinh Nguyen

    Guenter Roeck
     

19 Oct, 2021

1 commit

  • Both arch/nios2/ and drivers/mmc/host/tmio_mmc.c define a macro
    with the name "CTL_STATUS". Change the one in arch/nios2/ to be
    "CTL_FSTATUS" (flags status) to eliminate the build warning.

    In file included from ../drivers/mmc/host/tmio_mmc.c:22:
    drivers/mmc/host/tmio_mmc.h:31: warning: "CTL_STATUS" redefined
    31 | #define CTL_STATUS 0x1c
    arch/nios2/include/asm/registers.h:14: note: this is the location of the previous definition
    14 | #define CTL_STATUS 0

    Fixes: b31ebd8055ea ("nios2: Nios2 registers")
    Signed-off-by: Randy Dunlap
    Cc: Dinh Nguyen
    Signed-off-by: Dinh Nguyen

    Randy Dunlap
     

27 Sep, 2021

1 commit

  • This is a nuisance when CONFIG_WERROR is set, so drop the variable
    declaration since the code that used it was removed.

    ../arch/nios2/kernel/setup.c: In function 'setup_arch':
    ../arch/nios2/kernel/setup.c:152:13: warning: unused variable 'dram_start' [-Wunused-variable]
    152 | int dram_start;

    Fixes: 7f7bc20bc41a ("nios2: Don't use _end for calculating min_low_pfn")
    Signed-off-by: Randy Dunlap
    Reported-by: kernel test robot
    Reviewed-by: Mike Rapoport
    Cc: Andreas Oetken
    Signed-off-by: Dinh Nguyen

    Randy Dunlap
     

24 Sep, 2021

1 commit

  • SERIAL_CORE_CONSOLE depends on TTY so EARLY_PRINTK should also
    depend on TTY so that it does not select SERIAL_CORE_CONSOLE
    inadvertently.

    WARNING: unmet direct dependencies detected for SERIAL_CORE_CONSOLE
    Depends on [n]: TTY [=n] && HAS_IOMEM [=y]
    Selected by [y]:
    - EARLY_PRINTK [=y]

    Fixes: e8bf5bc776ed ("nios2: add early printk support")
    Signed-off-by: Randy Dunlap
    Cc: Dinh Nguyen
    Signed-off-by: Dinh Nguyen

    Randy Dunlap
     

09 Sep, 2021

2 commits

  • Merge more updates from Andrew Morton:
    "147 patches, based on 7d2a07b769330c34b4deabeed939325c77a7ec2f.

    Subsystems affected by this patch series: mm (memory-hotplug, rmap,
    ioremap, highmem, cleanups, secretmem, kfence, damon, and vmscan),
    alpha, percpu, procfs, misc, core-kernel, MAINTAINERS, lib,
    checkpatch, epoll, init, nilfs2, coredump, fork, pids, criu, kconfig,
    selftests, ipc, and scripts"

    * emailed patches from Andrew Morton : (94 commits)
    scripts: check_extable: fix typo in user error message
    mm/workingset: correct kernel-doc notations
    ipc: replace costly bailout check in sysvipc_find_ipc()
    selftests/memfd: remove unused variable
    Kconfig.debug: drop selecting non-existing HARDLOCKUP_DETECTOR_ARCH
    configs: remove the obsolete CONFIG_INPUT_POLLDEV
    prctl: allow to setup brk for et_dyn executables
    pid: cleanup the stale comment mentioning pidmap_init().
    kernel/fork.c: unexport get_{mm,task}_exe_file
    coredump: fix memleak in dump_vma_snapshot()
    fs/coredump.c: log if a core dump is aborted due to changed file permissions
    nilfs2: use refcount_dec_and_lock() to fix potential UAF
    nilfs2: fix memory leak in nilfs_sysfs_delete_snapshot_group
    nilfs2: fix memory leak in nilfs_sysfs_create_snapshot_group
    nilfs2: fix memory leak in nilfs_sysfs_delete_##name##_group
    nilfs2: fix memory leak in nilfs_sysfs_create_##name##_group
    nilfs2: fix NULL pointer in nilfs_##name##_attr_release
    nilfs2: fix memory leak in nilfs_sysfs_create_device_group
    trap: cleanup trap_init()
    init: move usermodehelper_enable() to populate_rootfs()
    ...

    Linus Torvalds
     
  • There are some empty trap_init() definitions in different ARCHs, Introduce
    a new weak trap_init() function to clean them up.

    Link: https://lkml.kernel.org/r/20210812123602.76356-1-wangkefeng.wang@huawei.com
    Signed-off-by: Kefeng Wang
    Acked-by: Russell King (Oracle) [arm32]
    Acked-by: Vineet Gupta [arc]
    Acked-by: Michael Ellerman [powerpc]
    Cc: Yoshinori Sato
    Cc: Ley Foon Tan
    Cc: Jonas Bonn
    Cc: Stefan Kristiansson
    Cc: Stafford Horne
    Cc: James E.J. Bottomley
    Cc: Helge Deller
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Paul Walmsley
    Cc: Jeff Dike
    Cc: Richard Weinberger
    Cc: Anton Ivanov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kefeng Wang
     

06 Sep, 2021

1 commit

  • Pull tracing updates from Steven Rostedt:

    - simplify the Kconfig use of FTRACE and TRACE_IRQFLAGS_SUPPORT

    - bootconfig can now start histograms

    - bootconfig supports group/all enabling

    - histograms now can put values in linear size buckets

    - execnames can be passed to synthetic events

    - introduce "event probes" that attach to other events and can retrieve
    data from pointers of fields, or record fields as different types (a
    pointer to a string as a string instead of just a hex number)

    - various fixes and clean ups

    * tag 'trace-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (35 commits)
    tracing/doc: Fix table format in histogram code
    selftests/ftrace: Add selftest for testing duplicate eprobes and kprobes
    selftests/ftrace: Add selftest for testing eprobe events on synthetic events
    selftests/ftrace: Add test case to test adding and removing of event probe
    selftests/ftrace: Fix requirement check of README file
    selftests/ftrace: Add clear_dynamic_events() to test cases
    tracing: Add a probe that attaches to trace events
    tracing/probes: Reject events which have the same name of existing one
    tracing/probes: Have process_fetch_insn() take a void * instead of pt_regs
    tracing/probe: Change traceprobe_set_print_fmt() to take a type
    tracing/probes: Use struct_size() instead of defining custom macros
    tracing/probes: Allow for dot delimiter as well as slash for system names
    tracing/probe: Have traceprobe_parse_probe_arg() take a const arg
    tracing: Have dynamic events have a ref counter
    tracing: Add DYNAMIC flag for dynamic events
    tracing: Replace deprecated CPU-hotplug functions.
    MAINTAINERS: Add an entry for os noise/latency
    tracepoint: Fix kerneldoc comments
    bootconfig/tracing/ktest: Update ktest example for boot-time tracing
    tools/bootconfig: Use per-group/all enable option in ftrace2bconf script
    ...

    Linus Torvalds
     

02 Sep, 2021

1 commit

  • Pull asm-generic updates from Arnd Bergmann:
    "The main content for 5.15 is a series that cleans up the handling of
    strncpy_from_user() and strnlen_user(), removing a lot of slightly
    incorrect versions of these in favor of the lib/strn*.c helpers that
    implement these correctly and more efficiently.

    The only architectures that retain a private version now are mips,
    ia64, um and parisc. I had offered to convert those at all, but Thomas
    Bogendoerfer wanted to keep the mips version for the moment until he
    had a chance to do regression testing.

    The branch also contains two patches for bitops and for ffs()"

    * tag 'asm-generic-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
    bitops/non-atomic: make @nr unsigned to avoid any DIV
    asm-generic: ffs: Drop bogus reference to ffz location
    asm-generic: reverse GENERIC_{STRNCPY_FROM,STRNLEN}_USER symbols
    asm-generic: remove extra strn{cpy_from,len}_user declarations
    asm-generic: uaccess: remove inline strncpy_from_user/strnlen_user
    s390: use generic strncpy/strnlen from_user
    microblaze: use generic strncpy/strnlen from_user
    csky: use generic strncpy/strnlen from_user
    arc: use generic strncpy/strnlen from_user
    hexagon: use generic strncpy/strnlen from_user
    h8300: remove stale strncpy_from_user
    asm-generic/uaccess.h: remove __strncpy_from_user/__strnlen_user

    Linus Torvalds
     

16 Aug, 2021

1 commit

  • Make architectures select TRACE_IRQFLAGS_SUPPORT instead of
    having many defines.

    Link: https://lkml.kernel.org/r/20210731052233.4703-2-masahiroy@kernel.org

    Acked-by: Heiko Carstens
    Acked-by: Vineet Gupta    #arch/arc
    Acked-by: Michael Ellerman (powerpc)
    Acked-by: Catalin Marinas
    Acked-by: Max Filippov
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Steven Rostedt (VMware)

    Masahiro Yamada
     

12 Aug, 2021

1 commit


30 Jul, 2021

1 commit

  • Most architectures do not need a custom implementation, and in most
    cases the generic implementation is preferred, so change the polariy
    on these Kconfig symbols to require architectures to select them when
    they provide their own version.

    The new name is CONFIG_ARCH_HAS_{STRNCPY_FROM,STRNLEN}_USER.

    The remaining architectures at the moment are: ia64, mips, parisc,
    um and xtensa. We should probably convert these as well, but
    I was not sure how far to take this series. Thomas Bogendoerfer
    had some concerns about converting mips but may still do some
    more detailed measurements to see which version is better.

    Cc: "James E.J. Bottomley"
    Cc: Anton Ivanov
    Cc: Christian Borntraeger
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: Jeff Dike
    Cc: Max Filippov
    Cc: Richard Weinberger
    Cc: Thomas Bogendoerfer
    Cc: Vasily Gorbik
    Cc: linux-ia64@vger.kernel.org
    Cc: linux-mips@vger.kernel.org
    Cc: linux-parisc@vger.kernel.org
    Cc: linux-s390@vger.kernel.org
    Cc: linux-um@lists.infradead.org
    Cc: linux-xtensa@linux-xtensa.org
    Acked-by: Geert Uytterhoeven
    Acked-by: Helge Deller # parisc
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Arnd Bergmann

    Arnd Bergmann
     

11 Jul, 2021

1 commit

  • Pull Kbuild updates from Masahiro Yamada:

    - Increase the -falign-functions alignment for the debug option.

    - Remove ugly libelf checks from the top Makefile.

    - Make the silent build (-s) more silent.

    - Re-compile the kernel if KBUILD_BUILD_TIMESTAMP is specified.

    - Various script cleanups

    * tag 'kbuild-v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (27 commits)
    scripts: add generic syscallnr.sh
    scripts: check duplicated syscall number in syscall table
    sparc: syscalls: use pattern rules to generate syscall headers
    parisc: syscalls: use pattern rules to generate syscall headers
    nds32: add arch/nds32/boot/.gitignore
    kbuild: mkcompile_h: consider timestamp if KBUILD_BUILD_TIMESTAMP is set
    kbuild: modpost: Explicitly warn about unprototyped symbols
    kbuild: remove trailing slashes from $(KBUILD_EXTMOD)
    kconfig.h: explain IS_MODULE(), IS_ENABLED()
    kconfig: constify long_opts
    scripts/setlocalversion: simplify the short version part
    scripts/setlocalversion: factor out 12-chars hash construction
    scripts/setlocalversion: add more comments to -dirty flag detection
    scripts/setlocalversion: remove workaround for old make-kpkg
    scripts/setlocalversion: remove mercurial, svn and git-svn supports
    kbuild: clean up ${quiet} checks in shell scripts
    kbuild: sink stdout from cmd for silent build
    init: use $(call cmd,) for generating include/generated/compile.h
    kbuild: merge scripts/mkmakefile to top Makefile
    sh: move core-y in arch/sh/Makefile to arch/sh/Kbuild
    ...

    Linus Torvalds
     

09 Jul, 2021

1 commit


03 Jul, 2021

1 commit

  • Merge more updates from Andrew Morton:
    "190 patches.

    Subsystems affected by this patch series: mm (hugetlb, userfaultfd,
    vmscan, kconfig, proc, z3fold, zbud, ras, mempolicy, memblock,
    migration, thp, nommu, kconfig, madvise, memory-hotplug, zswap,
    zsmalloc, zram, cleanups, kfence, and hmm), procfs, sysctl, misc,
    core-kernel, lib, lz4, checkpatch, init, kprobes, nilfs2, hfs,
    signals, exec, kcov, selftests, compress/decompress, and ipc"

    * emailed patches from Andrew Morton : (190 commits)
    ipc/util.c: use binary search for max_idx
    ipc/sem.c: use READ_ONCE()/WRITE_ONCE() for use_global_lock
    ipc: use kmalloc for msg_queue and shmid_kernel
    ipc sem: use kvmalloc for sem_undo allocation
    lib/decompressors: remove set but not used variabled 'level'
    selftests/vm/pkeys: exercise x86 XSAVE init state
    selftests/vm/pkeys: refill shadow register after implicit kernel write
    selftests/vm/pkeys: handle negative sys_pkey_alloc() return code
    selftests/vm/pkeys: fix alloc_random_pkey() to make it really, really random
    kcov: add __no_sanitize_coverage to fix noinstr for all architectures
    exec: remove checks in __register_bimfmt()
    x86: signal: don't do sas_ss_reset() until we are certain that sigframe won't be abandoned
    hfsplus: report create_date to kstat.btime
    hfsplus: remove unnecessary oom message
    nilfs2: remove redundant continue statement in a while-loop
    kprobes: remove duplicated strong free_insn_page in x86 and s390
    init: print out unknown kernel parameters
    checkpatch: do not complain about positive return values starting with EPOLL
    checkpatch: improve the indented label test
    checkpatch: scripts/spdxcheck.py now requires python3
    ...

    Linus Torvalds
     

02 Jul, 2021

2 commits

  • Currently most platforms define pmd_pgtable() as pmd_page() duplicating
    the same code all over. Instead just define a default value i.e
    pmd_page() for pmd_pgtable() and let platforms override when required via
    . All the existing platform that override pmd_pgtable()
    have been moved into their respective header in order to
    precede before the new generic definition. This makes it much cleaner
    with reduced code.

    Link: https://lkml.kernel.org/r/1623646133-20306-1-git-send-email-anshuman.khandual@arm.com
    Signed-off-by: Anshuman Khandual
    Acked-by: Geert Uytterhoeven
    Acked-by: Mike Rapoport
    Cc: Nick Hu
    Cc: Richard Henderson
    Cc: Vineet Gupta
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Guo Ren
    Cc: Brian Cain
    Cc: Geert Uytterhoeven
    Cc: Michal Simek
    Cc: Thomas Bogendoerfer
    Cc: Ley Foon Tan
    Cc: Jonas Bonn
    Cc: Stefan Kristiansson
    Cc: Stafford Horne
    Cc: "James E.J. Bottomley"
    Cc: Michael Ellerman
    Cc: Christophe Leroy
    Cc: Paul Walmsley
    Cc: Palmer Dabbelt
    Cc: Heiko Carstens
    Cc: Yoshinori Sato
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Thomas Gleixner
    Cc: Chris Zankel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anshuman Khandual
     
  • Currently most platforms define FIRST_USER_ADDRESS as 0UL duplication the
    same code all over. Instead just define a generic default value (i.e 0UL)
    for FIRST_USER_ADDRESS and let the platforms override when required. This
    makes it much cleaner with reduced code.

    The default FIRST_USER_ADDRESS here would be skipped in
    when the given platform overrides its value via .

    Link: https://lkml.kernel.org/r/1620615725-24623-1-git-send-email-anshuman.khandual@arm.com
    Signed-off-by: Anshuman Khandual
    Acked-by: Geert Uytterhoeven [m68k]
    Acked-by: Guo Ren [csky]
    Acked-by: Stafford Horne [openrisc]
    Acked-by: Catalin Marinas [arm64]
    Acked-by: Mike Rapoport
    Acked-by: Palmer Dabbelt [RISC-V]
    Cc: Richard Henderson
    Cc: Vineet Gupta
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Guo Ren
    Cc: Brian Cain
    Cc: Geert Uytterhoeven
    Cc: Michal Simek
    Cc: Thomas Bogendoerfer
    Cc: Ley Foon Tan
    Cc: Jonas Bonn
    Cc: Stefan Kristiansson
    Cc: Stafford Horne
    Cc: "James E.J. Bottomley"
    Cc: Michael Ellerman
    Cc: Christophe Leroy
    Cc: Paul Walmsley
    Cc: Heiko Carstens
    Cc: Yoshinori Sato
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Thomas Gleixner
    Cc: Chris Zankel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anshuman Khandual
     

30 Jun, 2021

1 commit

  • Pull irq updates from Thomas Gleixner:
    "Updates for the interrupt subsystem:

    Core changes:

    - Cleanup and simplification of common code to invoke the low level
    interrupt flow handlers when this invocation requires irqdomain
    resolution. Add the necessary core infrastructure.

    - Provide a proper interface for modular PMU drivers to set the
    interrupt affinity.

    - Add a request flag which allows to exclude interrupts from spurious
    interrupt detection. Useful especially for IPI handlers which
    always return IRQ_HANDLED which turns the spurious interrupt
    detection into a pointless waste of CPU cycles.

    Driver changes:

    - Bulk convert interrupt chip drivers to the new irqdomain low level
    flow handler invocation mechanism.

    - Add device tree bindings for the Renesas R-Car M3-W+ SoC

    - Enable modular build of the Qualcomm PDC driver

    - The usual small fixes and improvements"

    * tag 'irq-core-2021-06-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (38 commits)
    dt-bindings: interrupt-controller: arm,gic-v3: Describe GICv3 optional properties
    irqchip: gic-pm: Remove redundant error log of clock bulk
    irqchip/sun4i: Remove unnecessary oom message
    irqchip/irq-imx-gpcv2: Remove unnecessary oom message
    irqchip/imgpdc: Remove unnecessary oom message
    irqchip/gic-v3-its: Remove unnecessary oom message
    irqchip/gic-v2m: Remove unnecessary oom message
    irqchip/exynos-combiner: Remove unnecessary oom message
    irqchip: Bulk conversion to generic_handle_domain_irq()
    genirq: Move non-irqdomain handle_domain_irq() handling into ARM's handle_IRQ()
    genirq: Add generic_handle_domain_irq() helper
    irqchip/nvic: Convert from handle_IRQ() to handle_domain_irq()
    irqdesc: Fix __handle_domain_irq() comment
    genirq: Use irq_resolve_mapping() to implement __handle_domain_irq() and co
    irqdomain: Introduce irq_resolve_mapping()
    irqdomain: Protect the linear revmap with RCU
    irqdomain: Cache irq_data instead of a virq number in the revmap
    irqdomain: Use struct_size() helper when allocating irqdomain
    irqdomain: Make normal and nomap irqdomains exclusive
    powerpc: Move the use of irq_domain_add_nomap() behind a config option
    ...

    Linus Torvalds
     

18 Jun, 2021

1 commit

  • Replace a bunch of 'p->state == TASK_RUNNING' with a new helper:
    task_is_running(p).

    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Davidlohr Bueso
    Acked-by: Geert Uytterhoeven
    Acked-by: Will Deacon
    Link: https://lore.kernel.org/r/20210611082838.222401495@infradead.org

    Peter Zijlstra
     

10 Jun, 2021

1 commit


26 May, 2021

1 commit


03 May, 2021

1 commit

  • Pull misc vfs updates from Al Viro:
    "Assorted stuff all over the place"

    * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    useful constants: struct qstr for ".."
    hostfs_open(): don't open-code file_dentry()
    whack-a-mole: kill strlen_user() (again)
    autofs: should_expire() argument is guaranteed to be positive
    apparmor:match_mn() - constify devpath argument
    buffer: a small optimization in grow_buffers
    get rid of autofs_getpath()
    constify dentry argument of dentry_path()/dentry_path_raw()

    Linus Torvalds
     

01 May, 2021

2 commits

  • mem_init_print_info() is called in mem_init() on each architecture, and
    pass NULL argument, so using void argument and move it into mm_init().

    Link: https://lkml.kernel.org/r/20210317015210.33641-1-wangkefeng.wang@huawei.com
    Signed-off-by: Kefeng Wang
    Acked-by: Dave Hansen [x86]
    Reviewed-by: Christophe Leroy [powerpc]
    Acked-by: David Hildenbrand
    Tested-by: Anatoly Pugachev [sparc64]
    Acked-by: Russell King [arm]
    Acked-by: Mike Rapoport
    Cc: Catalin Marinas
    Cc: Richard Henderson
    Cc: Guo Ren
    Cc: Yoshinori Sato
    Cc: Huacai Chen
    Cc: Jonas Bonn
    Cc: Palmer Dabbelt
    Cc: Heiko Carstens
    Cc: "David S. Miller"
    Cc: "Peter Zijlstra"
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kefeng Wang
     
  • page_mapping_file() is only used by some architectures, and then it
    is usually only used in one place. Make it a static inline function
    so other architectures don't have to carry this dead code.

    Link: https://lkml.kernel.org/r/20210317123011.350118-1-willy@infradead.org
    Signed-off-by: Matthew Wilcox (Oracle)
    Reviewed-by: David Hildenbrand
    Acked-by: Mike Rapoport
    Cc: Huang Ying
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Matthew Wilcox (Oracle)
     

28 Mar, 2021

1 commit


28 Feb, 2021

1 commit

  • Pull io_uring thread rewrite from Jens Axboe:
    "This converts the io-wq workers to be forked off the tasks in question
    instead of being kernel threads that assume various bits of the
    original task identity.

    This kills > 400 lines of code from io_uring/io-wq, and it's the worst
    part of the code. We've had several bugs in this area, and the worry
    is always that we could be missing some pieces for file types doing
    unusual things (recent /dev/tty example comes to mind, userfaultfd
    reads installing file descriptors is another fun one... - both of
    which need special handling, and I bet it's not the last weird oddity
    we'll find).

    With these identical workers, we can have full confidence that we're
    never missing anything. That, in itself, is a huge win. Outside of
    that, it's also more efficient since we're not wasting space and code
    on tracking state, or switching between different states.

    I'm sure we're going to find little things to patch up after this
    series, but testing has been pretty thorough, from the usual
    regression suite to production. Any issue that may crop up should be
    manageable.

    There's also a nice series of further reductions we can do on top of
    this, but I wanted to get the meat of it out sooner rather than later.
    The general worry here isn't that it's fundamentally broken. Most of
    the little issues we've found over the last week have been related to
    just changes in how thread startup/exit is done, since that's the main
    difference between using kthreads and these kinds of threads. In fact,
    if all goes according to plan, I want to get this into the 5.10 and
    5.11 stable branches as well.

    That said, the changes outside of io_uring/io-wq are:

    - arch setup, simple one-liner to each arch copy_thread()
    implementation.

    - Removal of net and proc restrictions for io_uring, they are no
    longer needed or useful"

    * tag 'io_uring-worker.v3-2021-02-25' of git://git.kernel.dk/linux-block: (30 commits)
    io-wq: remove now unused IO_WQ_BIT_ERROR
    io_uring: fix SQPOLL thread handling over exec
    io-wq: improve manager/worker handling over exec
    io_uring: ensure SQPOLL startup is triggered before error shutdown
    io-wq: make buffered file write hashed work map per-ctx
    io-wq: fix race around io_worker grabbing
    io-wq: fix races around manager/worker creation and task exit
    io_uring: ensure io-wq context is always destroyed for tasks
    arch: ensure parisc/powerpc handle PF_IO_WORKER in copy_thread()
    io_uring: cleanup ->user usage
    io-wq: remove nr_process accounting
    io_uring: flag new native workers with IORING_FEAT_NATIVE_WORKERS
    net: remove cmsg restriction from io_uring based send/recvmsg calls
    Revert "proc: don't allow async path resolution of /proc/self components"
    Revert "proc: don't allow async path resolution of /proc/thread-self components"
    io_uring: move SQPOLL thread io-wq forked worker
    io-wq: make io_wq_fork_thread() available to other users
    io-wq: only remove worker from free_list, if it was there
    io_uring: remove io_identity
    io_uring: remove any grabbing of context
    ...

    Linus Torvalds
     

22 Feb, 2021

1 commit

  • PF_IO_WORKER are kernel threads too, but they aren't PF_KTHREAD in the
    sense that we don't assign ->set_child_tid with our own structure. Just
    ensure that every arch sets up the PF_IO_WORKER threads like kthreads
    in the arch implementation of copy_thread().

    Signed-off-by: Jens Axboe

    Jens Axboe
     

19 Feb, 2021

3 commits

  • If there is a initramfs linked into the kernel which will be
    freed later on there is free memory somewhere between _etext
    and _end, thus using _end for min_low_pfn is not correct.
    This may lead to issues in dma_capable when checking
    'min(addr, end) < phys_to_dma(dev, PFN_PHYS(min_low_pfn)))'
    as the address addr might be below min_low_pfn. Picked
    find_limits from architecture arm for applying min_low_pfn and
    max_low_pfn. Maybe using _etext for min_low_pfn would be
    fine too.

    Signed-off-by: Andreas Oetken
    Signed-off-by: Ley Foon Tan

    Andreas Oetken
     
  • The tls pointer must be pushed on the stack prior to calling nios2_clone
    as it is the 5th function argument. Prior handling of the tls pointer was
    done inside former called function copy_thread_tls using the r8 register
    from the current_pt_regs directly. This was a bad design and resulted in
    the current bug introduced in 04bd52fb.

    Fixes: 04bd52fb ("nios2: enable HAVE_COPY_THREAD_TLS, switch to kernel_clone_args")
    Signed-off-by: Andreas Oetken
    Signed-off-by: Ley Foon Tan
    Acked-by: Christian Brauner

    Andreas Oetken
     
  • We need to take the mmap lock around find_vma() and subsequent use of the
    VMA. Otherwise, we can race with concurrent operations like munmap(), which
    can lead to use-after-free accesses to freed VMAs.

    Fixes: 1000197d8013 ("nios2: System calls handling")
    Signed-off-by: Jann Horn
    Signed-off-by: Ley Foon Tan

    Jann Horn
     

17 Dec, 2020

1 commit

  • Pull TIF_NOTIFY_SIGNAL updates from Jens Axboe:
    "This sits on top of of the core entry/exit and x86 entry branch from
    the tip tree, which contains the generic and x86 parts of this work.

    Here we convert the rest of the archs to support TIF_NOTIFY_SIGNAL.

    With that done, we can get rid of JOBCTL_TASK_WORK from task_work and
    signal.c, and also remove a deadlock work-around in io_uring around
    knowing that signal based task_work waking is invoked with the sighand
    wait queue head lock.

    The motivation for this work is to decouple signal notify based
    task_work, of which io_uring is a heavy user of, from sighand. The
    sighand lock becomes a huge contention point, particularly for
    threaded workloads where it's shared between threads. Even outside of
    threaded applications it's slower than it needs to be.

    Roman Gershman reported that his networked
    workload dropped from 1.6M QPS at 80% CPU to 1.0M QPS at 100% CPU
    after io_uring was changed to use TIF_NOTIFY_SIGNAL. The time was all
    spent hammering on the sighand lock, showing 57% of the CPU time there
    [1].

    There are further cleanups possible on top of this. One example is
    TIF_PATCH_PENDING, where a patch already exists to use
    TIF_NOTIFY_SIGNAL instead. Hopefully this will also lead to more
    consolidation, but the work stands on its own as well"

    [1] https://github.com/axboe/liburing/issues/215

    * tag 'tif-task_work.arch-2020-12-14' of git://git.kernel.dk/linux-block: (28 commits)
    io_uring: remove 'twa_signal_ok' deadlock work-around
    kernel: remove checking for TIF_NOTIFY_SIGNAL
    signal: kill JOBCTL_TASK_WORK
    io_uring: JOBCTL_TASK_WORK is no longer used by task_work
    task_work: remove legacy TWA_SIGNAL path
    sparc: add support for TIF_NOTIFY_SIGNAL
    riscv: add support for TIF_NOTIFY_SIGNAL
    nds32: add support for TIF_NOTIFY_SIGNAL
    ia64: add support for TIF_NOTIFY_SIGNAL
    h8300: add support for TIF_NOTIFY_SIGNAL
    c6x: add support for TIF_NOTIFY_SIGNAL
    alpha: add support for TIF_NOTIFY_SIGNAL
    xtensa: add support for TIF_NOTIFY_SIGNAL
    arm: add support for TIF_NOTIFY_SIGNAL
    microblaze: add support for TIF_NOTIFY_SIGNAL
    hexagon: add support for TIF_NOTIFY_SIGNAL
    csky: add support for TIF_NOTIFY_SIGNAL
    openrisc: add support for TIF_NOTIFY_SIGNAL
    sh: add support for TIF_NOTIFY_SIGNAL
    um: add support for TIF_NOTIFY_SIGNAL
    ...

    Linus Torvalds
     

16 Dec, 2020

1 commit

  • …/git/arnd/asm-generic

    Pull asm-generic cross-architecture timer cleanup from Arnd Bergmann:
    "This cleans up two ancient timer features that were never completed in
    the past, CONFIG_GENERIC_CLOCKEVENTS and CONFIG_ARCH_USES_GETTIMEOFFSET.

    There was only one user left for the ARCH_USES_GETTIMEOFFSET variant
    of clocksource implementations, the ARM EBSA110 platform. Rather than
    changing to use modern timekeeping, we remove the platform entirely as
    Russell no longer uses his machine and nobody else seems to have one
    any more.

    The conditional code for using arch_gettimeoffset() is removed as a
    result.

    For CONFIG_GENERIC_CLOCKEVENTS, there are still a couple of platforms
    not using clockevent drivers: parisc, ia64, most of m68k, and one Arm
    platform. These all do timer ticks slighly differently, and this gets
    cleaned up to the point they at least all call the same helper
    function.

    Instead of most platforms using 'select GENERIC_CLOCKEVENTS' in
    Kconfig, the polarity is now reversed, with the few remaining ones
    selecting LEGACY_TIMER_TICK instead"

    * tag 'asm-generic-timers-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
    timekeeping: default GENERIC_CLOCKEVENTS to enabled
    timekeeping: remove xtime_update
    m68k: remove timer_interrupt() function
    m68k: change remaining timers to legacy_timer_tick
    m68k: m68328: use legacy_timer_tick()
    m68k: sun3/sun3c: use legacy_timer_tick
    m68k: split heartbeat out of timer function
    m68k: coldfire: use legacy_timer_tick()
    parisc: use legacy_timer_tick
    ARM: rpc: use legacy_timer_tick
    ia64: convert to legacy_timer_tick
    timekeeping: add CONFIG_LEGACY_TIMER_TICK
    timekeeping: remove arch_gettimeoffset
    net: remove am79c961a driver
    ARM: remove ebsa110 platform

    Linus Torvalds