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

2022-07-23 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-23 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. Signed-

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

2022-07-23 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 d240efef9

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

2022-07-23 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 --- hw

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

2022-07-23 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, t

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

2022-07-23 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 ins

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

2022-07-23 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 in

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

2022-07-23 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 i

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

2022-07-23 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 vi

Re: [PATCH] include/qemu/host-utils.h: Simplify the compiler check in mulu128()

2022-07-23 Thread Richard Henderson
On 7/21/22 13:18, Thomas Huth wrote: We currently require at least GCC 7.4 or Clang 6.0 for compiling QEMU. GCC has __builtin_mul_overflow since version 5 already, and Clang 6.0 also provides this built-in function (see its documentation on this page: https://releases.llvm.org/6.0.0/tools/clang/d

Re: [PATCH] hw/loongarch: remove acpi-build.c unused variable 'aml_len'

2022-07-23 Thread Richard Henderson
On 7/21/22 09:30, Song Gao wrote: Fix a compiler warning on openbsd: ../src/hw/loongarch/acpi-build.c:416:12: warning: variable 'aml_len' set but not used [-Wunused-but-set-variable] size_t aml_len = 0; ^ Reported-by: Peter Maydell Signed-off-by: Song Gao --- Reviewed-by: Ri

Re: [PATCH] linux-user: Use target abi_int type for pipefd[1] in pipe()

2022-07-23 Thread Laurent Vivier
Le 17/07/2022 à 18:21, Helge Deller a écrit : When writing back the fd[1] pipe file handle to emulated userspace memory, use sizeof(abi_int) as offset insted of the hosts's int type. There is no functional change in this patch. Signed-off-by: Helge Deller diff --git a/linux-user/syscall.c b/li

Re: [PATCH] target/mips: Handle lock_user() failure in UHI_plog semihosting call

2022-07-23 Thread Richard Henderson
On 7/20/22 00:47, Peter Maydell wrote: Coverity notes that we forgot to check the error return from lock_user() in one place in the handling of the UHI_plog semihosting call. Add the missing error handling. report_fault() is rather brutal in that it will call abort(), but this is the same error

Re: [PATCH] target/arm: Add MO_128 entry to pred_esz_masks[]

2022-07-23 Thread Richard Henderson
On 7/18/22 15:31, Peter Maydell wrote: In commit 7390e0e9ab8475, we added support for SME loads and stores. Unlike SVE loads and stores, these include handling of 128-bit elements. The SME load/store functions call down into the existing sve_cont_ldst_elements() function, which uses the element

Re: [PATCH] linux-user: Use target abi_int type for pipefd[1] in pipe()

2022-07-23 Thread Richard Henderson
On 7/17/22 21:51, Helge Deller wrote: When writing back the fd[1] pipe file handle to emulated userspace memory, use sizeof(abi_int) as offset insted of the hosts's int type. There is no functional change in this patch. Signed-off-by: Helge Deller Reviewed-by: Richard Henderson r~

Re: [PATCH v2 0/3] ci: refresh packages/containers and misc changes

2022-07-23 Thread Alex Bennée
Daniel P. Berrangé writes: > Mostly this is to get the latest libvirt-ci content pulled in, > but I throw two small fixes on top. > > Changed in v2: > > - Reworded various bits of the commit message > for first patch Queued to testing/next, thanks. -- Alex Bennée

Re: [RFC 0/3] add snapshot/restore fuzzing device

2022-07-23 Thread Alexander Bulekov
On 220722 2210, Claudio Fontana wrote: > Hi Richard, > > On 7/22/22 21:20, Richard Liu wrote: > > This RFC adds a virtual device for snapshot/restores within QEMU. I am > > working > > on this as a part of QEMU Google Summer of Code 2022. Fast snapshot/restores > > within QEMU is helpful for code

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

2022-07-23 Thread Cindy Lu
On Fri, 22 Jul 2022 at 20:21, Michael S. Tsirkin wrote: > > On Fri, Jul 22, 2022 at 03:46:52PM +0800, Cindy Lu wrote: > > Hi Micheal. > > Would you help review these patches, not sure if this is ok to merge? > > Thanks > > Cindy > > Pls note threading is broken in the patchset. Care to repost? > T

[PATCH] hw/display/bcm2835_fb: Fix framebuffer allocation address

2022-07-23 Thread alanjian85
This patch fixes the dedicated framebuffer mailbox interface(marked as deprecated in official docs, but can still be fixed for emulation purposes) by removing unneeded offset to make it works like buffer allocate tag in bcm2835_property interface[1], some baremetal applications like the Screen01/Sc

Re: [PATCH v6 1/3] hw/intc: Move mtimer/mtimecmp to aclint

2022-07-23 Thread Andrew Jones
On Thu, Jul 21, 2022 at 06:00:44PM -0700, Atish Patra wrote: > Historically, The mtime/mtimecmp has been part of the CPU because > they are per hart entities. However, they actually belong to aclint > which is a MMIO device. > > Move them to the ACLINT device. This also emulates the real hardware

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

2022-07-23 Thread Atish Patra
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. Adding it again would lead to segfault while creating the plic devic

Re: Corrupted display changing screen colour depth in qemu-system-ppc/MacOS

2022-07-23 Thread Mark Cave-Ayland
On 22/07/2022 17:40, Mark Cave-Ayland wrote: On 22/07/2022 14:44, Marc-André Lureau wrote: Hi On Fri, Jul 22, 2022 at 4:28 PM Howard Spoelstra wrote: On Fri, Jun 17, 2022 at 2:38 PM Marc-André Lureau wrote: Hi On Fri, Jun 17, 2022 at 1:56 PM Gerd Hoffmann wrote:    Hi, Can you

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

2022-07-23 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 ++--- hw/virtio/virtio-pci.h | 4 +- 2 files change

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

2022-07-23 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 688eccda9

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

2022-07-23 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 ins

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

2022-07-23 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. Signed-

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

2022-07-23 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 v14 06/10] virtio: add support for configure interrupt

2022-07-23 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 --- hw

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

2022-07-23 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 i

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

2022-07-23 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, t

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

2022-07-23 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 b/include/h

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

2022-07-23 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 in

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

2022-07-23 Thread Cindy Lu
These patches are interduce the support for configure interrupt These codes are all tested on x86_64 and aarch64 platform. In the scenario with 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 virtio-

[PATCH 8/8] tests/migration: Introduce dirty-limit into guestperf

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Guestperf tool does not cover the dirty-limit migration currently, support this feature. To enable dirty-limit, setting x-vcpu-dirty-limit-period as 500ms and vcpu-dirty-limit as 10MB/s: $ ./tests/migration/guestperf.py \ --dirty-limit --x-vcpu-dirty-limit-period 500 \

[PATCH 6/8] tests: Add migration dirty-limit capability test

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Add migration dirty-limit capability test if kernel support dirty ring. Migration dirty-limit capability introduce dirty limit capability, two parameters: x-vcpu-dirty-limit-period and vcpu-dirty-limit are introduced to implement the live migration with dirty limit. The te

[PATCH 5/8] migration: Export dirty-limit time info

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Export dirty limit throttle time and estimated ring full time, through which we can observe the process of dirty limit during live migration. Signed-off-by: Hyman Huang(黄勇) --- include/sysemu/dirtylimit.h | 2 ++ migration/migration.c | 10 ++ monitor/hmp-c

[PATCH 3/8] migration: Introduce dirty-limit capability

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Introduce migration dirty-limit capability, which can be turned on before live migration and limit dirty page rate durty live migration. Introduce migrate_dirty_limit function to help check if dirty-limit capability enabled during live migration. Meanwhile, refactor vcpu_d

[PATCH 1/8] qapi/migration: Introduce x-vcpu-dirty-limit-period parameter

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Introduce "x-vcpu-dirty-limit-period" migration experimental parameter, which is used to make dirtyrate calculation period configurable. Signed-off-by: Hyman Huang(黄勇) --- migration/migration.c | 16 monitor/hmp-cmds.c| 8 qapi/migration.jso

[PATCH 4/8] migration: Implement dirty-limit convergence algo

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Implement dirty-limit convergence algo for live migration, which is kind of like auto-converge algo but using dirty-limit instead of cpu throttle to make migration convergent. Signed-off-by: Hyman Huang(黄勇) --- migration/ram.c| 53 +

[PATCH 7/8] tests/migration: Introduce dirty-ring-size option into guestperf

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Guestperf tool does not enable diry ring feature when test migration by default. To support dirty ring migration performance test, introduce dirty-ring-size option into guestperf tools, which ranges in [1024, 65536]. To set dirty ring size with 4096 during migration test:

[PATCH 2/8] qapi/migration: Introduce vcpu-dirty-limit parameters

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Introduce "vcpu-dirty-limit" migration parameter used to limit dirty page rate during live migration. "vcpu-dirty-limit" and "x-vcpu-dirty-limit-period" are two dirty-limit-related migration parameters, which can be set before and during live migration by qmp migrate-set-pa

[PATCH 0/8] migration: introduce dirtylimit capability

2022-07-23 Thread huangy81
From: Hyman Huang(黄勇) Abstract This series added a new migration capability called "dirtylimit". It can be enabled when dirty ring is enabled, and it'll improve the vCPU performance during the process of migration. It is based on the previous patchset: https://lore.kernel.org/qemu-deve