Re: serial hang in qemu-system-ppc64 -M pseries

2022-04-30 Thread Rob Landley
On 4/29/22 16:43, Fabiano Rosas wrote: > Rob Landley writes: >> Then paste something longer than 16 characters at the eventual command prompt >> once the kernel finishes booting. > > I suspect this is due to how the tty driver (n_tty.c) interacts with > the console (hvc_console.c) driver's buffer

[PULL v2 00/25] Misc patches for 2022-04-29

2022-04-30 Thread Paolo Bonzini
The following changes since commit 731340813fdb4cb8339edb8630e3f923b7d987ec: Merge tag 'pull-riscv-to-apply-20220429' of github.com:alistair23/qemu into staging (2022-04-29 08:46:55 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you

[PULL v2 01/25] WHPX: support for xcr0

2022-04-30 Thread Paolo Bonzini
From: Sunil Muthuswamy Support for xcr0 to be able to enable xsave/xrstor. This by itself is not sufficient to enable xsave/xrstor. WHPX XSAVE API's also needs to be hooked up. Signed-off-by: Sunil Muthuswamy Message-Id: Signed-off-by: Paolo Bonzini --- target/i386/whpx/whpx-all.c | 87

[PULL 0/7] 9p queue 2022-04-30

2022-04-30 Thread Christian Schoenebeck
gs/pull-9p-20220430 for you to fetch changes up to e8fb9ed725fe2ed00a275674a84beb5ba6e538a7: 9pfs: fix qemu_mknodat() to always return -1 on error on macOS host (2022-04-30 13:11:48 +0200) 9pfs: various fixes * macOS: Fix recently (i

[PULL 4/7] 9pfs: fix wrong encoding of rdev field in Rgetattr on macOS

2022-04-30 Thread Christian Schoenebeck
The 'rdev' field in 9p reponse 'Rgetattr' is of type dev_t, which is actually a system dependant type and therefore both the size and encoding of dev_t differ between macOS and Linux. So far we have sent 'rdev' to guest in host's dev_t format as-is, which caused devices to appear with wrong device

[PULL 6/7] 9pfs: fix removing non-existent POSIX ACL xattr on macOS host

2022-04-30 Thread Christian Schoenebeck
When mapped POSIX ACL is used, we are ignoring errors when trying to remove a POSIX ACL xattr that does not exist. On Linux hosts we would get ENODATA in such cases, on macOS hosts however we get ENOATTR instead. As we can be sure that ENOATTR is defined as being identical on Linux hosts (at least

[PULL 3/7] 9pfs: fix qemu_mknodat(S_IFSOCK) on macOS

2022-04-30 Thread Christian Schoenebeck
mknod() on macOS does not support creating sockets, so divert to call sequence socket(), bind() and fchmodat() respectively if S_IFSOCK was passed with mode argument. Link: https://lore.kernel.org/qemu-devel/17933734.zYzKuhC07K@silver/ Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz

[PULL 1/7] 9pfs: fix inode sequencing in 'synth' driver

2022-04-30 Thread Christian Schoenebeck
The 'synth' driver's root node and the 'synth' driver's first subdirectory node falsely share the same inode number (zero), which makes it impossible for 9p clients (i.e. 9p test cases) to distinguish root node and first subdirectory from each other by comparing their QIDs (which are derived by 9p

[PULL 7/7] 9pfs: fix qemu_mknodat() to always return -1 on error on macOS host

2022-04-30 Thread Christian Schoenebeck
qemu_mknodat() is expected to behave according to its POSIX API, and therefore should always return exactly -1 on any error, and errno should be set for the actual error code. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Reviewed-by: Akihiko Odaki Message-Id: --- hw/9pfs/9p-ut

[PULL 2/7] 9pfs: fix qemu_mknodat(S_IFREG) on macOS

2022-04-30 Thread Christian Schoenebeck
mknod() on macOS does not support creating regular files, so divert to openat_file() if S_IFREG is passed with mode argument. Furthermore, 'man 2 mknodat' on Linux says: "Zero file type is equivalent to type S_IFREG". Link: https://lore.kernel.org/qemu-devel/17933734.zYzKuhC07K@silver/ Signed-off

[PULL 5/7] 9pfs: fix wrong errno being sent to Linux client on macOS host

2022-04-30 Thread Christian Schoenebeck
Linux and macOS only share some errno definitions with equal macro name and value. In fact most mappings for errno are completely different on the two systems. This patch converts some important errno values from macOS host to corresponding Linux errno values before eventually sending such error c

Re: [PATCH v5 0/6] 9pfs: macOS host fixes (resend)

2022-04-30 Thread Christian Schoenebeck
On Freitag, 29. April 2022 12:26:40 CEST Christian Schoenebeck wrote: > A bunch of fixes for recently (in QEMU 7.0) added 9p support on macOS hosts. > > Note: there are still issues to address with case-insensitive file systems > on macOS hosts. I sent a separate RFC on that icase issue: > https:/

Re: [PULL v2 00/25] Misc patches for 2022-04-29

2022-04-30 Thread Richard Henderson
On 4/30/22 02:25, Paolo Bonzini wrote: The following changes since commit 731340813fdb4cb8339edb8630e3f923b7d987ec: Merge tag 'pull-riscv-to-apply-20220429' of github.com:alistair23/qemu into staging (2022-04-29 08:46:55 -0700) are available in the Git repository at: https://gitlab.com/

[PATCH 00/43] semihosting cleanup

2022-04-30 Thread Richard Henderson
I had whipped up an rx-elf cross toolchain to test something recently, and since I had built it, thought it would be easy to use libgloss to run the multiarch hello and memory tests. But we haven't implemented libgloss-style semihosting for rx. I had forgotten how much boilerplate there is current

[PATCH 02/43] semihosting: Return failure from softmmu-uaccess.h functions

2022-04-30 Thread Richard Henderson
We were reporting unconditional success for these functions; pass on any failure from cpu_memory_rw_debug. Signed-off-by: Richard Henderson --- include/semihosting/softmmu-uaccess.h | 91 --- 1 file changed, 39 insertions(+), 52 deletions(-) diff --git a/include/semihost

[PATCH 04/43] semihosting: Move softmmu-uaccess functions out of line

2022-04-30 Thread Richard Henderson
Rather that static (and not even inline) functions within a header, move the functions to semihosting/uaccess.c. Signed-off-by: Richard Henderson --- include/semihosting/softmmu-uaccess.h | 42 +++--- semihosting/uaccess.c | 51 +++ semihos

[PATCH 01/43] semihosting: Move exec/softmmu-semi.h to semihosting/softmmu-uaccess.h

2022-04-30 Thread Richard Henderson
We have a subdirectory for semihosting; move this file out of exec. Rename to emphasize the contents are a replacement for the functions in linux-user/bsd-user uaccess.c. Signed-off-by: Richard Henderson --- .../{exec/softmmu-semi.h => semihosting/softmmu-uaccess.h} | 6 +++--- semihosting/arm-

[PATCH 08/43] semihosting: Generalize GuestFDFeatureFile

2022-04-30 Thread Richard Henderson
Rather than hard-coding the buffer from which we deliver data, pass it in on initialization. This decouples the feature from ARM semihosting. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 10 ++--- semihosting/arm-compat-semi.c | 39 ++-

[PATCH 12/43] include/exec: Move gdb open flags to gdbstub.h

2022-04-30 Thread Richard Henderson
There were 3 copies of these flags. Place them in the file with gdb_do_syscall, with which they belong. Signed-off-by: Richard Henderson --- include/exec/gdbstub.h| 10 ++ semihosting/arm-compat-semi.c | 8 target/m68k/m68k-semi.c | 8 target/nios2/nios

[PATCH 05/43] semihosting: Add target_strlen for softmmu-uaccess.h

2022-04-30 Thread Richard Henderson
Mirror the user-only function of the same name. Signed-off-by: Richard Henderson --- include/semihosting/softmmu-uaccess.h | 3 +++ semihosting/uaccess.c | 29 +++ 2 files changed, 32 insertions(+) diff --git a/include/semihosting/softmmu-uaccess.h b/in

[PATCH 03/43] semihosting: Improve condition for config.c and console.c

2022-04-30 Thread Richard Henderson
While CONFIG_SEMIHOSTING is currently only set for softmmu, this will not continue to be true. Signed-off-by: Richard Henderson --- semihosting/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semihosting/meson.build b/semihosting/meson.build index ea8090abe3..4344

[PATCH 11/43] semihosting: Move common-semi.h to include/semihosting/

2022-04-30 Thread Richard Henderson
This header is not private to the top-level semihosting directory, so place it in the public include directory. Signed-off-by: Richard Henderson --- {semihosting => include/semihosting}/common-semi.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {semihosting => include/semihosting

[PATCH 06/43] semihosting: Simplify softmmu_lock_user_string

2022-04-30 Thread Richard Henderson
We are not currently bounding the search to the 1024 bytes that we allocated, possibly overrunning the buffer. Use softmmu_strlen_user to find the length and allocate the correct size from the beginning. Signed-off-by: Richard Henderson --- semihosting/uaccess.c | 15 +++ 1 file chan

[PATCH 18/43] semihosting: Use env more often in do_common_semihosting

2022-04-30 Thread Richard Henderson
We've already loaded cs->env_ptr into a local variable; use it. Since env is unconditionally used, we don't need a dummy use. Signed-off-by: Richard Henderson --- target/arm/common-semi-target.h | 62 ++ target/riscv/common-semi-target.h | 50 +++ semihosting/arm-

[PATCH 17/43] semihosting: Split out common_semi_has_synccache

2022-04-30 Thread Richard Henderson
We already have some larger ifdef blocks for ARM and RISCV; split out a boolean test for SYS_SYNCCACHE. Signed-off-by: Richard Henderson --- semihosting/arm-compat-semi.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/semihosting/arm-compat-semi.c b/sem

[PATCH 07/43] semihosting: Split out guestfd.c

2022-04-30 Thread Richard Henderson
In arm-compat-semi.c, we have more advanced treatment of guest file descriptors than we do in other implementations. Split out GuestFD and related functions to a new file so that they can be shared. Signed-off-by: Richard Henderson --- configs/targets/aarch64-linux-user.mak| 1 + configs/t

[PATCH 22/43] semihosting: Split out semihost_sys_read

2022-04-30 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_READ to a reusable function. This handles all GuestFD. Isolate the curious ARM-specific return value processing to a new callback, common_semi_rw_cb. Note that gdb_do_syscall %x reads target_ulong, not int. Signed-off-by: Richard Henderson --- in

[PATCH 15/43] semihosting: Split is_64bit_semihosting per target

2022-04-30 Thread Richard Henderson
We already have some larger ifdef blocks for ARM and RISCV; split the function into multiple implementations per arch. Signed-off-by: Richard Henderson --- semihosting/arm-compat-semi.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/semihosting/arm-compa

[PATCH 24/43] semihosting: Bound length for semihost_sys_{read, write}

2022-04-30 Thread Richard Henderson
Fixes a minor bug in which a 64-bit guest on a 32-bit host could truncate the length. This would only ever cause a problem if there were no bits set in the low 32, so that it truncates to 0. Signed-off-by: Richard Henderson --- semihosting/guestfd.c | 16 1 file changed, 16 ins

[PATCH 16/43] semihosting: Split common_semi_flen_buf per target

2022-04-30 Thread Richard Henderson
We already have some larger ifdef blocks for ARM and RISCV; split out common_semi_stack_bottom per target. Signed-off-by: Richard Henderson --- semihosting/arm-compat-semi.c | 44 +-- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/semihosting/arm-

[PATCH 13/43] include/exec: Move gdb_stat and gdb_timeval to gdbstub.h

2022-04-30 Thread Richard Henderson
We have two copies of these structures, and require them in semihosting/ going forward. Signed-off-by: Richard Henderson --- include/exec/gdbstub.h| 25 + target/m68k/m68k-semi.c | 30 +++--- target/nios2/nios2-semi.c | 30 +++

[PATCH 10/43] semihosting: Adjust error checking in common_semi_cb

2022-04-30 Thread Richard Henderson
The err parameter is non-zero if and only if an error occured. Use this instead of ret == -1 for determining if we need to update the saved errno. This fixes the errno setting of SYS_ISTTY, which returns 0 on error, not -1. Signed-off-by: Richard Henderson --- semihosting/arm-compat-semi.c | 2

[PATCH 20/43] semihosting: Split out semihost_sys_open

2022-04-30 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_OPEN to a reusable function. This handles gdb and host file i/o. Add helpers to validate the length of the filename string. Prepare for usage by other semihosting by allowing the filename length parameter to be 0, and calling strlen. Signed-off-by:

[PATCH 14/43] semihosting: Use struct gdb_stat in common_semi_flen_cb

2022-04-30 Thread Richard Henderson
Use offsetof instead of an integer constant. Load the entire 64-bit size while we're at it. Signed-off-by: Richard Henderson --- semihosting/arm-compat-semi.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-s

[PATCH 09/43] semihosting: Return void from do_common_semihosting

2022-04-30 Thread Richard Henderson
Perform the cleanup in the FIXME comment in common_semi_gdb_syscall. Do not modify guest registers until the syscall is complete, which in the gdbstub case is asynchronous. In the synchronous non-gdbstub case, use common_semi_set_ret to set the result. Merge set_swi_errno into common_semi_cb. Rel

[PATCH 26/43] semihosting: Split out semihost_sys_isatty

2022-04-30 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_ISTTY to a reusable function. This handles all GuestFD. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 3 +++ semihosting/arm-compat-semi.c | 27 +--- semihosting/guestfd.c | 39 +++

[PATCH 23/43] semihosting: Split out semihost_sys_write

2022-04-30 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_WRITE to a reusable function. This handles all GuestFD. This removes the last use of common_semi_syscall_len. Note that gdb_do_syscall %x reads target_ulong, not int. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 3 ++ sem

[PATCH 31/43] semihosting: Create semihost_sys_{stat,fstat}

2022-04-30 Thread Richard Henderson
These syscalls will be used by m68k and nios2 semihosting. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 7 ++ semihosting/guestfd.c | 137 ++ 2 files changed, 144 insertions(+) diff --git a/include/semihosting/guestfd.h b/include

[PATCH 21/43] semihosting: Split out semihost_sys_close

2022-04-30 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_CLOSE to a reusable function. This handles all GuestFD. Note that gdb_do_syscall %x reads target_ulong, not int. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 2 ++ semihosting/arm-compat-semi.c | 41 +--

[PATCH 19/43] semihosting: Move GET_ARG/SET_ARG earlier in the file

2022-04-30 Thread Richard Henderson
Moving this to be useful for another function besides do_common_semihosting. Signed-off-by: Richard Henderson --- semihosting/arm-compat-semi.c | 52 +-- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/ar

[PATCH 27/43] semihosting: Split out semihost_sys_flen

2022-04-30 Thread Richard Henderson
The ARM-specific SYS_FLEN isn't really something that can be reused by other semihosting apis, but moving the implementation to guestfd.c means that we can keep the GuestFD stuff together. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 4 ++ semihosting/arm-compat-semi.c |

[PATCH 33/43] gdbstub: Widen gdb_syscall_complete_cb return value

2022-04-30 Thread Richard Henderson
Always pass a uint64_t. This resolves a FIXME in the m68k and nios2 semihosting that we've lost data. Signed-off-by: Richard Henderson --- include/exec/gdbstub.h| 3 +-- gdbstub.c | 7 --- semihosting/arm-compat-semi.c | 9 - semihosting/console.c

[PATCH 28/43] semihosting: Split out semihost_sys_remove

2022-04-30 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_REMOVE to a reusable function. This doesn't use GuestFD, but it does reuse validate_strlen() from semihost_sys_open. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 3 +++ semihosting/arm-compat-semi.c | 13 +--- semih

[PATCH 25/43] semihosting: Split out semihost_sys_lseek

2022-04-30 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_SEEK to a reusable function. This handles all GuestFD. Isolate the curious ARM-specific return value processing to a new callback, common_semi_seek_cb. Expand the internal type of the offset to int64_t, and provide the whence argument, which will be

[PATCH 42/43] target/nios2: Use guestfd.h to implement syscalls.

2022-04-30 Thread Richard Henderson
This separates guest file descriptors from host file descriptors, and utilizes shared infrastructure for integration with gdbstub. Signed-off-by: Richard Henderson --- target/nios2/nios2-semi.c | 287 ++ 1 file changed, 41 insertions(+), 246 deletions(-) diff

[PATCH 34/43] target/m68k: Eliminate m68k_semi_is_fseek

2022-04-30 Thread Richard Henderson
Reorg m68k_semi_return_* to gdb_syscall_complete_cb. Use the 32-bit version normally, and the 64-bit version for HOSTED_LSEEK. Signed-off-by: Richard Henderson --- target/m68k/m68k-semi.c | 55 + 1 file changed, 23 insertions(+), 32 deletions(-) diff --gi

[PATCH 29/43] semihosting: Split out semihost_sys_rename

2022-04-30 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_RENAME to a reusable function. This doesn't use GuestFD, but it does reuse validate_strlen() from semihost_sys_open. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 4 +++ semihosting/arm-compat-semi.c | 21 + semi

[PATCH 35/43] target/m68k: Make semihosting system only

2022-04-30 Thread Richard Henderson
While we had a call to do_m68k_semihosting in linux-user, it wasn't actually reachable. We don't include DISAS_INSN(halt) as an instruction unless system mode. Signed-off-by: Richard Henderson --- linux-user/m68k/cpu_loop.c | 5 - target/m68k/m68k-semi.c| 37 +--

[PATCH 36/43] target/m68k: Use guestfd.h to implement syscalls.

2022-04-30 Thread Richard Henderson
This separates guest file descriptors from host file descriptors, and utilizes shared infrastructure for integration with gdbstub. Signed-off-by: Richard Henderson --- target/m68k/m68k-semi.c | 268 ++-- 1 file changed, 38 insertions(+), 230 deletions(-) diff

[PATCH 43/43] target/nios2: Do semihosting call as a normal helper

2022-04-30 Thread Richard Henderson
There's no need to raise an exception; just call the helper function directly. Signed-off-by: Richard Henderson --- target/nios2/cpu.h| 3 --- target/nios2/helper.h | 1 + target/nios2/helper.c | 7 --- target/nios2/nios2-semi.c | 3 ++- target/nios2/translate.c | 2 +- 5 fi

[PATCH 30/43] semihosting: Split out semihost_sys_system

2022-04-30 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_SYSTEM to a reusable function. This doesn't use GuestFD, but it does reuse validate_strlen() from semihost_sys_open. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 3 +++ semihosting/arm-compat-semi.c | 12 +-- semiho

[PATCH 40/43] target/nios2: Eliminate nios2_semi_is_lseek

2022-04-30 Thread Richard Henderson
Reorg nios2_semi_return_* to gdb_syscall_complete_cb. Use the 32-bit version normally, and the 64-bit version for HOSTED_LSEEK. Signed-off-by: Richard Henderson --- target/nios2/nios2-semi.c | 59 +++ 1 file changed, 23 insertions(+), 36 deletions(-) diff --g

[PATCH 32/43] semihosting: Create semihost_sys_gettimeofday

2022-04-30 Thread Richard Henderson
This syscall will be used by m68k and nios2 semihosting. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 3 +++ semihosting/guestfd.c | 42 +++ 2 files changed, 45 insertions(+) diff --git a/include/semihosting/guestfd.h b/include/se

[PATCH 38/43] target/m68k: Enable semihosting for non-coldfire

2022-04-30 Thread Richard Henderson
The libgloss m68k-semi.txt spec says that bkpt #0 may be used when the halt insn is not available. While halt is available for 68060, continue to support bkpt #0 for all m68k processors. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 9 + 1 file changed, 9 insertions(+)

[PATCH 39/43] target/m68k: Remove EXCP_HALT_INSN

2022-04-30 Thread Richard Henderson
Now that semihosting is not attached to EXCP_HALT_INSN, we can use EXCP_HLT. Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 1 - target/m68k/op_helper.c | 5 - target/m68k/translate.c | 3 ++- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/target/m68k/cpu.h b/

[PATCH 37/43] target/m68k: Do semihosting call as a normal helper

2022-04-30 Thread Richard Henderson
There's no need to raise an exception; just call the helper function directly. The test for the required surrounding insns is easier as well. Move the load of nr inside the helper. Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 2 -- target/m68k/helper.h| 1 + target/m68k

[PULL v3 19/25] build: move vhost-vsock configuration to Kconfig

2022-04-30 Thread Paolo Bonzini
vhost-vsock and vhost-user-vsock are two devices of their own; it should be possible to enable/disable them with --without-default-devices, not --without-default-features. Compute their default value in Kconfig to obtain the more intuitive behavior. Reviewed-by: Marc-André Lureau Signed-off-by:

[PATCH 41/43] target/nios2: Move nios2-semi.c to nios2_softmmu_ss

2022-04-30 Thread Richard Henderson
Semihosting is not enabled for nios2-linux-user. Signed-off-by: Richard Henderson --- target/nios2/meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/nios2/meson.build b/target/nios2/meson.build index 2bd60ba306..c6e2243cc3 100644 --- a/target/nios2/meson.

[PULL v3 00/25] Misc patches for 2022-04-29

2022-04-30 Thread Paolo Bonzini
The following changes since commit 731340813fdb4cb8339edb8630e3f923b7d987ec: Merge tag 'pull-riscv-to-apply-20220429' of github.com:alistair23/qemu into staging (2022-04-29 08:46:55 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you

[PULL v3 20/25] build: move vhost-scsi configuration to Kconfig

2022-04-30 Thread Paolo Bonzini
vhost-scsi and vhost-user-scsi are two devices of their own; it should be possible to enable/disable them with --without-default-devices, not --without-default-features. Compute their default value in Kconfig to obtain the more intuitive behavior. Reviewed-by: Marc-André Lureau Signed-off-by: Pa

Building tools on unsupported cpu/arch

2022-04-30 Thread Michael Tokarev
Hello! Previously, it was possible to build qemu tools (such as qemu-img, or qemu-ga) on an unsupported cpu/architecture. In a hackish way, by specifying --enable-tcg-interpreter on the ./configure line. Today (with 7.0), it does not work anymore, with the following error during configure: co

[PATCH] hw/usb/hcd-ehci.c: print diagnostics when cpage out of range

2022-04-30 Thread Arnout Engelen
Making it easier to diagnose what is going on when it happens Signed-off-by: Arnout Engelen --- hw/usb/hcd-ehci.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 33a8a377bd..8e2f6578c2 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@

Re: [PULL 0/7] 9p queue 2022-04-30

2022-04-30 Thread Richard Henderson
https://github.com/cschoenebeck/qemu.git tags/pull-9p-20220430 for you to fetch changes up to e8fb9ed725fe2ed00a275674a84beb5ba6e538a7: 9pfs: fix qemu_mknodat() to always return -1 on error on macOS host (2022-04-30 13:11:48 +0200) ---

Re: [PULL v3 00/25] Misc patches for 2022-04-29

2022-04-30 Thread Richard Henderson
On 4/30/22 07:05, Paolo Bonzini wrote: The following changes since commit 731340813fdb4cb8339edb8630e3f923b7d987ec: Merge tag 'pull-riscv-to-apply-20220429' of github.com:alistair23/qemu into staging (2022-04-29 08:46:55 -0700) are available in the Git repository at: https://gitlab.com/

Re: Building tools on unsupported cpu/arch

2022-04-30 Thread Richard Henderson
On 4/30/22 07:11, Michael Tokarev wrote: Hello! Previously, it was possible to build qemu tools (such as qemu-img, or qemu-ga) on an unsupported cpu/architecture.  In a hackish way, by specifying --enable-tcg-interpreter on the ./configure line. Today (with 7.0), it does not work anymore, with

[PATCH 0/2] target/m68k: Enable halt insn for 68060

2022-04-30 Thread Richard Henderson
While looking at semihosting, I noticed that 060 does have halt. Then I was a bit surprised that it wasn't being disassembled and thought trying to exactly match disassembly to cpu was a bit frought with peril -- one also wants to know what the insn was *supposed* to be when it raises SIGILL. r~

[PATCH 1/2] target/m68k: Clear mach in m68k_cpu_disas_set_info

2022-04-30 Thread Richard Henderson
Zero selects all cpu features in disas/m68k.c, which is really what we want -- not limited to 68040. Signed-off-by: Richard Henderson --- target/m68k/cpu.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index c7aeb7da9c..5671067923

[PATCH 2/2] target/m68k: Enable halt insn for 68060

2022-04-30 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/m68k/translate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 4026572ed8..e4efd988d2 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -6003,6 +6003,7 @@ void register_m6

Re: Building tools on unsupported cpu/arch

2022-04-30 Thread Michael Tokarev
30.04.2022 19:57, Richard Henderson wrote: .. What's the way to build tools on an unsupported architecture these days? Hmm, well, there isn't a way.  This seems like a bug in common-user/meson.build. We should not add this include directory if neither linux-user and bsd-user are enabled. Aft

Re: [PATCH v3 25/43] target/loongarch: Add LoongArch CSR instruction

2022-04-30 Thread Richard Henderson
On 4/29/22 03:07, Xiaojuan Yang wrote: +[LOONGARCH_CSR_CPUID] = { +.offset = -1, +.flags = CSRFL_READONLY, +.readfn = gen_helper_csrrd_cpuid, +.writefn = NULL +}, The offset should be (int)offsetof(CPUState, cpu_index) - (int)offsetof(LoongArchCPU, e

Re: [PATCH v3 26/43] target/loongarch: Add LoongArch IOCSR instruction

2022-04-30 Thread Richard Henderson
On 4/29/22 03:07, Xiaojuan Yang wrote: This includes: - IOCSR{RD/WR}.{B/H/W/D} Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- target/loongarch/cpu.c| 44 target/loongarch/cpu.h| 25 +++ target/loongarch/disas.c

Re: [PATCH v3 32/43] hw/intc: Add LoongArch ls7a interrupt controller support(PCH-PIC)

2022-04-30 Thread Richard Henderson
On 4/29/22 03:07, Xiaojuan Yang wrote: This patch realize the PCH-PIC interrupt controller. Signed-off-by: Xiaojuan Yang Signed-off-by: Song Gao --- MAINTAINERS | 1 + hw/intc/Kconfig | 4 + hw/intc/loongarch_pch_pic.c | 431 +++

[PATCH v4 00/17] target/m68k: Conditional traps + trap cleanup

2022-04-30 Thread Richard Henderson
Changes for v4: - Rebase, which requires QEMU_NORETURN -> G_NORETURN. - Cast -4096 to abi_ulong for print_syscall_err. r~ v1: https://lore.kernel.org/qemu-devel/20211130103752.72099-1-richard.hender...@linaro.org/ v2: https://lore.kernel.org/qemu-devel/20211202204900.50973-1-richard.hende

[PATCH v4 03/17] target/m68k: Fix coding style in m68k_interrupt_all

2022-04-30 Thread Richard Henderson
Add parenthesis around & vs &&. Remove assignment to sr in function call argument -- note that sr is unused after the call, so the assignment was never needed, only the result of the & expression. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/op_helper.c

[PATCH v4 01/17] target/m68k: Raise the TRAPn exception with the correct pc

2022-04-30 Thread Richard Henderson
Rather than adjust the PC in all of the consumers, raise the exception with the correct PC in the first place. Reviewed-by: Laurent Vivier Signed-off-by: Richard Henderson --- linux-user/m68k/cpu_loop.c | 1 - target/m68k/op_helper.c| 9 - target/m68k/translate.c| 2 +- 3 files

[PATCH v4 04/17] linux-user/m68k: Handle EXCP_TRAP1 through EXCP_TRAP15

2022-04-30 Thread Richard Henderson
These are raised by guest instructions, and should not fall through into the default abort case. Signed-off-by: Richard Henderson --- linux-user/m68k/cpu_loop.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux-user/m68k/cpu_loop.c b/linux-user/m68k/cpu_loop.c index 56417f7401..6ca3e1e

[PATCH v4 15/17] linux-user/strace: Fix print_syscall_err

2022-04-30 Thread Richard Henderson
Errors are not all negative numbers, but only the top 4k. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/strace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 2cdbf030ba..dc4f810bd3 1

[PATCH v4 07/17] target/m68k: Fix pc, c flag, and address argument for EXCP_DIV0

2022-04-30 Thread Richard Henderson
According to the M68040 Users Manual, section 8.4.3, Six word stack frame (format 2), Zero Div (and others) is supposed to record the next insn in PC and the address of the trapping instruction in ADDRESS. While the N, Z and V flags are documented to be undefine on DIV0, the C flag is documented a

[PATCH v4 05/17] target/m68k: Remove retaddr in m68k_interrupt_all

2022-04-30 Thread Richard Henderson
The only value this variable holds is now env->pc. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/op_helper.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/target/m68k/op_helper.c b/target/m

[PATCH v4 02/17] target/m68k: Switch over exception type in m68k_interrupt_all

2022-04-30 Thread Richard Henderson
Replace an if ladder with a switch for clarity. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/op_helper.c | 49 + 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/target/m6

[PATCH v4 08/17] target/m68k: Fix address argument for EXCP_TRACE

2022-04-30 Thread Richard Henderson
According to the M68040 Users Manual, section 8.4.3, Six word stack frame (format 2), Trace (and others) is supposed to record the next insn in PC and the address of the trapping instruction in ADDRESS. Create gen_raise_exception_format2 to record the trapping pc in env->mmu.ar. Update m68k_inter

[PATCH v4 06/17] target/m68k: Fix address argument for EXCP_CHK

2022-04-30 Thread Richard Henderson
According to the M68040 Users Manual, section 8.4.3, Six word stack frame (format 2), CHK, CHK2 (and others) are supposed to record the next insn in PC and the address of the trapping instruction in ADDRESS. Create a raise_exception_format2 function to centralize recording of the trapping pc in mm

[PATCH v4 11/17] target/m68k: Implement TPF in terms of TRAPcc

2022-04-30 Thread Richard Henderson
TPF stands for "trap false", and is a long-form nop for ColdFire. Re-use the immediate consumption code from trapcc; the insn will already expand to a nop because of the TCG_COND_NEVER test within do_trapcc. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 18 +- 1

[PATCH v4 09/17] target/m68k: Fix stack frame for EXCP_ILLEGAL

2022-04-30 Thread Richard Henderson
According to the M68040 Users Manual, section 8.4.3, Four word stack frame (format 0), includes Illegal Instruction. Use the correct frame format, which does not use the ADDR argument. Signed-off-by: Richard Henderson --- target/m68k/op_helper.c | 5 - 1 file changed, 4 insertions(+), 1 del

[PATCH v4 12/17] target/m68k: Implement TRAPV

2022-04-30 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/m68k/translate.c | 9 + 1 file changed, 9 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index bb5ed1b7b1..0cd7ef89e3 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -4911,6 +4911,14 @@ DISAS_

[PATCH v4 10/17] target/m68k: Implement TRAPcc

2022-04-30 Thread Richard Henderson
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/754 Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 2 ++ linux-user/m68k/cpu_loop.c | 1 + target/m68k/cpu.c | 1 + target/m68k/op_helper.c| 6 + target/m68k/translate.c| 49 +++

[PATCH v4 16/17] linux-user/strace: Adjust get_thread_area for m68k

2022-04-30 Thread Richard Henderson
Unlike i386, m68k get_thread_area has no arguments. Signed-off-by: Richard Henderson --- linux-user/strace.list | 5 + 1 file changed, 5 insertions(+) diff --git a/linux-user/strace.list b/linux-user/strace.list index 278596acd1..72e17b1acf 100644 --- a/linux-user/strace.list +++ b/linux-us

[PATCH v4 13/17] target/m68k: Implement FTRAPcc

2022-04-30 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/m68k/translate.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 0cd7ef89e3..a3141d7f77 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -55

[PATCH v4 17/17] target/m68k: Mark helper_raise_exception as noreturn

2022-04-30 Thread Richard Henderson
Also mark raise_exception_ra and raise_exception, lest we generate a warning about helper_raise_exception returning. Signed-off-by: Richard Henderson --- target/m68k/helper.h| 2 +- target/m68k/op_helper.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/target/m68k/

[PATCH v4 14/17] tests/tcg/m68k: Add trap.c

2022-04-30 Thread Richard Henderson
Test various trap instructions: chk, div, trap, trapv, trapcc, ftrapcc, and the signals and addresses that we expect from them. Signed-off-by: Richard Henderson --- tests/tcg/m68k/trap.c | 129 + tests/tcg/m68k/Makefile.target | 3 + 2 files changed, 13

Re: [PULL 0/7] 9p queue 2022-04-30

2022-04-30 Thread Christian Schoenebeck
/qemu > >into staging (2022-04-29 08:46:55 -0700)> > > are available in the Git repository at: > >https://github.com/cschoenebeck/qemu.git tags/pull-9p-20220430 > > > > for you to fetch changes up to e8fb9ed725fe2ed00a275674a84beb5ba6e538a7: > >9pf

Re: [RFC PATCH 02/12] configure: add missing cross compiler fallbacks

2022-04-30 Thread Richard Henderson
On 4/29/22 07:18, Paolo Bonzini wrote: -: ${cross_cc_cflags_sparc="-m32 -mv8plus -mcpu=ultrasparc"} : ${cross_cc_sparc64="sparc64-linux-gnu-gcc"} : ${cross_cc_cflags_sparc64="-m64 -mcpu=ultrasparc"} +: ${cross_cc_sparc="$cross_cc_sparc64"} +: ${cross_cc_cflags_sparc="-m32 -mv8plus -mcpu=ultra

Re: [RFC PATCH 04/12] configure: introduce --cross-prefix-*=

2022-04-30 Thread Richard Henderson
On 4/29/22 07:18, Paolo Bonzini wrote: # cross compilers defaults, can be overridden with --cross-cc-ARCH -: ${cross_cc_aarch64="aarch64-linux-gnu-gcc"} +: ${cross_prefix_aarch64="aarch64-linux-gnu-"} +: ${cross_prefix_aarch64_be="$cross_prefix_aarch64"} +: ${cross_prefix_alpha="alpha-linux-gnu

Re: [RFC PATCH 05/12] configure: include more binutils in tests/tcg makefile

2022-04-30 Thread Richard Henderson
On 4/29/22 07:18, Paolo Bonzini wrote: Firmware builds require paths to all the binutils; it is not enough to use only cc, or even as/ld as in the case of tests/tcg/tricore. Adjust the cross-compiler configurator to detect also ar, nm, objcopy, ranlib and strip. Signed-off-by: Paolo Bonzini ---

Re: [RFC PATCH 06/12] configure, meson: move symlinking of ROMs to meson

2022-04-30 Thread Richard Henderson
On 4/29/22 07:18, Paolo Bonzini wrote: This is useful because pc-bios/meson.build already has a list of all ROM files, and thus does not need to use wildcards. The problems with wildcards are mentioned above the definition of the LINKS variable, but then the recommendation is disattended. Signe

Re: [RFC PATCH 07/12] configure: move symlink configuration earlier

2022-04-30 Thread Richard Henderson
On 4/29/22 07:18, Paolo Bonzini wrote: Ensure that the pc-bios/optionrom and pc-bios/s390-ccw directory exist at the time when we'll write out the compiler configuration for them. Signed-off-by: Paolo Bonzini --- configure | 49 - 1 file changed

Re: [RFC PATCH 08/12] configure: enable cross-compilation of s390-ccw

2022-04-30 Thread Richard Henderson
On 4/29/22 07:18, Paolo Bonzini wrote: -# Only build s390-ccw bios if we're on s390x and the compiler has -march=z900 -# or -march=z10 (which is the lowest architecture level that Clang supports) -if test "$cpu" = "s390x" ; then +# Only build s390-ccw bios the compiler has -march=z900 or -march=z

Re: [RFC PATCH 09/12] pc-bios/optionrom: detect -fno-pie

2022-04-30 Thread Richard Henderson
On 4/29/22 07:18, Paolo Bonzini wrote: Do not rely on the detection that was done in the configure script, since in the future we may want to cross-compile this file. Signed-off-by: Paolo Bonzini --- configure | 1 - pc-bios/optionrom/Makefile | 3 ++- 2 files changed, 2 ins

Re: [RFC PATCH 10/12] pc-bios/optionrom: compile with -Wno-array-bounds

2022-04-30 Thread Richard Henderson
On 4/29/22 07:18, Paolo Bonzini wrote: Avoids the following bogus warning: pvh_main.c: In function ‘pvh_load_kernel’: pvh_main.c:101:42: warning: array subscript 0 is outside array bounds of ‘uint16_t[0]’ {aka ‘short unsigned int[]’} [-Warray-bounds] 101 | uint32_t ebda_paddr = ((uin

Re: [RFC PATCH 11/12] configure: enable cross-compilation of optionrom

2022-04-30 Thread Richard Henderson
On 4/29/22 07:18, Paolo Bonzini wrote: While container-based cross compilers are not supported, this already makes it possible to build x86 optionroms on any machine that has an installation of GCC and binutils for 32- or 64-bit x86. Signed-off-by: Paolo Bonzini --- configure

  1   2   >