1. 27 6月, 2022 8 次提交
    • C
      attr: port attribute changes to new types · b27c82e1
      Christian Brauner 提交于
      Now that we introduced new infrastructure to increase the type safety
      for filesystems supporting idmapped mounts port the first part of the
      vfs over to them.
      
      This ports the attribute changes codepaths to rely on the new better
      helpers using a dedicated type.
      
      Before this change we used to take a shortcut and place the actual
      values that would be written to inode->i_{g,u}id into struct iattr. This
      had the advantage that we moved idmappings mostly out of the picture
      early on but it made reasoning about changes more difficult than it
      should be.
      
      The filesystem was never explicitly told that it dealt with an idmapped
      mount. The transition to the value that needed to be stored in
      inode->i_{g,u}id appeared way too early and increased the probability of
      bugs in various codepaths.
      
      We know place the same value in struct iattr no matter if this is an
      idmapped mount or not. The vfs will only deal with type safe
      vfs{g,u}id_t. This makes it massively safer to perform permission checks
      as the type will tell us what checks we need to perform and what helpers
      we need to use.
      
      Fileystems raising FS_ALLOW_IDMAP can't simply write ia_vfs{g,u}id to
      inode->i_{g,u}id since they are different types. Instead they need to
      use the dedicated vfs{g,u}id_to_k{g,u}id() helpers that map the
      vfs{g,u}id into the filesystem.
      
      The other nice effect is that filesystems like overlayfs don't need to
      care about idmappings explicitly anymore and can simply set up struct
      iattr accordingly directly.
      
      Link: https://lore.kernel.org/lkml/CAHk-=win6+ahs1EwLkcq8apqLi_1wXFWbrPf340zYEhObpz4jA@mail.gmail.com [1]
      Link: https://lore.kernel.org/r/20220621141454.2914719-9-brauner@kernel.org
      Cc: Seth Forshee <sforshee@digitalocean.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      CC: linux-fsdevel@vger.kernel.org
      Reviewed-by: NSeth Forshee <sforshee@digitalocean.com>
      Signed-off-by: NChristian Brauner (Microsoft) <brauner@kernel.org>
      b27c82e1
    • C
      security: pass down mount idmapping to setattr hook · 0e363cf3
      Christian Brauner 提交于
      Before this change we used to take a shortcut and place the actual
      values that would be written to inode->i_{g,u}id into struct iattr. This
      had the advantage that we moved idmappings mostly out of the picture
      early on but it made reasoning about changes more difficult than it
      should be.
      
      The filesystem was never explicitly told that it dealt with an idmapped
      mount. The transition to the value that needed to be stored in
      inode->i_{g,u}id appeared way too early and increased the probability of
      bugs in various codepaths.
      
      We know place the same value in struct iattr no matter if this is an
      idmapped mount or not. The vfs will only deal with type safe
      vfs{g,u}id_t. This makes it massively safer to perform permission checks
      as the type will tell us what checks we need to perform and what helpers
      we need to use.
      
      Adapt the security_inode_setattr() helper to pass down the mount's
      idmapping to account for that change.
      
      Link: https://lore.kernel.org/r/20220621141454.2914719-8-brauner@kernel.org
      Cc: Seth Forshee <sforshee@digitalocean.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      CC: linux-fsdevel@vger.kernel.org
      Reviewed-by: NSeth Forshee <sforshee@digitalocean.com>
      Signed-off-by: NChristian Brauner (Microsoft) <brauner@kernel.org>
      0e363cf3
    • C
      quota: port quota helpers mount ids · 71e7b535
      Christian Brauner 提交于
      Port the is_quota_modification() and dqout_transfer() helper to type
      safe vfs{g,u}id_t. Since these helpers are only called by a few
      filesystems don't introduce a new helper but simply extend the existing
      helpers to pass down the mount's idmapping.
      
      Note, that this is a non-functional change, i.e. nothing will have
      happened here or at the end of this series to how quota are done! This
      a change necessary because we will at the end of this series make
      ownership changes easier to reason about by keeping the original value
      in struct iattr for both non-idmapped and idmapped mounts.
      
      For now we always pass the initial idmapping which makes the idmapping
      functions these helpers call nops.
      
      This is done because we currently always pass the actual value to be
      written to i_{g,u}id via struct iattr. While this allowed us to treat
      the {g,u}id values in struct iattr as values that can be directly
      written to inode->i_{g,u}id it also increases the potential for
      confusion for filesystems.
      
      Now that we are have dedicated types to prevent this confusion we will
      ultimately only map the value from the idmapped mount into a filesystem
      value that can be written to inode->i_{g,u}id when the filesystem
      actually updates the inode. So pass down the initial idmapping until we
      finished that conversion at which point we pass down the mount's
      idmapping.
      
      Since struct iattr uses an anonymous union with overlapping types as
      supported by the C standard, filesystems that haven't converted to
      ia_vfs{g,u}id won't see any difference and things will continue to work
      as before. In other words, no functional changes intended with this
      change.
      
      Link: https://lore.kernel.org/r/20220621141454.2914719-7-brauner@kernel.org
      Cc: Seth Forshee <sforshee@digitalocean.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      CC: linux-fsdevel@vger.kernel.org
      Reviewed-by: NJan Kara <jack@suse.cz>
      Reviewed-by: NSeth Forshee <sforshee@digitalocean.com>
      Signed-off-by: NChristian Brauner (Microsoft) <brauner@kernel.org>
      71e7b535
    • C
      fs: port to iattr ownership update helpers · 35faf310
      Christian Brauner 提交于
      Earlier we introduced new helpers to abstract ownership update and
      remove code duplication. This converts all filesystems supporting
      idmapped mounts to make use of these new helpers.
      
      For now we always pass the initial idmapping which makes the idmapping
      functions these helpers call nops.
      
      This is done because we currently always pass the actual value to be
      written to i_{g,u}id via struct iattr. While this allowed us to treat
      the {g,u}id values in struct iattr as values that can be directly
      written to inode->i_{g,u}id it also increases the potential for
      confusion for filesystems.
      
      Now that we are have dedicated types to prevent this confusion we will
      ultimately only map the value from the idmapped mount into a filesystem
      value that can be written to inode->i_{g,u}id when the filesystem
      actually updates the inode. So pass down the initial idmapping until we
      finished that conversion at which point we pass down the mount's
      idmapping.
      
      No functional changes intended.
      
      Link: https://lore.kernel.org/r/20220621141454.2914719-6-brauner@kernel.org
      Cc: Seth Forshee <sforshee@digitalocean.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      CC: linux-fsdevel@vger.kernel.org
      Reviewed-by: NSeth Forshee <sforshee@digitalocean.com>
      Signed-off-by: NChristian Brauner (Microsoft) <brauner@kernel.org>
      35faf310
    • C
      fs: introduce tiny iattr ownership update helpers · 1f36146a
      Christian Brauner 提交于
      Nearly all fileystems currently open-code the same checks for
      determining whether the i_{g,u}id fields of an inode need to be updated
      and then updating the fields.
      
      Introduce tiny helpers i_{g,u}id_needs_update() and i_{g,u}id_update()
      that wrap this logic. This allows filesystems to not care about updating
      inode->i_{g,u}id with the correct values themselves instead leaving this
      to the helpers.
      
      We also get rid of a lot of code duplication and make it easier to
      change struct iattr in the future since changes can be localized to
      these helpers.
      
      And finally we make it hard to conflate k{g,u}id_t types with
      vfs{g,u}id_t types for filesystems that support idmapped mounts.
      
      In the following patch we will port all filesystems that raise
      FS_ALLOW_IDMAP to use the new helpers. However, the ultimate goal is to
      convert all filesystems to make use of these helpers.
      
      All new helpers are nops on non-idmapped mounts.
      
      Link: https://lore.kernel.org/r/20220621141454.2914719-5-brauner@kernel.org
      Cc: Seth Forshee <sforshee@digitalocean.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      CC: linux-fsdevel@vger.kernel.org
      Reviewed-by: NSeth Forshee <sforshee@digitalocean.com>
      Signed-off-by: NChristian Brauner (Microsoft) <brauner@kernel.org>
      1f36146a
    • C
      fs: use mount types in iattr · 45c31150
      Christian Brauner 提交于
      Add ia_vfs{g,u}id members of type vfs{g,u}id_t to struct iattr. We use
      an anonymous union (similar to what we do in struct file) around
      ia_{g,u}id and ia_vfs{g,u}id.
      
      At the end of this series ia_{g,u}id and ia_vfs{g,u}id will always
      contain the same value independent of whether struct iattr is
      initialized from an idmapped mount. This is a change from how this is
      done today.
      
      Wrapping this in a anonymous unions has a few advantages. It allows us
      to avoid needlessly increasing struct iattr. Since the types for
      ia_{g,u}id and ia_vfs{g,u}id are structures with overlapping/identical
      members they are covered by 6.5.2.3/6 of the C standard and it is safe
      to initialize and access them.
      
      Filesystems that raise FS_ALLOW_IDMAP and thus support idmapped mounts
      will have to use ia_vfs{g,u}id and the associated helpers. And will be
      ported at the end of this series. They will immediately benefit from the
      type safe new helpers.
      
      Filesystems that do not support FS_ALLOW_IDMAP can continue to use
      ia_{g,u}id for now. The aim is to convert every filesystem to always use
      ia_vfs{g,u}id and thus ultimately remove the ia_{g,u}id members.
      
      Link: https://lore.kernel.org/r/20220621141454.2914719-4-brauner@kernel.org
      Cc: Seth Forshee <sforshee@digitalocean.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      CC: linux-fsdevel@vger.kernel.org
      Reviewed-by: NSeth Forshee <sforshee@digitalocean.com>
      Signed-off-by: NChristian Brauner (Microsoft) <brauner@kernel.org>
      45c31150
    • C
      fs: add two type safe mapping helpers · 234a3113
      Christian Brauner 提交于
      Introduce i_{g,u}id_into_vfs{g,u}id(). They return vfs{g,u}id_t. This
      makes it way harder to confused idmapped mount {g,u}ids with filesystem
      {g,u}ids.
      
      The two helpers will eventually replace the old non type safe
      i_{g,u}id_into_mnt() helpers once we finished converting all places. Add
      a comment noting that they will be removed in the future.
      
      All new helpers are nops on non-idmapped mounts.
      
      Link: https://lore.kernel.org/r/20220621141454.2914719-3-brauner@kernel.org
      Cc: Seth Forshee <sforshee@digitalocean.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      CC: linux-fsdevel@vger.kernel.org
      Reviewed-by: NSeth Forshee <sforshee@digitalocean.com>
      Signed-off-by: NChristian Brauner (Microsoft) <brauner@kernel.org>
      234a3113
    • C
      mnt_idmapping: add vfs{g,u}id_t · 1e5267cd
      Christian Brauner 提交于
      Introduces new vfs{g,u}id_t types. Similar to k{g,u}id_t the new types
      are just simple wrapper structs around regular {g,u}id_t types.
      
      They allows to establish a type safety boundary between {g,u}ids on
      idmapped mounts and {g,u}ids as they are represented in filesystems
      themselves.
      
      A vfs{g,u}id_t is always created from a k{g,u}id_t, never directly from
      a {g,u}id_t as idmapped mounts remap a given {g,u}id according to the
      mount's idmapping. This is expressed in the VFS{G,U}IDT_INIT() macros.
      
      A vfs{g,u}id_t may be used as a k{g,u}id_t via AS_K{G,U}IDT(). This
      often happens when we need to check whether a {g,u}id mapped according
      to an idmapped mount is identical to a given k{g,u}id_t. For an example,
      see vfsgid_in_group_p() which determines whether the value of vfsgid_t
      matches the value of any of the caller's groups. Similar logic is
      expressed in the k{g,u}id_eq_vfs{g,u}id().
      
      The from_vfs{g,u}id() helpers map a given vfs{g,u}id_t from the mount's
      idmapping into the filesystem idmapping. They make it possible to update
      a filesystem object such as inode->i_{g,u}id with the correct value.
      
      This makes it harder to accidently write a wrong {g,u}id anwywhere. The
      vfs{g,u}id_has_fsmapping() helpers check whether a given vfs{g,u}id_t
      can be mapped into the filesystem idmapping.
      
      All new helpers are nops on non-idmapped mounts.
      
      I've done work on this roughly 7 months ago but dropped it to focus on
      the testsuite. Linus brought this up independently just last week and
      it's time to move this along (see [1]).
      
      [1]: https://lore.kernel.org/lkml/CAHk-=win6+ahs1EwLkcq8apqLi_1wXFWbrPf340zYEhObpz4jA@mail.gmail.com
      
      Link: https://lore.kernel.org/r/20220621141454.2914719-2-brauner@kernel.org
      Cc: Seth Forshee <sforshee@digitalocean.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      CC: linux-fsdevel@vger.kernel.org
      Reviewed-by: NSeth Forshee <sforshee@digitalocean.com>
      Signed-off-by: NChristian Brauner (Microsoft) <brauner@kernel.org>
      1e5267cd
  2. 20 6月, 2022 1 次提交
  3. 19 6月, 2022 19 次提交
  4. 18 6月, 2022 12 次提交
    • K
      x86/tdx: Handle load_unaligned_zeropad() page-cross to a shared page · 1e776965
      Kirill A. Shutemov 提交于
      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: NKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Signed-off-by: NDave Hansen <dave.hansen@linux.intel.com>
      Link: https://lkml.kernel.org/r/20220614120135.14812-4-kirill.shutemov@linux.intel.com
      1e776965
    • L
      Merge tag 'nfs-for-5.19-2' of git://git.linux-nfs.org/projects/anna/linux-nfs · 4b35035b
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'pci-v5.19-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci · 32efdbff
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'printk-for-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux · 93d17c1c
      Linus Torvalds 提交于
      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
    • H
      x86/PCI: Revert "x86/PCI: Clip only host bridge windows for E820 regions" · a2b36ffb
      Hans de Goede 提交于
      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: NGuilherme G. Piccoli <gpiccoli@igalia.com>
      Reported-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Reported-by: NBenjamin Coddington <bcodding@redhat.com>
      Reported-by: NJongman 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: NGuilherme G. Piccoli <gpiccoli@igalia.com>
      Tested-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Tested-by: NBenjamin Coddington <bcodding@redhat.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      a2b36ffb
    • L
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · ef06e682
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'loongarch-fixes-5.19-2' of... · cc2fb31d
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'riscv-for-linus-5.19-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · f1051632
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'hyperv-fixes-signed-20220617' of... · 2d806a68
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'block-5.19-2022-06-16' of git://git.kernel.dk/linux-block · 462abc9d
      Linus Torvalds 提交于
      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
    • L
      Merge tag 'io_uring-5.19-2022-06-16' of git://git.kernel.dk/linux-block · f8e174c3
      Linus Torvalds 提交于
      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
    • W
      arm64: mm: Don't invalidate FROM_DEVICE buffers at start of DMA transfer · c50f11c6
      Will Deacon 提交于
      Invalidating the buffer memory in arch_sync_dma_for_device() for
      FROM_DEVICE transfers
      
      When using the streaming DMA API to map a buffer prior to inbound
      non-coherent DMA (i.e. DMA_FROM_DEVICE), we invalidate any dirty CPU
      cachelines so that they will not be written back during the transfer and
      corrupt the buffer contents written by the DMA. This, however, poses two
      potential problems:
      
        (1) If the DMA transfer does not write to every byte in the buffer,
            then the unwritten bytes will contain stale data once the transfer
            has completed.
      
        (2) If the buffer has a virtual alias in userspace, then stale data
            may be visible via this alias during the period between performing
            the cache invalidation and the DMA writes landing in memory.
      
      Address both of these issues by cleaning (aka writing-back) the dirty
      lines in arch_sync_dma_for_device(DMA_FROM_DEVICE) instead of discarding
      them using invalidation.
      
      Cc: Ard Biesheuvel <ardb@kernel.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20220606152150.GA31568@willie-the-truckSigned-off-by: NWill Deacon <will@kernel.org>
      Reviewed-by: NArd Biesheuvel <ardb@kernel.org>
      Link: https://lore.kernel.org/r/20220610151228.4562-2-will@kernel.orgSigned-off-by: NCatalin Marinas <catalin.marinas@arm.com>
      c50f11c6