1. May 19, 2023
    • Jean-Philippe Brucker's avatar
      KVM: arm64: vgic: Fix locking comment · c38b8400
      Jean-Philippe Brucker authored
      It is now config_lock that must be held, not kvm lock. Replace the
      comment with a lockdep annotation.
      
      Fixes: f0032773
      
       ("KVM: arm64: Use config_lock to protect vgic state")
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe@linaro.org>
      Reviewed-by: default avatarOliver Upton <oliver.upton@linux.dev>
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Link: https://lore.kernel.org/r/20230518100914.2837292-4-jean-philippe@linaro.org
      c38b8400
    • Jean-Philippe Brucker's avatar
      KVM: arm64: vgic: Wrap vgic_its_create() with config_lock · 9cf2f840
      Jean-Philippe Brucker authored
      vgic_its_create() changes the vgic state without holding the
      config_lock, which triggers a lockdep warning in vgic_v4_init():
      
      [  358.667941] WARNING: CPU: 3 PID: 178 at arch/arm64/kvm/vgic/vgic-v4.c:245 vgic_v4_init+0x15c/0x7a8
      ...
      [  358.707410]  vgic_v4_init+0x15c/0x7a8
      [  358.708550]  vgic_its_create+0x37c/0x4a4
      [  358.709640]  kvm_vm_ioctl+0x1518/0x2d80
      [  358.710688]  __arm64_sys_ioctl+0x7ac/0x1ba8
      [  358.711960]  invoke_syscall.constprop.0+0x70/0x1e0
      [  358.713245]  do_el0_svc+0xe4/0x2d4
      [  358.714289]  el0_svc+0x44/0x8c
      [  358.715329]  el0t_64_sync_handler+0xf4/0x120
      [  358.716615]  el0t_64_sync+0x190/0x194
      
      Wrap the whole of vgic_its_create() with config_lock since, in addition
      to calling vgic_v4_init(), it also modifies the global kvm->arch.vgic
      state.
      
      Fixes: f0032773
      
       ("KVM: arm64: Use config_lock to protect vgic state")
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe@linaro.org>
      Reviewed-by: default avatarOliver Upton <oliver.upton@linux.dev>
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Link: https://lore.kernel.org/r/20230518100914.2837292-3-jean-philippe@linaro.org
      9cf2f840
    • Jean-Philippe Brucker's avatar
      KVM: arm64: vgic: Fix a circular locking issue · 59112e9c
      Jean-Philippe Brucker authored
      Lockdep reports a circular lock dependency between the srcu and the
      config_lock:
      
      [  262.179917] -> #1 (&kvm->srcu){.+.+}-{0:0}:
      [  262.182010]        __synchronize_srcu+0xb0/0x224
      [  262.183422]        synchronize_srcu_expedited+0x24/0x34
      [  262.184554]        kvm_io_bus_register_dev+0x324/0x50c
      [  262.185650]        vgic_register_redist_iodev+0x254/0x398
      [  262.186740]        vgic_v3_set_redist_base+0x3b0/0x724
      [  262.188087]        kvm_vgic_addr+0x364/0x600
      [  262.189189]        vgic_set_common_attr+0x90/0x544
      [  262.190278]        vgic_v3_set_attr+0x74/0x9c
      [  262.191432]        kvm_device_ioctl+0x2a0/0x4e4
      [  262.192515]        __arm64_sys_ioctl+0x7ac/0x1ba8
      [  262.193612]        invoke_syscall.constprop.0+0x70/0x1e0
      [  262.195006]        do_el0_svc+0xe4/0x2d4
      [  262.195929]        el0_svc+0x44/0x8c
      [  262.196917]        el0t_64_sync_handler+0xf4/0x120
      [  262.198238]        el0t_64_sync+0x190/0x194
      [  262.199224]
      [  262.199224] -> #0 (&kvm->arch.config_lock){+.+.}-{3:3}:
      [  262.201094]        __lock_acquire+0x2b70/0x626c
      [  262.202245]        lock_acquire+0x454/0x778
      [  262.203132]        __mutex_lock+0x190/0x8b4
      [  262.204023]        mutex_lock_nested+0x24/0x30
      [  262.205100]        vgic_mmio_write_v3_misc+0x5c/0x2a0
      [  262.206178]        dispatch_mmio_write+0xd8/0x258
      [  262.207498]        __kvm_io_bus_write+0x1e0/0x350
      [  262.208582]        kvm_io_bus_write+0xe0/0x1cc
      [  262.209653]        io_mem_abort+0x2ac/0x6d8
      [  262.210569]        kvm_handle_guest_abort+0x9b8/0x1f88
      [  262.211937]        handle_exit+0xc4/0x39c
      [  262.212971]        kvm_arch_vcpu_ioctl_run+0x90c/0x1c04
      [  262.214154]        kvm_vcpu_ioctl+0x450/0x12f8
      [  262.215233]        __arm64_sys_ioctl+0x7ac/0x1ba8
      [  262.216402]        invoke_syscall.constprop.0+0x70/0x1e0
      [  262.217774]        do_el0_svc+0xe4/0x2d4
      [  262.218758]        el0_svc+0x44/0x8c
      [  262.219941]        el0t_64_sync_handler+0xf4/0x120
      [  262.221110]        el0t_64_sync+0x190/0x194
      
      Note that the current report, which can be triggered by the vgic_irq
      kselftest, is a triple chain that includes slots_lock, but after
      inverting the slots_lock/config_lock dependency, the actual problem
      reported above remains.
      
      In several places, the vgic code calls kvm_io_bus_register_dev(), which
      synchronizes the srcu, while holding config_lock (#1). And the MMIO
      handler takes the config_lock while holding the srcu read lock (#0).
      
      Break dependency #1, by registering the distributor and redistributors
      without holding config_lock. The ITS also uses kvm_io_bus_register_dev()
      but already relies on slots_lock to serialize calls.
      
      The distributor iodev is created on the first KVM_RUN call. Multiple
      threads will race for vgic initialization, and only the first one will
      see !vgic_ready() under the lock. To serialize those threads, rely on
      slots_lock rather than config_lock.
      
      Redistributors are created earlier, through KVM_DEV_ARM_VGIC_GRP_ADDR
      ioctls and vCPU creation. Similarly, serialize the iodev creation with
      slots_lock, and the rest with config_lock.
      
      Fixes: f0032773
      
       ("KVM: arm64: Use config_lock to protect vgic state")
      Signed-off-by: default avatarJean-Philippe Brucker <jean-philippe@linaro.org>
      Reviewed-by: default avatarOliver Upton <oliver.upton@linux.dev>
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Link: https://lore.kernel.org/r/20230518100914.2837292-2-jean-philippe@linaro.org
      59112e9c
  2. May 11, 2023
    • Marc Zyngier's avatar
      Merge branch kvm-arm64/pgtable-fixes-6.4 into kvmarm-master/fixes · c3a62df4
      Marc Zyngier authored
      
      
      * kvm-arm64/pgtable-fixes-6.4:
        : .
        : Fixes for concurrent S2 mapping race from Oliver:
        :
        : "So it appears that there is a race between two parallel stage-2 map
        : walkers that could lead to mapping the incorrect PA for a given IPA, as
        : the IPA -> PA relationship picks up an unintended offset. This series
        : eliminates the problem by using the current IPA of the walk as the
        : source-of-truth regarding where we are in a map operation."
        : .
        KVM: arm64: Constify start/end/phys fields of the pgtable walker data
        KVM: arm64: Infer PA offset from VA in hyp map walker
        KVM: arm64: Infer the PA offset from IPA in stage-2 map walker
      
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      c3a62df4
    • Marc Zyngier's avatar
      Merge branch kvm-arm64/misc-6.4 into kvmarm-master/fixes · 9a48c597
      Marc Zyngier authored
      
      
      * kvm-arm64/misc-6.4:
        : .
        : Minor changes for 6.4:
        :
        : - Make better use of the bitmap API (bitmap_zero, bitmap_zalloc...)
        :
        : - FP/SVE/SME documentation update, in the hope that this field
        :   becomes clearer...
        :
        : - Add workaround for the usual Apple SEIS brokenness
        :
        : - Random comment fixes
        : .
        KVM: arm64: vgic: Add Apple M2 PRO/MAX cpus to the list of broken SEIS implementations
        KVM: arm64: Clarify host SME state management
        KVM: arm64: Restructure check for SVE support in FP trap handler
        KVM: arm64: Document check for TIF_FOREIGN_FPSTATE
        KVM: arm64: Fix repeated words in comments
        KVM: arm64: Use the bitmap API to allocate bitmaps
        KVM: arm64: Slightly optimize flush_context()
      
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      9a48c597
    • Marc Zyngier's avatar
      KVM: arm64: vgic: Add Apple M2 PRO/MAX cpus to the list of broken SEIS implementations · e910baa9
      Marc Zyngier authored
      
      
      Unsurprisingly, the M2 PRO is also affected by the SEIS bug, so add it
      to the naughty list. And since M2 MAX is likely to be of the same ilk,
      flag it as well.
      
      Tested on a M2 PRO mini machine.
      
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Reviewed-by: default avatarZenghui Yu <yuzenghui@huawei.com>
      Link: https://lore.kernel.org/r/20230501182141.39770-1-maz@kernel.org
      e910baa9
  3. May 08, 2023
    • Linus Torvalds's avatar
      Linux 6.4-rc1 · ac9a7868
      Linus Torvalds authored
      ac9a7868
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-for-v6.4-3-2023-05-06' of... · f085df1b
      Linus Torvalds authored
      Merge tag 'perf-tools-for-v6.4-3-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tool updates from Arnaldo Carvalho de Melo:
       "Third version of perf tool updates, with the build problems with with
        using a 'vmlinux.h' generated from the main build fixed, and the bpf
        skeleton build disabled by default.
      
        Build:
      
         - Require libtraceevent to build, one can disable it using
           NO_LIBTRACEEVENT=1.
      
           It is required for tools like 'perf sched', 'perf kvm', 'perf
           trace', etc.
      
           libtraceevent is available in most distros so installing
           'libtraceevent-devel' should be a one-time event to continue
           building perf as usual.
      
           Using NO_LIBTRACEEVENT=1 produces tooling that is functional and
           sufficient for lots of users not interested in those libtraceevent
           dependent features.
      
         - Allow Python support in 'perf script' when libtraceevent isn't
           linked, as not all features requires it, for instance Intel PT does
           not use tracepoints.
      
       ...
      f085df1b
    • Linus Torvalds's avatar
      Merge tag 'core-debugobjects-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 17784de6
      Linus Torvalds authored
      Pull debugobjects fix from Thomas Gleixner:
       "A single fix for debugobjects:
      
        The recent fix to ensure atomicity of lookup and allocation
        inadvertently broke the pool refill mechanism, so that debugobject
        OOMs now in certain situations. The reason is that the functions which
        got updated no longer invoke debug_objecs_init(), which is now the
        only place to care about refilling the tracking object pool.
      
        Restore the original behaviour by adding explicit refill opportunities
        to those places"
      
      * tag 'core-debugobjects-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        debugobject: Ensure pool refill (again)
      17784de6
    • Linus Torvalds's avatar
      Merge tag 'v6.4-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 6f69c981
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
      
       - A long-standing bug in crypto_engine
      
       - A buggy but harmless check in the sun8i-ss driver
      
       - A regression in the CRYPTO_USER interface
      
      * tag 'v6.4-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: api - Fix CRYPTO_USER checks for report function
        crypto: engine - fix crypto_queue backlog handling
        crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs()
      6f69c981
    • Linus Torvalds's avatar
      Merge tag '6.4-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · 63342b1d
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "smb3 client fixes, mostly DFS or reconnect related:
      
         - Two DFS connection sharing fixes
      
         - DFS refresh fix
      
         - Reconnect fix
      
         - Two potential use after free fixes
      
         - Also print prefix patch in mount debug msg
      
         - Two small cleanup fixes"
      
      * tag '6.4-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Remove unneeded semicolon
        cifs: fix sharing of DFS connections
        cifs: avoid potential races when handling multiple dfs tcons
        cifs: protect access of TCP_Server_Info::{origin,leaf}_fullpath
        cifs: fix potential race when tree connecting ipc
        cifs: fix potential use-after-free bugs in TCP_Server_Info::hostname
        cifs: print smb3_fs_context::source when mounting
        cifs: protect session status check in smb2_reconnect()
        SMB3.1.1: correct definition for app_instance_id create contexts
      63342b1d
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · d6b8a8c4
      Linus Torvalds authored
      Pull clk fixes from Stephen Boyd:
       "A couple more patches that would be good to get into -rc1:
      
         - Revert an i.MX patch that's causing video failures because division
           math goes sideways
      
         - Fix a clang + W=1 build isue where FIELD_PREP() is taking a 32-bit
           variable instead of the usual u64 type
      
         - Fix a Kconfig bug in the StarFive JH7110 clk config that selects a
           reset controller when it can't be selected"
      
      * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: starfive: Fix RESET_STARFIVE_JH7110 can't be selected in a specified case
        clk: sp7021: Adjust width of _m in HWM_FIELD_PREP()
        Revert "clk: imx: composite-8m: Add support to determine_rate"
      d6b8a8c4
    • Linus Torvalds's avatar
      Merge tag 'mailbox-v6.4' of git://git.linaro.org/landing-teams/working/fujitsu/integration · 1c1094e4
      Linus Torvalds authored
      Pull mailbox updates from Jassi Brar:
      
       - mailbox api: allow direct registration to a channel and convert omap
         and pcc to use mbox_bind_client
      
       - omap and hi6220 : use of_property_read_bool
      
       - test: fix double-free and use spinlock header
      
       - rockchip and bcm-pdc: drop of_match_ptr
      
       - mpfs: change config symbol
      
       - mediatek gce: support MT6795
      
       - qcom apcs: consolidate of_device_id and support IPQ9574
      
      * tag 'mailbox-v6.4' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        dt-bindings: mailbox: qcom: add compatible for IPQ9574 SoC
        mailbox: qcom-apcs-ipc: do not grow the of_device_id
        dt-bindings: mailbox: qcom,apcs-kpss-global: use fallbacks for few variants
        dt-bindings: mailbox: mediatek,gce-mailbox: Add support for MT6795
        mailbox: mpfs: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE
        mailbox: bcm-pdc: drop of_match_ptr for ID table
        mailbox: rockchip: drop of_match_pt...
      1c1094e4
    • Linus Torvalds's avatar
      Merge tag 'for-6.4/io_uring-2023-05-07' of git://git.kernel.dk/linux · 03e5cb7b
      Linus Torvalds authored
      Pull more io_uring updates from Jens Axboe:
       "Nothing major in here, just two different parts:
      
         - A small series from Breno that enables passing the full SQE down
           for ->uring_cmd().
      
           This is a prerequisite for enabling full network socket operations.
           Queued up a bit late because of some stylistic concerns that got
           resolved, would be nice to have this in 6.4-rc1 so the dependent
           work will be easier to handle for 6.5.
      
         - Fix for the huge page coalescing, which was a regression introduced
           in the 6.3 kernel release (Tobias)"
      
      * tag 'for-6.4/io_uring-2023-05-07' of git://git.kernel.dk/linux:
        io_uring: Remove unnecessary BUILD_BUG_ON
        io_uring: Pass whole sqe to commands
        io_uring: Create a helper to return the SQE size
        io_uring/rsrc: check for nonconsecutive pages
      03e5cb7b
  4. May 07, 2023
  5. May 06, 2023
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · dd9e11d6
      Linus Torvalds authored
      Pull more SCSI updates from James Bottomley:
       "Six late arriving patches for the merge window. Five are minor
        assorted fixes and updates.
      
        The IPR driver change removes SATA support, which will now allow a
        major cleanup in the ATA subsystem because it was the only driver
        still using the old attachment mechanism. The driver is only used on
        power systems and SATA was used to support a DVD device, which has
        long been moved to a different hba. IBM chose this route instead of
        porting ipr to the newer SATA interfaces"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: qedi: Fix use after free bug in qedi_remove()
        scsi: ufs: core: mcq: Fix &hwq->cq_lock deadlock issue
        scsi: ipr: Remove several unused variables
        scsi: pm80xx: Log device registration
        scsi: ipr: Remove SATA support
        scsi: scsi_debug: Abort commands from scsi_debug_device_reset()
      dd9e11d6
    • Linus Torvalds's avatar
      Merge tag 'for-6.4/block-2023-05-06' of git://git.kernel.dk/linux · a3b111b0
      Linus Torvalds authored
      Pull more block updates from Jens Axboe:
      
       - MD pull request via Song:
            - Improve raid5 sequential IO performance on spinning disks, which
              fixes a regression since v6.0 (Jan Kara)
            - Fix bitmap offset types, which fixes an issue introduced in this
              merge window (Jonathan Derrick)
      
       - Cleanup of hweight type used for cgroup writeback (Maxim)
      
       - Fix a regression with the "has_submit_bio" changes across partitions
         (Ming)
      
       - Cleanup of QUEUE_FLAG_ADD_RANDOM clearing.
      
         We used to set this flag on queues non blk-mq queues, and hence some
         drivers clear it unconditionally. Since all of these have since been
         converted to true blk-mq drivers, drop the useless clear as the bit
         is not set (Chaitanya)
      
       - Fix the flags being set in a bio for a flush for drbd (Christoph)
      
       - Cleanup and deduplication of the code handling setting block device
         capacity (Damien)
      
       - Fix for ublk handling IO timeouts (Ming)
      
       - Fix for a regression in blk-cgroup teardown (Tao)
      
       - NBD documentation and code fixes (Eric)
      
       - Convert blk-integrity to using device_attributes rather than a second
         kobject to manage lifetimes (Thomas)
      
      * tag 'for-6.4/block-2023-05-06' of git://git.kernel.dk/linux:
        ublk: add timeout handler
        drbd: correctly submit flush bio on barrier
        mailmap: add mailmap entries for Jens Axboe
        block: Skip destroyed blkg when restart in blkg_destroy_all()
        writeback: fix call of incorrect macro
        md: Fix bitmap offset type in sb writer
        md/raid5: Improve performance for sequential IO
        docs nbd: userspace NBD now favors github over sourceforge
        block nbd: use req.cookie instead of req.handle
        uapi nbd: add cookie alias to handle
        uapi nbd: improve doc links to userspace spec
        blk-integrity: register sysfs attributes on struct device
        blk-integrity: convert to struct device_attribute
        blk-integrity: use sysfs_emit
        block/drivers: remove dead clear of random flag
        block: sync part's ->bd_has_submit_bio with disk's
        block: Cleanup set_capacity()/bdev_set_nr_sectors()
      a3b111b0
    • Linus Torvalds's avatar
      Merge tag 'pipe-nonblock-2023-05-06' of git://git.kernel.dk/linux · 7644c823
      Linus Torvalds authored
      Pull nonblocking pipe io_uring support from Jens Axboe:
       "Here's the revised edition of the FMODE_NOWAIT support for pipes, in
        which we just flag it as such supporting FMODE_NOWAIT unconditionally,
        but clear it if we ever end up using splice/vmsplice on the pipe.
      
        The pipe read/write side is perfectly fine for nonblocking IO, however
        splice and vmsplice can potentially wait for IO with the pipe lock
        held"
      
      * tag 'pipe-nonblock-2023-05-06' of git://git.kernel.dk/linux:
        pipe: set FMODE_NOWAIT on pipes
        splice: clear FMODE_NOWAIT on file if splice/vmsplice is used
      7644c823
    • Linus Torvalds's avatar
      Merge tag 'sound-fix-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 0021b532
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "A collection of small fixes for rc1.
      
        The only (LOC-wise) dominant change was ASoC Qualcomm fix, but most of
        it was merely a code shuffling.
      
        Another significant change here is for ALSA PCM core; it received a
        revert and a series of fixes for PCM auto-silencing where it caused a
        regression in the previous PR for rc1.
      
        Others are all small: ASoC Intel fixes, various quirks for ASoC AMD,
        HD-audio and USB-audio, the continued legacy emu10k1 code cleanup, and
        some documentation updates"
      
      * tag 'sound-fix-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (23 commits)
        ALSA: pcm: use exit controlled loop in snd_pcm_playback_silence()
        ALSA: pcm: simplify top-up mode init in snd_pcm_playback_silence()
        ALSA: pcm: playback silence - move silence variable updates to separate function
        ALSA: pcm: playback silence - remove extra code
        ALSA: pcm: fix playback silence - correct incremental silencing
        ALSA: pcm: fix playback silence - use the actual new_hw_ptr for the threshold mode
        ALSA: pcm: Revert "ALSA: pcm: rewrite snd_pcm_playback_silence()"
        ALSA: hda/realtek: Fix mute and micmute LEDs for an HP laptop
        ALSA: caiaq: input: Add error handling for unsupported input methods in `snd_usb_caiaq_input_init`
        ALSA: usb-audio: Add quirk for Pioneer DDJ-800
        ALSA: hda/realtek: support HP Pavilion Aero 13-be0xxx Mute LED
        ASoC: Intel: soc-acpi-cht: Add quirk for Nextbook Ares 8A tablet
        ASoC: amd: yc: Add Asus VivoBook Pro 14 OLED M6400RC to the quirks list for acp6x
        ASoC: codecs: wcd938x: fix accessing regmap on unattached devices
        ALSA: docs: Fix code block indentation in ALSA driver example
        ALSA: docs: Extend module parameters description
        ALSA: hda/realtek: Add quirk for ASUS UM3402YAR using CS35L41
        ALSA: emu10k1: use more existing defines instead of open-coded numbers
        ASoC: amd: yc: Add ASUS M3402RA into DMI table
        ALSA: hda/realtek: Add quirk for ThinkPad P1 Gen 6
        ...
      0021b532
    • Linus Torvalds's avatar
      Merge tag 'regulator-fix-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator · 27e0c846
      Linus Torvalds authored
      Pull regulator fix from Mark Brown:
       "A trivial typo fix that came in during the merge window"
      
      * tag 'regulator-fix-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
        regulator: consumer.rst: fix 'regulator_enable' typo.
      27e0c846