diff options
author | Mark Johnston <markj@FreeBSD.org> | 2022-10-14 15:17:12 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2022-10-14 15:32:47 +0000 |
commit | 73a78b5efa737f53c81b37926476757b28888e54 (patch) | |
tree | d614de4c7ee6f90f757f0f919e9afa2934fa5ab3 | |
parent | b4e483bdb06b48a65e1031d48a8d8f4019413980 (diff) | |
download | src-73a78b5efa737f53c81b37926476757b28888e54.tar.gz src-73a78b5efa737f53c81b37926476757b28888e54.zip |
kinst: Clarify a comment in the trampoline allocator
Fixes: f0bc4ed144fc ("kinst: Initial revision")
-rw-r--r-- | sys/cddl/dev/kinst/trampoline.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/cddl/dev/kinst/trampoline.c b/sys/cddl/dev/kinst/trampoline.c index 094b055f1b14..2749fe7144a2 100644 --- a/sys/cddl/dev/kinst/trampoline.c +++ b/sys/cddl/dev/kinst/trampoline.c @@ -58,10 +58,11 @@ kinst_trampchunk_alloc(void) /* * Allocate virtual memory for the trampoline chunk. The returned - * address is saved in "trampaddr". - * - * Setting "trampaddr" to KERNBASE causes vm_map_find() to return an - * address above KERNBASE, so this satisfies both requirements. + * address is saved in "trampaddr". To simplify population of + * trampolines, we follow the amd64 kernel's code model and allocate + * them above KERNBASE, i.e., in the top 2GB of the kernel's virtual + * address space. Trampolines must be executable so max_prot must + * include VM_PROT_EXECUTE. */ trampaddr = KERNBASE; error = vm_map_find(kernel_map, NULL, 0, &trampaddr, |