07 Nov, 2020

1 commit


02 Nov, 2020

4 commits

  • Pull timer fixes from Thomas Gleixner:
    "A few fixes for timers/timekeeping:

    - Prevent undefined behaviour in the timespec64_to_ns() conversion
    which is used for converting user supplied time input to
    nanoseconds. It lacked overflow protection.

    - Mark sched_clock_read_begin/retry() to prevent recursion in the
    tracer

    - Remove unused debug functions in the hrtimer and timerlist code"

    * tag 'timers-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    time: Prevent undefined behaviour in timespec64_to_ns()
    timers: Remove unused inline funtion debug_timer_free()
    hrtimer: Remove unused inline function debug_hrtimer_free()
    time/sched_clock: Mark sched_clock_read_begin/retry() as notrace

    Linus Torvalds
     
  • Pull char/misc fixes/removals from Greg KH:
    "Here's some small fixes for 5.10-rc2 and a big driver removal.

    The fixes are for some reported issues in the interconnect and
    coresight drivers, nothing major.

    The "big" driver removal is the MIC drivers have been asked to be
    removed as the hardware never shipped and Intel no longer wants to
    maintain something that no one can use. This is welcomed by many as
    the DMA usage of these drivers was "interesting" and the security
    people were starting to question some issues that were starting to be
    found in the codebase.

    Note, one of the subsystems for this driver, the "VOP" code, will
    probably come back in future kernel versions as it was looking to
    potentially solve some PCIe virtualization issues that a number of
    other vendors were wanting to solve. But as-is, this codebase didn't
    work for anyone else so no actual functionality is being removed.

    All of these have been in linux-next with no reported issues"

    * tag 'char-misc-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    coresight: cti: Initialize dynamic sysfs attributes
    coresight: Fix uninitialised pointer bug in etm_setup_aux()
    coresight: add module license
    misc: mic: remove the MIC drivers
    interconnect: qcom: use icc_sync state for sm8[12]50
    interconnect: qcom: Ensure that the floor bandwidth value is enforced
    interconnect: qcom: sc7180: Init BCMs before creating the nodes
    interconnect: qcom: sdm845: Init BCMs before creating the nodes
    interconnect: Aggregate before setting initial bandwidth
    interconnect: qcom: sdm845: Enable keepalive for the MM1 BCM

    Linus Torvalds
     
  • Pull driver core and documentation fixes from Greg KH:
    "Here is one tiny debugfs change to fix up an API where the last user
    was successfully fixed up in 5.10-rc1 (so it couldn't be merged
    earlier), and a much larger Documentation/ABI/ update to the files so
    they can be automatically parsed by our tools.

    The Documentation/ABI/ updates are just formatting issues, small ones
    to bring the files into parsable format, and have been acked by
    numerous subsystem maintainers and the documentation maintainer. I
    figured it was good to get this into 5.10-rc2 to help wih the merge
    issues that would arise if these were to stick in linux-next until
    5.11-rc1.

    The debugfs change has been in linux-next for a long time, and the
    Documentation updates only for the last linux-next release"

    * tag 'driver-core-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (40 commits)
    scripts: get_abi.pl: assume ReST format by default
    docs: ABI: sysfs-class-led-trigger-pattern: remove hw_pattern duplication
    docs: ABI: sysfs-class-backlight: unify ABI documentation
    docs: ABI: sysfs-c2port: remove a duplicated entry
    docs: ABI: sysfs-class-power: unify duplicated properties
    docs: ABI: unify /sys/class/leds//brightness documentation
    docs: ABI: stable: remove a duplicated documentation
    docs: ABI: change read/write attributes
    docs: ABI: cleanup several ABI documents
    docs: ABI: sysfs-bus-nvdimm: use the right format for ABI
    docs: ABI: vdso: use the right format for ABI
    docs: ABI: fix syntax to be parsed using ReST notation
    docs: ABI: convert testing/configfs-acpi to ReST
    docs: Kconfig/Makefile: add a check for broken ABI files
    docs: abi-testing.rst: enable --rst-sources when building docs
    docs: ABI: don't escape ReST-incompatible chars from obsolete and removed
    docs: ABI: create a 2-depth index for ABI
    docs: ABI: make it parse ABI/stable as ReST-compatible files
    docs: ABI: sysfs-uevent: make it compatible with ReST output
    docs: ABI: testing: make the files compatible with ReST output
    ...

    Linus Torvalds
     
  • Pull USB driver fixes from Greg KH:
    "Here are a number of small bugfixes for reported issues in some USB
    drivers. They include:

    - typec bugfixes

    - xhci bugfixes and lockdep warning fixes

    - cdc-acm driver regression fix

    - kernel doc fixes

    - cdns3 driver bugfixes for a bunch of reported issues

    - other tiny USB driver fixes

    All have been in linux-next with no reported issues"

    * tag 'usb-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
    usb: cdns3: gadget: own the lock wrongly at the suspend routine
    usb: cdns3: Fix on-chip memory overflow issue
    usb: cdns3: gadget: suspicious implicit sign extension
    xhci: Don't create stream debugfs files with spinlock held.
    usb: xhci: Workaround for S3 issue on AMD SNPS 3.0 xHC
    xhci: Fix sizeof() mismatch
    usb: typec: stusb160x: fix signedness comparison issue with enum variables
    usb: typec: add missing MODULE_DEVICE_TABLE() to stusb160x
    USB: apple-mfi-fastcharge: don't probe unhandled devices
    usbcore: Check both id_table and match() when both available
    usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe()
    usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
    usb: typec: tcpm: reset hard_reset_count for any disconnect
    usb: cdc-acm: fix cooldown mechanism
    usb: host: fsl-mph-dr-of: check return of dma_set_mask()
    usb: fix kernel-doc markups
    usb: typec: stusb160x: fix some signedness bugs
    usb: cdns3: Variable 'length' set but not used

    Linus Torvalds
     

01 Nov, 2020

2 commits

  • Pull vhost fixes from Michael Tsirkin:
    "Fixes all over the place.

    A new UAPI is borderline: can also be considered a new feature but
    also seems to be the only way we could come up with to fix addressing
    for userspace - and it seems important to switch to it now before
    userspace making assumptions about addressing ability of devices is
    set in stone"

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    vdpasim: allow to assign a MAC address
    vdpasim: fix MAC address configuration
    vdpa: handle irq bypass register failure case
    vdpa_sim: Fix DMA mask
    Revert "vhost-vdpa: fix page pinning leakage in error path"
    vdpa/mlx5: Fix error return in map_direct_mr()
    vhost_vdpa: Return -EFAULT if copy_from_user() fails
    vdpa_sim: implement get_iova_range()
    vhost: vdpa: report iova range
    vdpa: introduce config op to get valid iova range

    Linus Torvalds
     
  • …linux/kernel/git/gustavoars/linux

    Pull more flexible-array member conversions from Gustavo A. R. Silva:
    "Replace zero-length arrays with flexible-array members"

    * tag 'flexible-array-conversions-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
    printk: ringbuffer: Replace zero-length array with flexible-array member
    net/smc: Replace zero-length array with flexible-array member
    net/mlx5: Replace zero-length array with flexible-array member
    mei: hw: Replace zero-length array with flexible-array member
    gve: Replace zero-length array with flexible-array member
    Bluetooth: btintel: Replace zero-length array with flexible-array member
    scsi: target: tcmu: Replace zero-length array with flexible-array member
    ima: Replace zero-length array with flexible-array member
    enetc: Replace zero-length array with flexible-array member
    fs: Replace zero-length array with flexible-array member
    Bluetooth: Replace zero-length array with flexible-array member
    params: Replace zero-length array with flexible-array member
    tracepoint: Replace zero-length array with flexible-array member
    platform/chrome: cros_ec_proto: Replace zero-length array with flexible-array member
    platform/chrome: cros_ec_commands: Replace zero-length array with flexible-array member
    mailbox: zynqmp-ipi-message: Replace zero-length array with flexible-array member
    dmaengine: ti-cppi5: Replace zero-length array with flexible-array member

    Linus Torvalds
     

31 Oct, 2020

5 commits

  • There is a regular need in the kernel to provide a way to declare having a
    dynamically sized set of trailing elements in a structure. Kernel code should
    always use “flexible array members”[1] for these cases. The older style of
    one-element or zero-length arrays should no longer be used[2].

    [1] https://en.wikipedia.org/wiki/Flexible_array_member
    [2] https://www.kernel.org/doc/html/v5.9/process/deprecated.html#zero-length-and-one-element-arrays

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     
  • Pull arm64 fixes from Will Deacon:
    "The diffstat is a bit spread out thanks to an invasive CPU erratum
    workaround which missed the merge window and also a bunch of fixes to
    the recently added MTE selftests.

    - Fixes to MTE kselftests

    - Fix return code from KVM Spectre-v2 hypercall

    - Build fixes for ld.lld and Clang's infamous integrated assembler

    - Ensure RCU is up and running before we use printk()

    - Workaround for Cortex-A77 erratum 1508412

    - Fix linker warnings from unexpected ELF sections

    - Ensure PE/COFF sections are 64k aligned"

    * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
    arm64: Change .weak to SYM_FUNC_START_WEAK_PI for arch/arm64/lib/mem*.S
    arm64/smp: Move rcu_cpu_starting() earlier
    arm64: Add workaround for Arm Cortex-A77 erratum 1508412
    arm64: Add part number for Arm Cortex-A77
    arm64: mte: Document that user PSTATE.TCO is ignored by kernel uaccess
    module: use hidden visibility for weak symbol references
    arm64: efi: increase EFI PE/COFF header padding to 64 KB
    arm64: vmlinux.lds: account for spurious empty .igot.plt sections
    kselftest/arm64: Fix check_user_mem test
    kselftest/arm64: Fix check_ksm_options test
    kselftest/arm64: Fix check_mmap_options test
    kselftest/arm64: Fix check_child_memory test
    kselftest/arm64: Fix check_tags_inclusion test
    kselftest/arm64: Fix check_buffer_fill test
    arm64: avoid -Woverride-init warning
    KVM: arm64: ARM_SMCCC_ARCH_WORKAROUND_1 doesn't return SMCCC_RET_NOT_REQUIRED
    arm64: vdso32: Allow ld.lld to properly link the VDSO

    Linus Torvalds
     
  • Pull asm-generic fix from Arnd Bergmann:
    "One small bugfix, fixing a build regression for RISC-V"

    * tag 'asm-generic-fixes-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
    asm-generic: mark __{get,put}_user_fn as __always_inline

    Linus Torvalds
     
  • Pull power management fixes from Rafael Wysocki:
    "These fix a few issues related to running intel_pstate in the passive
    mode with HWP enabled, correct the handling of the max_cstate module
    parameter in intel_idle and make a few janitorial changes.

    Specifics:

    - Modify Kconfig to prevent configuring either the "conservative" or
    the "ondemand" governor as the default cpufreq governor if
    intel_pstate is selected, in which case "schedutil" is the default
    choice for the default governor setting (Rafael Wysocki).

    - Modify the cpufreq core, intel_pstate and the schedutil governor to
    avoid missing updates of the HWP max limit when intel_pstate
    operates in the passive mode with HWP enabled (Rafael Wysocki).

    - Fix max_cstate module parameter handling in intel_idle for
    processor models with C-state tables coming from ACPI (Chen Yu).

    - Clean up assorted pieces of power management code (Jackie Zamow,
    Tom Rix, Zhang Qilong)"

    * tag 'pm-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    cpufreq: schedutil: Always call driver if CPUFREQ_NEED_UPDATE_LIMITS is set
    cpufreq: Introduce cpufreq_driver_test_flags()
    cpufreq: speedstep: remove unneeded semicolon
    PM: sleep: fix typo in kernel/power/process.c
    intel_idle: Fix max_cstate for processor models without C-state tables
    cpufreq: intel_pstate: Avoid missing HWP max updates in passive mode
    cpufreq: Introduce CPUFREQ_NEED_UPDATE_LIMITS driver flag
    cpufreq: Avoid configuring old governors as default with intel_pstate
    cpufreq: e_powersaver: remove unreachable break

    Linus Torvalds
     
  • Pull drm fixes from Dave Airlie:
    "A busier rc2 than normal, have larger sets of fixes for amdgpu +
    nouveau, along with some i915, docs, core, panel, sun4i, v3d, vc4
    fixes.

    Nothing spooky though or pumpkin related.

    docs:
    - kernel doc fixes

    core:
    - fix shmem helpers dma-buf mmap bug

    amdgpu:
    - Add new navi1x PCI ID
    - GPUVM reserved area fixes
    - Misc display fixes
    - Fix bad interactions between display code and CONFIG_KGDB
    - Fixes for SMU manual fan control and i2c

    nouveau:
    - endian regression fix for old gpus
    - buffer object refcount fix
    - uapi start/end alignment fix
    - display notifier fix
    - display clock checking fixes

    i915:
    - Fix max memory region size calculation
    - Restore ILK-M RPS support, restoring performance
    - Reject 90/270 degreerotated initial fbs

    panel:
    - mantix reset fixes

    sun4i:
    - scalar fix

    vc4:
    - hdmi audio fixes

    v3d:
    - fix double free"

    * tag 'drm-fixes-2020-10-30-1' of git://anongit.freedesktop.org/drm/drm: (42 commits)
    drm/nouveau/kms/nv50-: Fix clock checking algorithm in nv50_dp_mode_valid()
    drm/nouveau/kms/nv50-: Get rid of bogus nouveau_conn_mode_valid()
    drm/nouveau/device: fix changing endianess code to work on older GPUs
    drm/nouveau/gem: fix "refcount_t: underflow; use-after-free"
    drm/nouveau/kms/nv50-: Program notifier offset before requesting disp caps
    drm/nouveau/nouveau: fix the start/end range for migration
    drm/i915: Reject 90/270 degree rotated initial fbs
    drm/i915: Restore ILK-M RPS support
    drm/i915/region: fix max size calculation
    drm/vc4: Rework the structure conversion functions
    drm/vc4: hdmi: Add a name to the codec DAI component
    drm/shme-helpers: Fix dma_buf_mmap forwarding bug
    drm/vc4: hdmi: Avoid sleeping in atomic context
    drm/amdgpu/pm: fix the fan speed in fan1_input in manual mode for navi1x
    drm/amd/pm: fix the wrong fan speed in fan1_input
    drm/amdgpu/swsmu: drop smu i2c bus on navi1x
    drm/vc4: drv: Add error handding for bind
    drm: drm_print.h: fix kernel-doc markups
    drm: kernel-doc: drm_dp_helper.h: fix a typo
    drm: kernel-doc: add description for a new function parameter
    ...

    Linus Torvalds
     

30 Oct, 2020

11 commits

  • No one checks the return value of debugfs_create_devm_seqfile(), as it's
    not needed, so make the return value void, so that no one tries to do so
    in the future.

    Link: https://lore.kernel.org/r/20201023131037.2500765-1-gregkh@linuxfoundation.org
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • There is a regular need in the kernel to provide a way to declare having a
    dynamically sized set of trailing elements in a structure. Kernel code should
    always use “flexible array members”[1] for these cases. The older style of
    one-element or zero-length arrays should no longer be used[2].

    [1] https://en.wikipedia.org/wiki/Flexible_array_member
    [2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     
  • There is a regular need in the kernel to provide a way to declare having a
    dynamically sized set of trailing elements in a structure. Kernel code should
    always use “flexible array members”[1] for these cases. The older style of
    one-element or zero-length arrays should no longer be used[2].

    [1] https://en.wikipedia.org/wiki/Flexible_array_member
    [2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     
  • There is a regular need in the kernel to provide a way to declare having a
    dynamically sized set of trailing elements in a structure. Kernel code should
    always use “flexible array members”[1] for these cases. The older style of
    one-element or zero-length arrays should no longer be used[2].

    [1] https://en.wikipedia.org/wiki/Flexible_array_member
    [2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     
  • There is a regular need in the kernel to provide a way to declare having a
    dynamically sized set of trailing elements in a structure. Kernel code should
    always use “flexible array members”[1] for these cases. The older style of
    one-element or zero-length arrays should no longer be used[2].

    [1] https://en.wikipedia.org/wiki/Flexible_array_member
    [2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     
  • There is a regular need in the kernel to provide a way to declare having a
    dynamically sized set of trailing elements in a structure. Kernel code should
    always use “flexible array members”[1] for these cases. The older style of
    one-element or zero-length arrays should no longer be used[2].

    [1] https://en.wikipedia.org/wiki/Flexible_array_member
    [2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     
  • …ux/kernel/git/gustavoars/linux

    Pull fallthrough fix from Gustavo A. R. Silva:
    "This fixes a ton of fall-through warnings when building with Clang
    12.0.0 and -Wimplicit-fallthrough"

    * tag 'fallthrough-fixes-clang-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
    include: jhash/signal: Fix fall-through warnings for Clang

    Linus Torvalds
     
  • Pull rdma fixes from Jason Gunthorpe:
    "The good news is people are testing rc1 in the RDMA world - the bad
    news is testing of the for-next area is not as good as I had hoped, as
    we really should have caught at least the rdma_connect_locked() issue
    before now.

    Notable merge window regressions that didn't get caught/fixed in time
    for rc1:

    - Fix in kernel users of rxe, they were broken by the rapid fix to
    undo the uABI breakage in rxe from another patch

    - EFA userspace needs to read the GID table but was broken with the
    new GID table logic

    - Fix user triggerable deadlock in mlx5 using devlink reload

    - Fix deadlock in several ULPs using rdma_connect from the CM handler
    callbacks

    - Memory leak in qedr"

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
    RDMA/qedr: Fix memory leak in iWARP CM
    RDMA: Add rdma_connect_locked()
    RDMA/uverbs: Fix false error in query gid IOCTL
    RDMA/mlx5: Fix devlink deadlock on net namespace deletion
    RDMA/rxe: Fix small problem in network_type patch

    Linus Torvalds
     
  • In preparation to enable -Wimplicit-fallthrough for Clang, explicitly
    add break statements instead of letting the code fall through to the
    next case.

    This patch adds four break statements that, together, fix almost 40,000
    warnings when building Linux 5.10-rc1 with Clang 12.0.0 and this[1] change
    reverted. Notice that in order to enable -Wimplicit-fallthrough for Clang,
    such change[1] is meant to be reverted at some point. So, this patch helps
    to move in that direction.

    Something important to mention is that there is currently a discrepancy
    between GCC and Clang when dealing with switch fall-through to empty case
    statements or to cases that only contain a break/continue/return
    statement[2][3][4].

    Now that the -Wimplicit-fallthrough option has been globally enabled[5],
    any compiler should really warn on missing either a fallthrough annotation
    or any of the other case-terminating statements (break/continue/return/
    goto) when falling through to the next case statement. Making exceptions
    to this introduces variation in case handling which may continue to lead
    to bugs, misunderstandings, and a general lack of robustness. The point
    of enabling options like -Wimplicit-fallthrough is to prevent human error
    and aid developers in spotting bugs before their code is even built/
    submitted/committed, therefore eliminating classes of bugs. So, in order
    to really accomplish this, we should, and can, move in the direction of
    addressing any error-prone scenarios and get rid of the unintentional
    fallthrough bug-class in the kernel, entirely, even if there is some minor
    redundancy. Better to have explicit case-ending statements than continue to
    have exceptions where one must guess as to the right result. The compiler
    will eliminate any actual redundancy.

    [1] commit e2079e93f562c ("kbuild: Do not enable -Wimplicit-fallthrough for clang for now")
    [2] https://github.com/ClangBuiltLinux/linux/issues/636
    [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432
    [4] https://godbolt.org/z/xgkvIh
    [5] commit a035d552a93b ("Makefile: Globally enable fall-through warning")

    Co-developed-by: Kees Cook
    Signed-off-by: Kees Cook
    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     
  • Pull AFS fixes from David Howells:

    - Fix copy_file_range() to an afs file now returning EINVAL if the
    splice_write file op isn't supplied.

    - Fix a deref-before-check in afs_unuse_cell().

    - Fix a use-after-free in afs_xattr_get_acl().

    - Fix afs to not try to clear PG_writeback when laundering a page.

    - Fix afs to take a ref on a page that it sets PG_private on and to
    drop that ref when clearing PG_private. This is done through recently
    added helpers.

    - Fix a page leak if write_begin() fails.

    - Fix afs_write_begin() to not alter the dirty region info stored in
    page->private, but rather do this in afs_write_end() instead when we
    know what we actually changed.

    - Fix afs_invalidatepage() to alter the dirty region info on a page
    when partial page invalidation occurs so that we don't inadvertantly
    include a span of zeros that will get written back if a page gets
    laundered due to a remote 3rd-party induced invalidation.

    We mustn't, however, reduce the dirty region if the page has been
    seen to be mapped (ie. we got called through the page_mkwrite vector)
    as the page might still be mapped and we might lose data if the file
    is extended again.

    - Fix the dirty region info to have a lower resolution if the size of
    the page is too large for this to be encoded (e.g. powerpc32 with 64K
    pages).

    Note that this might not be the ideal way to handle this, since it
    may allow some leakage of undirtied zero bytes to the server's copy
    in the case of a 3rd-party conflict.

    To aid the last two fixes, two additional changes:

    - Wrap the manipulations of the dirty region info stored in
    page->private into helper functions.

    - Alter the encoding of the dirty region so that the region bounds can
    be stored with one fewer bit, making a bit available for the
    indication of mappedness.

    * tag 'afs-fixes-20201029' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
    afs: Fix dirty-region encoding on ppc32 with 64K pages
    afs: Fix afs_invalidatepage to adjust the dirty region
    afs: Alter dirty range encoding in page->private
    afs: Wrap page->private manipulations in inline functions
    afs: Fix where page->private is set during write
    afs: Fix page leak on afs_write_begin() failure
    afs: Fix to take ref on page when PG_private is set
    afs: Fix afs_launder_page to not clear PG_writeback
    afs: Fix a use after free in afs_xattr_get_acl()
    afs: Fix tracing deref-before-check
    afs: Fix copy_file_range()

    Linus Torvalds
     
  • Pull ext4 fixes from Ted Ts'o:
    "Bug fixes for the new ext4 fast commit feature, plus a fix for the
    'data=journal' bug fix.

    Also use the generic casefolding support which has now landed in
    fs/libfs.c for 5.10"

    * tag 'ext4_for_linus_fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
    ext4: indicate that fast_commit is available via /sys/fs/ext4/feature/...
    ext4: use generic casefolding support
    ext4: do not use extent after put_bh
    ext4: use IS_ERR() for error checking of path
    ext4: fix mmap write protection for data=journal mode
    jbd2: fix a kernel-doc markup
    ext4: use s_mount_flags instead of s_mount_state for fast commit state
    ext4: make num of fast commit blocks configurable
    ext4: properly check for dirty state in ext4_inode_datasync_dirty()
    ext4: fix double locking in ext4_fc_commit_dentry_updates()

    Linus Torvalds
     

29 Oct, 2020

6 commits

  • Fix afs_invalidatepage() to adjust the dirty region recorded in
    page->private when truncating a page. If the dirty region is entirely
    removed, then the private data is cleared and the page dirty state is
    cleared.

    Without this, if the page is truncated and then expanded again by truncate,
    zeros from the expanded, but no-longer dirty region may get written back to
    the server if the page gets laundered due to a conflicting 3rd-party write.

    It mustn't, however, shorten the dirty region of the page if that page is
    still mmapped and has been marked dirty by afs_page_mkwrite(), so a flag is
    stored in page->private to record this.

    Fixes: 4343d00872e1 ("afs: Get rid of the afs_writeback record")
    Signed-off-by: David Howells

    David Howells
     
  • The afs filesystem uses page->private to store the dirty range within a
    page such that in the event of a conflicting 3rd-party write to the server,
    we write back just the bits that got changed locally.

    However, there are a couple of problems with this:

    (1) I need a bit to note if the page might be mapped so that partial
    invalidation doesn't shrink the range.

    (2) There aren't necessarily sufficient bits to store the entire range of
    data altered (say it's a 32-bit system with 64KiB pages or transparent
    huge pages are in use).

    So wrap the accesses in inline functions so that future commits can change
    how this works.

    Also move them out of the tracing header into the in-directory header.
    There's not really any need for them to be in the tracing header.

    Signed-off-by: David Howells

    David Howells
     
  • Add a helper function to test the flags of the cpufreq driver in use
    againt a given flags mask.

    In particular, this will be needed to test the
    CPUFREQ_NEED_UPDATE_LIMITS cpufreq driver flag in the schedutil
    governor.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • This patch removes the MIC drivers from the kernel tree
    since the corresponding devices have been discontinued.

    Removing the dma and char-misc changes in one patch and
    merging via the char-misc tree is best to avoid any
    potential build breakage.

    Cc: Nikhil Rao
    Reviewed-by: Ashutosh Dixit
    Signed-off-by: Sudeep Dutt
    Acked-By: Vinod Koul
    Reviewed-by: Sherry Sun
    Link: https://lore.kernel.org/r/8c1443136563de34699d2c084df478181c205db4.1603854416.git.sudeep.dutt@intel.com
    Signed-off-by: Greg Kroah-Hartman

    Sudeep Dutt
     
  • The kernel-doc markup that documents _fc_replay_callback is
    missing an asterisk, causing this warning:

    ../include/linux/jbd2.h:1271: warning: Function parameter or member 'j_fc_replay_callback' not described in 'journal_s'

    When building the docs.

    Fixes: 609f928af48f ("jbd2: fast commit recovery path")
    Signed-off-by: Mauro Carvalho Chehab
    Link: https://lore.kernel.org/r/6055927ada2015b55b413cdd2670533bdc9a8da2.1603791716.git.mchehab+huawei@kernel.org
    Signed-off-by: Theodore Ts'o

    Mauro Carvalho Chehab
     
  • This patch reserves a field in the jbd2 superblock for number of fast
    commit blocks. When this value is non-zero, Ext4 uses this field to
    set the number of fast commit blocks.

    Fixes: 6866d7b3f2bb ("ext4/jbd2: add fast commit initialization")
    Signed-off-by: Harshad Shirwadkar
    Link: https://lore.kernel.org/r/20201027044915.2553163-2-harshadshirwadkar@gmail.com
    Signed-off-by: Theodore Ts'o

    Harshad Shirwadkar
     

28 Oct, 2020

6 commits

  • Geert reports that commit be2881824ae9eb92 ("arm64/build: Assert for
    unwanted sections") results in build errors on arm64 for configurations
    that have CONFIG_MODULES disabled.

    The commit in question added ASSERT()s to the arm64 linker script to
    ensure that linker generated sections such as .got.plt etc are empty,
    but as it turns out, there are corner cases where the linker does emit
    content into those sections. More specifically, weak references to
    function symbols (which can remain unsatisfied, and can therefore not
    be emitted as relative references) will be emitted as GOT and PLT
    entries when linking the kernel in PIE mode (which is the case when
    CONFIG_RELOCATABLE is enabled, which is on by default).

    What happens is that code such as

    struct device *(*fn)(struct device *dev);
    struct device *iommu_device;

    fn = symbol_get(mdev_get_iommu_device);
    if (fn) {
    iommu_device = fn(dev);

    essentially gets converted into the following when CONFIG_MODULES is off:

    struct device *iommu_device;

    if (&mdev_get_iommu_device) {
    iommu_device = mdev_get_iommu_device(dev);

    where mdev_get_iommu_device is emitted as a weak symbol reference into
    the object file. The first reference is decorated with an ordinary
    ABS64 data relocation (which yields 0x0 if the reference remains
    unsatisfied). However, the indirect call is turned into a direct call
    covered by a R_AARCH64_CALL26 relocation, which is converted into a
    call via a PLT entry taking the target address from the associated
    GOT entry.

    Given that such GOT and PLT entries are unnecessary for fully linked
    binaries such as the kernel, let's give these weak symbol references
    hidden visibility, so that the linker knows that the weak reference
    via R_AARCH64_CALL26 can simply remain unsatisfied.

    Signed-off-by: Ard Biesheuvel
    Tested-by: Geert Uytterhoeven
    Reviewed-by: Fangrui Song
    Acked-by: Jessica Yu
    Cc: Jessica Yu
    Cc: Kees Cook
    Cc: Geert Uytterhoeven
    Cc: Nick Desaulniers
    Link: https://lore.kernel.org/r/20201027151132.14066-1-ardb@kernel.org
    Signed-off-by: Will Deacon

    Ard Biesheuvel
     
  • There is a common comment marked, instead, with kernel-doc
    notation.

    Also, some identifiers have different names between their
    prototypes and the kernel-doc markup.

    Signed-off-by: Mauro Carvalho Chehab
    Acked-by: Felipe Balbi
    Link: https://lore.kernel.org/r/0b964be3884def04fcd20ea5c12cb90d0014871c.1603469755.git.mchehab+huawei@kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Mauro Carvalho Chehab
     
  • There are two flows for handling RDMA_CM_EVENT_ROUTE_RESOLVED, either the
    handler triggers a completion and another thread does rdma_connect() or
    the handler directly calls rdma_connect().

    In all cases rdma_connect() needs to hold the handler_mutex, but when
    handler's are invoked this is already held by the core code. This causes
    ULPs using the 2nd method to deadlock.

    Provide a rdma_connect_locked() and have all ULPs call it from their
    handlers.

    Link: https://lore.kernel.org/r/0-v2-53c22d5c1405+33-rdma_connect_locking_jgg@nvidia.com
    Reported-and-tested-by: Guoqing Jiang
    Fixes: 2a7cec538169 ("RDMA/cma: Fix locking for the RDMA_CM_CONNECT state")
    Acked-by: Santosh Shilimkar
    Acked-by: Jack Wang
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Max Gurtovoy
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Jason Gunthorpe

    Jason Gunthorpe
     
  • According to the SMCCC spec[1](7.5.2 Discovery) the
    ARM_SMCCC_ARCH_WORKAROUND_1 function id only returns 0, 1, and
    SMCCC_RET_NOT_SUPPORTED.

    0 is "workaround required and safe to call this function"
    1 is "workaround not required but safe to call this function"
    SMCCC_RET_NOT_SUPPORTED is "might be vulnerable or might not be, who knows, I give up!"

    SMCCC_RET_NOT_SUPPORTED might as well mean "workaround required, except
    calling this function may not work because it isn't implemented in some
    cases". Wonderful. We map this SMC call to

    0 is SPECTRE_MITIGATED
    1 is SPECTRE_UNAFFECTED
    SMCCC_RET_NOT_SUPPORTED is SPECTRE_VULNERABLE

    For KVM hypercalls (hvc), we've implemented this function id to return
    SMCCC_RET_NOT_SUPPORTED, 0, and SMCCC_RET_NOT_REQUIRED. One of those
    isn't supposed to be there. Per the code we call
    arm64_get_spectre_v2_state() to figure out what to return for this
    feature discovery call.

    0 is SPECTRE_MITIGATED
    SMCCC_RET_NOT_REQUIRED is SPECTRE_UNAFFECTED
    SMCCC_RET_NOT_SUPPORTED is SPECTRE_VULNERABLE

    Let's clean this up so that KVM tells the guest this mapping:

    0 is SPECTRE_MITIGATED
    1 is SPECTRE_UNAFFECTED
    SMCCC_RET_NOT_SUPPORTED is SPECTRE_VULNERABLE

    Note: SMCCC_RET_NOT_AFFECTED is 1 but isn't part of the SMCCC spec

    Fixes: c118bbb52743 ("arm64: KVM: Propagate full Spectre v2 workaround state to KVM guests")
    Signed-off-by: Stephen Boyd
    Acked-by: Marc Zyngier
    Acked-by: Will Deacon
    Cc: Andre Przywara
    Cc: Steven Price
    Cc: Marc Zyngier
    Cc: stable@vger.kernel.org
    Link: https://developer.arm.com/documentation/den0028/latest [1]
    Link: https://lore.kernel.org/r/20201023154751.1973872-1-swboyd@chromium.org
    Signed-off-by: Will Deacon

    Stephen Boyd
     
  • Under some circumstances, the compiler generates .ctors.* sections. This
    is seen doing a cross compile of x86_64 from a powerpc64el host:

    x86_64-linux-gnu-ld: warning: orphan section `.ctors.65435' from `kernel/trace/trace_clock.o' being
    placed in section `.ctors.65435'
    x86_64-linux-gnu-ld: warning: orphan section `.ctors.65435' from `kernel/trace/ftrace.o' being
    placed in section `.ctors.65435'
    x86_64-linux-gnu-ld: warning: orphan section `.ctors.65435' from `kernel/trace/ring_buffer.o' being
    placed in section `.ctors.65435'

    Include these orphans along with the regular .ctors section.

    Reported-by: Stephen Rothwell
    Tested-by: Stephen Rothwell
    Fixes: 83109d5d5fba ("x86/build: Warn on orphan section placement")
    Signed-off-by: Kees Cook
    Acked-by: Nick Desaulniers
    Link: https://lore.kernel.org/r/20201005025720.2599682-1-keescook@chromium.org

    Kees Cook
     
  • Generally, a cpufreq driver may need to update some internal upper
    and lower frequency boundaries on policy max and min changes,
    respectively, but currently this does not work if the target
    frequency does not change along with the policy limit.

    Namely, if the target frequency does not change along with the
    policy min or max, the "target_freq == policy->cur" check in
    __cpufreq_driver_target() prevents driver callbacks from being
    invoked and they do not even have a chance to update the
    corresponding internal boundary.

    This particularly affects the "powersave" and "performance"
    governors that always set the target frequency to one of the
    policy limits and it never changes when the other limit is updated.

    To allow cpufreq the drivers needing to update internal frequency
    boundaries on policy limits changes to avoid this issue, introduce
    a new driver flag, CPUFREQ_NEED_UPDATE_LIMITS, that (when set) will
    neutralize the check mentioned above.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Viresh Kumar

    Rafael J. Wysocki
     

27 Oct, 2020

5 commits

  • Without the explicit __always_inline, some RISC-V configs place the
    functions out of line, triggering the BUILD_BUG_ON checks in the
    function.

    Fixes: 11129e8ed4d9 ("riscv: use memcpy based uaccess for nommu again")
    Reported-by: kernel test robot
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Arnd Bergmann

    Christoph Hellwig
     
  • A kernel-doc markup should start with the identifier on its
    first line.

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/5b76c5625709aaaa3abee98faa620b9f3d27ff85.1603791716.git.mchehab+huawei@kernel.org

    Mauro Carvalho Chehab
     
  • Right now, kernel-doc generates a warning:
    ./include/drm/drm_dp_helper.h:1786: warning: Function parameter or member 'hbr2_reset' not described in 'drm_dp_phy_test_params'

    This is due to a typo:

    @hb2_reset -> @hbr2_reset

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/2a615cb38e951215bb1bddc2481ad323c9cf3fc9.1603791716.git.mchehab+huawei@kernel.org

    Mauro Carvalho Chehab
     
  • It is not possible to create cross-references for duplicated
    symbols. While Sphinx always detected it, on Sphinx 3 it
    generates warnings like this:

    .../Documentation/gpu/drm-kms-helpers:326: ../drivers/gpu/drm/drm_edid.c:1626: WARNING: Duplicate C declaration, also defined in 'gpu/drm-kms-helpers'.
    Declaration is 'bool drm_edid_are_equal (const struct edid *edid1, const struct edid *edid2)'.

    So, get rid of the duplicated kernel-doc markup.

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Daniel Vetter
    Link: https://patchwork.freedesktop.org/patch/msgid/9310f4074fa9d29cd3ad60684d86d0ace8dab7ae.1603791716.git.mchehab+huawei@kernel.org

    Mauro Carvalho Chehab
     
  • When a mlx5 core devlink instance is reloaded in different net namespace,
    its associated IB device is deleted and recreated.

    Example sequence is:
    $ ip netns add foo
    $ devlink dev reload pci/0000:00:08.0 netns foo
    $ ip netns del foo

    mlx5 IB device needs to attach and detach the netdevice to it through the
    netdev notifier chain during load and unload sequence. A below call graph
    of the unload flow.

    cleanup_net()
    down_read(&pernet_ops_rwsem);
    Signed-off-by: Leon Romanovsky
    Signed-off-by: Jason Gunthorpe

    Parav Pandit