[PATCH v2 2/4] linux-user: Fix shmat() strace

2024-03-25 Thread Ilya Leoshkevich
Henderson Signed-off-by: Ilya Leoshkevich --- linux-user/strace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 660f942f599..54169096aa4 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -701,7 +701,7 @@

[PATCH v2 4/4] tests/tcg: Test shmat(NULL)

2024-03-25 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/linux/linux-shmat-null.c | 38 1 file changed, 38 insertions(+) create mode 100644 tests/tcg/multiarch/linux/linux-shmat-null.c diff --git

[PATCH v2 0/4] linux-user: Fix shmat(NULL) for h != g

2024-03-25 Thread Ilya Leoshkevich
ues, and adds a test. Best regards, Ilya Ilya Leoshkevich (4): linux-user: Fix semctl() strace linux-user: Fix shmat() strace linux-user: Fix shmat(NULL) for h != g tests/tcg: Test shmat(NULL) linux-user/mmap.c| 2 +- linux-user/strace.c |

[PATCH v2 1/4] linux-user: Fix semctl() strace

2024-03-25 Thread Ilya Leoshkevich
t;Fix warnings that would be caused by gcc flag -Wwrite-strings") Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- linux-user/strace.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 9934e2208e2..6

[PATCH v2 3/4] linux-user: Fix shmat(NULL) for h != g

2024-03-25 Thread Ilya Leoshkevich
", which is set after mmap_find_vma(), is true. Fixes: 78bc8ed9a8f0 ("linux-user: Rewrite target_shmat") Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- linux-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/mmap.c b

[PATCH 0/4] linux-user: Fix shmat(NULL) for h != g

2024-03-25 Thread Ilya Leoshkevich
Hi, I noticed that while shmat() now works with /proc/self/maps, shmat(NULL) got broken. This series fixes that along with two related strace issues, and adds a test. Best regards, Ilya Ilya Leoshkevich (4): linux-user: Fix semctl() strace linux-user: Fix shmat() strace linux-user: Fix

[PATCH 2/4] linux-user: Fix shmat() strace

2024-03-25 Thread Ilya Leoshkevich
The indices of arguments passed to print_shmat() are all off-by-1, because arg1 is the ipc() command. Fix them. New output for linux-shmat-maps test: 3501769 shmat(4784214,0x0080,SHM_RND) = 0 Fixes: 9f7c97324c27 ("linux-user: Add strace for shmat") Signed-of

[PATCH 1/4] linux-user: Fix semctl() strace

2024-03-25 Thread Ilya Leoshkevich
t;Fix warnings that would be caused by gcc flag -Wwrite-strings") Signed-off-by: Ilya Leoshkevich --- linux-user/strace.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 9934e2208e2..9be71af4016 100644 --- a/linux-use

[PATCH 4/4] tests/tcg: Test shmat(NULL)

2024-03-25 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/linux/linux-shmat-null.c | 38 1 file changed, 38 insertions(+) create mode 100644 tests/tcg/multiarch/linux/linux-shmat-null.c diff --git a/tests/tcg/multiarch/linux/linux

[PATCH 3/4] linux-user: Fix shmat(NULL) for h != g

2024-03-25 Thread Ilya Leoshkevich
", which is set after mmap_find_vma(), is true. Fixes: 78bc8ed9a8f0 ("linux-user: Rewrite target_shmat") Signed-off-by: Ilya Leoshkevich --- linux-user/mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/mmap.c b/linux-user/mmap.c index e88faf1ab3d.

[PATCH v2 1/2] target/s390x: Use mutable temporary value for op_ts

2024-03-18 Thread Ilya Leoshkevich
From: Ido Plat Otherwise TCG would assume the register that holds t1 would be constant and reuse whenever it needs the value within it. Cc: qemu-sta...@nongnu.org Fixes: f1ea739bd598 ("target/s390x: Use tcg_constant_* in local contexts") Reviewed-by: Ilya Leoshkevich Reviewed-b

[PATCH v2 2/2] tests/tcg/s390x: Test TEST AND SET

2024-03-18 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/ts.c| 35 + 2 files changed, 36 insertions(+) create mode 100644 tests/tcg/s390x/ts.c diff --git a/tests/tcg/s390x

[PATCH 2/2] tests/tcg/s390x: Test TEST AND SET

2024-03-18 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/ts.c| 35 + 2 files changed, 36 insertions(+) create mode 100644 tests/tcg/s390x/ts.c diff --git a/tests/tcg/s390x

[PATCH 1/2] target/s390x: Use mutable temporary value for op_ts

2024-03-18 Thread Ilya Leoshkevich
From: Ido Plat Otherwise TCG would assume the register that holds t1 would be constant and reuse whenever it needs the value within it. Reviewed-by: Ilya Leoshkevich [iii: Adjust a newline and capitalization] Signed-off-by: Ido Plat --- target/s390x/tcg/translate.c | 3 ++- 1 file changed, 2

[PATCH] meson: Make DEBUG_REMAP a meson option

2024-03-11 Thread Ilya Leoshkevich
Currently DEBUG_REMAP is a macro that needs to be manually #defined to be activated, which makes it hard to have separate build directories dedicated to testing the code with it. Promote it to a meson option. Signed-off-by: Ilya Leoshkevich --- bsd-user/qemu.h | 6 ++ linux

[PATCH] gdbstub: Fix double close() of the follow-fork-mode socket

2024-03-11 Thread Ilya Leoshkevich
returning - instead. Fixes: Coverity CID 1539966 Fixes: d547e711a8a5 ("gdbstub: Implement follow-fork-mode child") Signed-off-by: Ilya Leoshkevich --- gdbstub/user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gdbstub/user.c b/gdbstub/user.c index 7f9f19a1249..0

Re: [PATCH] linux-user: Make TARGET_NR_setgroups affect only the current thread

2024-02-26 Thread Ilya Leoshkevich
On Wed, Jan 31, 2024 at 02:10:55PM +0100, Philippe Mathieu-Daudé wrote: > On 31/1/24 01:18, Ilya Leoshkevich wrote: > > Like TARGET_NR_setuid, TARGET_NR_setgroups should affect only the > > calling thread, and not the entire process. Therefore, implement it > > using a syscall

Re: [PATCH 3/3] linux-user: Rewrite target_shmat

2024-02-23 Thread Ilya Leoshkevich
) unless the address is sufficiently > + * aligned for the host, we'll need to check both. > + * TODO: Could be fixed with softmmu. > + */ Are there any plans to introduce softmmu to qemu-user? [...] Reviewed-by: Ilya Leoshkevich Please consider adding the reproducer to the series: &

[PATCH v4 03/12] {linux,bsd}-user: Update ts_tid after fork()

2024-02-19 Thread Ilya Leoshkevich
Currently ts_tid contains the parent tid after fork(), which is not correct. So far it has not affected anything, but the upcoming follow-fork-mode child support relies on the correct value, so fix it. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c | 1 + linux

[PATCH v4 02/12] {linux,bsd}-user: Introduce get_task_state()

2024-02-19 Thread Ilya Leoshkevich
A CPU's TaskState is stored in the CPUState's void *opaque field, accessing which is somewhat awkward due to having to use a cast. Introduce a wrapper and use it everywhere. Suggested-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- bsd-user/bsd-file.h | 2 +- bsd-user/qemu.h

[PATCH v4 00/12] gdbstub: Implement follow-fork-mode child

2024-02-19 Thread Ilya Leoshkevich
past exec() though). Patches 1-10 are preliminary refactorings, patch 11 is the implementation, and patch 12 is the test. [1] https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg06424.html Best regards, Ilya Ilya Leoshkevich (12): gdbstub: Support disablement in a multi-threaded process {

[PATCH v4 11/12] gdbstub: Implement follow-fork-mode child

2024-02-19 Thread Ilya Leoshkevich
that is initialized on fork(), decides the current owner of the gdbserver socket, and is terminated when one of the two processes is detached. The logic for the parent and the child is the same, only the initial state is different. Signed-off-by: Ilya Leoshkevich --- gdbstub/user.c | 212

[PATCH v4 09/12] gdbstub: Introduce gdb_handle_set_thread_user()

2024-02-19 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support needs to perform certain actions when GDB switches between the stopped parent and the stopped child. Introduce a user-specific hook for this. Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 11 +-- gdbstub/internals.h | 1 + gdbstub

Re: [PATCH v3 01/11] gdbstub: Support disablement in a multi-threaded process

2024-02-19 Thread Ilya Leoshkevich
On Mon, 2024-02-19 at 14:05 +0100, Ilya Leoshkevich wrote: > On Sat, 2024-02-17 at 10:21 -1000, Richard Henderson wrote: > > On 2/16/24 03:05, Ilya Leoshkevich wrote: > > > The upcoming follow-fork-mode child support will require > > > disabling > > > gdbstub i

[PATCH v4 06/12] {linux,bsd}-user: Pass pid to gdbserver_fork()

2024-02-19 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires knowing the child pid. Pass it down. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c| 2 +- gdbstub/user.c | 2 +- include/gdbstub/user.h | 2 +- linux-user/main.c | 2 +- 4 files

[PATCH v4 10/12] gdbstub: Introduce gdb_handle_detach_user()

2024-02-19 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support needs to perform certain actions when GDB detaches from the stopped parent or the stopped child. Introduce a user-specific hook for this. Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 6 ++ gdbstub/internals.h | 1 + gdbstub/user.c

[PATCH v4 12/12] tests/tcg: Add two follow-fork-mode tests

2024-02-19 Thread Ilya Leoshkevich
Add follow-fork-mode child and and follow-fork-mode parent tests. Check for the obvious pitfalls, such as lingering breakpoints, catchpoints, and single-step mode. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 17 +- tests/tcg/multiarch/follow-fork

[PATCH v4 07/12] gdbstub: Call gdbserver_fork() both in parent and in child

2024-02-19 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires post-fork message exchange between the parent and the child. Prepare gdbserver_fork() for this purpose. Rename it to gdbserver_fork_end() to better reflect its purpose. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- bsd

[PATCH v4 04/12] gdbstub: Introduce gdbserver_fork_start()

2024-02-19 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires knowing when fork() is about to happen in order to initialize its state. Add a hook for that. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c| 1 + gdbstub/user.c | 4 include/gdbstub/user.h

[PATCH v4 01/12] gdbstub: Support disablement in a multi-threaded process

2024-02-19 Thread Ilya Leoshkevich
. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- gdbstub/user.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/gdbstub/user.c b/gdbstub/user.c index 14918d1a217..3ce20b7bbfc 100644 --- a/gdbstub/user.c +++ b/gdbstub

[PATCH v4 05/12] {linux,bsd}-user: Pass pid to fork_end()

2024-02-19 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires knowing the child pid. Pass it down. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- bsd-user/freebsd/os-proc.h | 6 +++--- bsd-user/main.c | 4 +++- bsd-user/qemu.h | 2

[PATCH v4 08/12] gdbstub: Introduce gdb_handle_query_supported_user()

2024-02-19 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires advertising the fork-events feature, which is user-specific. Introduce a user-specific hook for this. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 12 +--- gdbstub/internals.h | 1

Re: [PATCH v3 01/11] gdbstub: Support disablement in a multi-threaded process

2024-02-19 Thread Ilya Leoshkevich
On Sat, 2024-02-17 at 10:21 -1000, Richard Henderson wrote: > On 2/16/24 03:05, Ilya Leoshkevich wrote: > > The upcoming follow-fork-mode child support will require disabling > > gdbstub in the parent process, which may have multiple threads > > (which > > are represen

[PATCH v3 10/11] gdbstub: Implement follow-fork-mode child

2024-02-16 Thread Ilya Leoshkevich
that is initialized on fork(), decides the current owner of the gdbserver socket, and is terminated when one of the two processes is detached. The logic for the parent and the child is the same, only the initial state is different. Signed-off-by: Ilya Leoshkevich --- gdbstub/user.c | 212

[PATCH v3 11/11] tests/tcg: Add two follow-fork-mode tests

2024-02-16 Thread Ilya Leoshkevich
Add follow-fork-mode child and and follow-fork-mode parent tests. Check for the obvious pitfalls, such as lingering breakpoints, catchpoints, and single-step mode. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 17 +- tests/tcg/multiarch/follow-fork

[PATCH v3 06/11] gdbstub: Call gdbserver_fork() both in parent and in child

2024-02-16 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires post-fork message exchange between the parent and the child. Prepare gdbserver_fork() for this purpose. Rename it to gdbserver_fork_end() to better reflect its purpose. Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c| 3

[PATCH v3 08/11] gdbstub: Introduce gdb_handle_set_thread_user()

2024-02-16 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support needs to perform certain actions when GDB switches between the stopped parent and the stopped child. Introduce a user-specific hook for this. Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 11 +-- gdbstub/internals.h | 1 + gdbstub

[PATCH v3 04/11] {linux,bsd}-user: Pass pid to fork_end()

2024-02-16 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires knowing the child pid. Pass it down. Signed-off-by: Ilya Leoshkevich --- bsd-user/freebsd/os-proc.h | 6 +++--- bsd-user/main.c | 4 +++- bsd-user/qemu.h | 2 +- linux-user/main.c | 4 +++- linux-user

[PATCH v3 09/11] gdbstub: Introduce gdb_handle_detach_user()

2024-02-16 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support needs to perform certain actions when GDB detaches from the stopped parent or the stopped child. Introduce a user-specific hook for this. Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 6 ++ gdbstub/internals.h | 1 + gdbstub/user.c

[PATCH v3 00/11] gdbstub: Implement follow-fork-mode child

2024-02-16 Thread Ilya Leoshkevich
t exec() though). Patches 1-9 are preliminary refactorings, patch 10 is the implementation, and patch 11 is the test. [1] https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg06424.html Best regards, Ilya Ilya Leoshkevich (11): gdbstub: Support disablement in a multi-threaded process {lin

[PATCH v3 05/11] {linux,bsd}-user: Pass pid to gdbserver_fork()

2024-02-16 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires knowing the child pid. Pass it down. Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c| 2 +- gdbstub/user.c | 2 +- include/gdbstub/user.h | 2 +- linux-user/main.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions

[PATCH v3 03/11] gdbstub: Introduce gdbserver_fork_start()

2024-02-16 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires knowing when fork() is about to happen in order to initialize its state. Add a hook for that. Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c| 1 + gdbstub/user.c | 4 include/gdbstub/user.h | 5 + linux-user

[PATCH v3 01/11] gdbstub: Support disablement in a multi-threaded process

2024-02-16 Thread Ilya Leoshkevich
-off-by: Ilya Leoshkevich --- gdbstub/user.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/gdbstub/user.c b/gdbstub/user.c index 14918d1a217..e17f7ece908 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -356,16 +356,27 @@ int gdbserver_start(const char

[PATCH v3 07/11] gdbstub: Introduce gdb_handle_query_supported_user()

2024-02-16 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires advertising the fork-events feature, which is user-specific. Introduce a user-specific hook for this. Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 12 +--- gdbstub/internals.h | 1 + gdbstub/user.c | 4 3

[PATCH v3 02/11] {linux,bsd}-user: Update ts_tid after fork()

2024-02-16 Thread Ilya Leoshkevich
Currently ts_tid contains the parent tid after fork(), which is not correct. So far it has not affected anything, but the upcoming follow-fork-mode child support relies on the correct value, so fix it. Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c | 1 + linux-user/main.c | 1 + 2 files

Re: [PATCH v5 0/3] linux-user: Allow gdbstub to ignore page protection

2024-02-16 Thread Ilya Leoshkevich
On Fri, 2024-02-16 at 11:44 +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > v4: > > https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg05857.html > > v4 -> v5: Fix the probe_proc_self_mem vs probe_proc_self_mem() > > typo. > >   A

Re: [PATCH v3 22/33] linux-user: Split out mmap_h_lt_g

2024-02-14 Thread Ilya Leoshkevich
On Tue, 2024-02-13 at 09:54 -1000, Richard Henderson wrote: > On 1/29/24 05:26, Ilya Leoshkevich wrote: > > On Tue, Jan 02, 2024 at 12:57:57PM +1100, Richard Henderson wrote: > > > Work much harder to get alignment and mapping beyond the end > > > of the file correct.  B

[PATCH v2 2/2] tests/tcg: Add SIGRTMIN/SIGRTMAX test

2024-02-12 Thread Ilya Leoshkevich
Test the lowest and the highest real-time signals. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/linux/linux-sigrtminmax.c | 41 +++ 1 file changed, 41 insertions(+) create mode 100644 tests/tcg/multiarch/linux/linux-sigrtminmax.c diff --git a/tests/tcg/multiarch

[PATCH v2 1/2] linux-user: Map low priority rt signals

2024-02-12 Thread Ilya Leoshkevich
will need it. Signed-off-by: Ilya Leoshkevich --- linux-user/signal.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index d3e62ab030f..a81533b563a 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -511,13

[PATCH v2 0/2] linux-user: Map low priority rt signals

2024-02-12 Thread Ilya Leoshkevich
the middle instead. Patch 1 makes the change, patch 2 is a test. Best regards, Ilya Ilya Leoshkevich (2): linux-user: Map low priority rt signals tests/tcg: Add SIGRTMIN/SIGRTMAX test linux-user/signal.c | 18 +--- tests/tcg/multiarch/linux/linux-sigrtminmax.c

Re: Re: [PULL 05/13] linux-user: Use walk_memory_regions for open_self_maps

2024-02-12 Thread Ilya Leoshkevich
On Mon, Feb 05, 2024 at 11:11:06AM +, Richard Purdie wrote: > On Mon, 2024-02-05 at 13:05 +1000, Richard Henderson wrote: > > On 1/26/24 23:52, Richard Purdie wrote: > > > On Fri, 2024-01-26 at 16:33 +0300, Michael Tokarev wrote: > > > > 26.01.2024 16:03, Richard Purdie wrote: > > > > > I've

Re: [PATCH v3 0/4] make vm-build-freebsd fixes

2024-02-07 Thread Ilya Leoshkevich
On Wed, 2024-02-07 at 15:02 +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > v2: > > https://lists.gnu.org/archive/html/qemu-devel/2024-02/msg00890.html > > v2 -> v3: Structure the meson check similar to have_asan_fiber; > >   Reduce th

[PATCH v3 0/4] make vm-build-freebsd fixes

2024-02-05 Thread Ilya Leoshkevich
IRC. I had several problems with it, which this series resolves. Best regards, Ilya Ilya Leoshkevich (4): tests/vm: Set UseDNS=no in the sshd configuration tests/vm/freebsd: Reload the sshd configuration test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics meson

[PATCH v3 2/4] tests/vm/freebsd: Reload the sshd configuration

2024-02-05 Thread Ilya Leoshkevich
After console_sshd_config(), the SSH server needs to be nudged to pick up the new configs. The scripts for the other BSD flavors already do this with a reboot, but a simple reload is sufficient. Reviewed-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/vm/freebsd | 1 + 1 file changed

[PATCH v3 4/4] meson: Link with libinotify on FreeBSD

2024-02-05 Thread Ilya Leoshkevich
reeBSD the inotify functions are defined in libinotify.so. Add it to the dependencies. Signed-off-by: Ilya Leoshkevich --- meson.build | 23 +++ util/meson.build | 6 +- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build

[PATCH v3 1/4] tests/vm: Set UseDNS=no in the sshd configuration

2024-02-05 Thread Ilya Leoshkevich
in the server config. Reviewed-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/vm/basevm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 61725b83254..c0d62c08031 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/ba

[PATCH v3 3/4] test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics

2024-02-05 Thread Ilya Leoshkevich
txt Event id=1 event=0 file=two.txt Expected event 0 but got 2 This difference in behavior is not expected to break the real users, so teach the test to accept it. Suggested-by: Daniel P. Berrange Signed-off-by: Ilya Leoshkevich --- tests/unit/test-util-filemonitor.c | 8

[PATCH v5 0/4] target/s390x: Emulate CVDG and CVB*

2024-02-05 Thread Ilya Leoshkevich
2865.html v1 -> v2: Fix !CONFIG_INT128 builds (Richard). Hi, Ido reported that we are missing the CVDG emulation (which is very similar to the existing CVD emulation). This series adds it along with a test. Best regards, Ilya Ilya Leoshkevich (4): target/s390x: Emulate CVDG target/s390x:

[PATCH v5 4/4] tests/tcg/s390x: Test CONVERT TO BINARY

2024-02-05 Thread Ilya Leoshkevich
Check the CVB's, CVBY's, and CVBG's corner cases. Co-developed-by: Pavel Zbitskiy Reviewed-by: Thomas Huth Tested-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/cvb.c | 102 2 files

[PATCH v5 3/4] tests/tcg/s390x: Test CONVERT TO DECIMAL

2024-02-05 Thread Ilya Leoshkevich
Check the CVD's, CVDY's, and CVDG's corner cases. Reviewed-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/cvd.c | 63 + 2 files changed, 64 insertions(+) create mode 100644 tests/tcg/s390x

[PATCH v5 1/4] target/s390x: Emulate CVDG

2024-02-05 Thread Ilya Leoshkevich
CVDG is the same as CVD, except that it converts 64 bits into 128, rather than 32 into 64. Create a new helper, which uses Int128 wrappers. Reported-by: Ido Plat Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- target/s390x/helper.h| 1 + target/s390x/tcg/insn

[PATCH v5 2/4] target/s390x: Emulate CVB, CVBY and CVBG

2024-02-05 Thread Ilya Leoshkevich
Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Co-developed-by: Pavel Zbitskiy Signed-off-by: Ilya Leoshkevich --- target/s390x/helper.h| 2 + target/s390x/tcg/insn

Re: Re: [PATCH v2 4/4] meson: Link with libinotify on FreeBSD

2024-02-05 Thread Ilya Leoshkevich
On Mon, Feb 05, 2024 at 07:36:32PM +0100, Philippe Mathieu-Daudé wrote: > Hi Ilya, > > On 5/2/24 19:11, Ilya Leoshkevich wrote: > > make vm-build-freebsd fails with: > > > > ld: error: undefined symbol: inotify_init1 > > >>> referenced by f

Re: Re: [PATCH v4 2/4] target/s390x: Emulate CVB, CVBY and CVBG

2024-02-05 Thread Ilya Leoshkevich
On Mon, Feb 05, 2024 at 06:04:27PM +0100, Thomas Huth wrote: > On 02/02/2024 15.11, Ilya Leoshkevich wrote: > > Convert to Binary - counterparts of the already implemented Convert > > to Decimal (CVD*) instructions. > > Example from the Principles of Operation: 25594C beco

[PATCH v2 3/4] tests/test-util-filemonitor: Adapt to FreeBSD inotify rename semantics

2024-02-05 Thread Ilya Leoshkevich
txt Event id=1 event=0 file=two.txt Expected event 0 but got 2 This difference in behavior is not expected to break the real users, so teach the test to accept it. Suggested-by: Daniel P. Berrange Signed-off-by: Ilya Leoshkevich --- tests/unit/test-util-filemonitor.c | 8

[PATCH v2 1/4] tests/vm: Set UseDNS=no in the sshd configuration

2024-02-05 Thread Ilya Leoshkevich
in the server config. Reviewed-by: Thomas Huth Signed-off-by: Ilya Leoshkevich --- tests/vm/basevm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 61725b83254..c0d62c08031 100644 --- a/tests/vm/basevm.py +++ b/tests

[PATCH v2 2/4] tests/vm/freebsd: Reload the sshd configuration

2024-02-05 Thread Ilya Leoshkevich
After console_sshd_config(), the SSH server needs to be nudged to pick up the new configs. The scripts for the other BSD flavors already do this with a reboot, but a simple reload is sufficient. Signed-off-by: Ilya Leoshkevich --- tests/vm/freebsd | 1 + 1 file changed, 1 insertion(+) diff

[PATCH v2 4/4] meson: Link with libinotify on FreeBSD

2024-02-05 Thread Ilya Leoshkevich
On FreeBSD inotify functions are defined in libinotify.so. Add it to the dependencies. Signed-off-by: Ilya Leoshkevich --- meson.build | 12 +++- util/meson.build | 6 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index b5d6dc94a83..

[PATCH v2 0/4] make vm-build-freebsd fixes

2024-02-05 Thread Ilya Leoshkevich
ded to verify that my qemu-user changes didn't break BSD, and Daniel Berrange suggested vm-build-freebsd on IRC. I had several problems with it, which this series resolves. Best regards, Ilya Ilya Leoshkevich (4): tests/vm: Set UseDNS=no in the sshd configuration tests/vm/freebsd: Reload the s

Re: [PATCH 3/3] meson: Disable CONFIG_NOTIFY1 on FreeBSD

2024-02-05 Thread Ilya Leoshkevich
, > > > but not true on *BSD, hence the undefined symbol. > > > > > > We need to augment the header file check with a linker > > > symbol check for the C library. > > > > > > If we wanted to also check for -linotify that'd make > > > it port

[PATCH v2 09/11] gdbstub: Introduce gdb_handle_detach_user()

2024-02-05 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support needs to perform certain actions when GDB detaches from the stopped parent or the stopped child. Introduce a user-specific hook for this. Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 6 ++ gdbstub/internals.h | 1 + gdbstub/user.c

[PATCH v2 08/11] gdbstub: Introduce gdb_handle_set_thread_user()

2024-02-05 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support needs to perform certain actions when GDB switches between the stopped parent and the stopped child. Introduce a user-specific hook for this. Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 11 +-- gdbstub/internals.h | 1 + gdbstub

[PATCH v2 04/11] {linux,bsd}-user: Pass pid to fork_end()

2024-02-05 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires knowing the child pid. Pass it down. Signed-off-by: Ilya Leoshkevich --- bsd-user/freebsd/os-proc.h | 6 +++--- bsd-user/main.c | 4 +++- bsd-user/qemu.h | 2 +- linux-user/main.c | 4 +++- linux-user

[PATCH v2 03/11] gdbstub: Introduce gdbserver_fork_start()

2024-02-05 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires knowing when fork() is about to happen in order to initialize its state. Add a hook for that. Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c| 1 + gdbstub/user.c | 4 include/gdbstub/user.h | 5 + linux-user

[PATCH v2 02/11] {linux,bsd}-user: Update ts_tid after fork()

2024-02-05 Thread Ilya Leoshkevich
Currently ts_tid contains the parent tid after fork(), which is not correct. So far it has not affected anything, but the upcoming follow-fork-mode child support relies on the correct value, so fix it. Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c | 1 + linux-user/main.c | 1 + 2 files

[PATCH v2 05/11] {linux,bsd}-user: Pass pid to gdbserver_fork()

2024-02-05 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires knowing the child pid. Pass it down. Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c| 2 +- gdbstub/user.c | 2 +- include/gdbstub/user.h | 2 +- linux-user/main.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions

[PATCH v2 10/11] gdbstub: Implement follow-fork-mode child

2024-02-05 Thread Ilya Leoshkevich
that is initialized on fork(), decides the current owner of the gdbserver socket, and is terminated when one of the two processes is detached. The logic for the parent and the child is the same, only the initial state is different. Signed-off-by: Ilya Leoshkevich --- gdbstub/user.c | 212

[PATCH v2 11/11] tests/tcg: Add two follow-fork-mode tests

2024-02-05 Thread Ilya Leoshkevich
Add follow-fork-mode child and and follow-fork-mode parent tests. Check for the obvious pitfalls, such as lingering breakpoints, catchpoints, and single-step mode. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 17 +- tests/tcg/multiarch/follow-fork

[PATCH v2 00/11] gdbstub: Implement follow-fork-mode child

2024-02-05 Thread Ilya Leoshkevich
1-9 are preliminary refactorings, patch 10 is the implementation, and patch 11 is the test. [1] https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg06424.html Best regards, Ilya Ilya Leoshkevich (11): gdbstub: Support disablement in a multi-threaded process {linux,bsd}-user: Update ts_tid aft

[PATCH v2 06/11] gdbstub: Call gdbserver_fork() both in parent and in child

2024-02-05 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires post-fork message exchange between the parent and the child. Prepare gdbserver_fork() for this purpose. Rename it to gdbserver_fork_end() to better reflect its purpose. Signed-off-by: Ilya Leoshkevich --- bsd-user/main.c| 3

[PATCH v2 07/11] gdbstub: Introduce gdb_handle_query_supported_user()

2024-02-05 Thread Ilya Leoshkevich
The upcoming follow-fork-mode child support requires advertising the fork-events feature, which is user-specific. Introduce a user-specific hook for this. Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 12 +--- gdbstub/internals.h | 1 + gdbstub/user.c | 4 3

[PATCH v2 01/11] gdbstub: Support disablement in a multi-threaded process

2024-02-05 Thread Ilya Leoshkevich
-off-by: Ilya Leoshkevich --- gdbstub/user.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/gdbstub/user.c b/gdbstub/user.c index 8f3affbad47..e6809da2243 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -356,16 +356,27 @@ int gdbserver_start(const char

Re: Re: [PATCH] tests/tcg: Fix the /proc/self/mem probing in the PROT_NONE gdbstub test

2024-02-05 Thread Ilya Leoshkevich
On Sat, Feb 03, 2024 at 11:48:44PM +0300, Michael Tokarev wrote: > 01.02.2024 01:02, Ilya Leoshkevich wrote: > > The `if not probe_proc_self_mem` check never passes, because > > probe_proc_self_mem is a function object, which is a truthy value. > > Add parentheses in order

[PATCH v3 4/5] gdbstub: Implement catching syscalls

2024-02-02 Thread Ilya Leoshkevich
ml Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 9 + gdbstub/internals.h | 1 + gdbstub/user.c | 95 + 3 files changed, 105 insertions(+) diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index 46d752bbc2c..7e73e916

[PATCH v3 5/5] tests/tcg: Add the syscall catchpoint gdbstub test

2024-02-02 Thread Ilya Leoshkevich
Check that adding/removing syscall catchpoints works. Reviewed-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 10 +++- tests/tcg/multiarch/catch-syscalls.c | 51 ++ tests/tcg/multiarch/gdbstub/catch-syscalls.py | 53

[PATCH v3 3/5] gdbstub: Add syscall entry/return hooks

2024-02-02 Thread Ilya Leoshkevich
The upcoming syscall catchpoint support needs to get control on syscall entry and return. Provide the necessary hooks for that, which are no-ops for now. Signed-off-by: Ilya Leoshkevich --- gdbstub/user.c | 8 include/gdbstub/user.h | 13 + include/user

[PATCH v3 0/5] gdbstub: Implement catching syscalls

2024-02-02 Thread Ilya Leoshkevich
1/2] and a test in [2/2]. I'm basing this on my other series, since it contains useful gdbstub test refactorings. Best regards, Ilya Ilya Leoshkevich (5): gdbstub: Expose TARGET_SIGTRAP in a target-agnostic way gdbstub: Allow specifying a reason in stop packets gdbstub: Add syscall ent

[PATCH v3 1/5] gdbstub: Expose TARGET_SIGTRAP in a target-agnostic way

2024-02-02 Thread Ilya Leoshkevich
The upcoming syscall catchpoint support needs to send SIGTRAP stop packets to GDB. Being able to compile this support only once for all targets is a good thing, and it requires hiding TARGET_SIGTRAP behind a function call. Signed-off-by: Ilya Leoshkevich --- gdbstub/internals.h | 1 + gdbstub

[PATCH v3 2/5] gdbstub: Allow specifying a reason in stop packets

2024-02-02 Thread Ilya Leoshkevich
The upcoming syscall catchpoint support needs to send stop packets with an associated reason to GDB. Add an extra parameter to gdb_handlesig() for that, and rename it to gdb_handlesig_reason(). Provide a compatibility wrapper with an old name. Signed-off-by: Ilya Leoshkevich --- gdbstub/user.c

Re: [PATCH v2 1/2] gdbstub: Implement catching syscalls

2024-02-02 Thread Ilya Leoshkevich
On Thu, 2024-02-01 at 17:15 +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > GDB supports stopping on syscall entry and exit using the "catch > > syscall" command. It relies on 3 packets, which are currently not > > supported by QEMU: > &

[PATCH v4 0/4] target/s390x: Emulate CVDG and CVB*

2024-02-02 Thread Ilya Leoshkevich
https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg02865.html v1 -> v2: Fix !CONFIG_INT128 builds (Richard). Hi, Ido reported that we are missing the CVDG emulation (which is very similar to the existing CVD emulation). This series adds it along with a test. Best regards, Ilya Ilya Leosh

[PATCH v4 1/4] target/s390x: Emulate CVDG

2024-02-02 Thread Ilya Leoshkevich
CVDG is the same as CVD, except that it converts 64 bits into 128, rather than 32 into 64. Create a new helper, which uses Int128 wrappers. Reported-by: Ido Plat Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- target/s390x/helper.h| 1 + target/s390x/tcg/insn

[PATCH v4 3/4] tests/tcg/s390x: Test CONVERT TO DECIMAL

2024-02-02 Thread Ilya Leoshkevich
Check the CVD's, CVDY's, and CVDG's corner cases. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/cvd.c | 63 + 2 files changed, 64 insertions(+) create mode 100644 tests/tcg/s390x/cvd.c diff --git a/tests

[PATCH v4 4/4] tests/tcg/s390x: Test CONVERT TO BINARY

2024-02-02 Thread Ilya Leoshkevich
Check the CVB's, CVBY's, and CVBG's corner cases. Co-developed-by: Pavel Zbitskiy Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/cvb.c | 102 2 files changed, 103 insertions(+) create mode 100644 tests

[PATCH v4 2/4] target/s390x: Emulate CVB, CVBY and CVBG

2024-02-02 Thread Ilya Leoshkevich
Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. Co-developed-by: Pavel Zbitskiy Signed-off-by: Ilya Leoshkevich --- target/s390x/helper.h| 2 + target/s390x/tcg/insn

Re: [PATCH 2/3] gdbstub: Implement follow-fork-mode child

2024-02-01 Thread Ilya Leoshkevich
On Thu, 2024-02-01 at 12:11 +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > Currently it's not possible to use gdbstub for debugging linux-user > > code that runs in a forked child, which is normally done using the > > `set > > follow-fork-m

[PATCH v3 3/4] target/s390x: implement CVB, CVBY and CVBG

2024-01-31 Thread Ilya Leoshkevich
From: Pavel Zbitskiy Convert to Binary - counterparts of the already implemented Convert to Decimal (CVD*) instructions. Example from the Principles of Operation: 25594C becomes 63FA. [iii: Use separate functions for CVB and CVBG for simplicity]. Signed-off-by: Pavel Zbitskiy ---

[PATCH v3 1/4] target/s390x: Emulate CVDG

2024-01-31 Thread Ilya Leoshkevich
CVDG is the same as CVD, except that it converts 64 bits into 128, rather than 32 into 64. Create a new helper, which uses Int128 wrappers. Reported-by: Ido Plat Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- target/s390x/helper.h| 1 + target/s390x/tcg/insn

[PATCH v3 4/4] tests/tcg/s390x: Test CONVERT TO BINARY

2024-01-31 Thread Ilya Leoshkevich
Check the CVB's and CVBG's corner cases. Co-developed-by: Pavel Zbitskiy Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/cvb.c | 47 + 2 files changed, 48 insertions(+) create mode 100644 tests/tcg/s390x

[PATCH v3 0/4] target/s390x: Emulate CVDG and CVB*

2024-01-31 Thread Ilya Leoshkevich
hat we are missing the CVDG emulation (which is very similar to the existing CVD emulation). This series adds it along with a test. Best regards, Ilya Ilya Leoshkevich (3): target/s390x: Emulate CVDG tests/tcg/s390x: Test CONVERT TO DECIMAL tests/tcg/s390x: Test CONVERT TO BINARY Pavel Zbits

  1   2   3   4   5   6   7   8   9   10   >