svn commit: r366090 - in head/sys: amd64/include arm/include arm64/include i386/include kern mips/include powerpc/include riscv/include vm
Mark Johnston
markj at FreeBSD.org
Wed Sep 23 19:34:24 UTC 2020
Author: markj
Date: Wed Sep 23 19:34:21 2020
New Revision: 366090
URL: https://svnweb.freebsd.org/changeset/base/366090
Log:
Add a vmparam.h constant indicating pmap support for large pages.
Enable SHM_LARGEPAGE support on arm64.
Reviewed by: alc, kib
Sponsored by: Juniper Networks, Inc., Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D26467
Modified:
head/sys/amd64/include/vmparam.h
head/sys/arm/include/vmparam.h
head/sys/arm64/include/vmparam.h
head/sys/i386/include/vmparam.h
head/sys/kern/uipc_shm.c
head/sys/mips/include/vmparam.h
head/sys/powerpc/include/vmparam.h
head/sys/riscv/include/vmparam.h
head/sys/vm/vm_fault.c
Modified: head/sys/amd64/include/vmparam.h
==============================================================================
--- head/sys/amd64/include/vmparam.h Wed Sep 23 19:33:47 2020 (r366089)
+++ head/sys/amd64/include/vmparam.h Wed Sep 23 19:34:21 2020 (r366090)
@@ -254,6 +254,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.
*/
#define MINIDUMP_PAGE_TRACKING 1
Modified: head/sys/arm/include/vmparam.h
==============================================================================
--- head/sys/arm/include/vmparam.h Wed Sep 23 19:33:47 2020 (r366089)
+++ head/sys/arm/include/vmparam.h Wed Sep 23 19:34:21 2020 (r366090)
@@ -194,6 +194,11 @@ extern vm_offset_t vm_max_kernel_address;
#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.
*/
#define MINIDUMP_PAGE_TRACKING 1
Modified: head/sys/arm64/include/vmparam.h
==============================================================================
--- head/sys/arm64/include/vmparam.h Wed Sep 23 19:33:47 2020 (r366089)
+++ head/sys/arm64/include/vmparam.h Wed Sep 23 19:34:21 2020 (r366090)
@@ -244,6 +244,11 @@ extern vm_offset_t init_pt_va;
#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.
*/
#define MINIDUMP_PAGE_TRACKING 1
Modified: head/sys/i386/include/vmparam.h
==============================================================================
--- head/sys/i386/include/vmparam.h Wed Sep 23 19:33:47 2020 (r366089)
+++ head/sys/i386/include/vmparam.h Wed Sep 23 19:34:21 2020 (r366090)
@@ -241,6 +241,11 @@
#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.
*/
#define MINIDUMP_PAGE_TRACKING 1
Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c Wed Sep 23 19:33:47 2020 (r366089)
+++ head/sys/kern/uipc_shm.c Wed Sep 23 19:34:21 2020 (r366090)
@@ -1067,10 +1067,8 @@ kern_shm_open2(struct thread *td, const char *userpath
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.
Modified: head/sys/mips/include/vmparam.h
==============================================================================
--- head/sys/mips/include/vmparam.h Wed Sep 23 19:33:47 2020 (r366089)
+++ head/sys/mips/include/vmparam.h Wed Sep 23 19:34:21 2020 (r366090)
@@ -198,6 +198,11 @@
#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.
*/
#define MINIDUMP_PAGE_TRACKING 1
Modified: head/sys/powerpc/include/vmparam.h
==============================================================================
--- head/sys/powerpc/include/vmparam.h Wed Sep 23 19:33:47 2020 (r366089)
+++ head/sys/powerpc/include/vmparam.h Wed Sep 23 19:34:21 2020 (r366090)
@@ -327,4 +327,9 @@ struct pmap_physseg {
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_ */
Modified: head/sys/riscv/include/vmparam.h
==============================================================================
--- head/sys/riscv/include/vmparam.h Wed Sep 23 19:33:47 2020 (r366089)
+++ head/sys/riscv/include/vmparam.h Wed Sep 23 19:34:21 2020 (r366090)
@@ -237,6 +237,11 @@ extern vm_offset_t init_pt_va;
#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.
*/
#define MINIDUMP_PAGE_TRACKING 1
Modified: head/sys/vm/vm_fault.c
==============================================================================
--- head/sys/vm/vm_fault.c Wed Sep 23 19:33:47 2020 (r366089)
+++ head/sys/vm/vm_fault.c Wed Sep 23 19:34:21 2020 (r366090)
@@ -487,6 +487,8 @@ vm_fault_populate(struct faultstate *fs)
* 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);
More information about the svn-src-all
mailing list