mirror of https://github.com/torvalds/linux.git
Some platforms can customize the PTE/PMD entry uffd-wp bit making it unavailable even if the architecture provides the resource. This patch adds a macro API pgtable_supports_uffd_wp() that allows architectures to define their specific implementations to check if the uffd-wp bit is available on which device the kernel is running. Also this patch is removing "ifdef CONFIG_HAVE_ARCH_USERFAULTFD_WP" and "ifdef CONFIG_PTE_MARKER_UFFD_WP" in favor of pgtable_supports_uffd_wp() and uffd_supports_wp_marker() checks respectively that default to IS_ENABLED(CONFIG_HAVE_ARCH_USERFAULTFD_WP) and "IS_ENABLED(CONFIG_HAVE_ARCH_USERFAULTFD_WP) && IS_ENABLED(CONFIG_PTE_MARKER_UFFD_WP)" if not overridden by the architecture, no change in behavior is expected. Link: https://lkml.kernel.org/r/20251113072806.795029-3-zhangchunyan@iscas.ac.cn Signed-off-by: Chunyan Zhang <zhangchunyan@iscas.ac.cn> Acked-by: David Hildenbrand <david@redhat.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Alexandre Ghiti <alex@ghiti.fr> Cc: Alexandre Ghiti <alexghiti@rivosinc.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Andrew Jones <ajones@ventanamicro.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Axel Rasmussen <axelrasmussen@google.com> Cc: Christian Brauner <brauner@kernel.org> Cc: Conor Dooley <conor.dooley@microchip.com> Cc: Conor Dooley <conor@kernel.org> Cc: Deepak Gupta <debug@rivosinc.com> Cc: Jan Kara <jack@suse.cz> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Peter Xu <peterx@redhat.com> Cc: Rob Herring <robh@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Yuanchu Xie <yuanchu@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> |
||
|---|---|---|
| .. | ||
| bitops | ||
| vdso | ||
| Kbuild | ||
| access_ok.h | ||
| agp.h | ||
| archrandom.h | ||
| asm-offsets.h | ||
| asm-prototypes.h | ||
| atomic.h | ||
| atomic64.h | ||
| audit_change_attr.h | ||
| audit_dir_write.h | ||
| audit_read.h | ||
| audit_signal.h | ||
| audit_write.h | ||
| barrier.h | ||
| bitops.h | ||
| bitsperlong.h | ||
| bug.h | ||
| cache.h | ||
| cacheflush.h | ||
| cfi.h | ||
| checksum.h | ||
| cmpxchg-local.h | ||
| cmpxchg.h | ||
| codetag.lds.h | ||
| compat.h | ||
| current.h | ||
| delay.h | ||
| device.h | ||
| div64.h | ||
| dma-mapping.h | ||
| dma.h | ||
| early_ioremap.h | ||
| emergency-restart.h | ||
| error-injection.h | ||
| exec.h | ||
| extable.h | ||
| fixmap.h | ||
| flat.h | ||
| fprobe.h | ||
| ftrace.h | ||
| futex.h | ||
| getorder.h | ||
| hardirq.h | ||
| hugetlb.h | ||
| hw_irq.h | ||
| int-ll64.h | ||
| io.h | ||
| ioctl.h | ||
| iomap.h | ||
| irq.h | ||
| irq_regs.h | ||
| irq_work.h | ||
| irqflags.h | ||
| kdebug.h | ||
| kmap_size.h | ||
| kprobes.h | ||
| kvm_para.h | ||
| kvm_types.h | ||
| linkage.h | ||
| local.h | ||
| local64.h | ||
| logic_io.h | ||
| mcs_spinlock.h | ||
| memory_model.h | ||
| mm_hooks.h | ||
| mmiowb.h | ||
| mmiowb_types.h | ||
| mmu.h | ||
| mmu_context.h | ||
| mmzone.h | ||
| module.h | ||
| module.lds.h | ||
| mshyperv.h | ||
| msi.h | ||
| nommu_context.h | ||
| numa.h | ||
| param.h | ||
| parport.h | ||
| pci.h | ||
| pci_iomap.h | ||
| percpu.h | ||
| pgalloc.h | ||
| pgtable-nop4d.h | ||
| pgtable-nopmd.h | ||
| pgtable-nopud.h | ||
| pgtable_uffd.h | ||
| preempt.h | ||
| qrwlock.h | ||
| qrwlock_types.h | ||
| qspinlock.h | ||
| qspinlock_types.h | ||
| resource.h | ||
| rqspinlock.h | ||
| runtime-const.h | ||
| rwonce.h | ||
| seccomp.h | ||
| sections.h | ||
| serial.h | ||
| set_memory.h | ||
| shmparam.h | ||
| signal.h | ||
| simd.h | ||
| softirq_stack.h | ||
| spinlock.h | ||
| spinlock_types.h | ||
| statfs.h | ||
| string.h | ||
| switch_to.h | ||
| syscall.h | ||
| syscalls.h | ||
| text-patching.h | ||
| thread_info_tif.h | ||
| ticket_spinlock.h | ||
| timex.h | ||
| tlb.h | ||
| tlbflush.h | ||
| topology.h | ||
| trace_clock.h | ||
| uaccess.h | ||
| unwind_user.h | ||
| user.h | ||
| vermagic.h | ||
| vga.h | ||
| video.h | ||
| vmlinux.lds.h | ||
| word-at-a-time.h | ||
| xor.h | ||