Re: [RFC PATCH v8 00/21] Net Control VQ support with asid in vDPA SVQ

2022-06-07 Thread Jason Wang
在 2022/5/20 03:12, Eugenio Pérez 写道: Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. Shadow VirtQueue (SVQ) already makes possible migration of virtqueue states, effectively intercepting

Re: [PATCH v3 4/4] Add a new doc "contacting-the-project.rst"

2022-06-07 Thread Thomas Huth
On 06/06/2022 18.43, Kashyap Chamarthy wrote: This document slightly duplicates the "support"[1] page here, but largely refers to the content in[1]. This is based on Peter Maydell's feedback[2] in v2: "there is some merit in the documentation being standalone, even if it does mean a bit of

Re: [PATCH v3 2/4] docs: rSTify MailingLists wiki; move it to QEMU Git

2022-06-07 Thread Thomas Huth
On 06/06/2022 18.43, Kashyap Chamarthy wrote: This document is referred to from the GettingStartedDevelopers wiki which will be rSTified in a follow-up commit. Converted from Mediawiki to rST using: $> pandoc -f Mediawiki -t rst MailingLists.wiki -o mailing-lists.rst The only

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-07 Thread Leonardo Bras Soares Passos
Hello Peter, On Wed, Jun 1, 2022 at 10:58 AM Peter Xu wrote: > [...] > > Hi, Leonardo. I'm also paying attention to the application of MSG_ZEROCOPY > > in live migration recently. I noticed that you defined a member > > `zero_copy_queued` in the struct QIOChannelSocket, but I can't find out > >

[PATCH v4 1/2] target/xtensa: Use an exception for semihosting

2022-06-07 Thread Richard Henderson
Within do_interrupt, we hold the iothread lock, which is required for Chardev access for the console, and for the round trip for use_gdb_syscalls(). Signed-off-by: Richard Henderson --- target/xtensa/cpu.h | 2 ++ target/xtensa/helper.h | 3 --- target/xtensa/exc_helper.c | 4

[PATCH v4 2/2] target/xtensa: Use semihosting/syscalls.h

2022-06-07 Thread Richard Henderson
This separates guest file descriptors from host file descriptors, and utilizes shared infrastructure for integration with gdbstub. Remove the xtensa custom console handing and rely on the generic -semihosting-config handling of chardevs. Signed-off-by: Richard Henderson --- target/xtensa/cpu.h

[PATCH v4 0/2] target/xtensa: semihosting cleanup

2022-06-07 Thread Richard Henderson
Based-on: <20220607204557.658541-1-richard.hender...@linaro.org> ("[PATCH v4 00/53] semihosting cleanup") Changes for v4: * Split out of v2. * Undo the gdb errno thing; continue to convert between host and xtensa. r~ Richard Henderson (2): target/xtensa: Use an exception for semihosting

[PATCH v4 11/11] target/mips: Remove GET_TARGET_STRING and FREE_TARGET_STRING

2022-06-07 Thread Richard Henderson
Inline these macros into the only two callers. Signed-off-by: Richard Henderson --- target/mips/tcg/sysemu/mips-semi.c | 27 +-- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/target/mips/tcg/sysemu/mips-semi.c b/target/mips/tcg/sysemu/mips-semi.c index

[PATCH v4 05/11] target/mips: Drop pread and pwrite syscalls from semihosting

2022-06-07 Thread Richard Henderson
We don't implement it with _WIN32 hosts, and the syscalls are missing from the gdb remote file i/o interface. Since we can't implement them universally, drop them. Signed-off-by: Richard Henderson --- target/mips/tcg/sysemu/mips-semi.c | 39 ++ 1 file changed, 7

[PATCH v4 10/11] target/mips: Simplify UHI_argnlen and UHI_argn

2022-06-07 Thread Richard Henderson
With semihosting_get_arg, we already have a check vs argc, so there's no point replicating it -- just check the result vs NULL. Merge copy_argn_to_target into its caller. Signed-off-by: Richard Henderson --- target/mips/tcg/sysemu/mips-semi.c | 44 ++ 1 file changed,

[PATCH v4 07/11] target/mips: Avoid qemu_semihosting_log_out for UHI_plog

2022-06-07 Thread Richard Henderson
Use semihost_sys_write and/or qemu_semihosting_console_write for implementing plog. When using gdbstub, copy the temp string below the stack so that gdb has a guest address from which to perform the log. Signed-off-by: Richard Henderson --- target/mips/tcg/sysemu/mips-semi.c | 52

[PATCH v4 04/11] target/mips: Drop link syscall from semihosting

2022-06-07 Thread Richard Henderson
We don't implement it with _WIN32 hosts, and the syscall is missing from the gdb remote file i/o interface. Since we can't implement it universally, drop it. Signed-off-by: Richard Henderson --- target/mips/tcg/sysemu/mips-semi.c | 9 - 1 file changed, 9 deletions(-) diff --git

Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-07 Thread Leonardo Bras Soares Passos
Hello 徐闯, Thanks for reviewing! On Wed, Jun 1, 2022 at 6:37 AM 徐闯 wrote: [...] > Hi, Leonardo. I'm also paying attention to the application of > MSG_ZEROCOPY in live migration recently. I noticed that you defined a > member `zero_copy_queued` in the struct QIOChannelSocket, but I can't > find

[PATCH v4 03/11] target/mips: Create report_fault for semihosting

2022-06-07 Thread Richard Henderson
The UHI specification does not have an EFAULT value, and further specifies that "undefined UHI operations should not return control to the target". So, log the error and abort. Signed-off-by: Richard Henderson --- target/mips/tcg/sysemu/mips-semi.c | 33 ++ 1 file

[PATCH v4 08/11] target/mips: Use error_report for UHI_assert

2022-06-07 Thread Richard Henderson
Always log the assert locally. Do not report_fault, but instead include the fact of the fault in the assertion. Don't bother freeing allocated strings before the abort(). Signed-off-by: Richard Henderson --- target/mips/tcg/sysemu/mips-semi.c | 39 ++ 1 file

[PATCH v4 02/11] target/mips: Add UHI errno values

2022-06-07 Thread Richard Henderson
>From the Unified Hosting Interface, MD01069 Reference Manual, version 1.1.6, 06 July 2015. Signed-off-by: Richard Henderson --- target/mips/tcg/sysemu/mips-semi.c | 40 ++ 1 file changed, 40 insertions(+) diff --git a/target/mips/tcg/sysemu/mips-semi.c

[PATCH v4 06/11] target/mips: Use semihosting/syscalls.h

2022-06-07 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/mips/tcg/sysemu/mips-semi.c | 219 + 1 file changed, 95 insertions(+), 124 deletions(-)

[PATCH v4 09/11] semihosting: Remove qemu_semihosting_log_out

2022-06-07 Thread Richard Henderson
The function is no longer used. Signed-off-by: Richard Henderson --- include/semihosting/console.h | 13 - semihosting/console.c | 9 - 2 files changed, 22 deletions(-) diff --git a/include/semihosting/console.h b/include/semihosting/console.h index

[PATCH v4 00/11] target/mips: semihosting cleanup

2022-06-07 Thread Richard Henderson
Based-on: <20220607204557.658541-1-richard.hender...@linaro.org> ("[PATCH v4 00/53] semihosting cleanup") Changes for v4: * Split out of v2. * Undo the gdb errno thing; continue to convert between host and uhi. r~ Richard Henderson (11): target/mips: Use an exception for semihosting

[PATCH v4 01/11] target/mips: Use an exception for semihosting

2022-06-07 Thread Richard Henderson
Within do_interrupt, we hold the iothread lock, which is required for Chardev access for the console, and for the round trip for use_gdb_syscalls(). Signed-off-by: Richard Henderson --- target/mips/cpu.h | 3 ++- target/mips/tcg/tcg-internal.h| 2 ++

Re: [RFC PATCH v8 14/21] vhost: Make possible to check for device exclusive vq group

2022-06-07 Thread Jason Wang
在 2022/5/20 03:12, Eugenio Pérez 写道: CVQ needs to be in its own group, not shared with any data vq. Enable the checking of it here, before introducing address space id concepts. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost.h | 2 + hw/net/vhost_net.c| 4 +-

Re: [RFC PATCH v8 12/21] vdpa: delay set_vring_ready after DRIVER_OK

2022-06-07 Thread Jason Wang
在 2022/5/20 03:12, Eugenio Pérez 写道: To restore the device in the destination of a live migration we send the commands through control virtqueue. For a device to read CVQ it must have received DRIVER_OK status bit. However this open a window where the device could start receiving packets in

Re: [RFC PATCH v8 11/21] vhost: Update kernel headers

2022-06-07 Thread Jason Wang
在 2022/5/20 03:12, Eugenio Pérez 写道: Signed-off-by: Eugenio Pérez --- It's better to use the helpers in scripts/ and mentioned to which version is this synced. Thanks include/standard-headers/linux/vhost_types.h | 11 - linux-headers/linux/vhost.h | 25

Re: [RFC PATCH v8 09/21] vhost: Add svq copy desc mode

2022-06-07 Thread Jason Wang
在 2022/5/20 03:12, Eugenio Pérez 写道: Enable SVQ to not to forward the descriptor translating its address to qemu's IOVA but copying to a region outside of the guest. Virtio-net control VQ will use this mode, so we don't need to send all the guest's memory every time there is a change, but

[PATCH v3 1/1] target/riscv: Add Zihintpause support

2022-06-07 Thread Dao Lu
Tested-by: Heiko Stuebner Signed-off-by: Dao Lu --- target/riscv/cpu.c | 2 ++ target/riscv/cpu.h | 1 + target/riscv/insn32.decode | 7 ++- target/riscv/insn_trans/trans_rvi.c.inc | 18 ++ 4 files changed, 27

[PATCH v3 0/1] target/riscv: Add Zihintpause support

2022-06-07 Thread Dao Lu
This patch adds RISC-V Zihintpause support. The extension is set to be enabled by default and opcode has been added to insn32.decode. Added trans_pause for TCG to mainly to break reservation and exit the TB. The change can also be found in:

[PATCH qemu] ppc/spapr: Implement H_WATCHDOG

2022-06-07 Thread Alexey Kardashevskiy
The new PAPR 2.12 defines a watchdog facility managed via the new H_WATCHDOG hypercall. This adds H_WATCHDOG support which a proposed driver for pseries uses: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=303120 This was tested by running QEMU with a debug kernel and command

[PATCH v4 2/3] target/nios2: Move nios2-semi.c to nios2_softmmu_ss

2022-06-07 Thread Richard Henderson
Semihosting is not enabled for nios2-linux-user. Signed-off-by: Richard Henderson --- target/nios2/nios2-semi.c | 5 - target/nios2/meson.build | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c index

[PATCH v4 0/3] target/nios2: semihosting cleanup

2022-06-07 Thread Richard Henderson
Based-on: <20220607204557.658541-1-richard.hender...@linaro.org> ("[PATCH v4 00/53] semihosting cleanup") Changes for v4: * Split out of v2. * Convert host errno to gdb errno, which for nios2 is guest errno. r~ Richard Henderson (3): target/nios2: Eliminate nios2_semi_is_lseek

[PATCH v4 3/3] target/nios2: Use semihosting/syscalls.h

2022-06-07 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 | 321 +- 1 file changed, 77 insertions(+), 244 deletions(-)

[PATCH v4 1/3] target/nios2: Eliminate nios2_semi_is_lseek

2022-06-07 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

Re: [PATCH v6 0/8] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-06-07 Thread Chao Peng
On Tue, Jun 07, 2022 at 05:55:46PM -0700, Marc Orr wrote: > On Tue, Jun 7, 2022 at 12:01 AM Chao Peng wrote: > > > > On Mon, Jun 06, 2022 at 01:09:50PM -0700, Vishal Annapurve wrote: > > > > > > > > Private memory map/unmap and conversion > > > > --- > > > >

Re: [PATCH 4/6] bsd-user/bsd-file.h: Add implementations for read, pread, readv and preadv

2022-06-07 Thread Warner Losh
On Tue, Jun 7, 2022 at 2:45 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/7/22 13:14, Warner Losh wrote: > > +/* read(2) */ > > +static inline abi_long do_bsd_read(abi_long arg1, abi_long arg2, > abi_long arg3) > > Why the inline markers? Best to drop them. > static inline

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

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

Re: [RFC PATCH v4 11/36] i386/tdx: Initialize TDX before creating TD vcpus

2022-06-07 Thread Xiaoyao Li
On 6/7/2022 7:16 PM, Gerd Hoffmann wrote: Hi, I guess it could be helpful for the discussion when you can outine the 'big picture' for tdx initialization. How does kvm accel setup look like without TDX, and what additional actions are needed for TDX? What ordering requirements and other

[PATCH 2/2] hw/nvme: Add trace events for shadow doorbell buffer

2022-06-07 Thread Jinhao Fan
When shadow doorbell buffer is enabled, doorbell registers are lazily updated. The actual queue head and tail pointers are stored in Shadow Doorbell buffers. Add trace events for updates on the Shadow Doorbell buffers and EventIdx buffers. Also add trace event for the Doorbell Buffer Config

Re: [PATCH v6 0/8] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-06-07 Thread Marc Orr
On Tue, Jun 7, 2022 at 12:01 AM Chao Peng wrote: > > On Mon, Jun 06, 2022 at 01:09:50PM -0700, Vishal Annapurve wrote: > > > > > > Private memory map/unmap and conversion > > > --- > > > Userspace's map/unmap operations are done by fallocate() ioctl on the > >

[PATCH 0/2] hw/nvme: Add shadow doorbell buffer support

2022-06-07 Thread Jinhao Fan
This patch adds shadow doorbell buffer support in NVMe 1.3 to QEMU NVMe. The Doorbell Buffer Config admin command is implemented for the guest to enable shadow doobell buffer. When this feature is enabled, each SQ/CQ is associated with two buffers, i.e., Shadow Doorbell buffer and EventIdx buffer.

[PATCH 1/2] hw/nvme: Implement shadow doorbell buffer support

2022-06-07 Thread Jinhao Fan
Implement Doorbel Buffer Config command (Section 5.7 in NVMe Spec 1.3) and Shadow Doorbel buffer & EventIdx buffer handling logic (Section 7.13 in NVMe Spec 1.3). For queues created before the Doorbell Buffer Config command, the nvme_dbbuf_config function tries to associate each existing SQ and CQ

[PATCH 4/4] hw/nvme: add new never_ready parameter to test the DNR bit

2022-06-07 Thread Niklas Cassel via
Since we verify that "ready_delay" parameter has to be smaller than CRWMT, we know that the namespace will always become ready. Therefore the "Namespace Not Ready" status code will never have the DNR bit set. Add a new parameter "never_ready" that can be used to emulate a namespace that never

[PATCH 1/4] hw/nvme: claim NVMe 2.0 compliance

2022-06-07 Thread Niklas Cassel via
CRMS.CRWMS bit shall be set to 1 on controllers compliant with versions later than NVMe 1.4. The first version later than NVMe 1.4 is NVMe 2.0 Let's claim compliance with NVMe 2.0 such that a follow up patch can set the CRMS.CRWMS bit. This is needed since CC.CRIME is only writable when both

[PATCH 2/4] hw/nvme: store a pointer to the NvmeSubsystem in the NvmeNamespace

2022-06-07 Thread Niklas Cassel via
Each NvmeNamespace can be used by serveral controllers, but a NvmeNamespace can at most belong to a single NvmeSubsystem. Store a pointer to the NvmeSubsystem, if the namespace was realized with a NvmeSubsystem. This will be used by a follow up patch. Signed-off-by: Niklas Cassel ---

[PATCH 3/4] hw/nvme: add support for ratified TP4084

2022-06-07 Thread Niklas Cassel via
TP4084 adds a new mode, CC.CRIME, that can be used to mark a namespace as ready independently from the controller. When CC.CRIME is 0 (default), things behave as before, all namespaces are ready when CSTS.RDY gets set to 1. When CC.CRIME is 1, the controller will become ready when CSTS.RDY gets

[PATCH 0/4] hw/nvme: add support for TP4084

2022-06-07 Thread Niklas Cassel via
Hello there, considering that Linux v5.19-rc1 is out which includes support for NVMe TP4084: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/nvme/host/core.c?id=354201c53e61e493017b15327294b0c8ab522d69 I thought that it might be nice to have QEMU support for the

[PULL v1 2/2] tpm_crb: mark command buffer as dirty on request completion

2022-06-07 Thread Stefan Berger
From: Anthony PERARD At the moment, there doesn't seems to be any way to know that QEMU made modification to the command buffer. This is potentially an issue on Xen while migrating a guest, as modification to the buffer after the migration as started could be ignored and not transfered to the

[PULL v1 0/2] Merge tpm 2022/06/07 v1

2022-06-07 Thread Stefan Berger
Hi! The patches in this PR resolve several Coverity issues and mark a memory region with TPM response data as dirty so that it does not get lost during migration. Stefan The following changes since commit 7077fcb9b68f058809c9dd9fd1dacae1881e886c: Merge tag 'vmbus-maint-20220530' of

[PULL v1 1/2] hw/tpm/tpm_tis_common.c: Assert that locty is in range

2022-06-07 Thread Stefan Berger
From: Peter Maydell In tpm_tis_mmio_read(), tpm_tis_mmio_write() and tpm_tis_dump_state(), we calculate a locality index with tpm_tis_locality_from_addr() and then use it as an index into the s->loc[] array. In all these cases, the array index can't overflow because the MemoryRegion is sized to

Re: [PATCH v2 1/8] hw/cxl: Make the CXL fixed memory window setup a machine parameter.

2022-06-07 Thread Davidlohr Bueso
On Wed, 01 Jun 2022, Jonathan Cameron wrote: Paolo Bonzini requested this change to simplify the ongoing effort to allow machine setup entirely via RPC. Includes shortening the command line form cxl-fixed-memory-window to cxl-fmw as the command lines are extremely long even with this change.

Re: [PATCH v2] target/riscv: Don't expose the CPU properties on names CPUs

2022-06-07 Thread Alistair Francis
On Wed, Jun 8, 2022 at 9:27 AM Bin Meng wrote: > > On Wed, Jun 1, 2022 at 9:37 AM Alistair Francis > wrote: > > > > From: Alistair Francis > > > > There are currently two types of RISC-V CPUs: > > - Generic CPUs (base or any) that allow complete custimisation > > - "Named" CPUs that match

Re: [PATCH v2 1/1] target/riscv: Add Zihintpause support

2022-06-07 Thread Alistair Francis
On Wed, Jun 8, 2022 at 9:20 AM Dao Lu wrote: > > Hi Alistair, > > Thanks for the response. I don't think I can find any comments > on this patch though, could you help point me to them? I see a PATCH v1 with comments and then your ping to PATCH v2, but I don't see the original PATCH v2. It might

[PATCH RFC 5/5] KVM: Hook kvm_arch_put_registers() errors to the caller

2022-06-07 Thread Peter Xu
Leverage the new mechanism to pass over errors to upper stack for kvm_arch_put_registers() when called for the post_init() accel hook. Signed-off-by: Peter Xu --- accel/kvm/kvm-all.c | 13 ++--- accel/kvm/kvm-cpus.h | 2 +- softmmu/cpus.c | 5 - 3 files changed, 15

[PATCH RFC 2/5] cpus-common: Add run_on_cpu2()

2022-06-07 Thread Peter Xu
This version of run_on_cpu() allows to take an Error** to detect errors. Signed-off-by: Peter Xu --- cpus-common.c | 27 +++ include/hw/core/cpu.h | 26 ++ softmmu/cpus.c| 6 ++ 3 files changed, 59 insertions(+) diff --git

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

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

[PATCH RFC 0/5] CPU: Detect put cpu register errors for migrations

2022-06-07 Thread Peter Xu
[Marking this as RFC] This series teaches QEMU to detect errors when e.g. putting registers from QEMU to KVM, and fail migrations properly. For the rational of this series and why it was posted, please refer to the bug report here: https://lore.kernel.org/all/YppVupW+IWsm7Osr@xz-m1.local/ But

[PATCH RFC 1/5] cpus-common: Introduce run_on_cpu_func2 which allows error returns

2022-06-07 Thread Peter Xu
run_on_cpu API does not yet support any way to pass over an error message to above. Add a new run_on_cpu_func2 hook to grant possibility of that. Note that this only changes the cpus-common core, no API is yet introduced for v2 of the run_on_cpu_func function. Signed-off-by: Peter Xu ---

Re: [PATCH v2] target/riscv: Don't expose the CPU properties on names CPUs

2022-06-07 Thread Bin Meng
On Wed, Jun 1, 2022 at 9:37 AM Alistair Francis wrote: > > From: Alistair Francis > > There are currently two types of RISC-V CPUs: > - Generic CPUs (base or any) that allow complete custimisation > - "Named" CPUs that match existing hardware > > Users can use the base CPUs to custimise the

[PATCH RFC 4/5] cpu: Allow cpu_synchronize_all_post_init() to take an errp

2022-06-07 Thread Peter Xu
Allow cpu_synchronize_all_post_init() to fail with an errp when it's set. Modify both precopy and postcopy to try to detect such error. Signed-off-by: Peter Xu --- hw/core/machine.c | 2 +- include/sysemu/cpus.h | 2 +- migration/savevm.c| 20 +--- softmmu/cpus.c

[PATCH v4 0/3] target/m68k: semihosting cleanup

2022-06-07 Thread Richard Henderson
Based-on: <20220607204557.658541-1-richard.hender...@linaro.org> ("[PATCH v4 00/53] semihosting cleanup") Changes for v4: * Split out of v2. * Convert host errno to gdb errno, which for m68k is guest errno. r~ Richard Henderson (3): target/m68k: Eliminate m68k_semi_is_fseek

Re: [PATCH v2 1/1] target/riscv: Add Zihintpause support

2022-06-07 Thread Dao Lu
Hi Alistair, Thanks for the response. I don't think I can find any comments on this patch though, could you help point me to them? Thanks, Dao On Tue, Jun 7, 2022 at 4:04 PM Alistair Francis wrote: > > On Wed, Jun 8, 2022 at 8:59 AM Dao Lu wrote: > > > > Ping > > The latest version of this

[PATCH v4 2/3] target/m68k: Make semihosting system only

2022-06-07 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| 36

Re: [PATCH v2 1/1] target/riscv: Add Zihintpause support

2022-06-07 Thread Alistair Francis
On Wed, Jun 8, 2022 at 8:59 AM Dao Lu wrote: > > Ping The latest version of this patch on the mailing list has comments that need to be addressed Alistair > > On Tue, May 24, 2022 at 1:36 PM Dao Lu wrote: > > > > Tested-by: Heiko Stuebner > > Signed-off-by: Dao Lu > > --- > >

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

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

[PATCH RFC 3/5] accel: Allow synchronize_post_init() to take an Error**

2022-06-07 Thread Peter Xu
It allows accel->synchronize_post_init() hook to return an error upwards. Add a new cpu_synchronize_post_init_full() for it, then let the existing cpu_synchronize_post_init() to call it with errp==NULL. Signed-off-by: Peter Xu --- accel/hvf/hvf-accel-ops.c | 2 +- accel/kvm/kvm-all.c

Re: [PATCH v2] target/riscv: Don't expose the CPU properties on names CPUs

2022-06-07 Thread Alistair Francis
On Wed, Jun 1, 2022 at 11:37 AM Alistair Francis wrote: > > From: Alistair Francis > > There are currently two types of RISC-V CPUs: > - Generic CPUs (base or any) that allow complete custimisation > - "Named" CPUs that match existing hardware > > Users can use the base CPUs to custimise the

Re: [PATCH 3/6] bsd-user/freebsd/os-syscall.c: Tracing and error boilerplate

2022-06-07 Thread Warner Losh
On Tue, Jun 7, 2022 at 2:34 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/7/22 13:14, Warner Losh wrote: > > +static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, > > +abi_long arg2, abi_long arg3, abi_long > arg4, > > +

Re: [PATCH 5/6] bsd-user/bsd-file.h: Meat of the write system calls

2022-06-07 Thread Richard Henderson
On 6/7/22 13:14, Warner Losh wrote: +/* write(2) */ +static inline abi_long do_bsd_write(abi_long arg1, abi_long arg2, abi_long arg3) Likewise drop the inline markers. r~

Re: [PATCH 4/6] bsd-user/bsd-file.h: Add implementations for read, pread, readv and preadv

2022-06-07 Thread Richard Henderson
On 6/7/22 13:14, Warner Losh wrote: +/* read(2) */ +static inline abi_long do_bsd_read(abi_long arg1, abi_long arg2, abi_long arg3) Why the inline markers? Best to drop them. +/* + * File system calls. + */ +case TARGET_FREEBSD_NR_read: /* read(2) */ +ret

Re: [PATCH qemu v19 00/16] Add tail agnostic behavior for rvv instructions

2022-06-07 Thread Alistair Francis
On Mon, Jun 6, 2022 at 4:22 PM ~eopxd wrote: > > According to v-spec, tail agnostic behavior can be either kept as > undisturbed or set elements' bits to all 1s. To distinguish the > difference of tail policies, QEMU should be able to simulate the tail > agnostic behavior as "set tail elements'

[PATCH v4 3/3] target/m68k: Use semihosting/syscalls.h

2022-06-07 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 | 306 ++-- 1 file changed, 76 insertions(+), 230 deletions(-)

[PATCH v4 1/3] target/m68k: Eliminate m68k_semi_is_fseek

2022-06-07 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

Re: [PATCH 1/6] bsd-user/freebsd/os-syscall.c: lock_iovec

2022-06-07 Thread Warner Losh
On Tue, Jun 7, 2022 at 2:01 PM Richard Henderson < richard.hender...@linaro.org> wrote: > On 6/7/22 13:14, Warner Losh wrote: > > +static void helper_unlock_iovec(struct target_iovec *target_vec, > > +abi_ulong target_addr, struct iovec > *vec, > > +

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

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

Re: [PATCH v2 1/1] target/riscv: Add Zihintpause support

2022-06-07 Thread Dao Lu
Ping On Tue, May 24, 2022 at 1:36 PM Dao Lu wrote: > > Tested-by: Heiko Stuebner > Signed-off-by: Dao Lu > --- > target/riscv/cpu.c | 2 ++ > target/riscv/cpu.h | 1 + > target/riscv/insn32.decode | 7 ++- >

Re: [PATCH 1/6] bsd-user/freebsd/os-syscall.c: lock_iovec

2022-06-07 Thread Richard Henderson
On 6/7/22 13:14, Warner Losh wrote: +static void helper_unlock_iovec(struct target_iovec *target_vec, +abi_ulong target_addr, struct iovec *vec, +int count, int copy) +{ +for (int i = 0; i < count; i++) { +abi_ulong base

[PATCH v4 52/53] semihosting: Remove qemu_semihosting_console_outs

2022-06-07 Thread Richard Henderson
This function has been replaced by *_write. Signed-off-by: Richard Henderson --- include/semihosting/console.h | 13 -- linux-user/semihost.c | 17 semihosting/console.c | 49 --- 3 files changed, 79 deletions(-) diff --git

[PATCH v4 50/53] semihosting: Remove qemu_semihosting_console_outc

2022-06-07 Thread Richard Henderson
This function has been replaced by *_write. Signed-off-by: Richard Henderson --- include/semihosting/console.h | 13 - linux-user/semihost.c | 16 semihosting/console.c | 18 -- 3 files changed, 47 deletions(-) diff --git

[PATCH v4 47/53] semihosting: Create qemu_semihosting_guestfd_init

2022-06-07 Thread Richard Henderson
For arm-compat, initialize console_{in,out}_gf; otherwise, initialize stdio file descriptors. This will go some way to cleaning up arm-compat, and will allow other semihosting to use normal stdio. Signed-off-by: Richard Henderson --- include/semihosting/guestfd.h | 7 +

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

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

Re: dbus-display-test is flakey

2022-06-07 Thread Marc-André Lureau
Hi Cole, On Sun, Jun 5, 2022 at 6:46 PM Cole Robinson wrote: > > Hi Marc-André, > > dbus-display-test seems flakey. I'm occasionally seeing: > > ▶ 692/746 > ERROR:../tests/qtest/dbus-display-test.c:68:test_dbus_display_vm: > assertion failed >

[PATCH v4 51/53] semihosting: Use console_out_gf for SYS_WRITE0

2022-06-07 Thread Richard Henderson
Signed-off-by: Richard Henderson --- semihosting/arm-compat-semi.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index dea5b2de8d..21b6bc3a0f 100644 --- a/semihosting/arm-compat-semi.c +++

[PATCH v4 42/53] semihosting: Pass CPUState to qemu_semihosting_console_inc

2022-06-07 Thread Richard Henderson
We don't need CPUArchState, and we do want the CPUState of the thread performing the operation -- use this instead of current_cpu. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- include/semihosting/console.h | 4 ++-- linux-user/semihost.c | 2 +-

[PATCH v4 48/53] semihosting: Use console_in_gf for SYS_READC

2022-06-07 Thread Richard Henderson
Signed-off-by: Richard Henderson --- semihosting/arm-compat-semi.c | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 20e99cdcc0..4c8932ad54 100644 ---

Re: [PATCH 3/6] bsd-user/freebsd/os-syscall.c: Tracing and error boilerplate

2022-06-07 Thread Richard Henderson
On 6/7/22 13:14, Warner Losh wrote: +static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1, +abi_long arg2, abi_long arg3, abi_long arg4, +abi_long arg5, abi_long arg6, abi_long arg7, +

[PATCH v4 46/53] semihosting: Add GuestFDConsole

2022-06-07 Thread Richard Henderson
Add a GuestFDType for connecting to the semihosting console. Hook up to read, write, isatty, and fstat syscalls. Note that the arm-specific syscall flen cannot be applied to the console, because the console is not a descriptor exposed to the guest. Signed-off-by: Richard Henderson ---

[PATCH v4 43/53] semihosting: Expand qemu_semihosting_console_inc to read

2022-06-07 Thread Richard Henderson
Allow more than one character to be read at one time. Will be used by m68k and nios2 semihosting for stdio. Signed-off-by: Richard Henderson --- include/semihosting/console.h | 12 +++- linux-user/semihost.c | 10 ++ semihosting/arm-compat-semi.c | 11 +--

[PATCH v4 37/53] semihosting: Split out semihost_sys_system

2022-06-07 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_SYSTEM to a reusable function. Signed-off-by: Richard Henderson --- include/semihosting/syscalls.h | 3 +++ semihosting/arm-compat-semi.c | 12 +- semihosting/syscalls.c | 40 ++ 3 files changed, 44

[PATCH v4 39/53] semihosting: Create semihost_sys_gettimeofday

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

Re: [PATCH v2 00/11] vfio/migration: Implement VFIO migration protocol v2

2022-06-07 Thread Alex Williamson
On Tue, 7 Jun 2022 20:44:23 +0300 Avihai Horon wrote: > On 5/30/2022 8:07 PM, Avihai Horon wrote: > > Hello, > > > > Following VFIO migration protocol v2 acceptance in kernel, this series > > implements VFIO migration according to the new v2 protocol and replaces > > the now deprecated v1

[PATCH v4 45/53] semihosting: Create qemu_semihosting_console_write

2022-06-07 Thread Richard Henderson
Will replace qemu_semihosting_console_{outs,outc}, but we need more plumbing first. Signed-off-by: Richard Henderson --- include/semihosting/console.h | 12 linux-user/semihost.c | 5 + semihosting/console.c | 9 + 3 files changed, 26 insertions(+)

[PATCH v4 29/53] semihosting: Split out semihost_sys_read

2022-06-07 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 ---

[PATCH v4 38/53] semihosting: Create semihost_sys_{stat,fstat}

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

[PATCH v4 41/53] semihosting: Fix docs comment for qemu_semihosting_console_inc

2022-06-07 Thread Richard Henderson
The implementation of qemu_semihosting_console_inc does not defer to gdbstub, but only reads from the fifo in console.c. Signed-off-by: Richard Henderson --- include/semihosting/console.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/semihosting/console.h

[PATCH v4 44/53] semihosting: Cleanup chardev init

2022-06-07 Thread Richard Henderson
Rename qemu_semihosting_connect_chardevs to qemu_semihosting_chardev_init; pass the result directly to qemu_semihosting_console_init. Store the chardev in SemihostingConsole instead of SemihostingConfig, which lets us drop semihosting_get_chardev. Signed-off-by: Richard Henderson ---

[PATCH v4 26/53] semihosting: Move GET_ARG/SET_ARG earlier in the file

2022-06-07 Thread Richard Henderson
Moving this to be useful for another function besides do_common_semihosting. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- semihosting/arm-compat-semi.c | 48 +-- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git

[PATCH v4 53/53] semihosting: Create semihost_sys_poll_one

2022-06-07 Thread Richard Henderson
This will be used for implementing the xtensa select_one system call. Choose "poll" over "select" so that we can reuse Glib's g_poll constants and to avoid struct timeval. Signed-off-by: Richard Henderson --- include/semihosting/console.h | 16 include/semihosting/syscalls.h | 3 ++

[PATCH v4 34/53] semihosting: Split out semihost_sys_flen

2022-06-07 Thread Richard Henderson
The ARM-specific SYS_FLEN isn't really something that can be reused by other semihosting apis, but there are parts that can reused for the implementation of semihost_sys_fstat. Signed-off-by: Richard Henderson --- include/semihosting/syscalls.h | 4 ++ semihosting/arm-compat-semi.c | 74

[PATCH v4 32/53] semihosting: Split out semihost_sys_lseek

2022-06-07 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

[PATCH v4 33/53] semihosting: Split out semihost_sys_isatty

2022-06-07 Thread Richard Henderson
Split out the non-ARM specific portions of SYS_ISTTY to a reusable function. This handles all GuestFD. Add a common_semi_istty_cb helper to translate the Posix error return, 0+ENOTTY, to the Arm semihosting not-a-file success result. Signed-off-by: Richard Henderson ---

[PATCH v4 24/53] semihosting: Split out common-semi-target.h

2022-06-07 Thread Richard Henderson
Move the ARM and RISCV specific helpers into their own header file. Signed-off-by: Richard Henderson --- target/arm/common-semi-target.h | 62 target/riscv/common-semi-target.h | 50 semihosting/arm-compat-semi.c | 94 +--

[PATCH v4 28/53] semihosting: Split out semihost_sys_close

2022-06-07 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/syscalls.h | 3 +++ semihosting/arm-compat-semi.c | 41

  1   2   3   4   >