Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec

2022-06-08 Thread Warner Losh
On Tue, Jun 7, 2022 at 7:02 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/7/22 16:35, Warner Losh wrote: > > > > > >> On Jun 7, 2022, at 3:23 PM, Richard Henderson < > richard.hender...@linaro.org> wrote: > >> > >> On 6/7/22 14:51, Warner Losh wrote: > >>> void unlock_iove

Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec

2022-06-07 Thread Richard Henderson
On 6/7/22 16:35, Warner Losh wrote: On Jun 7, 2022, at 3:23 PM, Richard Henderson wrote: On 6/7/22 14:51, Warner Losh wrote: void unlock_iovec(IOVecMap *map, bool copy_out) { for (int i = 0, count = map->count; i < count; ++i) { if (map->host[i].iov_base) {

Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec

2022-06-07 Thread Warner Losh
> On Jun 7, 2022, at 3:23 PM, Richard Henderson > wrote: > > On 6/7/22 14:51, Warner Losh wrote: >>void unlock_iovec(IOVecMap *map, bool copy_out) >>{ >> for (int i = 0, count = map->count; i < count; ++i) { >> if (map->host[i].iov_base) { >> abi_

Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec

2022-06-07 Thread Richard Henderson
On 6/7/22 14:51, Warner Losh wrote: void unlock_iovec(IOVecMap *map, bool copy_out) {      for (int i = 0, count = map->count; i < count; ++i) {          if (map->host[i].iov_base) {              abi_ulong target_base = tswapal(map->target[i].iov_base);              un

Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec

2022-06-07 Thread Richard Henderson
On 6/7/22 13:14, Warner Losh wrote: +void unlock_iovec(struct iovec *vec, abi_ulong target_addr, +int count, int copy) +{ +struct target_iovec *target_vec; + +target_vec = lock_user(VERIFY_READ, target_addr, + count * sizeof(struct target_iovec), 1); +

Re: [PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec

2022-06-07 Thread Warner Losh
On Tue, Jun 7, 2022 at 2:28 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/7/22 13:14, Warner Losh wrote: > > +void unlock_iovec(struct iovec *vec, abi_ulong target_addr, > > +int count, int copy) > > +{ > > +struct target_iovec *target_vec; > > + > > +target_ve

[PATCH 2/6] bsd-user/freebsd/os-syscall.c: unlock_iovec

2022-06-07 Thread Warner Losh
Releases the references to the iovec created by lock_iovec. Signed-off-by: Warner Losh --- bsd-user/freebsd/os-syscall.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index c41ef0eda40..510307f29d9 100644 --- a/b