[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

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

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

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

2024-01-31 Thread Ilya Leoshkevich
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 to perform a function call. Fixes: dc84d50a7f9b ("tests/tcg: Add the PROT_NONE gdbstub test") Signed-off-by: Ilya Leoshkevich ---

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

2024-01-31 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 2/3] gdbstub: Implement follow-fork-mode child

2024-01-31 Thread Ilya Leoshkevich
the `stepi` of a syscall corner case by disabling the single-stepping in detached processes. Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c | 29 -- gdbstub/internals.h | 3 + gdbstub/user.c | 210 +++- 3 files changed, 234 insertions(+), 8

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

2024-01-31 Thread Ilya Leoshkevich
I can split it if necessary. Patch 2 is the implementation, and patch 3 is the test. [1] https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg06424.html Best regards, Ilya Ilya Leoshkevich (3): gdbstub: Refactor fork() handling gdbstub: Implement follow-fork-mode child tests/tcg: A

[PATCH 1/3] gdbstub: Refactor fork() handling

2024-01-31 Thread Ilya Leoshkevich
in the forked child. Signed-off-by: Ilya Leoshkevich --- bsd-user/freebsd/os-proc.h | 6 +++--- bsd-user/main.c | 8 ++-- bsd-user/qemu.h | 2 +- gdbstub/user.c | 25 +++-- include/gdbstub/user.h | 11 --- linux-user

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

2024-01-31 Thread Ilya Leoshkevich
On Wed, 2024-01-31 at 14:24 +0100, Thomas Huth wrote: > On 25/01/2024 20.48, Ilya Leoshkevich wrote: > > Hi, > > > > I needed to verify that my qemu-user changes didn't break BSD, and > > Daniel Berrange suggested vm-build-freebsd on IRC. I had several > > pr

Re: [PULL 13/31] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-31 Thread Ilya Leoshkevich
On Tue, 2024-01-30 at 09:01 +1000, Richard Henderson wrote: > From: Ilya Leoshkevich > > Make sure that qemu gdbstub, like gdbserver, allows reading from and > writing to PROT_NONE pages. > > Signed-off-by: Ilya Leoshkevich > Message-Id: <20240129093410.3151-4-...@lin

[PATCH v5 3/3] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-31 Thread Ilya Leoshkevich
Make sure that qemu gdbstub, like gdbserver, allows reading from and writing to PROT_NONE pages. Acked-by: Alex Bennée Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 9 +- tests/tcg/multiarch/gdbstub/prot-none.py | 36 + tests/tcg

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

2024-01-31 Thread Ilya Leoshkevich
ng non-readable pages. This series improves the situation by using the same mechanism as gdbserver: /proc/self/mem. Best regards, Ilya Ilya Leoshkevich (3): linux-user: Allow gdbstub to ignore page protection tests/tcg: Factor out gdbstub test functions tests/tcg: Add the PROT_NONE gdb

[PATCH v5 2/3] tests/tcg: Factor out gdbstub test functions

2024-01-31 Thread Ilya Leoshkevich
Signed-off-by: Ilya Leoshkevich --- tests/guest-debug/run-test.py | 7 ++- tests/guest-debug/test_gdbstub.py | 60 +++ tests/tcg/aarch64/gdbstub/test-sve-ioctl.py | 34 +-- tests/tcg/aarch64/gdbstub/test-sve.py | 33 +- tests/tcg

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

2024-01-31 Thread Ilya Leoshkevich
-debugging with ptrace(POKE), which will break if QEMU itself is being debugged - a much more severe limitation. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- cpu-target.c | 78 ++-- 1 file changed, 63 insertions(+), 15 deletions

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

2024-01-31 Thread Ilya Leoshkevich
On Wed, Jan 31, 2024 at 08:53:49AM +0100, Helge Deller wrote: > On 1/31/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

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

2024-01-30 Thread Ilya Leoshkevich
Like TARGET_NR_setuid, TARGET_NR_setgroups should affect only the calling thread, and not the entire process. Therefore, implement it using a syscall, and not a libc call. Cc: qemu-sta...@nongnu.org Fixes: 19b84f3c35d7 ("added setgroups and getgroups syscalls") Signed-off-by: Ilya L

Re: [PATCH v3 33/33] target/alpha: Enable TARGET_PAGE_BITS_VARY for user-only

2024-01-30 Thread Ilya Leoshkevich
> 1 file changed, 14 insertions(+), 2 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 32/33] target/ppc: Enable TARGET_PAGE_BITS_VARY for user-only

2024-01-30 Thread Ilya Leoshkevich
_USER_ONLY) +#define TARGET_PAGE_BITS 16 +#else #define TARGET_PAGE_BITS 12 +#endif worked, but an official support for this would be even better. Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 31/33] linux-user: Bound mmap_min_addr by host page size

2024-01-30 Thread Ilya Leoshkevich
ertion(+), 1 deletion(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 29/33] linux-user: Allow TARGET_PAGE_BITS_VARY

2024-01-30 Thread Ilya Leoshkevich
On Tue, Jan 02, 2024 at 12:58:04PM +1100, Richard Henderson wrote: > If set, match the host and guest page sizes. > > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Richard Henderson > --- > linux-user/main.c | 16 +--- > 1 file changed, 13 insertions(+), 3 deletions(-)

Re: [PATCH v3 28/33] accel/tcg: Disconnect TargetPageDataNode from page size

2024-01-30 Thread Ilya Leoshkevich
d, 8 insertions(+), 5 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 27/33] cpu: Remove page_size_init

2024-01-30 Thread Ilya Leoshkevich
| 13 - > system/vl.c | 1 - > 7 files changed, 19 insertions(+), 24 deletions(-) Tested-by: Ilya Leoshkevich

Re: [PATCH v3 26/33] *-user: Deprecate and disable -p pagesize

2024-01-30 Thread Ilya Leoshkevich
On Tue, Jan 02, 2024 at 12:58:01PM +1100, Richard Henderson wrote: > This option controls the host page size. From the mis-usage in > our own testsuite, this is easily confused with guest page size. > > The only thing that occurs when changing the host page size is > that stuff breaks, because

Re: [PATCH v3 25/33] tests/tcg: Extend file in linux-madvise.c

2024-01-30 Thread Ilya Leoshkevich
igned-off-by: Richard Henderson > --- > tests/tcg/multiarch/linux/linux-madvise.c | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 24/33] tests/tcg: Remove run-test-mmap-*

2024-01-30 Thread Ilya Leoshkevich
--- > tests/tcg/sh4/Makefile.target | 3 --- > tests/tcg/sparc64/Makefile.target | 6 -- > 9 files changed, 45 deletions(-) > delete mode 100644 tests/tcg/ppc/Makefile.target > delete mode 100644 tests/tcg/sparc64/Makefile.target Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 23/33] linux-user: Split out mmap_h_gt_g

2024-01-30 Thread Ilya Leoshkevich
On Tue, Jan 02, 2024 at 12:57:58PM +1100, Richard Henderson wrote: > Signed-off-by: Richard Henderson > --- > linux-user/mmap.c | 288 ++ > 1 file changed, 139 insertions(+), 149 deletions(-) > > diff --git a/linux-user/mmap.c b/linux-user/mmap.c >

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

2024-01-29 Thread Ilya Leoshkevich
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. Both of which are excercised by our > test-mmap for alpha (8k pages) on any 4k page host. > > Signed-off-by: Richard Henderson > --- >

Re: [PATCH v3 21/33] linux-user: Split out mmap_h_eq_g

2024-01-29 Thread Ilya Leoshkevich
On Tue, Jan 02, 2024 at 12:57:56PM +1100, Richard Henderson wrote: > Move the MAX_FIXED_NOREPLACE check for reserved_va earlier. > Move the computation of host_prot earlier. > > Signed-off-by: Richard Henderson > --- > linux-user/mmap.c | 66 +-- > 1

Re: [PATCH v3 20/33] linux-user: Do early mmap placement only for reserved_va

2024-01-29 Thread Ilya Leoshkevich
; host_offset = offset & -host_page_size; > > /* > - * If the user is asking for the kernel to find a location, do that > - * before we truncate the length for mapping files below. > + * For reserved_va, we are in full control of the allocation. > + * Find a suitible hole and convert to MAP_FIXED. suitable? [...] Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 19/33] linux-user: Split out mmap_end

2024-01-29 Thread Ilya Leoshkevich
- > 1 file changed, 41 insertions(+), 30 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 18/33] linux-user: Fix sub-host-page mmap

2024-01-29 Thread Ilya Leoshkevich
. > > Signed-off-by: Richard Henderson > --- > linux-user/mmap.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 17/33] linux-user: Move some mmap checks outside the lock

2024-01-29 Thread Ilya Leoshkevich
s... */ > +len = TARGET_PAGE_ALIGN(len); > +if (!len || len != (size_t)len) { > +errno = ENOMEM; > +return -1; > +} The overflow fix is probably worth mentioning in the commit message (or even deserves a separate commit, for backporting into stable). Regardless: Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 16/33] linux-user: Split out target_mmap__locked

2024-01-29 Thread Ilya Leoshkevich
> 1 file changed, 35 insertions(+), 27 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 15/33] linux-user: Remove qemu_host_page_size from main

2024-01-29 Thread Ilya Leoshkevich
t_page_size); Does it make sense to allow values not divisible by TARGET_PAGE_SIZE here? It's probably not a big deal, since in the worst case we'll only waste a few bytes, so: Reviewed-by: Ilya Leoshkevich [...]

Re: [PATCH v3 14/33] softmmu/physmem: Remove HOST_PAGE_ALIGN

2024-01-29 Thread Ilya Leoshkevich
On Tue, Jan 02, 2024 at 12:57:49PM +1100, Richard Henderson wrote: > Align allocation sizes to the maximum of host and target page sizes. > > Signed-off-by: Richard Henderson > --- > system/physmem.c | 15 +++ > 1 file changed, 11 insertions(+), 4 deletions(-)

Re: [PATCH v3 13/33] softmmu/physmem: Remove qemu_host_page_size

2024-01-29 Thread Ilya Leoshkevich
On Tue, Jan 02, 2024 at 12:57:48PM +1100, Richard Henderson wrote: > Use qemu_real_host_page_size() instead. > > Signed-off-by: Richard Henderson > --- > system/physmem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 12/33] hw/tpm: Remove HOST_PAGE_ALIGN from tpm_ppi_init

2024-01-29 Thread Ilya Leoshkevich
On Tue, Jan 02, 2024 at 12:57:47PM +1100, Richard Henderson wrote: > The size of the allocation need not match the alignment. > > Signed-off-by: Richard Henderson > --- > hw/tpm/tpm_ppi.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 11/33] migration: Remove qemu_host_page_size

2024-01-29 Thread Ilya Leoshkevich
; 1 file changed, 18 insertions(+), 4 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 10/33] linux-user: Remove HOST_PAGE_ALIGN from mmap.c

2024-01-29 Thread Ilya Leoshkevich
t; 1 file changed, 6 insertions(+), 7 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 09/33] linux-user: Remove REAL_HOST_PAGE_ALIGN from mmap.c

2024-01-29 Thread Ilya Leoshkevich
ertion(+), 1 deletion(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 08/33] linux-user: Remove qemu_host_page_{size, mask} from mmap.c

2024-01-29 Thread Ilya Leoshkevich
On Tue, Jan 02, 2024 at 12:57:43PM +1100, Richard Henderson wrote: > Use qemu_real_host_page_size instead. > > Signed-off-by: Richard Henderson > --- > linux-user/mmap.c | 66 +++ > 1 file changed, 33 insertions(+), 33 deletions(-)

Re: Re: [PATCH v3 05/33] linux-user/hppa: Simplify init_guest_commpage

2024-01-29 Thread Ilya Leoshkevich
On Mon, Jan 29, 2024 at 11:28:59AM +0100, Ilya Leoshkevich wrote: > On Tue, Jan 02, 2024 at 12:57:40PM +1100, Richard Henderson wrote: > > If reserved_va, then we have already reserved the entire > > guest virtual address space; no need to remap page. > > If !

Re: [PATCH v3 05/33] linux-user/hppa: Simplify init_guest_commpage

2024-01-29 Thread Ilya Leoshkevich
VATE | MAP_FIXED_NOREPLACE, -1, > 0); > +if (addr == MAP_FAILED) { > +perror("Allocating guest commpage"); > +exit(EXIT_FAILURE); > +} > +if (addr != want) { > +return false; > +} > } > > /* > -- > 2.34.1 Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 04/33] linux-user: Remove qemu_host_page_size from create_elf_tables

2024-01-29 Thread Ilya Leoshkevich
erp_info ? interp_info->load_addr : > 0)); > NEW_AUX_ENT(AT_FLAGS, (abi_ulong)0); > NEW_AUX_ENT(AT_ENTRY, info->entry); > -- > 2.34.1 Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 03/33] linux-user: Remove qemu_host_page_{size, mask} in probe_guest_base

2024-01-29 Thread Ilya Leoshkevich
abi_ulong guest_hiaddr) > { > /* In order to use host shmat, we must be able to honor SHMLBA. */ > -uintptr_t align = MAX(SHMLBA, qemu_host_page_size); > +uintptr_t align = MAX(SHMLBA, TARGET_PAGE_SIZE); > > /* Sanity check the guest binary. */ > if (reserved_va) { > -- > 2.34.1 Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 02/33] linux-user: Adjust SVr4 NULL page mapping

2024-01-29 Thread Ilya Leoshkevich
AP_FIXED_NOREPLACE | MAP_PRIVATE | MAP_ANONYMOUS, > +-1, 0); > } > #ifdef TARGET_MIPS > info->interp_fp_abi = interp_info.fp_abi; > -- > 2.34.1 Nit: should we print a warning if we get EEXIST? Reviewed-by: Ilya Leoshkevich

Re: [PATCH v3 01/33] accel/tcg: Remove qemu_host_page_size from page_protect/page_unprotect

2024-01-29 Thread Ilya Leoshkevich
/tcg/user-exec.c | 18 ++ > 1 file changed, 10 insertions(+), 8 deletions(-) Reviewed-by: Ilya Leoshkevich

Re: [PATCH 14/33] tests/tcg: Factor out gdbstub test functions

2024-01-29 Thread Ilya Leoshkevich
On Sun, Jan 28, 2024 at 02:41:54PM +1000, Richard Henderson wrote: > From: Ilya Leoshkevich > > Both the report() function as well as the initial gdbstub test sequence > are copy-pasted into ~10 files with slight modifications. This > indicates that they are indeed generic, so

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

2024-01-29 Thread Ilya Leoshkevich
stub testing. Add a test. Hi, I've noticed that gdbstub behaves differently from gdbserver in that it doesn't allow reading non-readable pages. This series improves the situation by using the same mechanism as gdbserver: /proc/self/mem. Best regards, Ilya Ilya Leoshkevich (3): linux-user: A

[PATCH v4 2/3] tests/tcg: Factor out gdbstub test functions

2024-01-29 Thread Ilya Leoshkevich
Both the report() function as well as the initial gdbstub test sequence are copy-pasted into ~10 files with slight modifications. This indicates that they are indeed generic, so factor them out. While at it, add a few newlines to make the formatting closer to PEP-8. Signed-off-by: Ilya

[PATCH v4 3/3] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-29 Thread Ilya Leoshkevich
Make sure that qemu gdbstub, like gdbserver, allows reading from and writing to PROT_NONE pages. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 9 +- tests/tcg/multiarch/gdbstub/prot-none.py | 36 + tests/tcg/multiarch/prot-none.c

[PATCH v4 1/3] linux-user: Allow gdbstub to ignore page protection

2024-01-29 Thread Ilya Leoshkevich
-debugging with ptrace(POKE), which will break if QEMU itself is being debugged - a much more severe limitation. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- cpu-target.c | 78 ++-- 1 file changed, 63 insertions(+), 15 deletions

[PATCH] {linux, bsd}-user: Fail mmap() if size doesn't fit into host's size_t

2024-01-25 Thread Ilya Leoshkevich
ets truncated. Since there is no chance for such mmap() to succeed, detect this condition and fail the mmap() right away. Signed-off-by: Ilya Leoshkevich --- bsd-user/mmap.c | 4 linux-user/mmap.c | 4 2 files changed, 8 insertions(+) diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c in

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

2024-01-25 Thread Ilya Leoshkevich
5 (0x5) 888: 27.811765030 connect(5,{ AF_INET 10.0.2.3:53 },16) = 0 (0x0) 888: 27.812166941 sendto(5,"\^Z/\^A\0\0\^A\0\0\0\0\0\0\^A2"...,39,0,NULL,0) = 39 (0x27) 888: 29.363970743 poll({ 5/POLLRDNORM },1,5000) = 1 (0x1) So the delay is due to a DNS query. Disable DNS qu

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

2024-01-25 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 | 2 ++ 1 file changed, 2 insertions(+) diff

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

2024-01-25 Thread Ilya Leoshkevich
emu-devel/files/patch-util_meson.build?id=984366c18f1bc54e38751afc29be08c596b83696 Signed-off-by: Ilya Leoshkevich --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index d0329966f1b..3d67d78b522 100644 --- a/meson.build +++ b/meson.build @@ -2403,6 +2403,7 @@

[PATCH 0/3] make vm-build-freebsd fixes

2024-01-25 Thread Ilya Leoshkevich
Hi, I needed 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 (3): tests/vm: Set UseDNS=no in the sshd configuration tests/vm/freebsd

Re: [PATCH 0/2] target/s390x: Emulate CVDG

2024-01-25 Thread Ilya Leoshkevich
On Thu, 2024-01-18 at 18:28 +0100, Thomas Huth wrote: > On 15/01/2024 21.21, Ilya Leoshkevich wrote: > > Hi, > > > > Ido reported that we are missing the CVDG emulation (which is very > > similar to the existing CVD emulation). This series adds it along > > wit

[PATCH v2 0/2] target/s390x: Emulate CVDG

2024-01-25 Thread Ilya Leoshkevich
v1: 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 I

[PATCH v2 2/2] tests/tcg/s390x: Test CONVERT TO DECIMAL

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

[PATCH v2 1/2] target/s390x: Emulate CVDG

2024-01-25 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 Signed-off-by: Ilya Leoshkevich --- target/s390x/helper.h| 1 + target/s390x/tcg/insn-data.h.inc | 1 + target/s390x

Re: [PATCH v5 4/4] accel/tcg: Move perf and debuginfo support to tcg

2024-01-24 Thread Ilya Leoshkevich
On Thu, 2024-01-25 at 07:11 +1000, Richard Henderson wrote: > On 1/24/24 17:56, Philippe Mathieu-Daudé wrote: > > From: Ilya Leoshkevich > > > > tcg/ should not depend on accel/tcg/, but perf and debuginfo > > support provided by the latter are being used by tcg/t

Re: [PATCH v3 3/3] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-24 Thread Ilya Leoshkevich
On Mon, Jan 22, 2024 at 11:19:05PM +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > On Mon, Jan 22, 2024 at 03:54:32PM +, Alex Bennée wrote: > >> Ilya Leoshkevich writes: > >> > >> > Make sure that qemu gdbstub, like gdbserver, allows re

Re: [PATCH v3 15/38 6/6] target/s390x: Improve general case of disas_jcc

2024-01-22 Thread Ilya Leoshkevich
n {1,2}. > > Signed-off-by: Richard Henderson > Signed-off-by: Philippe Mathieu-Daudé > --- > target/s390x/tcg/translate.c | 52 +++- > 1 file changed, 15 insertions(+), 37 deletions(-) Acked-by: Ilya Leoshkevich

Re: Re: [PATCH v3 3/3] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-22 Thread Ilya Leoshkevich
On Mon, Jan 22, 2024 at 03:54:32PM +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > Make sure that qemu gdbstub, like gdbserver, allows reading from and > > writing to PROT_NONE pages. > > > > Signed-off-by: Ilya Leoshkevich > > --- > > tes

Re: Re: [PATCH v3 2/3] tests/tcg: Factor out gdbstub test functions

2024-01-22 Thread Ilya Leoshkevich
On Mon, Jan 22, 2024 at 04:00:44PM +, Alex Bennée wrote: > Ilya Leoshkevich writes: > > > Both the report() function as well as the initial gdbstub test sequence > > are copy-pasted into ~10 files with slight modifications. This > > indicates that they are indeed gen

Re: Re: [PATCH 1/2] target/s390x: Emulate CVDG

2024-01-19 Thread Ilya Leoshkevich
On Fri, Jan 19, 2024 at 08:12:18AM +1100, Richard Henderson wrote: > On 1/16/24 07:21, Ilya Leoshkevich wrote: > > CVDG is the same as CVD, except that it converts 64 bits into 128, > > rather than 32 into 64. Use larger data types in the CVD helper and > > reuse it. > >

[PATCH v2 2/2] tests/tcg: Add the syscall catchpoint gdbstub test

2024-01-16 Thread Ilya Leoshkevich
Check that adding/removing syscall catchpoints works. 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 | 52 +++ 3

[PATCH v2 0/2] gdbstub: Implement catching syscalls

2024-01-16 Thread Ilya Leoshkevich
. Hi, I noticed that GDB's "catch syscall" does not work with qemu-user. This series adds the missing bits in [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 (2): gdbstub: Implemen

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

2024-01-16 Thread Ilya Leoshkevich
ml Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c| 9 +++ gdbstub/internals.h | 2 + gdbstub/user-target.c| 5 ++ gdbstub/user.c | 104 ++- include/gdbstub/user.h | 29 +- include/user/sysca

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

2024-01-15 Thread Ilya Leoshkevich
Check that adding/removing syscall catchpoints works. 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 | 52 +++ 3

[PATCH 0/2] gdbstub: Implement catching syscalls

2024-01-15 Thread Ilya Leoshkevich
my other series, since it contains useful gdbstub test refactorings. Best regards, Ilya Ilya Leoshkevich (2): gdbstub: Implement catching syscalls tests/tcg: Add the syscall catchpoint gdbstub test gdbstub/gdbstub.c | 11 +++- gdbstub/internals.h

[PATCH 1/2] gdbstub: Implement catching syscalls

2024-01-15 Thread Ilya Leoshkevich
ml Signed-off-by: Ilya Leoshkevich --- gdbstub/gdbstub.c| 11 +++- gdbstub/internals.h | 16 +++ gdbstub/system.c | 1 + gdbstub/user-target.c| 39 +++ gdbstub/user.c

[PATCH v3 2/3] tests/tcg: Factor out gdbstub test functions

2024-01-15 Thread Ilya Leoshkevich
Both the report() function as well as the initial gdbstub test sequence are copy-pasted into ~10 files with slight modifications. This indicates that they are indeed generic, so factor them out. While at it, add a few newlines to make the formatting closer to PEP-8. Signed-off-by: Ilya

[PATCH v3 1/3] linux-user: Allow gdbstub to ignore page protection

2024-01-15 Thread Ilya Leoshkevich
-debugging with ptrace(POKE), which will break if QEMU itself is being debugged - a much more severe limitation. Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- cpu-target.c | 76 +--- 1 file changed, 61 insertions(+), 15 deletions

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

2024-01-15 Thread Ilya Leoshkevich
mechanism as gdbserver: /proc/self/mem. Best regards, Ilya Ilya Leoshkevich (3): linux-user: Allow gdbstub to ignore page protection tests/tcg: Factor out gdbstub test functions tests/tcg: Add the PROT_NONE gdbstub test cpu-target.c | 76 +++ te

[PATCH v3 3/3] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-15 Thread Ilya Leoshkevich
Make sure that qemu gdbstub, like gdbserver, allows reading from and writing to PROT_NONE pages. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 9 +- tests/tcg/multiarch/gdbstub/prot-none.py | 22 + tests/tcg/multiarch/prot-none.c | 40

[PATCH 1/2] target/s390x: Emulate CVDG

2024-01-15 Thread Ilya Leoshkevich
CVDG is the same as CVD, except that it converts 64 bits into 128, rather than 32 into 64. Use larger data types in the CVD helper and reuse it. Reported-by: Ido Plat Signed-off-by: Ilya Leoshkevich --- target/s390x/helper.h| 1 + target/s390x/tcg/insn-data.h.inc | 1 + target

[PATCH 2/2] tests/tcg/s390x: Test CONVERT TO DECIMAL

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

[PATCH 0/2] target/s390x: Emulate CVDG

2024-01-15 Thread Ilya Leoshkevich
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 (2): target/s390x: Emulate CVDG tests/tcg/s390x: Test CONVERT TO DECIMAL target/s390x/helper.h

[PATCH v2 1/2] target/s390x: Fix LAE setting a wrong access register

2024-01-11 Thread Ilya Leoshkevich
LAE should set the access register corresponding to the first operand, instead, it always modifies access register 1. Co-developed-by: Ido Plat Cc: qemu-sta...@nongnu.org Fixes: a1c7610a6879 ("target-s390x: implement LAY and LAEY instructions") Reviewed-by: David Hildenbrand Signed-of

[PATCH v2 2/2] tests/tcg/s390x: Test LOAD ADDRESS EXTENDED

2024-01-11 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Userspace runs in primary mode, so LAE should always set the access register to 0. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/lae.c | 31 +++ 2 files changed, 32

[PATCH v2 0/2] target/s390x: Fix LAE setting a wrong access register

2024-01-11 Thread Ilya Leoshkevich
v1: https://lists.gnu.org/archive/html/qemu-devel/2024-01/msg01596.html v1 -> v2: Fix building the test with clang (Thomas). Hi, Ido has noticed that LAE sets a wrong access register and proposed a fix. This series fixes the issue and adds a test. Best regards, Ilya Ilya Leoshkevich

Re: [PATCH 2/2] tests/tcg/s390x: Test LOAD ADDRESS EXTENDED

2024-01-11 Thread Ilya Leoshkevich
On Thu, 2024-01-11 at 09:37 +0100, Thomas Huth wrote: > On 10/01/2024 00.22, Ilya Leoshkevich wrote: > > Add a small test to prevent regressions. Userspace runs in primary > > mode, so LAE should always set the access register to 0. > > > > Signed-off-by: Ilya Leoshkevi

[PATCH 0/2] target/s390x: Fix LAE setting a wrong access register

2024-01-09 Thread Ilya Leoshkevich
Hi, Ido has noticed that LAE sets a wrong access register and proposed a fix. This series fixes the issue and adds a test. Best regards, Ilya Ilya Leoshkevich (2): target/s390x: Fix LAE setting a wrong access register tests/tcg/s390x: Test LOAD ADDRESS EXTENDED target/s390x/tcg

[PATCH 2/2] tests/tcg/s390x: Test LOAD ADDRESS EXTENDED

2024-01-09 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Userspace runs in primary mode, so LAE should always set the access register to 0. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target | 1 + tests/tcg/s390x/lae.c | 25 + 2 files changed, 26 insertions

[PATCH 1/2] target/s390x: Fix LAE setting a wrong access register

2024-01-09 Thread Ilya Leoshkevich
LAE should set the access register corresponding to the first operand, instead, it always modifies access register 1. Co-developed-by: Ido Plat Cc: qemu-sta...@nongnu.org Fixes: a1c7610a6879 ("target-s390x: implement LAY and LAEY instructions") Signed-off-by: Ilya Leoshkevich --- ta

[PATCH v2 2/3] tests/tcg: Factor out gdbstub test functions

2024-01-09 Thread Ilya Leoshkevich
Both the report() function as well as the initial gdbstub test sequence are copy-pasted into ~10 files with slight modifications. This indicates that they are indeed generic, so factor them out. While at it, add a few newlines to make the formatting closer to PEP-8. Signed-off-by: Ilya

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

2024-01-09 Thread Ilya Leoshkevich
Best regards, Ilya Ilya Leoshkevich (3): linux-user: Allow gdbstub to ignore page protection tests/tcg: Factor out gdbstub test functions tests/tcg: Add the PROT_NONE gdbstub test cpu-target.c | 76 +++ tests/guest-debug/run-t

[PATCH v2 1/3] linux-user: Allow gdbstub to ignore page protection

2024-01-09 Thread Ilya Leoshkevich
-debugging with ptrace(POKE), which will break if QEMU itself is being debugged - a much more severe limitation. Signed-off-by: Ilya Leoshkevich --- cpu-target.c | 76 +--- 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/cpu-target.c b

[PATCH v2 3/3] tests/tcg: Add the PROT_NONE gdbstub test

2024-01-09 Thread Ilya Leoshkevich
Make sure that qemu gdbstub, like gdbserver, allows reading from and writing to PROT_NONE pages. Signed-off-by: Ilya Leoshkevich --- tests/tcg/multiarch/Makefile.target | 9 +- tests/tcg/multiarch/gdbstub/prot-none.py | 22 + tests/tcg/multiarch/prot-none.c | 40

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

2024-01-09 Thread Ilya Leoshkevich
On Wed, 2024-01-10 at 04:42 +1100, Richard Henderson wrote: > On 1/9/24 10:34, Ilya Leoshkevich wrote: > > gdbserver ignores page protection by virtue of using > > /proc/$pid/mem. > > Teach qemu gdbstub to do this too. This will not work if /proc is > > not > >

<    1   2   3   4   5   6   7   8   9   10   >