1. 01 Jul, 2022 8 commits
    • Alexander Lobakin's avatar
      bitmap: don't assume compiler evaluates small mem*() builtins calls · 3e7e5baa
      Alexander Lobakin authored
      Intel kernel bot triggered the build bug on ARC architecture that
      in fact is as follows:
      
      	DECLARE_BITMAP(bitmap, BITS_PER_LONG);
      
      	bitmap_clear(bitmap, 0, BITS_PER_LONG);
      	BUILD_BUG_ON(!__builtin_constant_p(*bitmap));
      
      which can be expanded to:
      
      	unsigned long bitmap[1];
      
      	memset(bitmap, 0, sizeof(*bitmap));
      	BUILD_BUG_ON(!__builtin_constant_p(*bitmap));
      
      In most cases, a compiler is able to expand small/simple mem*()
      calls to simple assignments or bitops, in this case that would mean:
      
      	unsigned long bitmap[1] = { 0 };
      
      	BUILD_BUG_ON(!__builtin_constant_p(*bitmap));
      
      and on most architectures this works, but not on ARC, despite having
      -O3 for every build.
      So, to make this work, in case when the last bit to modify is still
      within the first long (small_const_nbits()), just use plain
      assignments for the rest of bitmap_*() functions which still use
      mem*(), but didn't receive such compile-time optimizations yet.
      This doesn't have the same coverage as compilers provide, but at
      least something to start:
      
      text: add/remove: 3/7 grow/shrink: 43/78 up/down: 1848/-3370 (-1546)
      data: add/remove: 1/11 grow/shrink: 0/8 up/down: 4/-356 (-352)
      
      notably cpumask_*() family when NR_CPUS <= BITS_PER_LONG:
      
      netif_get_num_default_rss_queues              38       4     -34
      cpumask_copy                                  90       -     -90
      cpumask_clear                                146       -    -146
      
      and the abovementioned assertion started passing.
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
      3e7e5baa
    • Alexander Lobakin's avatar
      net/ice: fix initializing the bitmap in the switch code · 2f7ee2a7
      Alexander Lobakin authored
      Kbuild spotted the following bug during the testing of one of
      the optimizations:
      
      In file included from include/linux/cpumask.h:12,
      [...]
                      from drivers/net/ethernet/intel/ice/ice_switch.c:4:
      drivers/net/ethernet/intel/ice/ice_switch.c: In function 'ice_find_free_recp_res_idx.constprop':
      include/linux/bitmap.h:447:22: warning: 'possible_idx[0]' is used uninitialized [-Wuninitialized]
        447 |                 *map |= GENMASK(start + nbits - 1, start);
            |                      ^~
      In file included from drivers/net/ethernet/intel/ice/ice.h:7,
                       from drivers/net/ethernet/intel/ice/ice_lib.h:7,
                       from drivers/net/ethernet/intel/ice/ice_switch.c:4:
      drivers/net/ethernet/intel/ice/ice_switch.c:4929:24: note: 'possible_idx[0]' was declared here
       4929 |         DECLARE_BITMAP(possible_idx, ICE_MAX_FV_WORDS);
            |                        ^~~~~~~~~~~~
      include/linux/types.h:11:23: note: in definition of macro 'DECLARE_BITMAP'
         11 |         unsigned long name[BITS_TO_LONGS(bits)]
            |                       ^~~~
      
      %ICE_MAX_FV_WORDS is 48, so bitmap_set() here was initializing only
      48 bits, leaving a junk in the rest 16.
      It was previously hidden due to that filling 48 bits makes
      bitmap_set() call external __bitmap_set(), but after making it use
      plain bit arithmetics on small bitmaps, compilers started seeing
      the issue. It was still working because those 16 weren't used
      anywhere anyhow.
      bitmap_{clear,set}() are not really intended to initialize bitmaps,
      rather to modify already initialized ones, as they don't do anything
      past the passed number of bits. The correct function to do this in
      that particular case is bitmap_fill(), so use it here. It will do
      `*possible_idx = ~0UL` instead of `*possible_idx |= GENMASK(47, 0)`,
      not leaving anything in an undefined state.
      
      Fixes: fd2a6b71 ("ice: create advanced switch recipe")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
      2f7ee2a7
    • Alexander Lobakin's avatar
      bitops: let optimize out non-atomic bitops on compile-time constants · b03fc117
      Alexander Lobakin authored
      Currently, many architecture-specific non-atomic bitop
      implementations use inline asm or other hacks which are faster or
      more robust when working with "real" variables (i.e. fields from
      the structures etc.), but the compilers have no clue how to optimize
      them out when called on compile-time constants. That said, the
      following code:
      
      	DECLARE_BITMAP(foo, BITS_PER_LONG) = { }; // -> unsigned long foo[1];
      	unsigned long bar = BIT(BAR_BIT);
      	unsigned long baz = 0;
      
      	__set_bit(FOO_BIT, foo);
      	baz |= BIT(BAZ_BIT);
      
      	BUILD_BUG_ON(!__builtin_constant_p(test_bit(FOO_BIT, foo));
      	BUILD_BUG_ON(!__builtin_constant_p(bar & BAR_BIT));
      	BUILD_BUG_ON(!__builtin_constant_p(baz & BAZ_BIT));
      
      triggers the first assertion on x86_64, which means that the
      compiler is unable to evaluate it to a compile-time initializer
      when the architecture-specific bitop is used even if it's obvious.
      In order to let the compiler optimize out such cases, expand the
      bitop() macro to use the "constant" C non-atomic bitop
      implementations when all of the arguments passed are compile-time
      constants, which means that the result will be a compile-time
      constant as well, so that it produces more efficient and simple
      code in 100% cases, comparing to the architecture-specific
      counterparts.
      
      The savings are architecture, compiler and compiler flags dependent,
      for example, on x86_64 -O2:
      
      GCC 12: add/remove: 78/29 grow/shrink: 332/525 up/down: 31325/-61560 (-30235)
      LLVM 13: add/remove: 79/76 grow/shrink: 184/537 up/down: 55076/-141892 (-86816)
      LLVM 14: add/remove: 10/3 grow/shrink: 93/138 up/down: 3705/-6992 (-3287)
      
      and ARM64 (courtesy of Mark):
      
      GCC 11: add/remove: 92/29 grow/shrink: 933/2766 up/down: 39340/-82580 (-43240)
      LLVM 14: add/remove: 21/11 grow/shrink: 620/651 up/down: 12060/-15824 (-3764)
      
      Cc: Mark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
      b03fc117
    • Alexander Lobakin's avatar
      bitops: wrap non-atomic bitops with a transparent macro · e69eb9c4
      Alexander Lobakin authored
      In preparation for altering the non-atomic bitops with a macro, wrap
      them in a transparent definition. This requires prepending one more
      '_' to their names in order to be able to do that seamlessly. It is
      a simple change, given that all the non-prefixed definitions are now
      in asm-generic.
      sparc32 already has several triple-underscored functions, so I had
      to rename them ('___' -> 'sp32_').
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
      e69eb9c4
    • Alexander Lobakin's avatar
      bitops: define const_*() versions of the non-atomics · bb7379bf
      Alexander Lobakin authored
      Define const_*() variants of the non-atomic bitops to be used when
      the input arguments are compile-time constants, so that the compiler
      will be always able to resolve those to compile-time constants as
      well. Those are mostly direct aliases for generic_*() with one
      exception for const_test_bit(): the original one is declared
      atomic-safe and thus doesn't discard the `volatile` qualifier, so
      in order to let optimize code, define it separately disregarding
      the qualifier.
      Add them to the compile-time type checks as well just in case.
      Suggested-by: default avatarMarco Elver <elver@google.com>
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
      bb7379bf
    • Alexander Lobakin's avatar
      bitops: unify non-atomic bitops prototypes across architectures · 0e862838
      Alexander Lobakin authored
      Currently, there is a mess with the prototypes of the non-atomic
      bitops across the different architectures:
      
      ret	bool, int, unsigned long
      nr	int, long, unsigned int, unsigned long
      addr	volatile unsigned long *, volatile void *
      
      Thankfully, it doesn't provoke any bugs, but can sometimes make
      the compiler angry when it's not handy at all.
      Adjust all the prototypes to the following standard:
      
      ret	bool				retval can be only 0 or 1
      nr	unsigned long			native; signed makes no sense
      addr	volatile unsigned long *	bitmaps are arrays of ulongs
      
      Next, some architectures don't define 'arch_' versions as they don't
      support instrumentation, others do. To make sure there is always the
      same set of callables present and to ease any potential future
      changes, make them all follow the rule:
       * architecture-specific files define only 'arch_' versions;
       * non-prefixed versions can be defined only in asm-generic files;
      and place the non-prefixed definitions into a new file in
      asm-generic to be included by non-instrumented architectures.
      
      Finally, add some static assertions in order to prevent people from
      making a mess in this room again.
      I also used the %__always_inline attribute consistently, so that
      they always get resolved to the actual operations.
      Suggested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Reviewed-by: default avatarYury Norov <yury.norov@gmail.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
      0e862838
    • Alexander Lobakin's avatar
      bitops: always define asm-generic non-atomic bitops · 21bb8af5
      Alexander Lobakin authored
      Move generic non-atomic bitops from the asm-generic header which
      gets included only when there are no architecture-specific
      alternatives, to a separate independent file to make them always
      available.
      Almost no actual code changes, only one comment added to
      generic_test_bit() saying that it's an atomic operation itself
      and thus `volatile` must always stay there with no cast-aways.
      
      Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # comment
      Suggested-by: Marco Elver <elver@google.com> # reference to kernel-doc
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: default avatarMarco Elver <elver@google.com>
      Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
      21bb8af5
    • Alexander Lobakin's avatar
      ia64, processor: fix -Wincompatible-pointer-types in ia64_get_irr() · e5a16a5c
      Alexander Lobakin authored
      test_bit(), as any other bitmap op, takes `unsigned long *` as a
      second argument (pointer to the actual bitmap), as any bitmap
      itself is an array of unsigned longs. However, the ia64_get_irr()
      code passes a ref to `u64` as a second argument.
      This works with the ia64 bitops implementation due to that they
      have `void *` as the second argument and then cast it later on.
      This works with the bitmap API itself due to that `unsigned long`
      has the same size on ia64 as `u64` (`unsigned long long`), but
      from the compiler PoV those two are different.
      Define @irr as `unsigned long` to fix that. That implies no
      functional changes. Has been hidden for 16 years!
      
      Fixes: a5878691 ("[IA64] avoid broken SAL_CACHE_FLUSH implementations")
      Cc: stable@vger.kernel.org # 2.6.16+
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarAlexander Lobakin <alexandr.lobakin@intel.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: default avatarYury Norov <yury.norov@gmail.com>
      Signed-off-by: default avatarYury Norov <yury.norov@gmail.com>
      e5a16a5c
  2. 24 Jun, 2022 1 commit
  3. 19 Jun, 2022 11 commits
    • Linus Torvalds's avatar
      Linux 5.19-rc3 · a111daf0
      Linus Torvalds authored
      a111daf0
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 05c6ca85
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
      
       - Make RESERVE_BRK() work again with older binutils. The recent
         'simplification' broke that.
      
       - Make early #VE handling increment RIP when successful.
      
       - Make the #VE code consistent vs. the RIP adjustments and add
         comments.
      
       - Handle load_unaligned_zeropad() across page boundaries correctly in
         #VE when the second page is shared.
      
      * tag 'x86-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page
        x86/tdx: Clarify RIP adjustments in #VE handler
        x86/tdx: Fix early #VE handling
        x86/mm: Fix RESERVE_BRK() for older binutils
      05c6ca85
    • Linus Torvalds's avatar
      Merge tag 'objtool-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5d770f11
      Linus Torvalds authored
      Pull build tooling updates from Thomas Gleixner:
      
       - Remove obsolete CONFIG_X86_SMAP reference from objtool
      
       - Fix overlapping text section failures in faddr2line for real
      
       - Remove OBJECT_FILES_NON_STANDARD usage from x86 ftrace and replace it
         with finegrained annotations so objtool can validate that code
         correctly.
      
      * tag 'objtool-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/ftrace: Remove OBJECT_FILES_NON_STANDARD usage
        faddr2line: Fix overlapping text section failures, the sequel
        objtool: Fix obsolete reference to CONFIG_X86_SMAP
      5d770f11
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 727c3991
      Linus Torvalds authored
      Pull scheduler fix from Thomas Gleixner:
       "A single scheduler fix plugging a race between sched_setscheduler()
        and balance_push().
      
        sched_setscheduler() spliced the balance callbacks accross a lock
        break which makes it possible for an interleaving schedule() to
        observe an empty list"
      
      * tag 'sched-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched: Fix balance_push() vs __sched_setscheduler()
      727c3991
    • Linus Torvalds's avatar
      Merge tag 'locking-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4afb6515
      Linus Torvalds authored
      Pull lockdep fix from Thomas Gleixner:
       "A RT fix for lockdep.
      
        lockdep invokes prandom_u32() to create cookies. This worked until
        prandom_u32() was switched to the real random generator, which takes a
        spinlock for extraction, which does not work on RT when invoked from
        atomic contexts.
      
        lockdep has no requirement for real random numbers and it turns out
        sched_clock() is good enough to create the cookie. That works
        everywhere and is faster"
      
      * tag 'locking-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        locking/lockdep: Use sched_clock() for random numbers
      4afb6515
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 36da9f5f
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A set of interrupt subsystem updates:
      
        Core:
      
         - Ensure runtime power management for chained interrupts
      
        Drivers:
      
         - A collection of OF node refcount fixes
      
         - Unbreak MIPS uniprocessor builds
      
         - Fix xilinx interrupt controller Kconfig dependencies
      
         - Add a missing compatible string to the Uniphier driver"
      
      * tag 'irq-urgent-2022-06-19' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/loongson-liointc: Use architecture register to get coreid
        irqchip/uniphier-aidet: Add compatible string for NX1 SoC
        dt-bindings: interrupt-controller/uniphier-aidet: Add bindings for NX1 SoC
        irqchip/realtek-rtl: Fix refcount leak in map_interrupts
        irqchip/gic-v3: Fix refcount leak in gic_populate_ppi_partitions
        irqchip/gic-v3: Fix error handling in gic_populate_ppi_partitions
        irqchip/apple-aic: Fix refcount leak in aic_of_ic_init
        irqchip/apple-aic: Fix refcount leak in build_fiq_affinity
        irqchip/gic/realview: Fix refcount leak in realview_gic_of_init
        irqchip/xilinx: Remove microblaze+zynq dependency
        genirq: PM: Use runtime PM for chained interrupts
      36da9f5f
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.19-rc3-take2' of... · bc94632c
      Linus Torvalds authored
      Merge tag 'char-misc-5.19-rc3-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
      
      Pull char/misc driver fixes for real from Greg KH:
       "Let's tag the proper branch this time...
      
        Here are some small char/misc driver fixes for 5.19-rc3 that resolve
        some reported issues.
      
        They include:
      
         - mei driver fixes
      
         - comedi driver fix
      
         - rtsx build warning fix
      
         - fsl-mc-bus driver fix
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      This is what the merge in commit f0ec9c65 _should_ have merged, but
      Greg fat-fingered the pull request and I got some small changes from
      linux-next instead there. Credit to Nathan Chancellor for eagle-eyes.
      
      Link: https://lore.kernel.org/all/Yqywy+Md2AfGDu8v@dev-arch.thelio-3990X/
      
      * tag 'char-misc-5.19-rc3-take2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        bus: fsl-mc-bus: fix KASAN use-after-free in fsl_mc_bus_remove()
        mei: me: add raptor lake point S DID
        mei: hbm: drop capability response on early shutdown
        mei: me: set internal pg flag to off on hardware reset
        misc: rtsx: Fix clang -Wsometimes-uninitialized in rts5261_init_from_hw()
        comedi: vmk80xx: fix expression for tx buffer size
      bc94632c
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · ee4eb6ee
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "MAINTAINERS rectifications and a few minor driver fixes"
      
      * tag 'i2c-for-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: mediatek: Fix an error handling path in mtk_i2c_probe()
        i2c: designware: Use standard optional ref clock implementation
        MAINTAINERS: core DT include belongs to core
        MAINTAINERS: add include/dt-bindings/i2c to I2C SUBSYSTEM HOST DRIVERS
        i2c: npcm7xx: Add check for platform_driver_register
        MAINTAINERS: Update Synopsys DesignWare I2C to Supported
      ee4eb6ee
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.19-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 063232b6
      Linus Torvalds authored
      Pull xfs fixes from Darrick Wong:
       "There's not a whole lot this time around (I'm still on vacation) but
        here are some important fixes for new features merged in -rc1:
      
         - Fix a bug where inode flag changes would accidentally drop nrext64
      
         - Fix a race condition when toggling LARP mode"
      
      * tag 'xfs-5.19-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: preserve DIFLAG2_NREXT64 when setting other inode attributes
        xfs: fix variable state usage
        xfs: fix TOCTOU race involving the new logged xattrs control knob
      063232b6
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 354c6e07
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "Fix a variety of bugs, many of which were found by folks using fuzzing
        or error injection.
      
        Also fix up how test_dummy_encryption mount option is handled for the
        new mount API.
      
        Finally, fix/cleanup a number of comments and ext4 Documentation
        files"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: fix a doubled word "need" in a comment
        ext4: add reserved GDT blocks check
        ext4: make variable "count" signed
        ext4: correct the judgment of BUG in ext4_mb_normalize_request
        ext4: fix bug_on ext4_mb_use_inode_pa
        ext4: fix up test_dummy_encryption handling for new mount API
        ext4: use kmemdup() to replace kmalloc + memcpy
        ext4: fix super block checksum incorrect after mount
        ext4: improve write performance with disabled delalloc
        ext4: fix warning when submitting superblock in ext4_commit_super()
        ext4, doc: remove unnecessary escaping
        ext4: fix incorrect comment in ext4_bio_write_page()
        fs: fix jbd2_journal_try_to_free_buffers() kernel-doc comment
      354c6e07
    • Linus Torvalds's avatar
      Merge tag '5.19-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · ace2045e
      Linus Torvalds authored
      Pull cifs client fixes from Steve French:
       "Two cifs debugging improvements - one found to deal with debugging a
        multichannel problem and one for a recent fallocate issue
      
        This does include the two larger multichannel reconnect (dynamically
        adjusting interfaces on reconnect) patches, because we recently found
        an additional problem with multichannel to one server type that I want
        to include at the same time"
      
      * tag '5.19-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: when a channel is not found for server, log its connection id
        smb3: add trace point for SMB2_set_eof
      ace2045e
  4. 18 Jun, 2022 9 commits
  5. 17 Jun, 2022 11 commits
    • Kirill A. Shutemov's avatar
      x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page · 1e776965
      Kirill A. Shutemov authored
      load_unaligned_zeropad() can lead to unwanted loads across page boundaries.
      The unwanted loads are typically harmless. But, they might be made to
      totally unrelated or even unmapped memory. load_unaligned_zeropad()
      relies on exception fixup (#PF, #GP and now #VE) to recover from these
      unwanted loads.
      
      In TDX guests, the second page can be shared page and a VMM may configure
      it to trigger #VE.
      
      The kernel assumes that #VE on a shared page is an MMIO access and tries to
      decode instruction to handle it. In case of load_unaligned_zeropad() it
      may result in confusion as it is not MMIO access.
      
      Fix it by detecting split page MMIO accesses and failing them.
      load_unaligned_zeropad() will recover using exception fixups.
      
      The issue was discovered by analysis and reproduced artificially. It was
      not triggered during testing.
      
      [ dhansen: fix up changelogs and comments for grammar and clarity,
      	   plus incorporate Kirill's off-by-one fix]
      Signed-off-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Link: https://lkml.kernel.org/r/20220614120135.14812-4-kirill.shutemov@linux.intel.com
      1e776965
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.19-2' of git://git.linux-nfs.org/projects/anna/linux-nfs · 4b35035b
      Linus Torvalds authored
      Pull NFS client fixes from Anna Schumaker:
      
       - Add FMODE_CAN_ODIRECT support to NFSv4 so opens don't fail
      
       - Fix trunking detection & cl_max_connect setting
      
       - Avoid pnfs_update_layout() livelocks
      
       - Don't keep retrying pNFS if the server replies with NFS4ERR_UNAVAILABLE
      
      * tag 'nfs-for-5.19-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        NFSv4: Add FMODE_CAN_ODIRECT after successful open of a NFS4.x file
        sunrpc: set cl_max_connect when cloning an rpc_clnt
        pNFS: Avoid a live lock condition in pnfs_update_layout()
        pNFS: Don't keep retrying if the server replied NFS4ERR_LAYOUTUNAVAILABLE
      4b35035b
    • Linus Torvalds's avatar
      Merge tag 'pci-v5.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 32efdbff
      Linus Torvalds authored
      Pull pci fix from Bjorn Helgaas:
       "Revert clipping of PCI host bridge windows to avoid E820 regions,
        which broke several machines by forcing unnecessary BAR reassignments
        (Hans de Goede)"
      
      * tag 'pci-v5.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
        x86/PCI: Revert "x86/PCI: Clip only host bridge windows for E820 regions"
      32efdbff
    • Linus Torvalds's avatar
      Merge tag 'printk-for-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux · 93d17c1c
      Linus Torvalds authored
      Pull printk fixes from Petr Mladek:
       "Make the global console_sem available for CPU that is handling panic()
        or shutdown.
      
        This is an old problem when an existing console lock owner might block
        console output, but it became more visible with the kthreads"
      
      * tag 'printk-for-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
        printk: Wait for the global console lock when the system is going down
        printk: Block console kthreads when direct printing will be required
      93d17c1c
    • Hans de Goede's avatar
      x86/PCI: Revert "x86/PCI: Clip only host bridge windows for E820 regions" · a2b36ffb
      Hans de Goede authored
      This reverts commit 4c5e242d.
      
      Prior to 4c5e242d ("x86/PCI: Clip only host bridge windows for E820
      regions"), E820 regions did not affect PCI host bridge windows.  We only
      looked at E820 regions and avoided them when allocating new MMIO space.
      If firmware PCI bridge window and BAR assignments used E820 regions, we
      left them alone.
      
      After 4c5e242d, we removed E820 regions from the PCI host bridge
      windows before looking at BARs, so firmware assignments in E820 regions
      looked like errors, and we moved things around to fit in the space left
      (if any) after removing the E820 regions.  This unnecessary BAR
      reassignment broke several machines.
      
      Guilherme reported that Steam Deck fails to boot after 4c5e242d.  We
      clipped the window that contained most 32-bit BARs:
      
        BIOS-e820: [mem 0x00000000a0000000-0x00000000a00fffff] reserved
        acpi PNP0A08:00: clipped [mem 0x80000000-0xf7ffffff window] to [mem 0xa0100000-0xf7ffffff window] for e820 entry [mem 0xa0000000-0xa00fffff]
      
      which forced us to reassign all those BARs, for example, this NVMe BAR:
      
        pci 0000:00:01.2: PCI bridge to [bus 01]
        pci 0000:00:01.2:   bridge window [mem 0x80600000-0x806fffff]
        pci 0000:01:00.0: BAR 0: [mem 0x80600000-0x80603fff 64bit]
        pci 0000:00:01.2: can't claim window [mem 0x80600000-0x806fffff]: no compatible bridge window
        pci 0000:01:00.0: can't claim BAR 0 [mem 0x80600000-0x80603fff 64bit]: no compatible bridge window
      
        pci 0000:00:01.2: bridge window: assigned [mem 0xa0100000-0xa01fffff]
        pci 0000:01:00.0: BAR 0: assigned [mem 0xa0100000-0xa0103fff 64bit]
      
      All the reassignments were successful, so the devices should have been
      functional at the new addresses, but some were not.
      
      Andy reported a similar failure on an Intel MID platform.  Benjamin
      reported a similar failure on a VMWare Fusion VM.
      
      Note: this is not a clean revert; this revert keeps the later change to
      make the clipping dependent on a new pci_use_e820 bool, moving the checking
      of this bool to arch_remove_reservations().
      
      [bhelgaas: commit log, add more reporters and testers]
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=216109Reported-by: default avatarGuilherme G. Piccoli <gpiccoli@igalia.com>
      Reported-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Reported-by: default avatarBenjamin Coddington <bcodding@redhat.com>
      Reported-by: default avatarJongman Heo <jongman.heo@gmail.com>
      Fixes: 4c5e242d ("x86/PCI: Clip only host bridge windows for E820 regions")
      Link: https://lore.kernel.org/r/20220612144325.85366-1-hdegoede@redhat.comTested-by: default avatarGuilherme G. Piccoli <gpiccoli@igalia.com>
      Tested-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Tested-by: default avatarBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      a2b36ffb
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · ef06e682
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
      
       - Revert the moving of the jump labels initialisation before
         setup_machine_fdt(). The bug was fixed in drivers/char/random.c.
      
       - Ftrace fixes: branch range check and consistent handling of PLTs.
      
       - Clean rather than invalidate FROM_DEVICE buffers at start of DMA
         transfer (safer if such buffer is mapped in user space). A cache
         invalidation is done already at the end of the transfer.
      
       - A couple of clean-ups (unexport symbol, remove unused label).
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: mm: Don't invalidate FROM_DEVICE buffers at start of DMA transfer
        arm64/cpufeature: Unexport set_cpu_feature()
        arm64: ftrace: remove redundant label
        arm64: ftrace: consistently handle PLTs.
        arm64: ftrace: fix branch range checks
        Revert "arm64: Initialize jump labels before setup_machine_fdt()"
      ef06e682
    • Linus Torvalds's avatar
      Merge tag 'loongarch-fixes-5.19-2' of... · cc2fb31d
      Linus Torvalds authored
      Merge tag 'loongarch-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
      
      Pull LoongArch fixes from Huacai Chen:
       "Add missing ELF_DETAILS in vmlinux.lds.S and fix document rendering"
      
      * tag 'loongarch-fixes-5.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
        docs/zh_CN/LoongArch: Fix notes rendering by using reST directives
        docs/LoongArch: Fix notes rendering by using reST directives
        LoongArch: vmlinux.lds.S: Add missing ELF_DETAILS
      cc2fb31d
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · f1051632
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A fix for the PolarFire SOC's device tree
      
       - A handful of fixes for the recently added Svpmbt support
      
       - An improvement to the Kconfig text for Svpbmt
      
      * tag 'riscv-for-linus-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol
        riscv: drop cpufeature_apply_feature tracking variable
        riscv: fix dependency for t-head errata
        riscv: dts: microchip: re-add pdma to mpfs device tree
      f1051632
    • Linus Torvalds's avatar
      Merge tag 'hyperv-fixes-signed-20220617' of... · 2d806a68
      Linus Torvalds authored
      Merge tag 'hyperv-fixes-signed-20220617' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
      
      Pull hyperv fixes from Wei Liu:
      
       - Fix hv_init_clocksource annotation (Masahiro Yamada)
      
       - Two bug fixes for vmbus driver (Saurabh Sengar)
      
       - Fix SEV negotiation (Tianyu Lan)
      
       - Fix comments in code (Xiang Wang)
      
       - One minor fix to HID driver (Michael Kelley)
      
      * tag 'hyperv-fixes-signed-20220617' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
        x86/Hyper-V: Add SEV negotiate protocol support in Isolation VM
        Drivers: hv: vmbus: Release cpu lock in error case
        HID: hyperv: Correctly access fields declared as __le16
        clocksource: hyper-v: unexport __init-annotated hv_init_clocksource()
        Drivers: hv: Fix syntax errors in comments
        Drivers: hv: vmbus: Don't assign VMbus channel interrupts to isolated CPUs
      2d806a68
    • Linus Torvalds's avatar
      Merge tag 'block-5.19-2022-06-16' of git://git.kernel.dk/linux-block · 462abc9d
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request from Christoph
            - Quirks, quirks, quirks to work around buggy consumer grade
              devices (Keith Bush, Ning Wang, Stefan Reiter, Rasheed Hsueh)
            - Better kernel messages for devices that need quirking (Keith
              Bush)
            - Make a kernel message more useful (Thomas Weißschuh)
      
       - MD pull request from Song, with a few fixes
      
       - blk-mq sysfs locking fixes (Ming)
      
       - BFQ stats fix (Bart)
      
       - blk-mq offline queue fix (Bart)
      
       - blk-mq flush request tag fix (Ming)
      
      * tag 'block-5.19-2022-06-16' of git://git.kernel.dk/linux-block:
        block/bfq: Enable I/O statistics
        blk-mq: don't clear flush_rq from tags->rqs[]
        blk-mq: avoid to touch q->elevator without any protection
        blk-mq: protect q->elevator by ->sysfs_lock in blk_mq_elv_switch_none
        block: Fix handling of offline queues in blk_mq_alloc_request_hctx()
        md/raid5-ppl: Fix argument order in bio_alloc_bioset()
        Revert "md: don't unregister sync_thread with reconfig_mutex held"
        nvme-pci: disable write zeros support on UMIC and Samsung SSDs
        nvme-pci: avoid the deepest sleep state on ZHITAI TiPro7000 SSDs
        nvme-pci: sk hynix p31 has bogus namespace ids
        nvme-pci: smi has bogus namespace ids
        nvme-pci: phison e12 has bogus namespace ids
        nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG GAMMIX S50
        nvme-pci: add trouble shooting steps for timeouts
        nvme: add bug report info for global duplicate id
        nvme: add device name to warning in uuid_show()
      462abc9d
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.19-2022-06-16' of git://git.kernel.dk/linux-block · f8e174c3
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "Bigger than usual at this time, both because we missed -rc2, but also
        because of some reverts that we chose to do. In detail:
      
         - Adjust mapped buffer API while we still can (Dylan)
      
         - Mapped buffer fixes (Dylan, Hao, Pavel, me)
      
         - Fix for uring_cmd wrong API usage for task_work (Dylan)
      
         - Fix for bug introduced in fixed file closing (Hao)
      
         - Fix race in buffer/file resource handling (Pavel)
      
         - Revert the NOP support for CQE32 and buffer selection that was
           brought up during the merge window (Pavel)
      
         - Remove IORING_CLOSE_FD_AND_FILE_SLOT introduced in this merge
           window. The API needs further refining, so just yank it for now and
           we'll revisit for a later kernel.
      
         - Series cleaning up the CQE32 support added in this merge window,
           making it more integrated rather than sitting on the side (Pavel)"
      
      * tag 'io_uring-5.19-2022-06-16' of git://git.kernel.dk/linux-block: (21 commits)
        io_uring: recycle provided buffer if we punt to io-wq
        io_uring: do not use prio task_work_add in uring_cmd
        io_uring: commit non-pollable provided mapped buffers upfront
        io_uring: make io_fill_cqe_aux honour CQE32
        io_uring: remove __io_fill_cqe() helper
        io_uring: fix ->extra{1,2} misuse
        io_uring: fill extra big cqe fields from req
        io_uring: unite fill_cqe and the 32B version
        io_uring: get rid of __io_fill_cqe{32}_req()
        io_uring: remove IORING_CLOSE_FD_AND_FILE_SLOT
        Revert "io_uring: add buffer selection support to IORING_OP_NOP"
        Revert "io_uring: support CQE32 for nop operation"
        io_uring: limit size of provided buffer ring
        io_uring: fix types in provided buffer ring
        io_uring: fix index calculation
        io_uring: fix double unlock for pbuf select
        io_uring: kbuf: fix bug of not consuming ring buffer in partial io case
        io_uring: openclose: fix bug of closing wrong fixed file
        io_uring: fix not locked access to fixed buf table
        io_uring: fix races with buffer table unregister
        ...
      f8e174c3