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

2022-07-24 Thread Alistair Francis
On Mon, Jul 25, 2022 at 1:48 PM Dao Lu wrote: > > 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 to exit the TB and return to main loop. > > The change can also be found in: >

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

2022-07-24 Thread Dao Lu
Added support for RISC-V PAUSE instruction from Zihintpause extension, enabled by default. Tested-by: Heiko Stuebner Reviewed-by: Alistair Francis Signed-off-by: Dao Lu --- target/riscv/cpu.c | 2 ++ target/riscv/cpu.h | 1 +

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

2022-07-24 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 to exit the TB and return to main loop. The change can also be found in: https://github.com/dlu42/qemu/tree/zihintpause_support_v1 Tested along

Re: [PATCH 00/16] Support VIRTIO_F_RING_RESET for virtio-net and vhost-user in virtio pci

2022-07-24 Thread Jason Wang
On Mon, Jul 25, 2022 at 10:34 AM Kangjie Xu wrote: > > Do you have any comments or suggestions about improvements to this patch > set? Will have a look and give feedback no later than the end of this week. Thanks > > > Regards, > > Kangjie > > 在 2022/7/18 19:16, Kangjie Xu 写道: > > The virtio

Re: [RFC] hw/nvme: Use irqfd to send interrupts

2022-07-24 Thread Jinhao Fan
at 3:36 AM, Stefan Hajnoczi wrote: > > > On Sun, Jul 24, 2022, 11:21 Jinhao Fan wrote: > at 9:29 PM, Stefan Hajnoczi wrote: > > > > > Nice, perf(1) is good for that. You can enable trace events and add > > kprobes/uprobes to record timestamps when specific functions are entered. > > > >

Re: [PATCH 00/16] Support VIRTIO_F_RING_RESET for virtio-net and vhost-user in virtio pci

2022-07-24 Thread Kangjie Xu
Do you have any comments or suggestions about improvements to this patch set? Regards, Kangjie 在 2022/7/18 19:16, Kangjie Xu 写道: The virtio queue reset function has already been defined in the virtio spec 1.2. The relevant virtio spec information is here:

Re: [PATCH v3 8/8] arm/aspeed: Replace mx25l25635e chip model

2022-07-24 Thread Andrew Jeffery
On Fri, 22 Jul 2022, at 16:06, Cédric Le Goater wrote: > A mx25l25635f chip model is generally found on these machines. It's > newer and uses 4B opcodes which is better to exercise the support in > the Linux kernel. > > Signed-off-by: Cédric Le Goater > --- > hw/arm/aspeed.c | 6 +++--- > 1

Re: [PATCH] .cirrus.yml: Change winsymlinks to 'native'

2022-07-24 Thread Yonggang Luo
On Mon, Jul 25, 2022 at 9:24 AM Bin Meng wrote: > > On Wed, Jul 20, 2022 at 12:12 AM Bin Meng wrote: > > > > From: Bin Meng > > > > At present winsymlinks is set to 'nativestrict', and its behavior is: > > > > a) if native symlinks are enabled and exists, creates > > as a native

Re: [PATCH] .cirrus.yml: Change winsymlinks to 'native'

2022-07-24 Thread Bin Meng
On Wed, Jul 20, 2022 at 12:12 AM Bin Meng wrote: > > From: Bin Meng > > At present winsymlinks is set to 'nativestrict', and its behavior is: > > a) if native symlinks are enabled and exists, creates > as a native Windows symlink; > b) else if native symlinks are not enabled or if

Re: [PATCH] hw/intc: sifive_plic: Fix multi-socket plic configuraiton

2022-07-24 Thread Alistair Francis
On Sat, Jul 23, 2022 at 7:22 PM Atish Patra wrote: > > Since commit 40244040a7ac, multi-socket configuration with plic is > broken as the hartid for second socket is calculated incorrectly. > The hartid stored in addr_config already includes the offset > for the base hartid for that socket.

Re: [PATCH v2 2/2] tests/tcg/s390x: Test unaligned accesses to lowcore

2022-07-24 Thread Richard Henderson
On 7/23/22 05:06, Ilya Leoshkevich wrote: Add a small test to avoid regressions. Signed-off-by: Ilya Leoshkevich Acked-by: Richard Henderson r~ --- tests/tcg/s390x/Makefile.softmmu-target | 9 + tests/tcg/s390x/unaligned-lowcore.S | 19 +++ 2 files

Re: [PATCH v2 1/2] qapi: Add exit-failure PanicAction

2022-07-24 Thread Richard Henderson
On 7/23/22 05:06, Ilya Leoshkevich wrote: Currently QEMU exits with code 0 on both panic an shutdown. For tests it is useful to return 1 on panic, so that it counts as a test failure. Introduce a new exit-failure PanicAction that makes main() return EXIT_FAILURE. Tests can use -action

Re: [PATCH] target/ppc: fix unreachable code in do_ldst_quad()

2022-07-24 Thread Richard Henderson
On 7/20/22 19:27, Daniel Henrique Barboza wrote: Coverity reports that commit fc34e81acd51 ("target/ppc: add macros to check privilege level") turned the following code unreachable: if (!prefixed && !(ctx->insns_flags2 & PPC2_LSQ_ISA207)) { /* lq and stq were privileged prior to V. 2.07 */

Re: [PATCH 4/4] semihosting: Fix handling of buffer in TARGET_SYS_TMPNAM

2022-07-24 Thread Richard Henderson
On 7/19/22 17:41, Peter Maydell wrote: The TARGET_SYS_TMPNAM implementation has two bugs spotted by Coverity: * confusion about whether 'len' has the length of the string including or excluding the terminating NUL means we lock_user() len bytes of memory but memcpy() len + 1 bytes *

Deadlock between bdrv_drain_all_begin and prepare_mmio_access

2022-07-24 Thread Liang Yan
Hello All, I am facing a lock situation between main-loop thread 1 and vcpu thread 4 when doing a qmp snapshot. QEMU is running on 6.0.x, checked the upstream code and did not see any big change since between. Guest is a Windows 10 VM. Unfortunately, I could not get into the windows vm or

Re: [RFC] hw/nvme: Use irqfd to send interrupts

2022-07-24 Thread Stefan Hajnoczi
On Sun, Jul 24, 2022, 11:21 Jinhao Fan wrote: > at 9:29 PM, Stefan Hajnoczi wrote: > > > > > Nice, perf(1) is good for that. You can enable trace events and add > > kprobes/uprobes to record timestamps when specific functions are entered. > > > > Thanks Stefan, > > One last question: Currently

Re: [PATCH 3/4] semihosting: Check for errors on SET_ARG()

2022-07-24 Thread Richard Henderson
On 7/19/22 17:41, Peter Maydell wrote: The SET_ARG() macro returns an error indication; we check this in the TARGET_SYS_GET_CMDLINE case but not when we use it in implementing TARGET_SYS_ELAPSED. Check for and handle the errors via the do_fault codepath, and update the comment documenting the

Re: [PATCH 2/4] semihosting: Don't copy buffer after console_write()

2022-07-24 Thread Richard Henderson
On 7/19/22 17:41, Peter Maydell wrote: The console_write() semihosting function outputs guest data from a buffer; it doesn't update that buffer. It therefore doesn't need to pass a length value to unlock_user(), but can pass 0, meaning "do not copy any data back to the guest memory".

Re: [PATCH 1/4] semihosting: Don't return negative values on qemu_semihosting_console_write() failure

2022-07-24 Thread Richard Henderson
On 7/19/22 17:41, Peter Maydell wrote: The documentation comment for qemu_semihosting_console_write() says * Returns: number of bytes written -- this should only ever be short * on some sort of i/o error. and the callsites rely on this. However, the implementation code path which sends

Re: [PATCH v6 3/5] target/riscv: smstateen check for fcsr

2022-07-24 Thread Mayuresh Chitale
On Fri, 2022-07-22 at 09:42 +0800, Weiwei Li wrote: > 在 2022/7/21 下午11:31, Mayuresh Chitale 写道: > > If smstateen is implemented and sstateen0.fcsr is clear then the > > floating point operations must return illegal instruction > > exception. > > > > Signed-off-by: Mayuresh Chitale > > --- > >

Re: [PATCH v6 1/5] target/riscv: Add smstateen support

2022-07-24 Thread Mayuresh Chitale
On Fri, 2022-07-22 at 08:31 +0800, Weiwei Li wrote: > 在 2022/7/21 下午11:31, Mayuresh Chitale 写道: > > Smstateen extension specifies a mechanism to close > > the potential covert channels that could cause security issues. > > > > This patch adds the CSRs defined in the specification and > > the

Re: [RFC] hw/nvme: Use irqfd to send interrupts

2022-07-24 Thread Jinhao Fan
at 9:29 PM, Stefan Hajnoczi wrote: > > Nice, perf(1) is good for that. You can enable trace events and add > kprobes/uprobes to record timestamps when specific functions are entered. > Thanks Stefan, One last question: Currently we can achieve hundreds of KIOPS. That means perf can easily

[PATCH v15 04/10] vhost: introduce new VhostOps vhost_set_config_call

2022-07-24 Thread Cindy Lu
This patch introduces new VhostOps vhost_set_config_call. This function allows the qemu to set the config event fd to kernel driver. Signed-off-by: Cindy Lu --- include/hw/virtio/vhost-backend.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/hw/virtio/vhost-backend.h

[PATCH v15 10/10] virtio-pci: add support for configure interrupt

2022-07-24 Thread Cindy Lu
Add process to handle the configure interrupt, The function's logic is the same with vq interrupt.Add extra process to check the configure interrupt Signed-off-by: Cindy Lu --- hw/virtio/virtio-pci.c | 110 - include/hw/virtio/virtio-pci.h | 4 +- 2

[PATCH v15 07/10] vhost: add support for configure interrupt

2022-07-24 Thread Cindy Lu
Add functions to support configure interrupt. The configure interrupt process will start in vhost_dev_start and stop in vhost_dev_stop. Also add the functions to support vhost_config_pending and vhost_config_mask. Signed-off-by: Cindy Lu --- hw/virtio/vhost.c | 78

[PATCH v15 03/10] virtio-pci: decouple the single vector from the interrupt process

2022-07-24 Thread Cindy Lu
To reuse the interrupt process in configure interrupt Need to decouple the single vector from the interrupt process. We add new function kvm_virtio_pci_vector_use_one and _release_one. These functions are used for the single vector, the whole process will finish in the loop with vq number.

[PATCH v15 09/10] virtio-mmio: add support for configure interrupt

2022-07-24 Thread Cindy Lu
Add configure interrupt support in virtio-mmio bus. add function to set configure guest notifier. Signed-off-by: Cindy Lu --- hw/virtio/virtio-mmio.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index

[PATCH v15 06/10] virtio: add support for configure interrupt

2022-07-24 Thread Cindy Lu
Add the functions to support the configure interrupt in virtio The function virtio_config_guest_notifier_read will notify the guest if there is an configure interrupt. The function virtio_config_set_guest_notifier_fd_handler is to set the fd hander for the notifier Signed-off-by: Cindy Lu ---

[PATCH v15 01/10] virtio: introduce macro VIRTIO_CONFIG_IRQ_IDX

2022-07-24 Thread Cindy Lu
To support configure interrupt for vhost-vdpa Introduce VIRTIO_CONFIG_IRQ_IDX -1 as configure interrupt's queue index, Then we can reuse the functions guest_notifier_mask and guest_notifier_pending. Add the check of queue index in these drivers, if the driver does not support configure interrupt,

[PATCH v15 08/10] virtio-net: add support for configure interrupt

2022-07-24 Thread Cindy Lu
Add functions to support configure interrupt in virtio_net Add the functions to support vhost_net_config_pending and vhost_net_config_mask. Signed-off-by: Cindy Lu --- hw/net/vhost_net.c | 9 + hw/net/virtio-net.c | 4 ++-- include/net/vhost_net.h | 2 ++ 3 files changed, 13

[PATCH v15 05/10] vhost-vdpa: add support for config interrupt

2022-07-24 Thread Cindy Lu
Add new call back function in vhost-vdpa, The function vhost_set_config_call can set the event fd to kernel. This function will be called in the vhost_dev_start and vhost_dev_stop Signed-off-by: Cindy Lu --- hw/virtio/trace-events | 1 + hw/virtio/vhost-vdpa.c | 8 2 files changed, 9

[PATCH v15 02/10] virtio-pci: decouple notifier from interrupt process

2022-07-24 Thread Cindy Lu
To reuse the notifier process. We add the virtio_pci_get_notifier to get the notifier and vector. The INPUT for this function is IDX, The OUTPUT is the notifier and the vector Signed-off-by: Cindy Lu --- hw/virtio/virtio-pci.c | 88 +++--- 1 file changed, 57

[PATCH v15 00/10] vhost-vdpa: add support for configure interrupt

2022-07-24 Thread Cindy Lu
These patches introduced the support for configure interrupt  These codes are tested on x86_64 and aarch64 platforms.   the test scenario is based on vp-vdpa/vdpa_sim /virtio net device, with the irqfd and without irqfd. Tested in virtio-pci bus and virtio-mmio bus Change in v2: Add support for