FWIW, it's a syscall that's been around for as long as I can remember. In macOS 11 they added a new mach_vm_remap but kept the old one for compatibility so I don't think it's going away any time soon.
-j On Tue, Nov 10, 2020 at 9:37 AM Alex Bennée <alex.ben...@linaro.org> wrote: > > > Richard Henderson <richard.hender...@linaro.org> writes: > > > Cribbed from code posted by Joelle van Dyne <j...@getutm.app>, > > and rearranged to a cleaner structure. Completely untested. > > > > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > > --- > > accel/tcg/translate-all.c | 65 +++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 65 insertions(+) > > > > diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c > > index 1931e65365..17df6c94fa 100644 > > --- a/accel/tcg/translate-all.c > > +++ b/accel/tcg/translate-all.c > > @@ -1166,9 +1166,71 @@ static bool > > alloc_code_gen_buffer_splitwx_memfd(size_t size, Error **errp) > > } > > #endif /* CONFIG_POSIX */ > > > > +#ifdef CONFIG_DARWIN > > +#include <mach/mach.h> > > + > > +extern kern_return_t mach_vm_remap(vm_map_t target_task, > > + mach_vm_address_t *target_address, > > + mach_vm_size_t size, > > + mach_vm_offset_t mask, > > + int flags, > > + vm_map_t src_task, > > + mach_vm_address_t src_address, > > + boolean_t copy, > > + vm_prot_t *cur_protection, > > + vm_prot_t *max_protection, > > + vm_inherit_t inheritance); > > Our checkpatch really doesn't like the extern being dropped in here but > having grepped the xnu source I'm not sure we have a choice. I'm curious > how stable the function might be given it's not in a published header. > > -- > Alex Bennée