[PATCH] linux-user: Add several IFTUN ioctls

2020-07-10 Thread Josh Kunz
/dcde237b9b0eb1d19306e6f48c0a4e058907619f/include/uapi/linux/if_tun.h#L31 Signed-off-by: Josh Kunz --- linux-user/ioctls.h | 20 linux-user/syscall.c | 1 + linux-user/syscall_defs.h | 21 + 3 files changed, 42 insertions(+) diff --git a/linux

Re: [PATCH 4/5] linux-user: Support CLONE_VM and extended clone options

2020-07-08 Thread Josh Kunz
Sorry for the late reply, response inline. Also I noticed a couple mails ago I seemed to have removed the devel list and maintainers. I've re-added them to the CC line. On Wed, Jun 24, 2020 at 3:17 AM Alex Bennée wrote: > > > Josh Kunz writes: > > > On Tue, Jun 23, 2020, 1

[PATCH] linux-user: Use EPROTONOSUPPORT for unimplemented netlink protocols

2020-07-06 Thread Josh Kunz
linux-user targets on x86. [1]: https://github.com/torvalds/linux/blob/bfe91da29bfad9941d5d703d45e29f0812a20724/net/netlink/af_netlink.c#L683 Signed-off-by: Josh Kunz --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/syscall.c b/linux-user

Re: [PATCH 4/5] linux-user: Support CLONE_VM and extended clone options

2020-06-22 Thread Josh Kunz
etty heavyweight approach. Especially compared to the solution included in this series. Do you think there's a simpler approach that involves using a daemon to do coordination? Thanks again for your reviews. -- Josh Kunz

Re: [PATCH 0/5] linux-user: Support extended clone(CLONE_VM)

2020-06-16 Thread Josh Kunz
libc internals. I agree it would be interesting to test against musl. I'm pretty sure it would work (this patch only relies on POSIX APIs + Platform ABIs for TLS), but it would be interesting to confirm. -- Josh Kunz

Re: [PATCH 4/5] linux-user: Support CLONE_VM and extended clone options

2020-06-12 Thread Josh Kunz
> +child_tid = atomic_fetch_or(>managed_tid, 0); > +/* > + * Check if the child has already terminated by this point. If not, wait > + * for the child to exit. As long as the trampoline is not killed by > + * a signal, the kernel guarantees that the memory at >managed_tid > +

[PATCH 5/5] linux-user: Add PDEATHSIG test for clone process hierarchy.

2020-06-11 Thread Josh Kunz
Certain process-level linux features like subreapers, and PDEATHSIG, depend on the guest's process hierarchy being emulated correctly on the host. This change adds a test that makes sure PDEATHSIG works for a guest process created with `clone`. Signed-off-by: Josh Kunz --- tests/tcg/multiarch

[PATCH 2/5] linux-user: Make fd_trans task-specific.

2020-06-11 Thread Josh Kunz
if a task needs to use a different FD table. Signed-off-by: Josh Kunz --- linux-user/Makefile.objs | 2 +- linux-user/fd-trans-tbl.c | 13 +++ linux-user/fd-trans-type.h | 17 + linux-user/fd-trans.c | 3 -- linux-user/fd-trans.h | 75

[PATCH 4/5] linux-user: Support CLONE_VM and extended clone options

2020-06-11 Thread Josh Kunz
y terminated children. * Doing the child clone directly in the TLS manager thread: This saves the need for the trampoline process, but it causes the child process to be parented to the wrong kernel task (the TLS thread instead of the Main thread) breaking things like PDEATHSIG.

[PATCH 0/5] linux-user: Support extended clone(CLONE_VM)

2020-06-11 Thread Josh Kunz
ciated. * execve does not clean up the CPUs of clone'd children, for the same reasons as `exit_group`. Josh Kunz (5): linux-user: Refactor do_fork to use new `qemu_clone` linux-user: Make fd_trans task-specific. linux-user: Make sigact_table part of the task state. linux-user: S

[PATCH 3/5] linux-user: Make sigact_table part of the task state.

2020-06-11 Thread Josh Kunz
when cloning children. Signed-off-by: Josh Kunz --- linux-user/qemu.h| 8 linux-user/signal.c | 35 +++ linux-user/syscall.c | 17 + 3 files changed, 52 insertions(+), 8 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h

[PATCH 1/5] linux-user: Refactor do_fork to use new `qemu_clone`

2020-06-11 Thread Josh Kunz
) into a separate file. Signed-off-by: Josh Kunz --- linux-user/Makefile.objs | 2 +- linux-user/clone.c | 152 linux-user/clone.h | 27 +++ linux-user/syscall.c | 376 +++ 4 files changed, 365 insertions(+), 192 deletions(-) create mode

Re: [PATCH 0/4] linux-user: fix use of SIGRTMIN

2020-02-04 Thread Josh Kunz
On Tue, Feb 4, 2020 at 3:55 AM Laurent Vivier wrote: > We should add signal 63 here, but it's becoming not very clean. https://golang.org/issue/33746 has some discussion of the issue. The Go maintainers wanted to clean this up rather than just adding 63. The patch is on ice right now because it

Re: [PATCH 0/4] migration: Replace gemu_log with qemu_log

2020-02-03 Thread Josh Kunz
On Mon, Jan 20, 2020 at 3:36 AM Alex Bennée wrote: > Ahh the default build target for the BSDs is "check" but as bsd-user > doesn't have any checks it doesn't end up building. You can force it > with > > make vm-build-netbsd EXTRA_CONFIGURE_OPTS="--disable-system" > BUILD_TARGET="all" > > It

Re: [PATCH v2 1/4] linux-user: Use `qemu_log' for non-strace logging

2020-02-03 Thread Josh Kunz
ent Vivier writes: > > > >> Le 17/01/2020 à 20:28, Josh Kunz a écrit : > >>> Since most calls to `gemu_log` are actually logging unimplemented > >>> features, > >>> this change replaces most non-strace calls to `gemu_log` with calls to > >>> `qe

[PATCH v3 4/4] bsd-user: Replace gemu_log with qemu_log

2020-02-03 Thread Josh Kunz
redirection. bsd-user does not currently implement any logging redirection options, or log masking options, but this change brings it more in line with the linux-user tree. Signed-off-by: Josh Kunz --- bsd-user/main.c| 29 + bsd-user/qemu.h| 2 -- bsd-user

[PATCH v3 3/4] linux-user: remove gemu_log from the linux-user tree

2020-02-03 Thread Josh Kunz
Now that all uses have been migrated to `qemu_log' it is no longer needed. Reviewed-by: Laurent Vivier Signed-off-by: Josh Kunz --- linux-user/main.c | 9 - linux-user/qemu.h | 1 - 2 files changed, 10 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 8f1d07cdd6

Re: [PATCH v2 2/4] linux-user: Use `qemu_log' for strace

2020-02-03 Thread Josh Kunz
On Tue, Jan 28, 2020 at 7:07 AM Laurent Vivier wrote: > > Le 17/01/2020 à 20:28, Josh Kunz a écrit : > > This change switches linux-user strace logging to use the newer `qemu_log` > > logging subsystem rather than the older `gemu_log` (notice the "g") > > logger.

[PATCH v3 2/4] linux-user: Use `qemu_log' for strace

2020-02-03 Thread Josh Kunz
gging (via the QEMU_LOG environment variable or options). This change introduces a new log mask: `LOG_STRACE` which is used for logging of user-mode strace messages. Reviewed-by: Laurent Vivier Signed-off-by: Josh Kunz --- include/qemu/log.h | 2 + linux-user/main.c| 30 ++- linux-u

[PATCH v3 1/4] linux-user: Use `qemu_log' for non-strace logging

2020-02-03 Thread Josh Kunz
is slightly backwards incompatible, since now these "unimplemented" log messages will not be logged by default. Signed-off-by: Josh Kunz --- linux-user/arm/cpu_loop.c | 5 ++-- linux-user/fd-trans.c | 55 +-- linux-user/syscall.c

[PATCH v3 0/4] migration: Replace gemu_log with qemu_log

2020-02-03 Thread Josh Kunz
stderr. Tested: * Built with clang 9 and g++ 8.3 * `make check` run with clang 9 build * Verified: * QEMU_STRACE/-strace still works for linux-user * `make vm-build-netbsd EXTRA_CONFIGURE_OPTS="--disable-system" \ BUILD_TARGET="all"` passed. Josh Kunz (4):

Re: [PATCH 0/4] linux-user: fix use of SIGRTMIN

2020-02-03 Thread Josh Kunz
On Sat, Feb 1, 2020 at 4:27 AM Laurent Vivier wrote: > This has been tested with Go (golang 1.10.1 linux/arm64, bionic) on x86_64 > fedora 31. We can avoid the failure in this case allowing the unsupported > signals when we don't provide the "act" parameters to sigaction, only the > "oldact" one.

Re: [PATCH 2/4] linux-user: Use `qemu_log' for strace

2020-01-17 Thread Josh Kunz
On Tue, Jan 14, 2020 at 2:56 AM Alex Bennée wrote: > Could we cut out the middle-man and just qemu_add_log(LOG_STRACE) here > and drop the enable_strace variable. This code has been re-factored based on Laurent's comments. In v2 `enable_strace` is still needed to avoid QEMU_LOG/-d overwriting

Re: [PATCH 2/4] linux-user: Use `qemu_log' for strace

2020-01-17 Thread Josh Kunz
On Tue, Jan 14, 2020 at 1:09 AM Laurent Vivier wrote: > This is really a special case as the flags are all given at the same > time, could you use directly qemu_set_log() in main()? Fixed in v2. > > +/* Remove (subtract) the given log flags from the current log mask. */ > > +static inline void

Re: [PATCH 1/4] linux-user: Use `qemu_log' for non-strace logging

2020-01-17 Thread Josh Kunz
On Tue, Jan 14, 2020 at 2:43 AM Alex Bennée wrote: > > As Laurent said I think LOG_UNIMP is perfectly fine for stuff we haven't > done. I don't think any of the cases warrant LOG_GUEST_ERROR. I've replaced `LOG_USER` with `LOG_UNIMP`. Didn't catch that mask at first, LOG_UNIMP is indeed a better

[PATCH v2 4/4] bsd-user: Replace gemu_log with qemu_log

2020-01-17 Thread Josh Kunz
redirection. bsd-user does not currently implement any logging redirection options, or log masking options, but this change brings it more in line with the linux-user tree. Signed-off-by: Josh Kunz --- bsd-user/main.c| 13 ++--- bsd-user/qemu.h| 2 -- bsd-user/strace.c | 32

[PATCH v2 1/4] linux-user: Use `qemu_log' for non-strace logging

2020-01-17 Thread Josh Kunz
is slightly backwards incompatible, since now these "unimplemented" log messages will not be logged by default. Signed-off-by: Josh Kunz --- linux-user/arm/cpu_loop.c | 5 ++-- linux-user/fd-trans.c | 55 +-- linux-user/syscall.c

[PATCH v2 2/4] linux-user: Use `qemu_log' for strace

2020-01-17 Thread Josh Kunz
gging (via the QEMU_LOG environment variable or options). This change introduces a new log mask: `LOG_STRACE` which is used for logging of user-mode strace messages. Signed-off-by: Josh Kunz --- include/qemu/log.h | 2 + linux-user/main.c| 30 ++- linux-user/qemu.h| 1 - linux-use

[PATCH v2 0/4] migration: Replace gemu_log with qemu_log

2020-01-17 Thread Josh Kunz
ot tested: * Build/logging with bsd-user. I do not have easy access to a BSD system. Josh Kunz (4): linux-user: Use `qemu_log' for non-strace logging linux-user: Use `qemu_log' for strace linux-user: remove gemu_log from the linux-user tree bsd-user: Replace gemu_log with qemu_l

[PATCH v2 3/4] linux-user: remove gemu_log from the linux-user tree

2020-01-17 Thread Josh Kunz
Now that all uses have been migrated to `qemu_log' it is no longer needed. Signed-off-by: Josh Kunz --- linux-user/main.c | 9 - linux-user/qemu.h | 1 - 2 files changed, 10 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 8f1d07cdd6..22578b1633 100644 --- a/linux

Re: [PATCH 0/4] migration: Replace gemu_log with qemu_log

2020-01-16 Thread Josh Kunz
On Mon, Jan 13, 2020 at 7:06 PM Warner Losh wrote: > The bsd-user that is in tree doesn't work. I've been trying to catch up to > qemu head of tree, but I'm only up to 3.2... chances are the bsd-user > changes will not change the state of things... > Ah good to know. Would you all prefer I

Re: [PATCH 0/4] migration: Replace gemu_log with qemu_log

2020-01-16 Thread Josh Kunz
On Tue, Jan 14, 2020 at 3:02 AM Alex Bennée wrote: > > Josh Kunz writes: > > > > > > Not tested: > > * Build/logging with bsd-user. I do not have easy access to a BSD > > system. > > If you have the time we have vm-build-netbsd: > > make

[PATCH 4/4] bsd-user: Replace gemu_log with qemu_log

2020-01-13 Thread Josh Kunz
redirection. bsd-user does not currently implement any logging redirection options, or log masking options, but this change brings it more in line with the linux-user tree. Signed-off-by: Josh Kunz --- bsd-user/main.c| 13 ++--- bsd-user/qemu.h| 2 -- bsd-user/strace.c | 32

[PATCH 2/4] linux-user: Use `qemu_log' for strace

2020-01-13 Thread Josh Kunz
gging (via the QEMU_LOG environment variable or options). Signed-off-by: Josh Kunz --- include/qemu/log.h | 13 ++ linux-user/main.c| 17 +- linux-user/qemu.h| 1 - linux-user/signal.c | 3 +- linux-user/strace.c | 479 ++- linux-user

[PATCH 1/4] linux-user: Use `qemu_log' for non-strace logging

2020-01-13 Thread Josh Kunz
o mask out these log messages if they desire. Signed-off-by: Josh Kunz --- include/qemu/log.h| 2 ++ linux-user/arm/cpu_loop.c | 5 ++-- linux-user/fd-trans.c | 55 +-- linux-user/main.c | 24 + linux-user/syscall.c

[PATCH 3/4] linux-user: remove gemu_log from the linux-user tree

2020-01-13 Thread Josh Kunz
Now that all uses have been migrated to `qemu_log' it is no longer needed. Signed-off-by: Josh Kunz --- linux-user/main.c | 9 - linux-user/qemu.h | 1 - 2 files changed, 10 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 0bf40c4d27..945b6adf3a 100644 --- a/linux

[PATCH 0/4] migration: Replace gemu_log with qemu_log

2020-01-13 Thread Josh Kunz
QEMU_STRACE/-strace still works for linux-user * -no-force-user-mode-logging uses QEMU_LOG + `user_mode` or `strace` can be set in QEMU_LOG to trigger the appropriate logging. Not tested: * Build/logging with bsd-user. I do not have easy access to a BSD system. Josh Kunz (4

Re: [PATCH] linux-user: Support for NETLINK socket options

2019-11-05 Thread Josh Kunz
Thanks for the fixes Laurent, sorry for the delay. Josh On Tue, Nov 5, 2019 at 1:25 AM Laurent Vivier wrote: > Le 29/10/2019 à 23:43, Josh Kunz a écrit : > > This change includes support for all AF_NETLINK socket options up to > about > > kernel version 5.4 (5.4 is not

[PATCH] linux-user: Support for NETLINK socket options

2019-10-29 Thread Josh Kunz
. This change has been built under gcc 8.3, and clang 9.0, and it passes `make check`. The netlink options have been tested by emulating some non-trival software that uses NETLINK socket options, but they have not been exaustively verified. Signed-off-by: Josh Kunz --- linux-user/syscall.c | 98

Re: [EXTERNAL]Re: [Qemu-devel] patch to swap SIGRTMIN + 1 and SIGRTMAX - 1

2019-10-02 Thread Josh Kunz
, this is unavoidable; but for the SIGRTMIN, SIGRTMIN+1 case, I’m not sure it’s worth it. After considering these drawbacks, do the QEMU maintainers still think this is the right approach for handling these libc reserved signals? On Fri, Aug 30, 2019 at 6:26 PM Josh Kunz wrote: > I can take o

Re: [Qemu-devel] [PATCH] linux-user: Support gdb 'qOffsets' query for ELF

2019-09-03 Thread Josh Kunz via Qemu-devel
/gdb/General-Query-Packets.html#General-Query-Packets On Mon, Aug 26, 2019 at 1:29 AM Laurent Vivier wrote: > Le 17/08/2019 à 01:34, Josh Kunz via Qemu-devel a écrit : > > This is needed to support debugging PIE ELF binaries running under QEMU > > user mode. Currentl

Re: [Qemu-devel] [EXTERNAL]Re: patch to swap SIGRTMIN + 1 and SIGRTMAX - 1

2019-08-30 Thread Josh Kunz via Qemu-devel
to swap SIGRTMIN + 1 and > SIGRTMAX - 1 > > > > Le 26/08/2019 à 23:10, Josh Kunz a écrit : > > > On Wed, Aug 21, 2019 at 2:28 AM Laurent Vivier > > <mailto:laur...@vivier.eu>> wrote: > > > > > > Le 19/08/2019 à 23:46, Josh Kunz via Qemu-devel a

Re: [Qemu-devel] patch to swap SIGRTMIN + 1 and SIGRTMAX - 1

2019-08-26 Thread Josh Kunz via Qemu-devel
On Wed, Aug 21, 2019 at 2:28 AM Laurent Vivier wrote: > Le 19/08/2019 à 23:46, Josh Kunz via Qemu-devel a écrit : > > Hi all, > > > > I have also experienced issues with SIGRTMIN + 1, and am interested in > > moving this patch forwards. Anything I can do here to help

Re: [Qemu-devel] patch to swap SIGRTMIN + 1 and SIGRTMAX - 1

2019-08-19 Thread Josh Kunz via Qemu-devel
is a link to the original thread this message is in reply to in-case my mail-client doesn't set up the reply properly: https://lists.nongnu.org/archive/html/qemu-devel/2019-07/msg01303.html Thanks, Josh Kunz

Re: [Qemu-devel] [PATCH] linux-user: Support gdb 'qOffsets' query for ELF

2019-08-16 Thread Josh Kunz via Qemu-devel
+cc: riku.voi...@iki.fi, I typoed the email on the first go. On Fri, Aug 16, 2019 at 4:34 PM Josh Kunz wrote: > This is needed to support debugging PIE ELF binaries running under QEMU > user mode. Currently, `code_offset` and `data_offset` remain unset for > all ELF binaries, so GDB

[Qemu-devel] [PATCH] linux-user: Support gdb 'qOffsets' query for ELF

2019-08-16 Thread Josh Kunz via Qemu-devel
. Buglink: https://bugs.launchpad.net/qemu/+bug/1528239 Signed-off-by: Josh Kunz --- linux-user/elfload.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 3365e192eb..ceac035208 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c