Index: sys/amd64/include/vmparam.h =================================================================== --- sys/amd64/include/vmparam.h +++ sys/amd64/include/vmparam.h @@ -253,6 +253,11 @@ */ #define VM_BATCHQUEUE_SIZE 31 +/* + * The pmap can create non-transparent large page mappings. + */ +#define PMAP_HAS_LARGEPAGES 1 + /* * Need a page dump array for minidump. */ Index: sys/arm/include/vmparam.h =================================================================== --- sys/arm/include/vmparam.h +++ sys/arm/include/vmparam.h @@ -193,6 +193,11 @@ #define DEVMAP_MAX_VADDR ARM_VECTORS_HIGH +/* + * No non-transparent large page support in the pmap. + */ +#define PMAP_HAS_LARGEPAGES 0 + /* * Need a page dump array for minidump. */ Index: sys/arm64/include/vmparam.h =================================================================== --- sys/arm64/include/vmparam.h +++ sys/arm64/include/vmparam.h @@ -243,6 +243,11 @@ #define DEVMAP_MAX_VADDR VM_MAX_KERNEL_ADDRESS +/* + * The pmap can create non-transparent large page mappings. + */ +#define PMAP_HAS_LARGEPAGES 1 + /* * Need a page dump array for minidump. */ Index: sys/i386/include/vmparam.h =================================================================== --- sys/i386/include/vmparam.h +++ sys/i386/include/vmparam.h @@ -240,6 +240,11 @@ #define PHYS_TO_DMAP(x) ({ panic("No direct map exists"); 0; }) #define DMAP_TO_PHYS(x) ({ panic("No direct map exists"); 0; }) +/* + * No non-transparent large page support in the pmap. + */ +#define PMAP_HAS_LARGEPAGES 0 + /* * Need a page dump array for minidump. */ Index: sys/kern/uipc_shm.c =================================================================== --- sys/kern/uipc_shm.c +++ sys/kern/uipc_shm.c @@ -1067,10 +1067,8 @@ return (EINVAL); largepage = (shmflags & SHM_LARGEPAGE) != 0; -#if !defined(__amd64__) - if (largepage) + if (largepage && !PMAP_HAS_LARGEPAGES) return (ENOTTY); -#endif /* * Currently only F_SEAL_SEAL may be set when creating or opening shmfd. Index: sys/mips/include/vmparam.h =================================================================== --- sys/mips/include/vmparam.h +++ sys/mips/include/vmparam.h @@ -197,6 +197,11 @@ #define PHYS_TO_DMAP(x) MIPS_PHYS_TO_DIRECT(x) #define DMAP_TO_PHYS(x) MIPS_DIRECT_TO_PHYS(x) +/* + * No non-transparent large page support in the pmap. + */ +#define PMAP_HAS_LARGEPAGES 0 + /* * Need a page dump array for minidump. */ Index: sys/powerpc/include/vmparam.h =================================================================== --- sys/powerpc/include/vmparam.h +++ sys/powerpc/include/vmparam.h @@ -327,4 +327,9 @@ KASSERT(hw_direct_map, ("Direct map not provided by PMAP")); \ (x) &~ DMAP_BASE_ADDRESS; }) +/* + * No non-transparent large page support in the pmap. + */ +#define PMAP_HAS_LARGEPAGES 0 + #endif /* _MACHINE_VMPARAM_H_ */ Index: sys/riscv/include/vmparam.h =================================================================== --- sys/riscv/include/vmparam.h +++ sys/riscv/include/vmparam.h @@ -236,6 +236,11 @@ #define DEVMAP_MAX_VADDR VM_MAX_KERNEL_ADDRESS +/* + * No non-transparent large page support in the pmap. + */ +#define PMAP_HAS_LARGEPAGES 0 + /* * Need a page dump array for minidump. */ Index: sys/vm/vm_fault.c =================================================================== --- sys/vm/vm_fault.c +++ sys/vm/vm_fault.c @@ -487,6 +487,8 @@ * populate only busies the first page in superpage run. */ if (bdry_idx != 0) { + KASSERT(PMAP_HAS_LARGEPAGES, + ("missing pmap support for large pages")); m = vm_page_lookup(fs->first_object, pager_first); vm_fault_populate_check_page(m); VM_OBJECT_WUNLOCK(fs->first_object);