Skip to content
  1. Sep 09, 2023
    • Palmer Dabbelt's avatar
      Merge patch series "riscv: dma-mapping: unify support for cache flushes" · 7f215d00
      Palmer Dabbelt authored
      Prabhakar <prabhakar.csengg@gmail.com> says:
      
      From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
      
      This patch series is a subset from Arnd's original series [0]. Ive just
      picked up the bits required for RISC-V unification of cache flushing.
      Remaining patches from the series [0] will be taken care by Arnd soon.
      
      * b4-shazam-merge:
        riscv: dma-mapping: switch over to generic implementation
        riscv: dma-mapping: skip invalidation before bidirectional DMA
        riscv: dma-mapping: only invalidate after DMA, not flush
      
      Link: https://lore.kernel.org/r/20230816232336.164413-1-prabhakar.mahadev-lad.rj@bp.renesas.com
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      7f215d00
    • Palmer Dabbelt's avatar
      Merge patch series "RISC-V: Probe for misaligned access speed" · 580253b5
      Palmer Dabbelt authored
      Evan Green <evan@rivosinc.com> says:
      
      The current setting for the hwprobe bit indicating misaligned access
      speed is controlled by a vendor-specific feature probe function. This is
      essentially a per-SoC table we have to maintain on behalf of each vendor
      going forward. Let's convert that instead to something we detect at
      runtime.
      
      We have two assembly routines at the heart of our probe: one that
      does a bunch of word-sized accesses (without aligning its input buffer),
      and the other that does byte accesses. If we can move a larger number of
      bytes using misaligned word accesses than we can with the same amount of
      time doing byte accesses, then we can declare misaligned accesses as
      "fast".
      
      The tradeoff of reducing this maintenance burden is boot time. We spend
      4-6 jiffies per core doing this measurement (0-2 on jiffie edge
      alignment, and 4 on measurement). The timing loop was based on
      raid6_choose_gen(), which uses (16+1)*N jiffies (where N is the number
      of algorithms). By taking only the fastest iteration out of all
      attempts for use in the comparison, variance between runs is very low.
      On my THead C906, it looks like this:
      
      [    0.047563] cpu0: Ratio of byte access time to unaligned word access is 4.34, unaligned accesses are fast
      
      Several others have chimed in with results on slow machines with the
      older algorithm, which took all runs into account, including noise like
      interrupts. Even with this variation, results indicate that in all cases
      (fast, slow, and emulated) the measured numbers are nowhere near each
      other (always multiple factors away).
      
      * b4-shazam-merge:
        RISC-V: alternative: Remove feature_probe_func
        RISC-V: Probe for unaligned access speed
      
      Link: https://lore.kernel.org/r/20230818194136.4084400-1-evan@rivosinc.com
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      580253b5
  2. Sep 02, 2023
  3. Sep 01, 2023
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-6.6-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · e0152e74
      Linus Torvalds authored
      Pull RISC-V updates from Palmer Dabbelt:
      
       - Support for the new "riscv,isa-extensions" and "riscv,isa-base"
         device tree interfaces for probing extensions
      
       - Support for userspace access to the performance counters
      
       - Support for more instructions in kprobes
      
       - Crash kernels can be allocated above 4GiB
      
       - Support for KCFI
      
       - Support for ELFs in !MMU configurations
      
       - ARCH_KMALLOC_MINALIGN has been reduced to 8
      
       - mmap() defaults to sv48-sized addresses, with longer addresses hidden
         behind a hint (similar to Arm and Intel)
      
       - Also various fixes and cleanups
      
      * tag 'riscv-for-linus-6.6-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (51 commits)
        lib/Kconfig.debug: Restrict DEBUG_INFO_SPLIT for RISC-V
        riscv: support PREEMPT_DYNAMIC with static keys
        riscv: Move create_tmp_mapping() to init sections
        riscv: Mark KASAN tmp* page tables variables as static
        riscv: mm: use bitmap_zero() API
        riscv: enable DEBUG_FORCE_FUNCTION_ALIGN_64B
        riscv: remove redundant mv instructions
        RISC-V: mm: Document mmap changes
        RISC-V: mm: Update pgtable comment documentation
        RISC-V: mm: Add tests for RISC-V mm
        RISC-V: mm: Restrict address space for sv39,sv48,sv57
        riscv: enable DMA_BOUNCE_UNALIGNED_KMALLOC for !dma_coherent
        riscv: allow kmalloc() caches aligned to the smallest value
        riscv: support the elf-fdpic binfmt loader
        binfmt_elf_fdpic: support 64-bit systems
        riscv: Allow CONFIG_CFI_CLANG to be selected
        riscv/purgatory: Disable CFI
        riscv: Add CFI error handling
        riscv: Add ftrace_stub_graph
        riscv: Add types to indirectly called assembly functions
        ...
      e0152e74
    • Linus Torvalds's avatar
      Merge tag 'csky-for-linus-6.6-2' of https://github.com/c-sky/csky-linux · a031eba2
      Linus Torvalds authored
      Pull arch/csky fix from Guo Ren:
      
       - Fix compile error by missing header file
      
      * tag 'csky-for-linus-6.6-2' of https://github.com/c-sky/csky-linux:
        csky: Fixup compile error
      a031eba2
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-6.6-1' of git://git.linux-nfs.org/projects/anna/linux-nfs · 99d99825
      Linus Torvalds authored
      Pull NFS client updates from Anna Schumaker:
       "New Features:
         - Enable the NFS v4.2 READ_PLUS operation by default
      
        Stable Fixes:
         - NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info
         - NFS: Fix a potential data corruption
      
        Bugfixes:
         - Fix various READ_PLUS issues including:
            - smatch warnings
            - xdr size calculations
            - scratch buffer handling
            - 32bit / highmem xdr page handling
         - Fix checkpatch errors in file.c
         - Fix redundant readdir request after an EOF
         - Fix handling of COPY ERR_OFFLOAD_NO_REQ
         - Fix assignment of xprtdata.cred
      
        Cleanups:
         - Remove unused xprtrdma function declarations
         - Clean up an integer overflow check to avoid a warning
         - Clean up #includes in dns_resolve.c
         - Clean up nfs4_get_device_info so we don't pass a NULL pointer
           to __free_page()
         - Clean up sunrpc TCP socket timeout configuration
         - Guard against READDIR loops when entry names are too long
         - Use EXCHID4_FLAG_USE_PNFS_DS for DS servers"
      
      * tag 'nfs-for-6.6-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (22 commits)
        pNFS: Fix assignment of xprtdata.cred
        NFSv4.2: fix handling of COPY ERR_OFFLOAD_NO_REQ
        NFS: Guard against READDIR loop when entry names exceed MAXNAMELEN
        NFSv4.1: use EXCHGID4_FLAG_USE_PNFS_DS for DS server
        NFS/pNFS: Set the connect timeout for the pNFS flexfiles driver
        SUNRPC: Don't override connect timeouts in rpc_clnt_add_xprt()
        SUNRPC: Allow specification of TCP client connect timeout at setup
        SUNRPC: Refactor and simplify connect timeout
        SUNRPC: Set the TCP_SYNCNT to match the socket timeout
        NFS: Fix a potential data corruption
        nfs: fix redundant readdir request after get eof
        nfs/blocklayout: Use the passed in gfp flags
        filemap: Fix errors in file.c
        NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info
        NFS: Move common includes outside ifdef
        SUNRPC: clean up integer overflow check
        xprtrdma: Remove unused function declaration rpcrdma_bc_post_recv()
        NFS: Enable the READ_PLUS operation by default
        SUNRPC: kmap() the xdr pages during decode
        NFSv4.2: Rework scratch handling for READ_PLUS (again)
        ...
      99d99825
    • Linus Torvalds's avatar
      Merge tag 'nfsd-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux · f35d1706
      Linus Torvalds authored
      Pull nfsd updates from Chuck Lever:
       "I'm thrilled to announce that the Linux in-kernel NFS server now
        offers NFSv4 write delegations. A write delegation enables a client to
        cache data and metadata for a single file more aggressively, reducing
        network round trips and server workload. Many thanks to Dai Ngo for
        contributing this facility, and to Jeff Layton and Neil Brown for
        reviewing and testing it.
      
        This release also sees the removal of all support for DES- and
        triple-DES-based Kerberos encryption types in the kernel's SunRPC
        implementation. These encryption types have been deprecated by the
        Internet community for years and are considered insecure. This change
        affects both the in-kernel NFS client and server.
      
        The server's UDP and TCP socket transports have now fully adopted
        David Howells' new bio_vec iterator so that no more than one sendmsg()
        call is needed to transmit each RPC message. In particular, this helps
        kTLS optimize record boundaries when sending RPC-with-TLS replies, and
        it takes the server a baby step closer to handling file I/O via
        folios.
      
        We've begun work on overhauling the SunRPC thread scheduler to remove
        a costly linked-list walk when looking for an idle RPC service thread
        to wake. The pre-requisites are included in this release. Thanks to
        Neil Brown for his ongoing work on this improvement"
      
      * tag 'nfsd-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (56 commits)
        Documentation: Add missing documentation for EXPORT_OP flags
        SUNRPC: Remove unused declaration rpc_modcount()
        SUNRPC: Remove unused declarations
        NFSD: da_addr_body field missing in some GETDEVICEINFO replies
        SUNRPC: Remove return value of svc_pool_wake_idle_thread()
        SUNRPC: make rqst_should_sleep() idempotent()
        SUNRPC: Clean up svc_set_num_threads
        SUNRPC: Count ingress RPC messages per svc_pool
        SUNRPC: Deduplicate thread wake-up code
        SUNRPC: Move trace_svc_xprt_enqueue
        SUNRPC: Add enum svc_auth_status
        SUNRPC: change svc_xprt::xpt_flags bits to enum
        SUNRPC: change svc_rqst::rq_flags bits to enum
        SUNRPC: change svc_pool::sp_flags bits to enum
        SUNRPC: change cache_head.flags bits to enum
        SUNRPC: remove timeout arg from svc_recv()
        SUNRPC: change svc_recv() to return void.
        SUNRPC: call svc_process() from svc_recv().
        nfsd: separate nfsd_last_thread() from nfsd_put()
        nfsd: Simplify code around svc_exit_thread() call in nfsd()
        ...
      f35d1706
    • Linus Torvalds's avatar
      Merge tag '6.6-rc-ksmbd-fixes-part1' of git://git.samba.org/ksmbd · 8ae5d298
      Linus Torvalds authored
      Pull smb server updates from Steve French:
      
       - fix potential overflows in decoding create and in session setup
         requests
      
       - cleanup fixes
      
       - compounding fixes, including one for MacOS compounded read requests
      
       - session setup error handling fix
      
       - fix mode bit bug when applying force_directory_mode and
         force_create_mode
      
       - RDMA (smbdirect) write fix
      
      * tag '6.6-rc-ksmbd-fixes-part1' of git://git.samba.org/ksmbd:
        ksmbd: add missing calling smb2_set_err_rsp() on error
        ksmbd: replace one-element array with flex-array member in struct smb2_ea_info
        ksmbd: fix slub overflow in ksmbd_decode_ntlmssp_auth_blob()
        ksmbd: fix wrong DataOffset validation of create context
        ksmbd: Fix one kernel-doc comment
        ksmbd: reduce descriptor size if remaining bytes is less than request size
        ksmbd: fix `force create mode' and `force directory mode'
        ksmbd: fix wrong interim response on compound
        ksmbd: add support for read compound
        ksmbd: switch to use kmemdup_nul() helper
      8ae5d298
    • Linus Torvalds's avatar
      Merge tag 'jfs-6.6' of github.com:kleikamp/linux-shaggy · 7e5cd6f6
      Linus Torvalds authored
      Pull jfs updates from Dave Kleikamp:
       "A few small fixes"
      
      * tag 'jfs-6.6' of github.com:kleikamp/linux-shaggy:
        jfs: validate max amount of blocks before allocation.
        jfs: remove redundant initialization to pointer ip
        jfs: fix invalid free of JFS_IP(ipimap)->i_imap in diUnmount
        FS: JFS: (trivial) Fix grammatical error in extAlloc
        fs/jfs: prevent double-free in dbUnmount() after failed jfs_remount()
      7e5cd6f6
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 3ef96fcf
      Linus Torvalds authored
      Pull ext4 updates from Ted Ts'o:
       "Many ext4 and jbd2 cleanups and bug fixes:
      
         - Cleanups in the ext4 remount code when going to and from read-only
      
         - Cleanups in ext4's multiblock allocator
      
         - Cleanups in the jbd2 setup/mounting code paths
      
         - Performance improvements when appending to a delayed allocation file
      
         - Miscellaneous syzbot and other bug fixes"
      
      * tag 'ext4_for_linus-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (60 commits)
        ext4: fix slab-use-after-free in ext4_es_insert_extent()
        libfs: remove redundant checks of s_encoding
        ext4: remove redundant checks of s_encoding
        ext4: reject casefold inode flag without casefold feature
        ext4: use LIST_HEAD() to initialize the list_head in mballoc.c
        ext4: do not mark inode dirty every time when appending using delalloc
        ext4: rename s_error_work to s_sb_upd_work
        ext4: add periodic superblock update check
        ext4: drop dio overwrite only flag and associated warning
        ext4: add correct group descriptors and reserved GDT blocks to system zone
        ext4: remove unused function declaration
        ext4: mballoc: avoid garbage value from err
        ext4: use sbi instead of EXT4_SB(sb) in ext4_mb_new_blocks_simple()
        ext4: change the type of blocksize in ext4_mb_init_cache()
        ext4: fix unttached inode after power cut with orphan file feature enabled
        jbd2: correct the end of the journal recovery scan range
        ext4: ext4_get_{dev}_journal return proper error value
        ext4: cleanup ext4_get_dev_journal() and ext4_get_journal()
        jbd2: jbd2_journal_init_{dev,inode} return proper error return value
        jbd2: drop useless error tag in jbd2_journal_wipe()
        ...
      3ef96fcf
    • Linus Torvalds's avatar
      Merge tag 'dlm-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm · 659b3613
      Linus Torvalds authored
      Pull dlm updates from David Teigland:
      
       - Allow blocking posix lock requests to be interrupted while waiting.
         This requires a cancel request to be sent to the userspace daemon
         where posix lock requests are processed across the cluster.
      
       - Fix a posix lock patch from the previous cycle in which lock requests
         from different file systems could be mixed up.
      
       - Fix some long standing problems with nfs posix lock cancelation.
      
       - Add a new debugfs file for printing queued callbacks.
      
       - Stop modifying buffers that have been used to receive a message.
      
       - Misc cleanups and some refactoring.
      
      * tag 'dlm-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm:
        dlm: fix plock lookup when using multiple lockspaces
        fs: dlm: don't use RCOM_NAMES for version detection
        fs: dlm: create midcomms nodes when configure
        fs: dlm: constify receive buffer
        fs: dlm: drop rxbuf manipulation in dlm_recover_master_copy
        fs: dlm: drop rxbuf manipulation in dlm_copy_master_names
        fs: dlm: get recovery sequence number as parameter
        fs: dlm: cleanup lock order
        fs: dlm: remove clear_members_cb
        fs: dlm: add plock dev tracepoints
        fs: dlm: check on plock ops when exit dlm
        fs: dlm: debugfs for queued callbacks
        fs: dlm: remove unused processed_nodes
        fs: dlm: add missing spin_unlock
        fs: dlm: fix F_CANCELLK to cancel pending request
        fs: dlm: allow to F_SETLKW getting interrupted
        fs: dlm: remove twice newline
      659b3613
    • Linus Torvalds's avatar
      Merge tag 'v6.6-vfs.super.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs · e7e9423d
      Linus Torvalds authored
      Pull more superblock follow-on fixes from Christian Brauner:
       "This contains two more small follow-up fixes for the super work this
        cycle. I went through all filesystems once more and detected two minor
        issues that still needed fixing:
      
         - Some filesystems support mtd devices (e.g., mount -t jffs2 mtd2
           /mnt). The mtd infrastructure uses the sb->s_mtd pointer to find an
           existing superblock. When the mtd device is put and sb->s_mtd
           cleared the superblock can still be found fs_supers and so this
           risks a use-after-free.
      
           Add a small patch that aligns mtd with what we did for regular
           block devices and switch keying to rely on sb->s_dev.
      
           (This was tested with mtd devices and jffs2 as xfstests doesn't
           support mtd devices.)
      
         - Switch nfs back to rely on kill_anon_super() so the superblock is
           removed from the list of active supers before sb->s_fs_info is
           freed"
      
      * tag 'v6.6-vfs.super.fixes.2' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
        NFS: switch back to using kill_anon_super
        mtd: key superblock by device number
        fs: export sget_dev()
      e7e9423d
    • Ingo Molnar's avatar
      powerpc: Fix pud_mkwrite() definition after pte_mkwrite() API changes · f441ff73
      Ingo Molnar authored
      
      
      Fix up missed semantic mis-merge between commits
      
        161e393c ("mm: Make pte_mkwrite() take a VMA")
        27af67f3 ("powerpc/book3s64/mm: enable transparent pud hugepage")
      
      where the newly introduced powerpc use of 'pte_mkwrite()' needs to use
      the 'novma()' versions as per commit 2f0584f3 ("mm: Rename arch
      pte_mkwrite()'s to pte_mkwrite_novma()").
      
      Fixes: df57721f ("Merge tag 'x86_shstk_for_6.6-rc1' of [...]")
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f441ff73
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm · 87dfd85c
      Linus Torvalds authored
      Pull ARM updates from Russell King:
      
       - Refactor VFP code and convert to C code (Ard Biesheuvel)
      
       - Fix hardware breakpoint single-stepping using bpf_overflow_handler
      
       - Make SMP stop calls asynchronous allowing panic from irq context to
         work
      
       - Fix for kernel-doc warnings for locomo
      
      * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
        Revert part of ae1f8d79 ("ARM: 9304/1: add prototype for function called only from asm")
        ARM: 9318/1: locomo: move kernel-doc to prevent warnings
        ARM: 9317/1: kexec: Make smp stop calls asynchronous
        ARM: 9316/1: hw_breakpoint: fix single-stepping when using bpf_overflow_handler
        ARM: entry: Make asm coproc dispatch code NWFPE only
        ARM: iwmmxt: Use undef hook to enable coprocessor for task
        ARM: entry: Disregard Thumb undef exception in coproc dispatch
        ARM: vfp: Use undef hook for handling VFP exceptions
        ARM: kernel: Get rid of thread_info::used_cp[] array
        ARM: vfp: Reimplement VFP exception entry in C code
        ARM: vfp: Remove workaround for Feroceon CPUs
        ARM: vfp: Record VFP bounces as perf emulation faults
      87dfd85c
    • Linus Torvalds's avatar
      Merge tag 'powerpc-6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 4ad0a4c2
      Linus Torvalds authored
      Pull powerpc updates from Michael Ellerman:
      
       - Add HOTPLUG_SMT support (/sys/devices/system/cpu/smt) and honour the
         configured SMT state when hotplugging CPUs into the system
      
       - Combine final TLB flush and lazy TLB mm shootdown IPIs when using the
         Radix MMU to avoid a broadcast TLBIE flush on exit
      
       - Drop the exclusion between ptrace/perf watchpoints, and drop the now
         unused associated arch hooks
      
       - Add support for the "nohlt" command line option to disable CPU idle
      
       - Add support for -fpatchable-function-entry for ftrace, with GCC >=
         13.1
      
       - Rework memory block size determination, and support 256MB size on
         systems with GPUs that have hotpluggable memory
      
       - Various other small features and fixes
      
      Thanks to Andrew Donnellan, Aneesh Kumar K.V, Arnd Bergmann, Athira
      Rajeev, Benjamin Gray, Christophe Leroy, Frederic Barrat, Gautam
      Menghani, Geoff Levand, Hari Bathini, Immad Mir, Jialin Zhang, Joel
      Stanley, Jordan Niethe, Justin Stitt, Kajol Jain, Kees Cook, Krzysztof
      Kozlowski, Laurent Dufour, Liang He, Linus Walleij, Mahesh Salgaonkar,
      Masahiro Yamada, Michal Suchanek, Nageswara R Sastry, Nathan Chancellor,
      Nathan Lynch, Naveen N Rao, Nicholas Piggin, Nick Desaulniers, Omar
      Sandoval, Randy Dunlap, Reza Arbab, Rob Herring, Russell Currey, Sourabh
      Jain, Thomas Gleixner, Trevor Woerner, Uwe Kleine-König, Vaibhav Jain,
      Xiongfeng Wang, Yuan Tan, Zhang Rui, and Zheng Zengkai.
      
      * tag 'powerpc-6.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (135 commits)
        macintosh/ams: linux/platform_device.h is needed
        powerpc/xmon: Reapply "Relax frame size for clang"
        powerpc/mm/book3s64: Use 256M as the upper limit with coherent device memory attached
        powerpc/mm/book3s64: Fix build error with SPARSEMEM disabled
        powerpc/iommu: Fix notifiers being shared by PCI and VIO buses
        powerpc/mpc5xxx: Add missing fwnode_handle_put()
        powerpc/config: Disable SLAB_DEBUG_ON in skiroot
        powerpc/pseries: Remove unused hcall tracing instruction
        powerpc/pseries: Fix hcall tracepoints with JUMP_LABEL=n
        powerpc: dts: add missing space before {
        powerpc/eeh: Use pci_dev_id() to simplify the code
        powerpc/64s: Move CPU -mtune options into Kconfig
        powerpc/powermac: Fix unused function warning
        powerpc/pseries: Rework lppaca_shared_proc() to avoid DEBUG_PREEMPT
        powerpc: Don't include lppaca.h in paca.h
        powerpc/pseries: Move hcall_vphn() prototype into vphn.h
        powerpc/pseries: Move VPHN constants into vphn.h
        cxl: Drop unused detach_spa()
        powerpc: Drop zalloc_maybe_bootmem()
        powerpc/powernv: Use struct opal_prd_msg in more places
        ...
      4ad0a4c2
    • Linus Torvalds's avatar
      Merge tag 'x86_shstk_for_6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · df57721f
      Linus Torvalds authored
      Pull x86 shadow stack support from Dave Hansen:
       "This is the long awaited x86 shadow stack support, part of Intel's
        Control-flow Enforcement Technology (CET).
      
        CET consists of two related security features: shadow stacks and
        indirect branch tracking. This series implements just the shadow stack
        part of this feature, and just for userspace.
      
        The main use case for shadow stack is providing protection against
        return oriented programming attacks. It works by maintaining a
        secondary (shadow) stack using a special memory type that has
        protections against modification. When executing a CALL instruction,
        the processor pushes the return address to both the normal stack and
        to the special permission shadow stack. Upon RET, the processor pops
        the shadow stack copy and compares it to the normal stack copy.
      
        For more information, refer to the links below for the earlier
        versions of this patch set"
      
      Link: https://lore.kernel.org/lkml/20220130211838.8382-1-rick.p.edgecombe@intel.com/
      Link: https://lore.kernel.org/lkml/20230613001108.3040476-1-rick.p.edgecombe@intel.com/
      
      * tag 'x86_shstk_for_6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (47 commits)
        x86/shstk: Change order of __user in type
        x86/ibt: Convert IBT selftest to asm
        x86/shstk: Don't retry vm_munmap() on -EINTR
        x86/kbuild: Fix Documentation/ reference
        x86/shstk: Move arch detail comment out of core mm
        x86/shstk: Add ARCH_SHSTK_STATUS
        x86/shstk: Add ARCH_SHSTK_UNLOCK
        x86: Add PTRACE interface for shadow stack
        selftests/x86: Add shadow stack test
        x86/cpufeatures: Enable CET CR4 bit for shadow stack
        x86/shstk: Wire in shadow stack interface
        x86: Expose thread features in /proc/$PID/status
        x86/shstk: Support WRSS for userspace
        x86/shstk: Introduce map_shadow_stack syscall
        x86/shstk: Check that signal frame is shadow stack mem
        x86/shstk: Check that SSP is aligned on sigreturn
        x86/shstk: Handle signals for shadow stack
        x86/shstk: Introduce routines modifying shstk
        x86/shstk: Handle thread shadow stack
        x86/shstk: Add user-mode shadow stack support
        ...
      df57721f
  4. Aug 31, 2023
    • Randy Dunlap's avatar
      macintosh/ams: linux/platform_device.h is needed · 85a61641
      Randy Dunlap authored
      
      
      ams.h uses struct platform_device, so the header should be used
      to prevent build errors:
      
      drivers/macintosh/ams/ams-input.c: In function 'ams_input_enable':
      drivers/macintosh/ams/ams-input.c:68:45: error: invalid use of undefined type 'struct platform_device'
         68 |         input->dev.parent = &ams_info.of_dev->dev;
      drivers/macintosh/ams/ams-input.c: In function 'ams_input_init':
      drivers/macintosh/ams/ams-input.c:146:51: error: invalid use of undefined type 'struct platform_device'
        146 |         return device_create_file(&ams_info.of_dev->dev, &dev_attr_joystick);
      drivers/macintosh/ams/ams-input.c: In function 'ams_input_exit':
      drivers/macintosh/ams/ams-input.c:151:44: error: invalid use of undefined type 'struct platform_device'
        151 |         device_remove_file(&ams_info.of_dev->dev, &dev_attr_joystick);
      drivers/macintosh/ams/ams-input.c: In function 'ams_input_init':
      drivers/macintosh/ams/ams-input.c:147:1: error: control reaches end of non-void function [-Werror=return-type]
        147 | }
      
      Fixes: 233d687d ("macintosh: Explicitly include correct DT includes")
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://msgid.link/20230829225837.15520-1-rdunlap@infradead.org
      85a61641
    • Christoph Hellwig's avatar
      NFS: switch back to using kill_anon_super · 5069ba84
      Christoph Hellwig authored
      
      
      NFS switch to open coding kill_anon_super in 7b14a213
      ("nfs: don't call bdi_unregister") to avoid the extra bdi_unregister
      call.  At that point bdi_destroy was called in nfs_free_server and
      thus it required a later freeing of the anon dev_t.  But since
      0db10944 ("nfs: Convert to separately allocated bdi") the bdi has
      been free implicitly by the sb destruction, so this isn't needed
      anymore.
      
      By not open coding kill_anon_super, nfs now inherits the fix in
      dc3216b1 ("super: ensure valid info"), and we remove the only
      open coded version of kill_anon_super.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Message-Id: <20230831052940.256193-1-hch@lst.de>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      5069ba84
    • Christian Brauner's avatar
      mtd: key superblock by device number · ec952aa2
      Christian Brauner authored
      The mtd driver has similar problems than the one that was fixed in
      commit dc3216b1 ("super: ensure valid info").
      
      The kill_mtd_super() helper calls shuts the superblock down but leaves
      the superblock on fs_supers as the devices are still in use but puts the
      mtd device and cleans out the superblock's s_mtd field.
      
      This means another mounter can find the superblock on the list accessing
      its s_mtd field while it is curently in the process of being freed or
      already freed.
      
      Prevent that from happening by keying superblock by dev_t just as we do
      in the generic code.
      
      Link: https://lore.kernel.org/linux-fsdevel/20230829-weitab-lauwarm-49c40fc85863@brauner
      
      
      Acked-by: default avatarRichard Weinberger <richard@nod.at>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Message-Id: <20230829-vfs-super-mtd-v1-2-fecb572e5df3@kernel.org>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      ec952aa2
    • Christian Brauner's avatar
      fs: export sget_dev() · 69881be3
      Christian Brauner authored
      
      
      They will be used for mtd devices as well.
      
      Acked-by: default avatarRichard Weinberger <richard@nod.at>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Message-Id: <20230829-vfs-super-mtd-v1-1-fecb572e5df3@kernel.org>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
      69881be3
    • Nathan Chancellor's avatar
      lib/Kconfig.debug: Restrict DEBUG_INFO_SPLIT for RISC-V · 89775a27
      Nathan Chancellor authored
      When building for ARCH=riscv using LLVM < 14, there is an error with
      CONFIG_DEBUG_INFO_SPLIT=y:
      
        error: A dwo section may not contain relocations
      
      This was worked around in LLVM 15 by disallowing '-gsplit-dwarf' with
      '-mrelax' (the default), so CONFIG_DEBUG_INFO_SPLIT is not selectable
      with newer versions of LLVM:
      
        $ clang --target=riscv64-linux-gnu -gsplit-dwarf -c -o /dev/null -x c /dev/null
        clang: error: -gsplit-dwarf is unsupported with RISC-V linker relaxation (-mrelax)
      
      GCC silently had a similar issue that was resolved with GCC 12.x.
      Restrict CONFIG_DEBUG_INFO_SPLIT for RISC-V when using LLVM or GCC <
      12.x to avoid these known issues.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/1914
      Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99090
      
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/all/202308090204.9yZffBWo-lkp@intel.com/
      
      
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Reviewed-by: default avatarFangrui Song <maskray@google.com>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Link: https://lore.kernel.org/r/20230816-riscv-debug_info_split-v1-1-d1019d6ccc11@kernel.org
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      89775a27
    • Palmer Dabbelt's avatar
      Merge patch series "RISC-V: mm: Make SV48 the default address space" · 94f00388
      Palmer Dabbelt authored
      Charlie Jenkins <charlie@rivosinc.com> says:
      
      Make sv48 the default address space for mmap as some applications
      currently depend on this assumption. Users can now select a
      desired address space using a non-zero hint address to mmap. Previously,
      requesting the default address space from mmap by passing zero as the hint
      address would result in using the largest address space possible. Some
      applications depend on empty bits in the virtual address space, like Go and
      Java, so this patch provides more flexibility for application developers.
      
      * b4-shazam-merge:
        RISC-V: mm: Document mmap changes
        RISC-V: mm: Update pgtable comment documentation
        RISC-V: mm: Add tests for RISC-V mm
        RISC-V: mm: Restrict address space for sv39,sv48,sv57
      
      Link: https://lore.kernel.org/r/20230809232218.849726-1-charlie@rivosinc.com
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      94f00388
    • Palmer Dabbelt's avatar
      Merge patch series "riscv: Reduce ARCH_KMALLOC_MINALIGN to 8" · 52b77c28
      Palmer Dabbelt authored
      Jisheng Zhang <jszhang@kernel.org> says:
      
      Currently, riscv defines ARCH_DMA_MINALIGN as L1_CACHE_BYTES, I.E
      64Bytes, if CONFIG_RISCV_DMA_NONCOHERENT=y. To support unified kernel
      Image, usually we have to enable CONFIG_RISCV_DMA_NONCOHERENT, thus
      it brings some bad effects to coherent platforms:
      
      Firstly, it wastes memory, kmalloc-96, kmalloc-32, kmalloc-16 and
      kmalloc-8 slab caches don't exist any more, they are replaced with
      either kmalloc-128 or kmalloc-64.
      
      Secondly, larger than necessary kmalloc aligned allocations results
      in unnecessary cache/TLB pressure.
      
      This issue also exists on arm64 platforms. From last year, Catalin
      tried to solve this issue by decoupling ARCH_KMALLOC_MINALIGN from
      ARCH_DMA_MINALIGN, limiting kmalloc() minimum alignment to
      dma_get_cache_alignment() and replacing ARCH_KMALLOC_MINALIGN usage
      in various drivers with ARCH_DMA_MINALIGN etc.[1]
      
      One fact we can make use of for riscv: if the CPU doesn't support
      ZICBOM or T-HEAD CMO, we know the platform is coherent. Based on
      Catalin's work and above fact, we can easily solve the kmalloc align
      issue for riscv: we can override dma_get_cache_alignment(), then let
      it return ARCH_DMA_MINALIGN at the beginning and return 1 once we know
      the underlying HW neither supports ZICBOM nor supports T-HEAD CMO.
      
      So what about if the CPU supports ZICBOM or T-HEAD CMO, but all the
      devices are dma coherent? Well, we use ARCH_DMA_MINALIGN as the
      kmalloc minimum alignment, nothing changed in this case. This case
      can be improved in the future once we see such platforms in mainline.
      
      After this patch, a simple test of booting to a small buildroot rootfs
      on qemu shows:
      
      kmalloc-96           5041    5041     96  ...
      kmalloc-64           9606    9606     64  ...
      kmalloc-32           5128    5128     32  ...
      kmalloc-16           7682    7682     16  ...
      kmalloc-8           10246   10246      8  ...
      
      So we save about 1268KB memory. The saving will be much larger in normal
      OS env on real HW platforms.
      
      patch1 allows kmalloc() caches aligned to the smallest value.
      patch2 enables DMA_BOUNCE_UNALIGNED_KMALLOC.
      
      After this series:
      
      As for coherent platforms, kmalloc-{8,16,32,96} caches come back on
      coherent both RV32 and RV64 platforms, I.E !ZICBOM and !THEAD_CMO.
      
      As for noncoherent RV32 platforms, nothing changed.
      
      As for noncoherent RV64 platforms, I.E either ZICBOM or THEAD_CMO, the
      above kmalloc caches also come back if > 4GB memory or users pass
      "swiotlb=mmnn,force" to force swiotlb creation if <= 4GB memory. How
      much mmnn should be depends on the specific platform, it needs to be
      tried and tested all possible usage case on the specific hardware. For
      example, I can use the minimal I/O TLB slabs on Sipeed M1S Dock.
      
      * b4-shazam-merge:
        riscv: enable DMA_BOUNCE_UNALIGNED_KMALLOC for !dma_coherent
        riscv: allow kmalloc() caches aligned to the smallest value
      
      Link: https://lore.kernel.org/linux-arm-kernel/20230524171904.3967031-1-catalin.marinas@arm.com/ [1]
      Link: https://lore.kernel.org/r/20230718152214.2907-1-jszhang@kernel.org
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      52b77c28
    • Jisheng Zhang's avatar
      riscv: support PREEMPT_DYNAMIC with static keys · 4e90d052
      Jisheng Zhang authored
      
      
      Currently, each architecture can support PREEMPT_DYNAMIC through
      either static calls or static keys. To support PREEMPT_DYNAMIC on
      riscv, we face three choices:
      
      1. only add static calls support to riscv
      As Mark pointed out in commit 99cf983c ("sched/preempt: Add
      PREEMPT_DYNAMIC using static keys"), static keys "...should have
      slightly lower overhead than non-inline static calls, as this
      effectively inlines each trampoline into the start of its callee. This
      may avoid redundant work, and may integrate better with CFI schemes."
      So even we add static calls(without inline static calls) to riscv,
      static keys is still a better choice.
      
      2. add static calls and inline static calls to riscv
      Per my understanding, inline static calls requires objtool support
      which is not easy.
      
      3. use static keys
      
      While riscv doesn't have static calls support, it supports static keys
      perfectly. So this patch selects HAVE_PREEMPT_DYNAMIC_KEY to enable
      support for PREEMPT_DYNAMIC on riscv, so that the preemption model can
      be chosen at boot time. It also patches asm-generic/preempt.h, mainly
      to add __preempt_schedule() and __preempt_schedule_notrace() macros
      for PREEMPT_DYNAMIC case. Other architectures which use generic
      preempt.h can also benefit from this patch by simply selecting
      HAVE_PREEMPT_DYNAMIC_KEY to enable PREEMPT_DYNAMIC if they supports
      static keys.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Reviewed-by: default avatarConor Dooley <conor.dooley@microchip.com>
      Link: https://lore.kernel.org/r/20230716164925.1858-1-jszhang@kernel.org
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      4e90d052
    • Palmer Dabbelt's avatar
      Merge patch series "riscv: support ELF format binaries in nommu mode" · 150e3c92
      Palmer Dabbelt authored
      Greg Ungerer <gerg@kernel.org> says:
      
      The following changes add the ability to run ELF format binaries when
      running RISC-V in nommu mode. That support is actually part of the
      ELF-FDPIC loader, so these changes are all about making that work on
      RISC-V.
      
      The first issue to deal with is making the ELF-FDPIC loader capable of
      handling 64-bit ELF files. As coded right now it only supports 32-bit
      ELF files.
      
      Secondly some changes are required to enable and compile the ELF-FDPIC
      loader on RISC-V and to pass the ELF-FDPIC mapping addresses through to
      user space when execing the new program.
      
      These changes have not been used to run actual ELF-FDPIC binaries.
      It is used to load and run normal ELF - compiled -pie format. Though the
      underlying changes are expected to work with full ELF-FDPIC binaries if
      or when that is supported on RISC-V in gcc.
      
      To avoid needing changes to the C-library (tested with uClibc-ng
      currently) there is a simple runtime dynamic loader (interpreter)
      available to do the final relocations, https://github.com/gregungerer/uldso.
      The nice thing about doing it this way is that the same program
      binary can also be loaded with the usual ELF loader in MMU linux.
      
      The motivation here is to provide an easy to use alternative to the
      flat format binaries normally used for RISC-V nommu based systems.
      
      * b4-shazam-merge:
        riscv: support the elf-fdpic binfmt loader
        binfmt_elf_fdpic: support 64-bit systems
      
      Link: https://lore.kernel.org/r/20230711130754.481209-1-gerg@kernel.org
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      150e3c92
    • Palmer Dabbelt's avatar
      Merge patch series "riscv: KCFI support" · 7f7d3ea6
      Palmer Dabbelt authored
      Sami Tolvanen <samitolvanen@google.com> says:
      
      This series adds KCFI support for RISC-V. KCFI is a fine-grained
      forward-edge control-flow integrity scheme supported in Clang >=16,
      which ensures indirect calls in instrumented code can only branch to
      functions whose type matches the function pointer type, thus making
      code reuse attacks more difficult.
      
      Patch 1 implements a pt_regs based syscall wrapper to address
      function pointer type mismatches in syscall handling. Patches 2 and 3
      annotate indirectly called assembly functions with CFI types. Patch 4
      implements error handling for indirect call checks. Patch 5 disables
      CFI for arch/riscv/purgatory. Patch 6 finally allows CONFIG_CFI_CLANG
      to be enabled for RISC-V.
      
      Note that Clang 16 has a generic architecture-agnostic KCFI
      implementation, which does work with the kernel, but doesn't produce
      a stable code sequence for indirect call checks, which means
      potential failures just trap and won't result in informative error
      messages. Clang 17 includes a RISC-V specific back-end implementation
      for KCFI, which emits a predictable code sequence for the checks and a
      .kcfi_traps section with locations of the traps, which patch 5 uses to
      produce more useful errors.
      
      The type mismatch fixes and annotations in the first three patches
      also become necessary in future if the kernel decides to support
      fine-grained CFI implemented using the hardware landing pad
      feature proposed in the in-progress Zicfisslp extension. Once the
      specification is ratified and hardware support emerges, implementing
      runtime patching support that replaces KCFI instrumentation with
      Zicfisslp landing pads might also be feasible (similarly to KCFI to
      FineIBT patching on x86_64), allowing distributions to ship a unified
      kernel binary for all devices.
      
      * b4-shazam-merge:
        riscv: Allow CONFIG_CFI_CLANG to be selected
        riscv/purgatory: Disable CFI
        riscv: Add CFI error handling
        riscv: Add ftrace_stub_graph
        riscv: Add types to indirectly called assembly functions
        riscv: Implement syscall wrappers
      
      Link: https://lore.kernel.org/r/20230710183544.999540-8-samitolvanen@google.com
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      7f7d3ea6
    • Alexandre Ghiti's avatar
      riscv: Move create_tmp_mapping() to init sections · 9bdd9248
      Alexandre Ghiti authored
      
      
      This function is only used at boot time so mark it as __init.
      
      Fixes: 96f9d4da ("riscv: Rework kasan population functions")
      Signed-off-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
      Link: https://lore.kernel.org/r/20230704074357.233982-2-alexghiti@rivosinc.com
      
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      9bdd9248
    • Alexandre Ghiti's avatar
      riscv: Mark KASAN tmp* page tables variables as static · dd7664d6
      Alexandre Ghiti authored
      
      
      tmp_pg_dir, tmp_p4d and tmp_pud are only used in kasan_init.c so they
      should be declared as static.
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Closes: https://lore.kernel.org/oe-kbuild-all/202306282202.bODptiGE-lkp@intel.com/
      
      
      Fixes: 96f9d4da ("riscv: Rework kasan population functions")
      Signed-off-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
      Link: https://lore.kernel.org/r/20230704074357.233982-1-alexghiti@rivosinc.com
      
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      dd7664d6
    • Ye Xingchen's avatar
      riscv: mm: use bitmap_zero() API · 665c51f6
      Ye Xingchen authored
      
      
      bitmap_zero() is faster than bitmap_clear(), so use bitmap_zero()
      instead of bitmap_clear().
      
      Signed-off-by: default avatarYe Xingchen <ye.xingchen@zte.com.cn>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Link: https://lore.kernel.org/r/202305061711417142802@zte.com.cn
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      665c51f6
    • Palmer Dabbelt's avatar
      Merge patch series "support allocating crashkernel above 4G explicitly on riscv" · 9389e671
      Palmer Dabbelt authored
      Chen Jiahao <chenjiahao16@huawei.com> says:
      
      On riscv, the current crash kernel allocation logic is trying to
      allocate within 32bit addressible memory region by default, if
      failed, try to allocate without 4G restriction.
      
      In need of saving DMA zone memory while allocating a relatively large
      crash kernel region, allocating the reserved memory top down in
      high memory, without overlapping the DMA zone, is a mature solution.
      Hence this patchset introduces the parameter option crashkernel=X,[high,low].
      
      One can reserve the crash kernel from high memory above DMA zone range
      by explicitly passing "crashkernel=X,high"; or reserve a memory range
      below 4G with "crashkernel=X,low". Besides, there are few rules need
      to take notice:
      1. "crashkernel=X,[high,low]" will be ignored if "crashkernel=size"
         is specified.
      2. "crashkernel=X,low" is valid only when "crashkernel=X,high" is passed
         and there is enough memory to be allocated under 4G.
      3. When allocating crashkernel above 4G and no "crashkernel=X,low" is
         specified, a 128M low memory will be allocated automatically for
         swiotlb bounce buffer.
      See Documentation/admin-guide/kernel-parameters.txt for more information.
      
      To verify loading the crashkernel, adapted kexec-tools is attached below:
      https://github.com/chenjh005/kexec-tools/tree/build-test-riscv-v2
      
      Following test cases have been performed as expected:
      1) crashkernel=256M                          //low=256M
      2) crashkernel=1G                            //low=1G
      3) crashkernel=4G                            //high=4G, low=128M(default)
      4) crashkernel=4G crashkernel=256M,high      //high=4G, low=128M(default), high is ignored
      5) crashkernel=4G crashkernel=256M,low       //high=4G, low=128M(default), low is ignored
      6) crashkernel=4G,high                       //high=4G, low=128M(default)
      7) crashkernel=256M,low                      //low=0M, invalid
      8) crashkernel=4G,high crashkernel=256M,low  //high=4G, low=256M
      9) crashkernel=4G,high crashkernel=4G,low    //high=0M, low=0M, invalid
      10) crashkernel=512M@0xd0000000              //low=512M
      11) crashkernel=1G,high crashkernel=0M,low   //high=1G, low=0M
      
      * b4-shazam-merge:
        docs: kdump: Update the crashkernel description for riscv
        riscv: kdump: Implement crashkernel=X,[high,low]
      
      Link: https://lore.kernel.org/r/20230726175000.2536220-1-chenjiahao16@huawei.com
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      9389e671
    • Palmer Dabbelt's avatar
      Merge patch series "riscv: kprobes: simulate some instructions" · 82dfb5fd
      Palmer Dabbelt authored
      Nam Cao <namcaov@gmail.com> says:
      
      Simulate some currently rejected instructions. Still to be simulated are:
          - c.jal
          - c.ebreak
      
      * b4-shazam-merge:
        riscv: kprobes: simulate c.beqz and c.bnez
        riscv: kprobes: simulate c.jr and c.jalr instructions
        riscv: kprobes: simulate c.j instruction
      
      Link: https://lore.kernel.org/r/cover.1690704360.git.namcaov@gmail.com
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      82dfb5fd
    • Jisheng Zhang's avatar
      riscv: enable DEBUG_FORCE_FUNCTION_ALIGN_64B · 3ed8513c
      Jisheng Zhang authored
      
      
      Allow to force all function address 64B aligned as it is possible for
      other architectures. This may be useful when verify if performance
      bump is caused by function alignment changes.
      
      Before commit 1bf18da6 ("lib/Kconfig.debug: add ARCH dependency
      for FUNCTION_ALIGN option"), riscv supports enabling the
      DEBUG_FORCE_FUNCTION_ALIGN_64B option, but after that commit, each
      arch needs to claim the support explicitly.
      
      Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
      Reviewed-by: default avatarConor Dooley <conor.dooley@microchip.com>
      Link: https://lore.kernel.org/r/20230727160356.3874-1-jszhang@kernel.org
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      3ed8513c
    • Nam Cao's avatar
      riscv: remove redundant mv instructions · 6b289a3f
      Nam Cao authored
      
      
      Some mv instructions were useful when first introduced to preserve a0 and
      a1 before function calls. However the code has changed and they are now
      redundant. Remove them.
      
      Signed-off-by: default avatarNam Cao <namcaov@gmail.com>
      Reviewed-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
      Link: https://lore.kernel.org/r/20230725053835.138910-1-namcaov@gmail.com
      
      
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      6b289a3f
    • Linus Torvalds's avatar
      Merge tag '6.6-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6 · b97d64c7
      Linus Torvalds authored
      Pull smb client updates from Steve French:
      
       - fixes for excessive stack usage
      
       - multichannel reconnect improvements
      
       - DFS fix and cleanup patches
      
       - move UCS-2 conversion code to fs/nls and update cifs and jfs to use
         them
      
       - cleanup patch for compounding, one to fix confusing function name
      
       - inode number collision fix
      
       - reparse point fixes (including avoiding an extra unneeded query on
         symlinks) and a minor cleanup
      
       - directory lease (caching) improvement
      
      * tag '6.6-rc-smb3-client-fixes-part1' of git://git.samba.org/sfrench/cifs-2.6: (24 commits)
        fs/jfs: Use common ucs2 upper case table
        fs/smb/client: Use common code in client
        fs/smb: Swing unicode common code from smb->NLS
        fs/smb: Remove unicode 'lower' tables
        SMB3: rename macro CIFS_SERVER_IS_CHAN to avoid confusion
        [SMB3] send channel sequence number in SMB3 requests after reconnects
        cifs: update desired access while requesting for directory lease
        smb: client: reduce stack usage in smb2_query_reparse_point()
        smb: client: reduce stack usage in smb2_query_info_compound()
        smb: client: reduce stack usage in smb2_set_ea()
        smb: client: reduce stack usage in smb_send_rqst()
        smb: client: reduce stack usage in cifs_demultiplex_thread()
        smb: client: reduce stack usage in cifs_try_adding_channels()
        smb: cilent: set reparse mount points as automounts
        smb: client: query reparse points in older dialects
        smb: client: do not query reparse points twice on symlinks
        smb: client: parse reparse point flag in create response
        smb: client: get rid of dfs code dep in namespace.c
        smb: client: get rid of dfs naming in automount code
        smb: client: rename cifs_dfs_ref.c to namespace.c
        ...
      b97d64c7
    • Linus Torvalds's avatar
      Merge tag 'libnvdimm-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 47d154eb
      Linus Torvalds authored
      Pull nvdimm updates from Dave Jiang:
       "This is mostly small cleanups, fixes, and with a change to prevent
        zero-sized namespace exposed to user for nvdimm.
      
        Summary:
      
         - kstrtobool() conversion for nvdimm
      
         - Add REQ_OP_WRITE for virtio_pmem
      
         - Header files update for of_pmem
      
         - Restrict zero-sized namespace from being exposed to user
      
         - Avoid unnecessary endian conversion
      
         - Fix mem leak in nvdimm pmu
      
         - Fix dereference after free in nvdimm pmu"
      
      * tag 'libnvdimm-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        nvdimm: Fix dereference after free in register_nvdimm_pmu()
        nvdimm: Fix memleak of pmu attr_groups in unregister_nvdimm_pmu()
        nvdimm/pfn_dev: Avoid unnecessary endian conversion
        nvdimm/pfn_dev: Prevent the creation of zero-sized namespaces
        nvdimm: Explicitly include correct DT includes
        virtio_pmem: add the missing REQ_OP_WRITE for flush bio
        nvdimm: Use kstrtobool() instead of strtobool()
      47d154eb
    • Linus Torvalds's avatar
      Merge tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd · 4debf771
      Linus Torvalds authored
      Pull iommufd updates from Jason Gunthorpe:
       "On top of the vfio updates is built some new iommufd functionality:
      
         - IOMMU_HWPT_ALLOC allows userspace to directly create the low level
           IO Page table objects and affiliate them with IOAS objects that
           hold the translation mapping. This is the basic functionality for
           the normal IOMMU_DOMAIN_PAGING domains.
      
         - VFIO_DEVICE_ATTACH_IOMMUFD_PT can be used to replace the current
           translation. This is wired up to through all the layers down to the
           driver so the driver has the ability to implement a hitless
           replacement. This is necessary to fully support guest behaviors
           when emulating HW (eg guest atomic change of translation)
      
         - IOMMU_GET_HW_INFO returns information about the IOMMU driver HW
           that owns a VFIO device. This includes support for the Intel iommu,
           and patches have been posted for all the other server IOMMU.
      
        Along the way are a number of internal items:
      
         - New iommufd kernel APIs: iommufd_ctx_has_group(),
              iommufd_device_to_ictx(), iommufd_device_to_id(),
              iommufd_access_detach(), iommufd_ctx_from_fd(),
              iommufd_device_replace()
      
         - iommufd now internally tracks iommu_groups as it needs some
           per-group data
      
         - Reorganize how the internal hwpt allocation flows to have more
           robust locking
      
         - Improve the access interfaces to support detach and replace of an
           IOAS from an access
      
         - New selftests and a rework of how the selftests creates a mock
           iommu driver to be more like a real iommu driver"
      
      Link: https://lore.kernel.org/lkml/ZO%2FTe6LU1ENf58ZW@nvidia.com/
      
      * tag 'for-linus-iommufd' of git://git.kernel.org/pub/scm/linux/kernel/git/jgg/iommufd: (34 commits)
        iommufd/selftest: Don't leak the platform device memory when unloading the module
        iommu/vt-d: Implement hw_info for iommu capability query
        iommufd/selftest: Add coverage for IOMMU_GET_HW_INFO ioctl
        iommufd: Add IOMMU_GET_HW_INFO
        iommu: Add new iommu op to get iommu hardware information
        iommu: Move dev_iommu_ops() to private header
        iommufd: Remove iommufd_ref_to_users()
        iommufd/selftest: Make the mock iommu driver into a real driver
        vfio: Support IO page table replacement
        iommufd/selftest: Add IOMMU_TEST_OP_ACCESS_REPLACE_IOAS coverage
        iommufd: Add iommufd_access_replace() API
        iommufd: Use iommufd_access_change_ioas in iommufd_access_destroy_object
        iommufd: Add iommufd_access_change_ioas(_id) helpers
        iommufd: Allow passing in iopt_access_list_id to iopt_remove_access()
        vfio: Do not allow !ops->dma_unmap in vfio_pin/unpin_pages()
        iommufd/selftest: Add a selftest for IOMMU_HWPT_ALLOC
        iommufd/selftest: Return the real idev id from selftest mock_domain
        iommufd: Add IOMMU_HWPT_ALLOC
        iommufd/selftest: Test iommufd_device_replace()
        iommufd: Make destroy_rwsem use a lock class per object type
        ...
      4debf771