Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2020 13:16:15 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r360433 - stable/12/sys/vm
Message-ID:  <202004281316.03SDGF22006045@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Apr 28 13:16:15 2020
New Revision: 360433
URL: https://svnweb.freebsd.org/changeset/base/360433

Log:
  MFC r360153:
  Minimize conditional compilation for handling of M_EXEC.

Modified:
  stable/12/sys/vm/vm_kern.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/vm/vm_kern.c
==============================================================================
--- stable/12/sys/vm/vm_kern.c	Tue Apr 28 08:28:13 2020	(r360432)
+++ stable/12/sys/vm/vm_kern.c	Tue Apr 28 13:16:15 2020	(r360433)
@@ -400,14 +400,10 @@ kmem_malloc_domain(int domain, vm_size_t size, int fla
 	vm_offset_t addr;
 	int rv;
 
-#if VM_NRESERVLEVEL > 0
 	if (__predict_true((flags & M_EXEC) == 0))
 		arena = vm_dom[domain].vmd_kernel_arena;
 	else
 		arena = vm_dom[domain].vmd_kernel_rwx_arena;
-#else
-	arena = vm_dom[domain].vmd_kernel_arena;
-#endif
 	size = round_page(size);
 	if (vmem_alloc(arena, size, flags | M_BESTFIT, &addr))
 		return (0);
@@ -499,10 +495,8 @@ retry:
 		m->valid = VM_PAGE_BITS_ALL;
 		pmap_enter(kernel_pmap, addr + i, m, prot,
 		    prot | PMAP_ENTER_WIRED, 0);
-#if VM_NRESERVLEVEL > 0
 		if (__predict_false((prot & VM_PROT_EXECUTE) != 0))
 			m->oflags |= VPO_KMEM_EXEC;
-#endif
 	}
 	VM_OBJECT_WUNLOCK(object);
 
@@ -576,14 +570,10 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_
 	VM_OBJECT_WLOCK(object);
 	m = vm_page_lookup(object, atop(offset)); 
 	domain = vm_phys_domain(m);
-#if VM_NRESERVLEVEL > 0
 	if (__predict_true((m->oflags & VPO_KMEM_EXEC) == 0))
 		arena = vm_dom[domain].vmd_kernel_arena;
 	else
 		arena = vm_dom[domain].vmd_kernel_rwx_arena;
-#else
-	arena = vm_dom[domain].vmd_kernel_arena;
-#endif
 	for (; offset < end; offset += PAGE_SIZE, m = next) {
 		next = vm_page_next(m);
 		vm_page_unwire_noq(m);
@@ -799,6 +789,9 @@ kmem_init(vm_offset_t start, vm_offset_t end)
 		vmem_set_import(vm_dom[domain].vmd_kernel_rwx_arena,
 		    kva_import_domain, (vmem_release_t *)vmem_xfree,
 		    kernel_arena, KVA_QUANTUM);
+#else
+		vm_dom[domain].vmd_kernel_rwx_arena =
+		    vm_dom[domain].vmd_kernel_arena;
 #endif
 	}
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004281316.03SDGF22006045>