28 May, 2021

1 commit


23 May, 2021

1 commit

  • lib/bitfield_kunit.c: In function `test_bitfields_constants':
    lib/bitfield_kunit.c:93:1: warning: the frame size of 7456 bytes is larger than 2048 bytes [-Wframe-larger-than=]
    }
    ^

    As the description of BITFIELD_KUNIT in lib/Kconfig.debug, it "Only useful
    for kernel devs running the KUnit test harness, and not intended for
    inclusion into a production build". Therefore, it is not worth modifying
    variable 'test_bitfields_constants' to clear this warning. Just suppress
    it.

    Link: https://lkml.kernel.org/r/20210518094533.7652-1-thunder.leizhen@huawei.com
    Signed-off-by: Zhen Lei
    Cc: Shuah Khan
    Cc: Vitor Massaru Iha
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zhen Lei
     

21 May, 2021

1 commit

  • Pull char/misc driver fixes from Greg KH:
    "Here is a big set of char/misc/other driver fixes for 5.13-rc3.

    The majority here is the fallout of the umn.edu re-review of all prior
    submissions. That resulted in a bunch of reverts along with the
    "correct" changes made, such that there is no regression of any of the
    potential fixes that were made by those individuals. I would like to
    thank the over 80 different developers who helped with the review and
    fixes for this mess.

    Other than that, there's a few habanna driver fixes for reported
    issues, and some dyndbg fixes for reported problems.

    All of these have been in linux-next for a while with no reported
    problems"

    * tag 'char-misc-5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (82 commits)
    misc: eeprom: at24: check suspend status before disable regulator
    uio_hv_generic: Fix another memory leak in error handling paths
    uio_hv_generic: Fix a memory leak in error handling paths
    uio/uio_pci_generic: fix return value changed in refactoring
    Revert "Revert "ALSA: usx2y: Fix potential NULL pointer dereference""
    dyndbg: drop uninformative vpr_info
    dyndbg: avoid calling dyndbg_emit_prefix when it has no work
    binder: Return EFAULT if we fail BINDER_ENABLE_ONEWAY_SPAM_DETECTION
    cdrom: gdrom: initialize global variable at init time
    brcmfmac: properly check for bus register errors
    Revert "brcmfmac: add a check for the status of usb_register"
    video: imsttfb: check for ioremap() failures
    Revert "video: imsttfb: fix potential NULL pointer dereferences"
    net: liquidio: Add missing null pointer checks
    Revert "net: liquidio: fix a NULL pointer dereference"
    media: gspca: properly check for errors in po1030_probe()
    Revert "media: gspca: Check the return value of write_bridge for timeout"
    media: gspca: mt9m111: Check write_bridge for timeout
    Revert "media: gspca: mt9m111: Check write_bridge for timeout"
    media: dvb: Add check on sp8870_readreg return
    ...

    Linus Torvalds
     

15 May, 2021

1 commit

  • These tests deliberately access these arrays out of bounds, which will
    cause the dynamic local bounds checks inserted by
    CONFIG_UBSAN_LOCAL_BOUNDS to fail and panic the kernel. To avoid this
    problem, access the arrays via volatile pointers, which will prevent the
    compiler from being able to determine the array bounds.

    These accesses use volatile pointers to char (char *volatile) rather than
    the more conventional pointers to volatile char (volatile char *) because
    we want to prevent the compiler from making inferences about the pointer
    itself (i.e. its array bounds), not the data that it refers to.

    Link: https://lkml.kernel.org/r/20210507025915.1464056-1-pcc@google.com
    Link: https://linux-review.googlesource.com/id/I90b1713fbfa1bf68ff895aef099ea77b98a7c3b9
    Signed-off-by: Peter Collingbourne
    Tested-by: Alexander Potapenko
    Reviewed-by: Andrey Konovalov
    Cc: Peter Collingbourne
    Cc: George Popescu
    Cc: Elena Petrova
    Cc: Evgenii Stepanov
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Collingbourne
     

14 May, 2021

2 commits

  • Remove a vpr_info which I added in 2012, when I knew even less than now.
    In 2020, a simpler pr_fmt stripped it of context, and any remaining value.

    no functional change.

    Signed-off-by: Jim Cromie
    Link: https://lore.kernel.org/r/20210504222235.1033685-3-jim.cromie@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Jim Cromie
     
  • Wrap function in a static-inline one, which checks flags to avoid
    calling the function unnecessarily.

    And hoist its output-buffer initialization to the grand-caller, which
    is already allocating the buffer on the stack, and can trivially
    initialize it too.

    Signed-off-by: Jim Cromie
    Link: https://lore.kernel.org/r/20210504222235.1033685-2-jim.cromie@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Jim Cromie
     

13 May, 2021

1 commit


09 May, 2021

1 commit

  • Pull more Kbuild updates from Masahiro Yamada:

    - Convert sh and sparc to use generic shell scripts to generate the
    syscall headers

    - refactor .gitignore files

    - Update kernel/config_data.gz only when the content of the .config
    is really changed, which avoids the unneeded re-link of vmlinux

    - move "remove stale files" workarounds to scripts/remove-stale-files

    - suppress unused-but-set-variable warnings by default for Clang
    as well

    - fix locale setting LANG=C to LC_ALL=C

    - improve 'make distclean'

    - always keep intermediate objects from scripts/link-vmlinux.sh

    - move IF_ENABLED out of to make it self-contained

    - misc cleanups

    * tag 'kbuild-v5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (25 commits)
    linux/kconfig.h: replace IF_ENABLED() with PTR_IF() in
    kbuild: Don't remove link-vmlinux temporary files on exit/signal
    kbuild: remove the unneeded comments for external module builds
    kbuild: make distclean remove tag files in sub-directories
    kbuild: make distclean work against $(objtree) instead of $(srctree)
    kbuild: refactor modname-multi by using suffix-search
    kbuild: refactor fdtoverlay rule
    kbuild: parameterize the .o part of suffix-search
    arch: use cross_compiling to check whether it is a cross build or not
    kbuild: remove ARCH=sh64 support from top Makefile
    .gitignore: prefix local generated files with a slash
    kbuild: replace LANG=C with LC_ALL=C
    Makefile: Move -Wno-unused-but-set-variable out of GCC only block
    kbuild: add a script to remove stale generated files
    kbuild: update config_data.gz only when the content of .config is changed
    .gitignore: ignore only top-level modules.builtin
    .gitignore: move tags and TAGS close to other tag files
    kernel/.gitgnore: remove stale timeconst.h and hz.bc
    usr/include: refactor .gitignore
    genksyms: fix stale comment
    ...

    Linus Torvalds
     

08 May, 2021

1 commit

  • Pull networking fixes from Jakub Kicinski:
    "Networking fixes for 5.13-rc1, including fixes from bpf, can and
    netfilter trees. Self-contained fixes, nothing risky.

    Current release - new code bugs:

    - dsa: ksz: fix a few bugs found by static-checker in the new driver

    - stmmac: fix frame preemption handshake not triggering after
    interface restart

    Previous releases - regressions:

    - make nla_strcmp handle more then one trailing null character

    - fix stack OOB reads while fragmenting IPv4 packets in openvswitch
    and net/sched

    - sctp: do asoc update earlier in sctp_sf_do_dupcook_a

    - sctp: delay auto_asconf init until binding the first addr

    - stmmac: clear receive all(RA) bit when promiscuous mode is off

    - can: mcp251x: fix resume from sleep before interface was brought up

    Previous releases - always broken:

    - bpf: fix leakage of uninitialized bpf stack under speculation

    - bpf: fix masking negation logic upon negative dst register

    - netfilter: don't assume that skb_header_pointer() will never fail

    - only allow init netns to set default tcp cong to a restricted algo

    - xsk: fix xp_aligned_validate_desc() when len == chunk_size to avoid
    false positive errors

    - ethtool: fix missing NLM_F_MULTI flag when dumping

    - can: m_can: m_can_tx_work_queue(): fix tx_skb race condition

    - sctp: fix a SCTP_MIB_CURRESTAB leak in sctp_sf_do_dupcook_b

    - bridge: fix NULL-deref caused by a races between assigning
    rx_handler_data and setting the IFF_BRIDGE_PORT bit

    Latecomer:

    - seg6: add counters support for SRv6 Behaviors"

    * tag 'net-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (73 commits)
    atm: firestream: Use fallthrough pseudo-keyword
    net: stmmac: Do not enable RX FIFO overflow interrupts
    mptcp: fix splat when closing unaccepted socket
    i40e: Remove LLDP frame filters
    i40e: Fix PHY type identifiers for 2.5G and 5G adapters
    i40e: fix the restart auto-negotiation after FEC modified
    i40e: Fix use-after-free in i40e_client_subtask()
    i40e: fix broken XDP support
    netfilter: nftables: avoid potential overflows on 32bit arches
    netfilter: nftables: avoid overflows in nft_hash_buckets()
    tcp: Specify cmsgbuf is user pointer for receive zerocopy.
    mlxsw: spectrum_mr: Update egress RIF list before route's action
    net: ipa: fix inter-EE IRQ register definitions
    can: m_can: m_can_tx_work_queue(): fix tx_skb race condition
    can: mcp251x: fix resume from sleep before interface was brought up
    can: mcp251xfd: mcp251xfd_probe(): add missing can_rx_offload_del() in error path
    can: mcp251xfd: mcp251xfd_probe(): fix an error pointer dereference in probe
    netfilter: nftables: Fix a memleak from userdata error path in new objects
    netfilter: remove BUG_ON() after skb_header_pointer()
    netfilter: nfnetlink_osf: Fix a missing skb_header_pointer() NULL check
    ...

    Linus Torvalds
     

07 May, 2021

12 commits

  • Merge yet more updates from Andrew Morton:
    "This is everything else from -mm for this merge window.

    90 patches.

    Subsystems affected by this patch series: mm (cleanups and slub),
    alpha, procfs, sysctl, misc, core-kernel, bitmap, lib, compat,
    checkpatch, epoll, isofs, nilfs2, hpfs, exit, fork, kexec, gcov,
    panic, delayacct, gdb, resource, selftests, async, initramfs, ipc,
    drivers/char, and spelling"

    * emailed patches from Andrew Morton : (90 commits)
    mm: fix typos in comments
    mm: fix typos in comments
    treewide: remove editor modelines and cruft
    ipc/sem.c: spelling fix
    fs: fat: fix spelling typo of values
    kernel/sys.c: fix typo
    kernel/up.c: fix typo
    kernel/user_namespace.c: fix typos
    kernel/umh.c: fix some spelling mistakes
    include/linux/pgtable.h: few spelling fixes
    mm/slab.c: fix spelling mistake "disired" -> "desired"
    scripts/spelling.txt: add "overflw"
    scripts/spelling.txt: Add "diabled" typo
    scripts/spelling.txt: add "overlfow"
    arm: print alloc free paths for address in registers
    mm/vmalloc: remove vwrite()
    mm: remove xlate_dev_kmem_ptr()
    drivers/char: remove /dev/kmem for good
    mm: fix some typos and code style problems
    ipc/sem.c: mundane typo fixes
    ...

    Linus Torvalds
     
  • Mark match_uint() as kernel-doc notation since it is already fully
    annotated as such. Use % prefix on constants in kernel-doc comments.
    Convert function return descriptions to use the "Return:" kernel-doc
    notation.

    Link: https://lkml.kernel.org/r/20210407034514.5651-1-rdunlap@infradead.org
    Signed-off-by: Randy Dunlap
    Cc: Alexander Viro
    Cc: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     
  • Commit 52fbf1134d47 ("lib/genalloc.c: fix allocation of aligned buffer
    from non-aligned chunk") added a new parameter 'start_addr' w/o
    description for it. That causes some doc compile warning:

    lib/genalloc.c:649: warning: Function parameter or member 'start_addr' not described in 'gen_pool_first_fit'
    lib/genalloc.c:667: warning: Function parameter or member 'start_addr' not described in 'gen_pool_first_fit_align'
    lib/genalloc.c:694: warning: Function parameter or member 'start_addr' not described in 'gen_pool_fixed_alloc'
    lib/genalloc.c:729: warning: Function parameter or member 'start_addr' not described in 'gen_pool_first_fit_order_align'
    lib/genalloc.c:752: warning: Function parameter or member 'start_addr' not described in 'gen_pool_best_fit'

    This fixes it by adding a parameter descriptions.

    Link: https://lkml.kernel.org/r/20210405132021.131231-1-alexs@kernel.org
    Signed-off-by: Alex Shi
    Cc: Alexey Skidanov
    Cc: Huang Shijie
    Cc: Alex Shi
    Cc: Bhaskar Chowdhury
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alex Shi
     
  • commit 3e8f399da490 ("writeback: rework wb_[dec|inc]_stat family of
    functions") add some function description of percpu_counter_add_batch.
    but the double '*' in comments means a kernel-doc format comment which
    isn't right.

    Since the whole file of lib/percpu_counter.c has no any other kernel-doc
    format comments, we'd better to remove this incomplete one to tame the
    kernel-doc warning:

    lib/percpu_counter.c:83: warning: Function parameter or member 'fbc' not described in 'percpu_counter_add_batch'
    lib/percpu_counter.c:83: warning: Function parameter or member 'amount' not described in 'percpu_counter_add_batch'
    lib/percpu_counter.c:83: warning: Function parameter or member 'batch' not described in 'percpu_counter_add_batch'

    Link: https://lkml.kernel.org/r/20210405135505.132446-1-alexs@kernel.org
    Signed-off-by: Alex Shi
    Cc: Nikolay Borisov
    Cc: Stephen Boyd
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alex Shi
     
  • In RT system, the spin_lock will be replaced by sleepable rt_mutex lock,
    in __call_rcu(), disable interrupts before calling
    kasan_record_aux_stack(), will trigger this calltrace:

    BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:951
    in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 19, name: pgdatinit0
    Call Trace:
    ___might_sleep.cold+0x1b2/0x1f1
    rt_spin_lock+0x3b/0xb0
    stack_depot_save+0x1b9/0x440
    kasan_save_stack+0x32/0x40
    kasan_record_aux_stack+0xa5/0xb0
    __call_rcu+0x117/0x880
    __exit_signal+0xafb/0x1180
    release_task+0x1d6/0x480
    exit_notify+0x303/0x750
    do_exit+0x678/0xcf0
    kthread+0x364/0x4f0
    ret_from_fork+0x22/0x30

    Replace spinlock with raw_spinlock.

    Link: https://lkml.kernel.org/r/20210329084009.27013-1-qiang.zhang@windriver.com
    Signed-off-by: Zqiang
    Reported-by: Andrew Halaney
    Cc: Alexander Potapenko
    Cc: Gustavo A. R. Silva
    Cc: Vijayanand Jitta
    Cc: Vinayak Menon
    Cc: Yogesh Lal
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zqiang
     
  • crc8() does not change the data passed to it, so the pointer argument
    should be declared const. This avoids callers that receive const data
    having to cast it to a non-const pointer to call crc8().

    Link: https://lkml.kernel.org/r/20210329122409.3291-1-rf@opensource.cirrus.com
    Signed-off-by: Richard Fitzgerald
    Acked-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Richard Fitzgerald
     
  • s/macthing/matching/

    Link: https://lkml.kernel.org/r/20210326131530.30481-1-unixbhaskar@gmail.com
    Signed-off-by: Bhaskar Chowdhury
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bhaskar Chowdhury
     
  • Replace beautiully with beautifully

    Link: https://lkml.kernel.org/r/20210315090633.9759-1-mrtoastcheng@gmail.com
    Signed-off-by: ShihCheng Tu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    ToastC
     
  • Smatch gives the warning:
    lib/decompress_unlzma.c:395 process_bit1() warn: inconsistent indenting

    Link: https://lkml.kernel.org/r/1614567775-4478-1-git-send-email-wangqing@vivo.com
    Signed-off-by: Wang Qing
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wang Qing
     
  • s/buid/build/

    Link: https://lkml.kernel.org/r/20210301123129.18754-1-unixbhaskar@gmail.com
    Signed-off-by: Bhaskar Chowdhury
    Acked-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bhaskar Chowdhury
     
  • Similarly to bitmap functions, users would benefit if we'll handle a case
    of small-size bitmaps that fit into a single word.

    While here, move the find_last_bit() declaration to bitops/find.h where
    other find_*_bit() functions sit.

    Link: https://lkml.kernel.org/r/20210401003153.97325-11-yury.norov@gmail.com
    Signed-off-by: Yury Norov
    Acked-by: Rasmus Villemoes
    Acked-by: Andy Shevchenko
    Cc: Alexey Klimov
    Cc: Arnd Bergmann
    Cc: David Sterba
    Cc: Dennis Zhou
    Cc: Geert Uytterhoeven
    Cc: Jianpeng Ma
    Cc: Joe Perches
    Cc: John Paul Adrian Glaubitz
    Cc: Josh Poimboeuf
    Cc: Rich Felker
    Cc: Stefano Brivio
    Cc: Wei Yang
    Cc: Wolfram Sang
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yury Norov
     
  • lib/find_bit.c declares five single-line wrappers for _find_next_bit().
    We may turn those wrappers to inline functions. It eliminates unneeded
    function calls and opens room for compile-time optimizations.

    Link: https://lkml.kernel.org/r/20210401003153.97325-8-yury.norov@gmail.com
    Signed-off-by: Yury Norov
    Acked-by: Rasmus Villemoes
    Acked-by: Andy Shevchenko
    Cc: Alexey Klimov
    Cc: Arnd Bergmann
    Cc: David Sterba
    Cc: Dennis Zhou
    Cc: Geert Uytterhoeven
    Cc: Jianpeng Ma
    Cc: Joe Perches
    Cc: John Paul Adrian Glaubitz
    Cc: Josh Poimboeuf
    Cc: Rich Felker
    Cc: Stefano Brivio
    Cc: Wei Yang
    Cc: Wolfram Sang
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yury Norov
     

06 May, 2021

6 commits

  • Merge more updates from Andrew Morton:
    "The remainder of the main mm/ queue.

    143 patches.

    Subsystems affected by this patch series (all mm): pagecache, hugetlb,
    userfaultfd, vmscan, compaction, migration, cma, ksm, vmstat, mmap,
    kconfig, util, memory-hotplug, zswap, zsmalloc, highmem, cleanups, and
    kfence"

    * emailed patches from Andrew Morton : (143 commits)
    kfence: use power-efficient work queue to run delayed work
    kfence: maximize allocation wait timeout duration
    kfence: await for allocation using wait_event
    kfence: zero guard page after out-of-bounds access
    mm/process_vm_access.c: remove duplicate include
    mm/mempool: minor coding style tweaks
    mm/highmem.c: fix coding style issue
    btrfs: use memzero_page() instead of open coded kmap pattern
    iov_iter: lift memzero_page() to highmem.h
    mm/zsmalloc: use BUG_ON instead of if condition followed by BUG.
    mm/zswap.c: switch from strlcpy to strscpy
    arm64/Kconfig: introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
    x86/Kconfig: introduce ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE
    mm,memory_hotplug: add kernel boot option to enable memmap_on_memory
    acpi,memhotplug: enable MHP_MEMMAP_ON_MEMORY when supported
    mm,memory_hotplug: allocate memmap from the added memory range
    mm,memory_hotplug: factor out adjusting present pages into adjust_present_page_count()
    mm,memory_hotplug: relax fully spanned sections check
    drivers/base/memory: introduce memory_block_{online,offline}
    mm/memory_hotplug: remove broken locking of zone PCP structures during hot remove
    ...

    Linus Torvalds
     
  • Android userspace has been using TCA_KIND with a char[IFNAMESIZ]
    many-null-terminated buffer containing the string 'bpf'.

    This works on 4.19 and ceases to work on 5.10.

    I'm not entirely sure what fixes tag to use, but I think the issue
    was likely introduced in the below mentioned 5.4 commit.

    Reported-by: Nucca Chen
    Cc: Cong Wang
    Cc: David Ahern
    Cc: David S. Miller
    Cc: Jakub Kicinski
    Cc: Jamal Hadi Salim
    Cc: Jiri Pirko
    Cc: Jiri Pirko
    Fixes: 62794fc4fbf5 ("net_sched: add max len check for TCA_KIND")
    Change-Id: I66dc281f165a2858fc29a44869a270a2d698a82b
    Signed-off-by: David S. Miller

    Maciej Żenczykowski
     
  • Pull gpio updates from Bartosz Golaszewski:

    - new driver for the Realtek Otto GPIO controller

    - ACPI support for gpio-mpc8xxx

    - edge event support for gpio-sch (+ Kconfig fixes)

    - Kconfig improvements in gpio-ich

    - fixes to older issues in gpio-mockup

    - ACPI quirk for ignoring EC wakeups on Dell Venue 10 Pro 5055

    - improve the GPIO aggregator code by using more generic interfaces
    instead of reimplementing them in the driver

    - convert the DT bindings for gpio-74x164 to yaml

    - documentation improvements

    - a slew of other minor fixes and improvements to GPIO drivers

    * tag 'gpio-updates-for-v5.13-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (34 commits)
    dt-bindings: gpio: add YAML description for rockchip,gpio-bank
    gpio: mxs: remove useless function
    dt-bindings: gpio: fairchild,74hc595: Convert to json-schema
    gpio: it87: remove unused code
    gpio: 104-dio-48e: Fix coding style issues
    gpio: mpc8xxx: Add ACPI support
    gpio: ich: Switch to be dependent on LPC_ICH
    gpio: sch: Drop MFD_CORE selection
    gpio: sch: depends on LPC_SCH
    gpiolib: acpi: Add quirk to ignore EC wakeups on Dell Venue 10 Pro 5055
    gpio: sch: Hook into ACPI GPE handler to catch GPIO edge events
    gpio: sch: Add edge event support
    gpio: aggregator: Replace custom get_arg() with a generic next_arg()
    lib/cmdline: Export next_arg() for being used in modules
    gpio: omap: Use device_get_match_data() helper
    gpio: Add Realtek Otto GPIO support
    dt-bindings: gpio: Binding for Realtek Otto GPIO
    docs: kernel-parameters: Add gpio_mockup_named_lines
    docs: kernel-parameters: Move gpio-mockup for alphabetic order
    lib: bitmap: provide devm_bitmap_alloc() and devm_bitmap_zalloc()
    ...

    Linus Torvalds
     
  • …el/git/gregkh/char-misc

    Pull char/misc driver fixes from Greg KH:
    "Here are two char/misc fixes for 5.13-rc1 to resolve reported issues.

    The first is a bugfix for the nitro_enclaves driver that fixed some
    important problems. The second was a dyndbg bugfix that resolved some
    reported problems in dynamic debugging control.

    Both have been in linux-next for a while with no reported issues"

    * tag 'char-misc-5.13-rc1-round2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    dyndbg: fix parsing file query without a line-range suffix
    nitro_enclaves: Fix stale file descriptors on failed usercopy

    Linus Torvalds
     
  • Patch series "kfence: optimize timer scheduling", v2.

    We have observed that mostly-idle systems with KFENCE enabled wake up
    otherwise idle CPUs, preventing such to enter a lower power state.
    Debugging revealed that KFENCE spends too much active time in
    toggle_allocation_gate().

    While the first version of KFENCE was using all the right bits to be
    scheduling optimal, and thus power efficient, by simply using wait_event()
    + wake_up(), that code was unfortunately removed.

    As KFENCE was exposed to various different configs and tests, the
    scheduling optimal code slowly disappeared. First because of hung task
    warnings, and finally because of deadlocks when an allocation is made by
    timer code with debug objects enabled. Clearly, the "fixes" were not too
    friendly for devices that want to be power efficient.

    Therefore, let's try a little harder to fix the hung task and deadlock
    problems that we have with wait_event() + wake_up(), while remaining as
    scheduling friendly and power efficient as possible.

    Crucially, we need to defer the wake_up() to an irq_work, avoiding any
    potential for deadlock.

    The result with this series is that on the devices where we observed a
    power regression, power usage returns back to baseline levels.

    This patch (of 3):

    On mostly-idle systems, we have observed that toggle_allocation_gate() is
    a cause of frequent wake-ups, preventing an otherwise idle CPU to go into
    a lower power state.

    A late change in KFENCE's development, due to a potential deadlock [1],
    required changing the scheduling-friendly wait_event_timeout() and
    wake_up() to an open-coded wait-loop using schedule_timeout(). [1]
    https://lkml.kernel.org/r/000000000000c0645805b7f982e4@google.com

    To avoid unnecessary wake-ups, switch to using wait_event_timeout().

    Unfortunately, we still cannot use a version with direct wake_up() in
    __kfence_alloc() due to the same potential for deadlock as in [1].
    Instead, add a level of indirection via an irq_work that is scheduled if
    we determine that the kfence_timer requires a wake_up().

    Link: https://lkml.kernel.org/r/20210421105132.3965998-1-elver@google.com
    Link: https://lkml.kernel.org/r/20210421105132.3965998-2-elver@google.com
    Fixes: 0ce20dd84089 ("mm: add Kernel Electric-Fence infrastructure")
    Signed-off-by: Marco Elver
    Cc: Alexander Potapenko
    Cc: Dmitry Vyukov
    Cc: Jann Horn
    Cc: Mark Rutland
    Cc: Hillf Danton
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Marco Elver
     
  • Patch series "btrfs: Convert kmap/memset/kunmap to memzero_user()".

    Lifting memzero_user(), convert it to kmap_local_page() and then use it
    in btrfs.

    This patch (of 3):

    memzero_page() can replace the kmap/memset/kunmap pattern in other
    places in the code. While zero_user() has the same interface it is not
    the same call and its use should be limited and some of those calls may
    be better converted from zero_user() to memzero_page().[1] But that is
    not addressed in this series.

    Lift memzero_page() to highmem.

    [1] https://lore.kernel.org/lkml/CAHk-=wijdojzo56FzYqE5TOYw2Vws7ik3LEMGj9SPQaJJ+Z73Q@mail.gmail.com/

    Link: https://lkml.kernel.org/r/20210309212137.2610186-1-ira.weiny@intel.com
    Link: https://lkml.kernel.org/r/20210309212137.2610186-2-ira.weiny@intel.com
    Signed-off-by: Ira Weiny
    Cc: Alexander Viro
    Cc: David Sterba
    Cc: Chris Mason
    Cc: Josef Bacik
    Cc: Chaitanya Kulkarni
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ira Weiny
     

05 May, 2021

3 commits


02 May, 2021

1 commit

  • Pull kvm updates from Paolo Bonzini:
    "This is a large update by KVM standards, including AMD PSP (Platform
    Security Processor, aka "AMD Secure Technology") and ARM CoreSight
    (debug and trace) changes.

    ARM:

    - CoreSight: Add support for ETE and TRBE

    - Stage-2 isolation for the host kernel when running in protected
    mode

    - Guest SVE support when running in nVHE mode

    - Force W^X hypervisor mappings in nVHE mode

    - ITS save/restore for guests using direct injection with GICv4.1

    - nVHE panics now produce readable backtraces

    - Guest support for PTP using the ptp_kvm driver

    - Performance improvements in the S2 fault handler

    x86:

    - AMD PSP driver changes

    - Optimizations and cleanup of nested SVM code

    - AMD: Support for virtual SPEC_CTRL

    - Optimizations of the new MMU code: fast invalidation, zap under
    read lock, enable/disably dirty page logging under read lock

    - /dev/kvm API for AMD SEV live migration (guest API coming soon)

    - support SEV virtual machines sharing the same encryption context

    - support SGX in virtual machines

    - add a few more statistics

    - improved directed yield heuristics

    - Lots and lots of cleanups

    Generic:

    - Rework of MMU notifier interface, simplifying and optimizing the
    architecture-specific code

    - a handful of "Get rid of oprofile leftovers" patches

    - Some selftests improvements"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (379 commits)
    KVM: selftests: Speed up set_memory_region_test
    selftests: kvm: Fix the check of return value
    KVM: x86: Take advantage of kvm_arch_dy_has_pending_interrupt()
    KVM: SVM: Skip SEV cache flush if no ASIDs have been used
    KVM: SVM: Remove an unnecessary prototype declaration of sev_flush_asids()
    KVM: SVM: Drop redundant svm_sev_enabled() helper
    KVM: SVM: Move SEV VMCB tracking allocation to sev.c
    KVM: SVM: Explicitly check max SEV ASID during sev_hardware_setup()
    KVM: SVM: Unconditionally invoke sev_hardware_teardown()
    KVM: SVM: Enable SEV/SEV-ES functionality by default (when supported)
    KVM: SVM: Condition sev_enabled and sev_es_enabled on CONFIG_KVM_AMD_SEV=y
    KVM: SVM: Append "_enabled" to module-scoped SEV/SEV-ES control variables
    KVM: SEV: Mask CPUID[0x8000001F].eax according to supported features
    KVM: SVM: Move SEV module params/variables to sev.c
    KVM: SVM: Disable SEV/SEV-ES if NPT is disabled
    KVM: SVM: Free sev_asid_bitmap during init if SEV setup fails
    KVM: SVM: Zero out the VMCB array used to track SEV ASID association
    x86/sev: Drop redundant and potentially misleading 'sev_enabled'
    KVM: x86: Move reverse CPUID helpers to separate header file
    KVM: x86: Rename GPR accessors to make mode-aware variants the defaults
    ...

    Linus Torvalds
     

01 May, 2021

8 commits

  • The pattern prefixed with '/' matches files in the same directory,
    but not ones in sub-directories.

    Signed-off-by: Masahiro Yamada
    Acked-by: Miguel Ojeda
    Acked-by: Rob Herring
    Acked-by: Andra Paraschiv
    Acked-by: Greg Kroah-Hartman
    Acked-by: Gabriel Krisman Bertazi

    Masahiro Yamada
     
  • Merge misc updates from Andrew Morton:
    "A few misc subsystems and some of MM.

    175 patches.

    Subsystems affected by this patch series: ia64, kbuild, scripts, sh,
    ocfs2, kfifo, vfs, kernel/watchdog, and mm (slab-generic, slub,
    kmemleak, debug, pagecache, msync, gup, memremap, memcg, pagemap,
    mremap, dma, sparsemem, vmalloc, documentation, kasan, initialization,
    pagealloc, and memory-failure)"

    * emailed patches from Andrew Morton : (175 commits)
    mm/memory-failure: unnecessary amount of unmapping
    mm/mmzone.h: fix existing kernel-doc comments and link them to core-api
    mm: page_alloc: ignore init_on_free=1 for debug_pagealloc=1
    net: page_pool: use alloc_pages_bulk in refill code path
    net: page_pool: refactor dma_map into own function page_pool_dma_map
    SUNRPC: refresh rq_pages using a bulk page allocator
    SUNRPC: set rq_page_end differently
    mm/page_alloc: inline __rmqueue_pcplist
    mm/page_alloc: optimize code layout for __alloc_pages_bulk
    mm/page_alloc: add an array-based interface to the bulk page allocator
    mm/page_alloc: add a bulk page allocator
    mm/page_alloc: rename alloced to allocated
    mm/page_alloc: duplicate include linux/vmalloc.h
    mm, page_alloc: avoid page_to_pfn() in move_freepages()
    mm/Kconfig: remove default DISCONTIGMEM_MANUAL
    mm: page_alloc: dump migrate-failed pages
    mm/mempolicy: fix mpol_misplaced kernel-doc
    mm/mempolicy: rewrite alloc_pages_vma documentation
    mm/mempolicy: rewrite alloc_pages documentation
    mm/mempolicy: rename alloc_pages_current to alloc_pages
    ...

    Linus Torvalds
     
  • Pull powerpc updates from Michael Ellerman:

    - Enable KFENCE for 32-bit.

    - Implement EBPF for 32-bit.

    - Convert 32-bit to do interrupt entry/exit in C.

    - Convert 64-bit BookE to do interrupt entry/exit in C.

    - Changes to our signal handling code to use user_access_begin/end()
    more extensively.

    - Add support for time namespaces (CONFIG_TIME_NS)

    - A series of fixes that allow us to reenable STRICT_KERNEL_RWX.

    - Other smaller features, fixes & cleanups.

    Thanks to Alexey Kardashevskiy, Andreas Schwab, Andrew Donnellan, Aneesh
    Kumar K.V, Athira Rajeev, Bhaskar Chowdhury, Bixuan Cui, Cédric Le
    Goater, Chen Huang, Chris Packham, Christophe Leroy, Christopher M.
    Riedl, Colin Ian King, Dan Carpenter, Daniel Axtens, Daniel Henrique
    Barboza, David Gibson, Davidlohr Bueso, Denis Efremov, dingsenjie,
    Dmitry Safonov, Dominic DeMarco, Fabiano Rosas, Ganesh Goudar, Geert
    Uytterhoeven, Geetika Moolchandani, Greg Kurz, Guenter Roeck, Haren
    Myneni, He Ying, Jiapeng Chong, Jordan Niethe, Laurent Dufour, Lee
    Jones, Leonardo Bras, Li Huafei, Madhavan Srinivasan, Mahesh Salgaonkar,
    Masahiro Yamada, Nathan Chancellor, Nathan Lynch, Nicholas Piggin,
    Oliver O'Halloran, Paul Menzel, Pu Lehui, Randy Dunlap, Ravi Bangoria,
    Rosen Penev, Russell Currey, Santosh Sivaraj, Sebastian Andrzej Siewior,
    Segher Boessenkool, Shivaprasad G Bhat, Srikar Dronamraju, Stephen
    Rothwell, Thadeu Lima de Souza Cascardo, Thomas Gleixner, Tony Ambardar,
    Tyrel Datwyler, Vaibhav Jain, Vincenzo Frascino, Xiongwei Song, Yang Li,
    Yu Kuai, and Zhang Yunkai.

    * tag 'powerpc-5.13-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (302 commits)
    powerpc/signal32: Fix erroneous SIGSEGV on RT signal return
    powerpc: Avoid clang uninitialized warning in __get_user_size_allowed
    powerpc/papr_scm: Mark nvdimm as unarmed if needed during probe
    powerpc/kvm: Fix build error when PPC_MEM_KEYS/PPC_PSERIES=n
    powerpc/kasan: Fix shadow start address with modules
    powerpc/kernel/iommu: Use largepool as a last resort when !largealloc
    powerpc/kernel/iommu: Align size for IOMMU_PAGE_SIZE() to save TCEs
    powerpc/44x: fix spelling mistake in Kconfig "varients" -> "variants"
    powerpc/iommu: Annotate nested lock for lockdep
    powerpc/iommu: Do not immediately panic when failed IOMMU table allocation
    powerpc/iommu: Allocate it_map by vmalloc
    selftests/powerpc: remove unneeded semicolon
    powerpc/64s: remove unneeded semicolon
    powerpc/eeh: remove unneeded semicolon
    powerpc/selftests: Add selftest to test concurrent perf/ptrace events
    powerpc/selftests/perf-hwbreak: Add testcases for 2nd DAWR
    powerpc/selftests/perf-hwbreak: Coalesce event creation code
    powerpc/selftests/ptrace-hwbreak: Add testcases for 2nd DAWR
    powerpc/configs: Add IBMVNIC to some 64-bit configs
    selftests/powerpc: Add uaccess flush test
    ...

    Linus Torvalds
     
  • Currently, KASAN-KUnit tests can check that a particular annotated part of
    code causes a KASAN report. However, they do not check that no unwanted
    reports happen between the annotated parts.

    This patch implements these checks.

    It is done by setting report_data.report_found to false in
    kasan_test_init() and at the end of KUNIT_EXPECT_KASAN_FAIL() and then
    checking that it remains false at the beginning of
    KUNIT_EXPECT_KASAN_FAIL() and in kasan_test_exit().

    kunit_add_named_resource() call is moved to kasan_test_init(), and the
    value of fail_data.report_expected is kept as false in between
    KUNIT_EXPECT_KASAN_FAIL() annotations for consistency.

    Link: https://lkml.kernel.org/r/48079c52cc329fbc52f4386996598d58022fb872.1617207873.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Cc: Alexander Potapenko
    Cc: Dmitry Vyukov
    Cc: Andrey Ryabinin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • This change adds an argument to kasan_poison() and kasan_unpoison() that
    allows initializing memory along with setting the tags for HW_TAGS.

    Combining setting allocation tags with memory initialization will improve
    HW_TAGS KASAN performance when init_on_alloc/free is enabled.

    This change doesn't integrate memory initialization with KASAN, this is
    done is subsequent patches in this series.

    Link: https://lkml.kernel.org/r/3054314039fa64510947e674180d675cab1b4c41.1615296150.git.andreyknvl@google.com
    Signed-off-by: Andrey Konovalov
    Reviewed-by: Marco Elver
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Branislav Rankov
    Cc: Catalin Marinas
    Cc: Christoph Lameter
    Cc: David Rientjes
    Cc: Dmitry Vyukov
    Cc: Evgenii Stepanov
    Cc: Joonsoo Kim
    Cc: Kevin Brodsky
    Cc: Pekka Enberg
    Cc: Peter Collingbourne
    Cc: Vincenzo Frascino
    Cc: Vlastimil Babka
    Cc: Will Deacon
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrey Konovalov
     
  • By using this parameter we can specify how many workers are created to
    perform vmalloc tests. By default it is one CPU. The maximum value is
    set to 1024.

    As a result of this change a 'single_cpu_test' one becomes obsolete,
    therefore it is no longer needed.

    [urezki@gmail.com: extend max value of nr_threads parameter]
    Link: https://lkml.kernel.org/r/20210406124536.19658-1-urezki@gmail.com

    Link: https://lkml.kernel.org/r/20210402202237.20334-2-urezki@gmail.com
    Signed-off-by: Uladzislau Rezki (Sony)
    Cc: Hillf Danton
    Cc: Matthew Wilcox
    Cc: Michal Hocko
    Cc: Oleksiy Avramchenko
    Cc: Shuah Khan
    Cc: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uladzislau Rezki (Sony)
     
  • Remove two test cases related to kvfree_rcu() and SLAB. Those are
    considered as redundant now, because similar test functionality has
    recently been introduced in the "rcuscale" RCU test-suite.

    Link: https://lkml.kernel.org/r/20210402202237.20334-1-urezki@gmail.com
    Signed-off-by: Uladzislau Rezki (Sony)
    Cc: Hillf Danton
    Cc: Michal Hocko
    Cc: Matthew Wilcox
    Cc: Oleksiy Avramchenko
    Cc: Steven Rostedt
    Cc: Shuah Khan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Uladzislau Rezki (Sony)
     
  • early_memtest() does not get called from all architectures. Hence
    enabling CONFIG_MEMTEST and providing a valid memtest=[1..N] kernel
    command line option might not trigger the memory pattern tests as would be
    expected in normal circumstances. This situation is misleading.

    The change here prevents the above mentioned problem after introducing a
    new config option ARCH_USE_MEMTEST that should be subscribed on platforms
    that call early_memtest(), in order to enable the config CONFIG_MEMTEST.
    Conversely CONFIG_MEMTEST cannot be enabled on platforms where it would
    not be tested anyway.

    Link: https://lkml.kernel.org/r/1617269193-22294-1-git-send-email-anshuman.khandual@arm.com
    Signed-off-by: Anshuman Khandual
    Acked-by: Catalin Marinas (arm64)
    Reviewed-by: Max Filippov
    Cc: Russell King
    Cc: Will Deacon
    Cc: Thomas Bogendoerfer
    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Chris Zankel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anshuman Khandual
     

30 Apr, 2021

1 commit

  • Query like 'file tcp_input.c line 1234 +p' was broken by
    commit aaebe329bff0 ("dyndbg: accept 'file foo.c:func1' and 'file
    foo.c:10-100'") because a file name without a ':' now makes the loop in
    ddebug_parse_query() exits early before parsing the 'line 1234' part.
    As a result, all pr_debug() in tcp_input.c will be enabled, instead of only
    the one on line 1234. Changing 'break' to 'continue' fixes this.

    Fixes: aaebe329bff0 ("dyndbg: accept 'file foo.c:func1' and 'file foo.c:10-100'")
    Cc: stable
    Reviewed-by: Eric Dumazet
    Signed-off-by: Shuo Chen
    Acked-by: Jason Baron
    Link: https://lore.kernel.org/r/20210414212400.2927281-1-giantchen@gmail.com
    Signed-off-by: Greg Kroah-Hartman

    Shuo Chen