Re: [PATCH 1/6] bsd-user/freebsd/os-syscall.c: lock_iovec

2022-06-07 Thread Warner Losh
On Tue, Jun 7, 2022 at 2:01 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/7/22 13:14, Warner Losh wrote: > > +static void helper_unlock_iovec(struct target_iovec *target_vec, > > +abi_ulong target_addr, struct iovec > *vec, > > +

Re: [PATCH 1/6] bsd-user/freebsd/os-syscall.c: lock_iovec

2022-06-07 Thread Richard Henderson
On 6/7/22 13:14, Warner Losh wrote: +static void helper_unlock_iovec(struct target_iovec *target_vec, +abi_ulong target_addr, struct iovec *vec, +int count, int copy) +{ +for (int i = 0; i < count; i++) { +abi_ulong base

[PATCH 1/6] bsd-user/freebsd/os-syscall.c: lock_iovec

2022-06-07 Thread Warner Losh
lock_iovec will lock an I/O vec and the memory to which it refers and create a iovec in the host space that refers to it, with full error unwinding. Add helper_iovec_unlock to unlock the partially locked iovec in case there's an error. The code will be used in iovec_unlock when that is committed.