[PATCH RESEND] hw/pci: add comment to explain checking for available function 0 in pci hotplug

2023-07-11 Thread Ani Sinha
This change is cosmetic. A comment is added explaining why we need to check for the availability of function 0 when we hotplug a device. CC: m...@redhat.com CC: m...@tls.msk.ru Signed-off-by: Ani Sinha --- hw/pci/pci.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git

[PATCH v3 1/1] target/riscv: Add Zihintntl extension ISA string to DTS

2023-07-11 Thread Jason Chien
RVA23 Profiles states: The RVA23 profiles are intended to be used for 64-bit application processors that will run rich OS stacks from standard binary OS distributions and with a substantial number of third-party binary user applications that will be supported over a considerable length of time in t

[PATCH v3 0/1] target/riscv: Add Zihintntl extension ISA string to DTS

2023-07-11 Thread Jason Chien
In v2, I rebased the patch on https://github.com/alistair23/qemu/tree/riscv-to-apply.next However, I forgot to add "Reviewed-by" in v2, so I add them in v3. Jason Chien (1): target/riscv: Add Zihintntl extension ISA string to DTS target/riscv/cpu.c | 2 ++ target/riscv/cpu_cfg.h | 1 + 2 f

Re: [PATCH V2] vhost_vdpa: no need to fetch vring base when poweroff

2023-07-11 Thread Jason Wang
On Tue, Jul 11, 2023 at 12:09 PM Zhu, Lingshan wrote: > > > > On 7/11/2023 10:50 AM, Jason Wang wrote: > > On Mon, Jul 10, 2023 at 4:53 PM Zhu Lingshan wrote: > >> In the poweroff routine, no need to fetch last available index. > >> > > This is because there's no concept of shutdown in the vhost

Re: [PATCH 4/4] pci: Compare function number and ARI next function number

2023-07-11 Thread Ani Sinha
> On 01-Jul-2023, at 12:31 PM, Akihiko Odaki wrote: > > The function number must be lower than the next function number > advertised with ARI. > > Signed-off-by: Akihiko Odaki > --- > hw/pci/pci.c | 15 +++ > 1 file changed, 15 insertions(+) > > diff --git a/hw/pci/pci.c b/hw/pci

Re: [PATCH V2] vhost_vdpa: no need to fetch vring base when poweroff

2023-07-11 Thread Eugenio Perez Martin
On Tue, Jul 11, 2023 at 9:05 AM Jason Wang wrote: > > On Tue, Jul 11, 2023 at 12:09 PM Zhu, Lingshan wrote: > > > > > > > > On 7/11/2023 10:50 AM, Jason Wang wrote: > > > On Mon, Jul 10, 2023 at 4:53 PM Zhu Lingshan > > > wrote: > > >> In the poweroff routine, no need to fetch last available in

Re: [PATCH V2] vhost_vdpa: no need to fetch vring base when poweroff

2023-07-11 Thread Jason Wang
On Tue, Jul 11, 2023 at 3:25 PM Eugenio Perez Martin wrote: > On Tue, Jul 11, 2023 at 9:05 AM Jason Wang wrote: > > > > On Tue, Jul 11, 2023 at 12:09 PM Zhu, Lingshan > wrote: > > > > > > > > > > > > On 7/11/2023 10:50 AM, Jason Wang wrote: > > > > On Mon, Jul 10, 2023 at 4:53 PM Zhu Lingshan

[PATCH] riscv/disas: Fix disas output of upper immediates

2023-07-11 Thread Christoph Muellner
From: Christoph Müllner The GNU assembler produces the following output for instructions with upper immediates: 2597auipc a1,0x2 24b7lui s1,0x2 6409lui s0,0x2 # c.lui The immediate operands of upper immediates are

Re: [PATCH] Revert "virtio-scsi: Send "REPORTED LUNS CHANGED" sense data upon disk hotplug events"

2023-07-11 Thread Stefano Garzarella
Hi Mark On Fri, Jul 7, 2023 at 5:58 PM Mark Kanda wrote: [...] > >> On 7/5/2023 2:15 AM, Stefano Garzarella wrote: > >>> This reverts commit 8cc5583abe6419e7faaebc9fbd109f34f4c850f2. > >>> > >>> That commit causes several problems in Linux as described in the BZ. > >>> In particular, after a wh

Re: [PATCH v3 3/7] arm/virt: Use virtio-md-pci (un)plug functions

2023-07-11 Thread David Hildenbrand
On 10.07.23 23:40, Michael S. Tsirkin wrote: On Mon, Jul 10, 2023 at 12:07:10PM +0200, David Hildenbrand wrote: Let's use our new helper functions. Note that virtio-pmem-pci is not enabled for arm and, therefore, not compiled in. Signed-off-by: David Hildenbrand --- hw/arm/virt.c | 81 ++

Re: [PULL 00/44] MIPS patches for 2023-07-10

2023-07-11 Thread Richard Henderson
On 7/10/23 23:25, Philippe Mathieu-Daudé wrote: The following changes since commit fcb237e64f9d026c03d635579c7b288d0008a6e5: Merge tag 'pull-vfio-20230710' ofhttps://github.com/legoater/qemu into staging (2023-07-10 09:17:06 +0100) are available in the Git repository at: https://github

Re: [PATCH 4/4] pci: Compare function number and ARI next function number

2023-07-11 Thread Michael S. Tsirkin
On Tue, Jul 11, 2023 at 12:40:47PM +0530, Ani Sinha wrote: > > > > On 01-Jul-2023, at 12:31 PM, Akihiko Odaki wrote: > > > > The function number must be lower than the next function number > > advertised with ARI. > > > > Signed-off-by: Akihiko Odaki > > --- > > hw/pci/pci.c | 15

Re: [PATCH v3 3/7] arm/virt: Use virtio-md-pci (un)plug functions

2023-07-11 Thread Michael S. Tsirkin
On Tue, Jul 11, 2023 at 10:32:31AM +0200, David Hildenbrand wrote: > On 10.07.23 23:40, Michael S. Tsirkin wrote: > > > @@ -2855,12 +2796,11 @@ static void > > > virt_machine_device_plug_cb(HotplugHandler *hotplug_dev, > > >SYS_BUS_DEVICE(dev)); > > >

[hotfix PATCH-for-8.1] meson: Fix cross-building for RISCV host

2023-07-11 Thread Philippe Mathieu-Daudé
While when building on native Linux the host architecture is reported as "riscv32" or "riscv64", when cross-compiling it is detected as "riscv". Meson handles the cross-detection but displays a warning: WARNING: Unknown CPU family riscv, please report this at https://github.com/mesonbuild/meson

[PATCH] gdbstub: Fix client Ctrl-C handling

2023-07-11 Thread Nicholas Piggin
The gdb remote protocol has a special interrupt character (0x03) that is transmitted outside the regular packet processing, and represents a Ctrl-C pressed in the client. Despite not being a regular packet, it does expect a regular stop response if the stub successfully stops the running program.

Re: [hotfix PATCH-for-8.1] meson: Fix cross-building for RISCV host

2023-07-11 Thread Philippe Mathieu-Daudé
On 11/7/23 10:54, Philippe Mathieu-Daudé wrote: While when building on native Linux the host architecture is reported as "riscv32" or "riscv64", when cross-compiling it is detected as "riscv". Meson handles the cross-detection but displays a warning: WARNING: Unknown CPU family riscv, please

Re: [PATCH v2] hw/ide/piix: properly initialize the BMIBA register

2023-07-11 Thread Olaf Hering
Wed, 05 Jul 2023 21:52:05 + Bernhard Beschow : > I wonder if we should fix this line rather than dropping it. I think this needs to be fixed, just to fix the initial commit which added this bug. This will allow backporting this oneliner. Further changes to pci_xen_ide_unplug will be done in

Re: [PATCH v3 3/7] arm/virt: Use virtio-md-pci (un)plug functions

2023-07-11 Thread David Hildenbrand
On 11.07.23 10:47, Michael S. Tsirkin wrote: On Tue, Jul 11, 2023 at 10:32:31AM +0200, David Hildenbrand wrote: On 10.07.23 23:40, Michael S. Tsirkin wrote: @@ -2855,12 +2796,11 @@ static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev, SYS_

[hotfix PATCH-for-8.1 v2] meson: Fix cross-building for RISCV host

2023-07-11 Thread Philippe Mathieu-Daudé
While when building on native Linux the host architecture is reported as "riscv32" or "riscv64", when cross-compiling it is detected as "riscv". Meson handles the cross-detection but displays a warning: WARNING: Unknown CPU family riscv, please report this at https://github.com/mesonbuild/meson

Re: [hotfix PATCH-for-8.1] meson: Fix cross-building for RISCV host

2023-07-11 Thread Richard Henderson
On 7/11/23 10:02, Philippe Mathieu-Daudé wrote: On 11/7/23 10:54, Philippe Mathieu-Daudé wrote: While when building on native Linux the host architecture is reported as "riscv32" or "riscv64", when cross-compiling it is detected as "riscv". Meson handles the cross-detection but displays a warnin

Re: [hotfix PATCH-for-8.1 v2] meson: Fix cross-building for RISCV host

2023-07-11 Thread Peter Maydell
On Tue, 11 Jul 2023 at 10:26, Philippe Mathieu-Daudé wrote: > > While when building on native Linux the host architecture > is reported as "riscv32" or "riscv64", when cross-compiling > it is detected as "riscv". Meson handles the cross-detection > but displays a warning: > > WARNING: Unknown CP

[hotfix PATCH-for-8.1 v3] meson: Fix cross-building for RISCV host

2023-07-11 Thread Philippe Mathieu-Daudé
While when building on native Linux the host architecture is reported as "riscv32" or "riscv64": Host machine cpu family: riscv64 Host machine cpu: riscv64 Found pkg-config: /usr/bin/pkg-config (0.29.2) When cross-compiling it is detected as "riscv". Meson handles the cross-detection but di

Re: [PATCH v3 3/7] arm/virt: Use virtio-md-pci (un)plug functions

2023-07-11 Thread David Hildenbrand
On 11.07.23 11:22, David Hildenbrand wrote: On 11.07.23 10:47, Michael S. Tsirkin wrote: On Tue, Jul 11, 2023 at 10:32:31AM +0200, David Hildenbrand wrote: On 10.07.23 23:40, Michael S. Tsirkin wrote: @@ -2855,12 +2796,11 @@ static void virt_machine_device_plug_cb(HotplugHandler *hotplug_dev,

Re: [hotfix PATCH-for-8.1 v2] meson: Fix cross-building for RISCV host

2023-07-11 Thread Philippe Mathieu-Daudé
On 11/7/23 11:35, Peter Maydell wrote: On Tue, 11 Jul 2023 at 10:26, Philippe Mathieu-Daudé wrote: While when building on native Linux the host architecture is reported as "riscv32" or "riscv64", when cross-compiling it is detected as "riscv". Meson handles the cross-detection but displays a w

Re: [PULL 00/66] pc,pci,virtio: cleanups, fixes, features

2023-07-11 Thread Richard Henderson
On 7/11/23 00:02, Michael S. Tsirkin wrote: The following changes since commit fcb237e64f9d026c03d635579c7b288d0008a6e5: Merge tag 'pull-vfio-20230710' ofhttps://github.com/legoater/qemu into staging (2023-07-10 09:17:06 +0100) are available in the Git repository at: https://git.kernel

[PATCH v3] Hexagon: move GETPC() calls to top level helpers

2023-07-11 Thread Matheus Tavares Bernardino
As docs/devel/loads-stores.rst states: ``GETPC()`` should be used with great care: calling it in other functions that are *not* the top level ``HELPER(foo)`` will cause unexpected behavior. Instead, the value of ``GETPC()`` should be read from the helper and passed if needed to the funct

PING: [PATCH v4 0/3] hw/ufs: Add Universal Flash Storage (UFS) support

2023-07-11 Thread Jeuk Kim
Hi, Any more reviews...? Dear Stefan If you don't mind, Could you give it "reviewed-by"? And is there anything else I should do...? Thanks, Jeuk On 2023-07-04 오후 5:33, Jeuk Kim wrote: From: Jeuk Kim Since v3: - Replace softmmu_ss -> system_ss in meson Since v2: Addressed review comment from

Re: [PATCH] gdbstub: Fix client Ctrl-C handling

2023-07-11 Thread Matheus Tavares Bernardino
> Nicholas Piggin wrote: > > diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c > index 6911b73c07..ce8b42eb15 100644 > --- a/gdbstub/gdbstub.c > +++ b/gdbstub/gdbstub.c > @@ -2051,8 +2051,17 @@ void gdb_read_byte(uint8_t ch) > return; > } > if (runstate_is_running()) { > -

Re: [PATCH for-8.1 2/3] target/arm: Fix S1_ptw_translate() debug path

2023-07-11 Thread Jean-Philippe Brucker
On Mon, Jul 10, 2023 at 04:21:29PM +0100, Peter Maydell wrote: > In commit XXX we rearranged the logic in S1_ptw_translate() so that > the debug-access "call get_phys_addr_*" codepath is used both when S1 > is doing ptw reads from stage 2 and when it is doing ptw reads from > physical memory. Howe

[hotfix PATCH-for-8.1 v4] configure: Fix cross-building for RISCV host

2023-07-11 Thread Philippe Mathieu-Daudé
While when building on native Linux the host architecture is reported as "riscv32" or "riscv64": Host machine cpu family: riscv64 Host machine cpu: riscv64 Found pkg-config: /usr/bin/pkg-config (0.29.2) Since commit ba0e733362 ("configure: Merge riscv32 and riscv64 host architectures"), whe

Re: [PATCH] tests/migration: Restrict initrd-stress.img to Linux

2023-07-11 Thread Daniel P . Berrangé
On Mon, Jul 10, 2023 at 09:17:43PM +0200, Philippe Mathieu-Daudé wrote: > On 10/7/23 20:11, Daniel P. Berrangé wrote: > > On Mon, Jul 10, 2023 at 07:56:07PM +0200, Philippe Mathieu-Daudé wrote: > > > Trying to build initrd-stress.img on Darwin we get: > > > > > >$ ninja tests/migration/initrd-

[PATCH v3 01/16] target/riscv: Remove unuseful KVM stubs

2023-07-11 Thread Philippe Mathieu-Daudé
Since we always check whether KVM is enabled before calling kvm_riscv_reset_vcpu() and kvm_riscv_set_irq(), their call is elided by the compiler when KVM is not available. Therefore the stubs are not even linked. Remove them. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barb

[PATCH v3 08/16] target/riscv: Move TCG-specific cpu_get_tb_cpu_state() to tcg/cpu.c

2023-07-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu_helper.c| 84 --- target/riscv/tcg/cpu.c | 98 target/riscv/tcg/meson.build | 1 + 3 files changed, 99 insertions(+), 84 deletions(-) create mode 100644 target/r

[PATCH-for-8.2 v3 00/16] target/riscv: Allow building without TCG (KVM-only so far)

2023-07-11 Thread Philippe Mathieu-Daudé
v3: Rebased on master (commit 94d68c1136, merge tag 'pull-riscv-to-apply-20230710-1') Philippe Mathieu-Daudé (16): target/riscv: Remove unuseful KVM stubs target/riscv: Remove unused 'instmap.h' header in translate.c target/riscv: Restrict sysemu specific header to user emulation targe

[RFC PATCH v3 13/16] target/riscv: Move TCG/sysemu-specific code to tcg/sysemu/cpu_helper.c

2023-07-11 Thread Philippe Mathieu-Daudé
Move TCG/sysemu-specific code and restrict the corresponding prototypes to TCG, adapting meson rules. Signed-off-by: Philippe Mathieu-Daudé --- RFC due to riscv_cpu_get_phys_page_debug() --- target/riscv/cpu.h | 15 +- target/riscv/cpu_helper.c| 745 ---

[PATCH v3 05/16] target/riscv: Move sysemu-specific files to target/riscv/sysemu/

2023-07-11 Thread Philippe Mathieu-Daudé
Move sysemu-specific files to the a new 'sysemu' sub-directory, adapt meson rules. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair Francis --- target/riscv/cpu.h | 2 +- target/riscv/{ => sysemu}/instmap.h| 0 targ

[PATCH v3 16/16] gitlab-ci.d/crossbuilds: Add KVM riscv64 cross-build jobs

2023-07-11 Thread Philippe Mathieu-Daudé
Add a new job to cross-build the riscv64 target without the TCG accelerator (IOW: only KVM accelerator enabled). Signed-off-by: Philippe Mathieu-Daudé --- .gitlab-ci.d/crossbuilds.yml | 8 1 file changed, 8 insertions(+) diff --git a/.gitlab-ci.d/crossbuilds.yml b/.gitlab-ci.d/crossbui

[PATCH v3 14/16] target/riscv: Move sysemu-specific code to sysemu/cpu_helper.c

2023-07-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu_helper.c| 858 +- target/riscv/sysemu/cpu_helper.c | 863 +++ target/riscv/sysemu/meson.build | 1 + 3 files changed, 865 insertions(+), 857 deletions(-) create mode 1006

[PATCH v3 04/16] target/riscv: Restrict 'rv128' machine to TCG accelerator

2023-07-11 Thread Philippe Mathieu-Daudé
We only build for 32/64-bit hosts, so TCG is required for 128-bit targets. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair Francis --- target/riscv/cpu.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target/riscv/

[PATCH v3 02/16] target/riscv: Remove unused 'instmap.h' header in translate.c

2023-07-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair Francis --- target/riscv/translate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 697df1be9e..c65be83442 100644 --- a/target/riscv/transl

[PATCH v3 03/16] target/riscv: Restrict sysemu specific header to user emulation

2023-07-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair Francis --- target/riscv/cpu.c| 10 ++ target/riscv/cpu_helper.c | 2 ++ target/riscv/csr.c| 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/target/riscv

[PATCH v3 07/16] target/riscv: Move TCG-specific files to target/riscv/tcg/

2023-07-11 Thread Philippe Mathieu-Daudé
Move TCG-specific files to the a new 'tcg' sub-directory. Add stubs for riscv_cpu_[get/set]_fflags and riscv_raise_exception(). Adapt meson rules. Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/{ => tcg}/XVentanaCondOps.decode | 0 target/riscv/{ => tcg}/insn16.decode | 0 tar

[PATCH v3 06/16] target/riscv: Restrict riscv_cpu_do_interrupt() to sysemu

2023-07-11 Thread Philippe Mathieu-Daudé
riscv_cpu_do_interrupt() is not reachable on user emulation. Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.h| 5 +++-- target/riscv/cpu_helper.c | 7 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index dba78db6

[PATCH v3 09/16] target/riscv: Expose some 'trigger' prototypes from debug.c

2023-07-11 Thread Philippe Mathieu-Daudé
We want to extract TCG-specific code from debug.c, but some functions call get_trigger_type() / do_trigger_action(). Expose these prototypes in "debug.h". Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/debug.h | 4 target/riscv/debug.c | 5 ++--- 2 files changed, 6 insertions(+), 3

[PATCH v3 10/16] target/riscv: Extract TCG-specific code from debug.c

2023-07-11 Thread Philippe Mathieu-Daudé
Extract TCG-specific code from debug.c to tcg/sysemu/debug.c, restrict the prototypes to TCG, adapt meson rules. Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/debug.h| 2 + target/riscv/debug.c| 148 - target/riscv/tcg/sysemu/deb

[PATCH v3 15/16] target/riscv: Restrict TCG-specific prototype declarations

2023-07-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.h | 3 +++ target/riscv/cpu.c | 11 +++ 2 files changed, 14 insertions(+) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 6d78e59214..d2a9764317 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -479,7 +479,

[PATCH v3 11/16] target/riscv: Move sysemu-specific debug files to target/riscv/sysemu/

2023-07-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.h| 2 +- target/riscv/{ => sysemu}/debug.h | 0 target/riscv/cpu_helper.c | 2 +- target/riscv/{ => sysemu}/debug.c | 0 target/riscv/meson.build | 4 target/riscv/sysemu/meson.build | 1 + 6 files

[PATCH v3 12/16] target/riscv: Expose riscv_cpu_pending_to_irq() from cpu_helper.c

2023-07-11 Thread Philippe Mathieu-Daudé
We want to extract TCG/sysemu-specific code from cpu_helper.c, but some functions call riscv_cpu_pending_to_irq(). Expose the prototype in "internals.h". Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/internals.h | 4 target/riscv/cpu_helper.c | 6 +++--- 2 files changed, 7 inserti

Re: [PATCH] migration/calc-dirty-rate: millisecond precision period

2023-07-11 Thread gudkov . andrei--- via
On Thu, Jul 06, 2023 at 03:23:43PM -0400, Peter Xu wrote: > On Thu, Jun 29, 2023 at 11:59:03AM +0300, Andrei Gudkov wrote: > > Introduces alternative argument calc-time-ms, which is the > > the same as calc-time but accepts millisecond value. > > Millisecond precision allows to make predictions whe

Re: [PATCH] hw/intc/loongarch_pch: fix edge triggered irq handling

2023-07-11 Thread Song Gao
在 2023/7/7 下午5:15, Bibo Mao 写道: For edge triggered irq, qemu_irq_pulse is used to inject irq. It will set irq with high level and low level soon to simluate pulse irq. For edge triggered irq, irq is injected and set as pending at rising level, do not clear irq at lowering level. LoongArch pch

Re: [PATCH 1/1] linux-headers: update to v6.5-rc1

2023-07-11 Thread Anthony Krowiak
For the vfio-ap bus driver IRQ index mapping: Reviewed-by: Tony Krowiak On 7/9/23 5:23 PM, Cédric Le Goater wrote: Signed-off-by: Cédric Le Goater --- include/standard-headers/drm/drm_fourcc.h | 43 ++ include/standard-headers/linux/const.h| 2 +- include/standard-head

[PATCH v2 1/3] tests/lcitool: Generate distribution packages list in JSON format

2023-07-11 Thread Philippe Mathieu-Daudé
Add the generate_pkglist() helper to generate a list of packages required by a distribution to build QEMU. Generate the FreeBSD JSON file (based on FreeBSD 13). Suggested-by: Erik Skultety Signed-off-by: Philippe Mathieu-Daudé --- tests/lcitool/refresh | 11 +++ 1 file changed, 11 inse

[PATCH v2 0/3] tests/vm/freebsd: Get up-to-date package list from lcitool

2023-07-11 Thread Philippe Mathieu-Daudé
Inspired by this patch from Thomas: https://lore.kernel.org/qemu-devel/20230531090415.40421-1-th...@redhat.com/ Instead of updating the package list manually, use lcitool vars file. Since v1: - Addressed Erik & Daniel comments (generate in JSON) Philippe Mathieu-Daudé (3): tests/lcitool: Gener

[PATCH v2 3/3] tests/vm/freebsd: Get up-to-date package list from lcitool vars file

2023-07-11 Thread Philippe Mathieu-Daudé
Get an up-to-date package list from lcitool, that way we don't need to manually keep this array in sync. Inspired-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé --- tests/vm/Makefile.include | 2 ++ tests/vm/freebsd | 42 ++- 2 files changed,

[PATCH v2 2/3] tests/vm: Introduce get_qemu_packages_from_lcitool_json() helper

2023-07-11 Thread Philippe Mathieu-Daudé
Add the get_qemu_packages_from_lcitool_json() helper which return such package list from a lcitool env var file in JSON format. Suggested-by: Daniel P. Berrangé Signed-off-by: Philippe Mathieu-Daudé --- tests/vm/Makefile.include | 4 tests/vm/basevm.py| 9 + 2 files changed

Re: [PATCH v2 1/3] tests/lcitool: Generate distribution packages list in JSON format

2023-07-11 Thread Daniel P . Berrangé
On Tue, Jul 11, 2023 at 04:01:41PM +0200, Philippe Mathieu-Daudé wrote: > Add the generate_pkglist() helper to generate a list of packages > required by a distribution to build QEMU. > > Generate the FreeBSD JSON file (based on FreeBSD 13). > > Suggested-by: Erik Skultety > Signed-off-by: Philip

Re: [PATCH v2 3/3] tests/vm/freebsd: Get up-to-date package list from lcitool vars file

2023-07-11 Thread Daniel P . Berrangé
On Tue, Jul 11, 2023 at 04:01:43PM +0200, Philippe Mathieu-Daudé wrote: > Get an up-to-date package list from lcitool, that way we > don't need to manually keep this array in sync. > > Inspired-by: Thomas Huth > Signed-off-by: Philippe Mathieu-Daudé > --- > tests/vm/Makefile.include | 2 ++ >

Re: [PATCH v2 2/3] tests/vm: Introduce get_qemu_packages_from_lcitool_json() helper

2023-07-11 Thread Daniel P . Berrangé
On Tue, Jul 11, 2023 at 04:01:42PM +0200, Philippe Mathieu-Daudé wrote: > Add the get_qemu_packages_from_lcitool_json() helper which return > such package list from a lcitool env var file in JSON format. > > Suggested-by: Daniel P. Berrangé > Signed-off-by: Philippe Mathieu-Daudé > --- > tests/

Re: [PATCH v2 2/3] tests/vm: Introduce get_qemu_packages_from_lcitool_json() helper

2023-07-11 Thread Philippe Mathieu-Daudé
On 11/7/23 16:08, Daniel P. Berrangé wrote: On Tue, Jul 11, 2023 at 04:01:42PM +0200, Philippe Mathieu-Daudé wrote: Add the get_qemu_packages_from_lcitool_json() helper which return such package list from a lcitool env var file in JSON format. Suggested-by: Daniel P. Berrangé Signed-off-by: Ph

Re: [PATCH v3 0/7] virtio-mem: Device unplug support

2023-07-11 Thread Mario Casquero
This series has been successfully tested by QE. Start a VM, plug a virtio-mem device, resize the device (adding memory) and verify that the virtio-mem device cannot be unplugged. Finally, resize the device (removing all the memory) and check that it can be unplugged seamlessly. Tested-by: Mario Ca

[PATCH] s390x: Fix QEMU abort by selecting S390_FLIC_KVM

2023-07-11 Thread Cédric Le Goater
If QEMU is built with --without-default-devices, the s390-flic-kvm device is missing and QEMU aborts when started with the KVM accelerator. Make sure it's available by selecting S390_FLIC_KVM in Kconfig. Consequently, this also fixes an abort in tests/qtest/migration-test. Signed-off-by: Cédric L

Re: [PATCH v2 1/3] tests/lcitool: Generate distribution packages list in JSON format

2023-07-11 Thread Philippe Mathieu-Daudé
On 11/7/23 16:01, Philippe Mathieu-Daudé wrote: Add the generate_pkglist() helper to generate a list of packages required by a distribution to build QEMU. Generate the FreeBSD JSON file (based on FreeBSD 13). Suggested-by: Erik Skultety Signed-off-by: Philippe Mathieu-Daudé --- tests/lcitoo

[PATCH v3 3/4] tests/vm: Introduce get_qemu_packages_from_lcitool_json() helper

2023-07-11 Thread Philippe Mathieu-Daudé
Add the get_qemu_packages_from_lcitool_json() helper which return such package list from a lcitool env var file in JSON format. Suggested-by: Daniel P. Berrangé Signed-off-by: Philippe Mathieu-Daudé --- tests/vm/basevm.py | 11 +++ 1 file changed, 11 insertions(+) diff --git a/tests/vm

[PATCH v3 2/4] tests/lcitool: Refresh generated files

2023-07-11 Thread Philippe Mathieu-Daudé
Refresh the generated files by running: $ make lcitool-refresh Signed-off-by: Philippe Mathieu-Daudé --- tests/docker/dockerfiles/debian-amd64.docker | 2 - tests/docker/dockerfiles/ubuntu2004.docker | 2 - tests/docker/dockerfiles/ubuntu2204.docker | 2 - tests/vm/generated/freebsd.js

[PATCH v3 0/4] tests/vm/freebsd: Get up-to-date package list from lcitool

2023-07-11 Thread Philippe Mathieu-Daudé
Inspired by this patch from Thomas: https://lore.kernel.org/qemu-devel/20230531090415.40421-1-th...@redhat.com/ Instead of updating the package list manually, use lcitool vars file. Since v2: - Commit generated json (Daniel) Since v1: - Addressed Erik & Daniel comments (generate in JSON) Philip

[PATCH v3 4/4] tests/vm/freebsd: Get up-to-date package list from lcitool vars file

2023-07-11 Thread Philippe Mathieu-Daudé
Get an up-to-date package list from lcitool, that way we don't need to manually keep this array in sync. Inspired-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé --- tests/vm/freebsd | 42 ++ 1 file changed, 2 insertions(+), 40 deletions(-) diff --

[PATCH v3 1/4] tests/lcitool: Generate distribution packages list in JSON format

2023-07-11 Thread Philippe Mathieu-Daudé
Add the generate_pkglist() helper to generate a list of packages required by a distribution to build QEMU. Since we can not add a "THIS FILE WAS AUTO-GENERATED" comment in JSON, create the files under tests/vm/generated/ sub-directory; add a README mentioning the files are generated. Suggested-by

Re: [PATCH] s390x: Fix QEMU abort by selecting S390_FLIC_KVM

2023-07-11 Thread Philippe Mathieu-Daudé
On 11/7/23 16:34, Cédric Le Goater wrote: If QEMU is built with --without-default-devices, the s390-flic-kvm device is missing and QEMU aborts when started with the KVM accelerator. Make sure it's available by selecting S390_FLIC_KVM in Kconfig. Consequently, this also fixes an abort in tests/qt

[PATCH v2] s390x: Fix QEMU abort by selecting S390_FLIC_KVM

2023-07-11 Thread Cédric Le Goater
If QEMU is built with --without-default-devices, the s390-flic-kvm device is missing and QEMU aborts when started with the KVM accelerator. Make sure it's available by selecting S390_FLIC_KVM in Kconfig. Consequently, this also fixes an abort in tests/qtest/migration-test. Signed-off-by: Cédric L

Re: [PATCH v3 1/4] tests/lcitool: Generate distribution packages list in JSON format

2023-07-11 Thread Daniel P . Berrangé
On Tue, Jul 11, 2023 at 04:49:19PM +0200, Philippe Mathieu-Daudé wrote: > Add the generate_pkglist() helper to generate a list of packages > required by a distribution to build QEMU. > > Since we can not add a "THIS FILE WAS AUTO-GENERATED" comment in > JSON, create the files under tests/vm/genera

Re: [PATCH v3 0/7] virtio-mem: Device unplug support

2023-07-11 Thread David Hildenbrand
On 11.07.23 16:19, Mario Casquero wrote: Tested-by: Mario Casquero Thanks a lot Mario! -- Cheers, David / dhildenb

[PATCH-for-8.1] linux-user/arm: Do not allocate a commpage at all for M-profile CPUs

2023-07-11 Thread Philippe Mathieu-Daudé
Since commit fbd3c4cff6 ("linux-user/arm: Mark the commpage executable") executing bare-metal (linked with rdimon.specs) cortex-M code fails as: $ qemu-arm -cpu cortex-m3 ~/hello.exe.m3 qemu-arm: ../../accel/tcg/user-exec.c:492: page_set_flags: Assertion `last <= GUEST_ADDR_MAX' failed. Abo

[PATCH v4 2/7] pc: Factor out (un)plug handling of virtio-md-pci devices

2023-07-11 Thread David Hildenbrand
Let's factor out (un)plug handling, to be reused from arm/virt code. Provide stubs for the case that CONFIG_VIRTIO_MD is not selected because neither virtio-mem nor virtio-pmem is enabled. While this cannot currently happen for x86, it will be possible for arm/virt. Tested-by: Mario Casquero Sig

[PATCH v4 1/7] virtio-md-pci: New parent type for virtio-mem-pci and virtio-pmem-pci

2023-07-11 Thread David Hildenbrand
Let's add a new abstract "virtio memory device" type, and use it as parent class of virtio-mem-pci and virtio-pmem-pci. Tested-by: Mario Casquero Signed-off-by: David Hildenbrand --- MAINTAINERS | 6 ++ hw/virtio/Kconfig | 8 +-- hw/virtio/meson.b

[PATCH v4 6/7] virtio-mem: Prepare for device unplug support

2023-07-11 Thread David Hildenbrand
In many cases, blindly unplugging a virtio-mem device is problematic. We can only safely remove a device once: * The guest is not expecting to be able to read unplugged memory (unplugged-inaccessible == on) * The virtio-mem device does not have memory plugged (size == 0) * The virtio-mem device d

[PATCH v4 4/7] virtio-md-pci: Handle unplug of virtio based memory devices

2023-07-11 Thread David Hildenbrand
While we fence unplug requests from the outside, the VM can still trigger unplug of virtio based memory devices, for example, in Linux doing on a virtio-mem-pci device: # echo 0 > /sys/bus/pci/slots/3/power While doing that is not really expected to work without harming the guest OS (e.g., rem

[PATCH v4 3/7] arm/virt: Use virtio-md-pci (un)plug functions

2023-07-11 Thread David Hildenbrand
Let's use our new helper functions. Note that virtio-pmem-pci is not enabled for arm and, therefore, not compiled in. Tested-by: Mario Casquero Signed-off-by: David Hildenbrand --- hw/arm/virt.c | 81 --- 1 file changed, 12 insertions(+), 69 delet

[PATCH v4 5/7] virtio-md-pci: Support unplug requests for compatible devices

2023-07-11 Thread David Hildenbrand
Let's support unplug requests for virtio-md-pci devices that provide a unplug_request_check() callback. We'll wire that up for virtio-mem-pci next. Tested-by: Mario Casquero Signed-off-by: David Hildenbrand --- hw/virtio/virtio-md-pci.c | 38 +-- include/hw/

[PATCH v4 0/7] virtio-mem: Device unplug support

2023-07-11 Thread David Hildenbrand
One limitation of virtio-mem is that we cannot currently unplug virtio-mem devices that have all memory unplugged from the VM. Let's properly handle forced unplug (as can be triggered by the VM) and add support for ordinary unplug (requests) of virtio-mem devices that are in a compatible state (no

Re: [PATCH v4 0/7] virtio-mem: Device unplug support

2023-07-11 Thread Michael S. Tsirkin
On Tue, Jul 11, 2023 at 05:34:38PM +0200, David Hildenbrand wrote: > One limitation of virtio-mem is that we cannot currently unplug virtio-mem > devices that have all memory unplugged from the VM. > > Let's properly handle forced unplug (as can be triggered by the VM) and > add support for ordina

Re: [PATCH v4 0/7] virtio-mem: Device unplug support

2023-07-11 Thread David Hildenbrand
On 11.07.23 17:37, Michael S. Tsirkin wrote: On Tue, Jul 11, 2023 at 05:34:38PM +0200, David Hildenbrand wrote: One limitation of virtio-mem is that we cannot currently unplug virtio-mem devices that have all memory unplugged from the VM. Let's properly handle forced unplug (as can be triggered

[PATCH v4 7/7] virtio-mem-pci: Device unplug support

2023-07-11 Thread David Hildenbrand
Let's support device unplug by forwarding the unplug_request_check() callback to the virtio-mem device. Further, disallow changing the requested-size once an unplug request is pending. Disallowing requested-size changes handles corner cases such as (1) pausing the VM (2) requesting device unplug

[PATCH 3/6] vhost: Do not reset suspended devices on stop

2023-07-11 Thread Hanna Czenczek
Move the `suspended` field from vhost_vdpa into the global vhost_dev struct, so vhost_dev_stop() can check whether the back-end has been suspended by `vhost_ops->vhost_dev_start(hdev, false)`. If it has, there is no need to reset it; the reset is just a fall-back to stop device operations for back

[PATCH 0/6] vhost-user: Add suspend/resume

2023-07-11 Thread Hanna Czenczek
Hi, As discussed on the previous version of the virtio-fs migration series (https://lists.nongnu.org/archive/html/qemu-devel/2023-04/msg01575.html), we currently don’t have a good way to have a vhost-user back-end fully cease all operations, including background operations. To work around this, w

[PATCH 1/6] vhost-user.rst: Add suspend/resume

2023-07-11 Thread Hanna Czenczek
When stopping the VM, qemu wants all devices to fully cease any operation, too. Currently, we can only have vhost-user back-ends stop processing vrings, but not background operations. Add the SUSPEND and RESUME commands from vDPA, which allow the front-end (qemu) to tell back-ends to cease all op

[PATCH 4/6] vhost-user: Implement suspend/resume

2023-07-11 Thread Hanna Czenczek
Implement SUSPEND/RESUME like vDPA does, by automatically using it in vhost_user_dev_start(). (Though our vDPA code does not implement RESUME yet, so there, the device is reset when it is to be resumed.) Signed-off-by: Hanna Czenczek --- hw/virtio/vhost-user.c | 99 +

[PATCH 6/6] vhost-user: Have reset_status fall back to reset

2023-07-11 Thread Hanna Czenczek
The only user of vhost_user_reset_status() is vhost_dev_stop(), which only uses it as a fall-back to stop the back-end if it does not support SUSPEND. However, vhost-user's implementation is a no-op unless the back-end supports SET_STATUS. vhost-vdpa's implementation instead just calls vhost_vdpa

[PATCH 5/6] vhost-vdpa: Match vhost-user's status reset

2023-07-11 Thread Hanna Czenczek
vhost-vdpa and vhost-user differ in how they reset the status in their respective vhost_reset_status implementations: vhost-vdpa zeroes it, then re-adds the S_ACKNOWLEDGE and S_DRIVER config bits. S_DRIVER_OK is then set in vhost_vdpa_dev_start(). vhost-user in contrast just zeroes the status, an

[PATCH 2/6] vhost-vdpa: Move vhost_vdpa_reset_status() up

2023-07-11 Thread Hanna Czenczek
The next commit is going to have vhost_vdpa_dev_start() call this, so move it up to have the declaration where we are going to need it. Signed-off-by: Hanna Czenczek --- hw/virtio/vhost-vdpa.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/v

[hotfix PATCH-for-8.1 v5] configure: Fix cross-building for RISCV host

2023-07-11 Thread Philippe Mathieu-Daudé
While when building on native Linux the host architecture is reported as "riscv32" or "riscv64": Host machine cpu family: riscv64 Host machine cpu: riscv64 Found pkg-config: /usr/bin/pkg-config (0.29.2) Since commit ba0e733362 ("configure: Merge riscv32 and riscv64 host architectures"), whe

Re: [PATCH v2] s390x: Fix QEMU abort by selecting S390_FLIC_KVM

2023-07-11 Thread Philippe Mathieu-Daudé
On 11/7/23 17:14, Cédric Le Goater wrote: If QEMU is built with --without-default-devices, the s390-flic-kvm device is missing and QEMU aborts when started with the KVM accelerator. Make sure it's available by selecting S390_FLIC_KVM in Kconfig. Consequently, this also fixes an abort in tests/qt

Re: [hotfix PATCH-for-8.1 v4] configure: Fix cross-building for RISCV host

2023-07-11 Thread Richard Henderson
On 7/11/23 12:06, Philippe Mathieu-Daudé wrote: While when building on native Linux the host architecture is reported as "riscv32" or "riscv64": Host machine cpu family: riscv64 Host machine cpu: riscv64 Found pkg-config: /usr/bin/pkg-config (0.29.2) Since commit ba0e733362 ("configure

Re: [PULL 02/22] accel/tcg/translate-all.c: Widen pc and cs_base

2023-07-11 Thread Peter Maydell
On Mon, 26 Jun 2023 at 16:40, Richard Henderson wrote: > > From: Anton Johansson > > Signed-off-by: Anton Johansson > Reviewed-by: Richard Henderson > Message-Id: <20230621135633.1649-3-a...@rev.ng> > Signed-off-by: Richard Henderson > --- > @@ -634,10 +634,10 @@ void cpu_io_recompile(CPUStat

Re: [PULL 06/22] accel/tcg/cpu-exec.c: Widen pc to vaddr

2023-07-11 Thread Peter Maydell
On Mon, 26 Jun 2023 at 16:48, Richard Henderson wrote: > > From: Anton Johansson > > Signed-off-by: Anton Johansson > Reviewed-by: Richard Henderson > Message-Id: <20230621135633.1649-7-a...@rev.ng> > Signed-off-by: Richard Henderson > -static void log_cpu_exec(target_ulong pc, CPUState *cpu

Re: [PULL 32/52] exec-all: Widen TranslationBlock pc and cs_base to 64-bits

2023-07-11 Thread Peter Maydell
On Mon, 5 Jun 2023 at 21:27, Richard Henderson wrote: > > This makes TranslationBlock agnostic to the address size of the guest. > Use vaddr for pc, since that's always a virtual address. > Use uint64_t for cs_base, since usage varies between guests. > index 60ca9e229e..1cf4f1fa22 100644 > --- a/

riscv kvm breakage

2023-07-11 Thread Richard Henderson
Hiya, This breakage crept in while cross-riscv64-system was otherwise broken in configure: https://gitlab.com/qemu-project/qemu/-/jobs/4633277557#L4165 ../target/riscv/kvm.c:209:38: error: ‘KVM_RISCV_ISA_EXT_ZICBOZ’ undeclared here (not in a function); did you mean ‘KVM_RISCV_ISA_EXT_ZICBOM’?

Re: riscv kvm breakage

2023-07-11 Thread Philippe Mathieu-Daudé
On 11/7/23 18:43, Richard Henderson wrote: Hiya, This breakage crept in while cross-riscv64-system was otherwise broken in configure: https://gitlab.com/qemu-project/qemu/-/jobs/4633277557#L4165 ../target/riscv/kvm.c:209:38: error: ‘KVM_RISCV_ISA_EXT_ZICBOZ’ undeclared here (not in a functi

Re: riscv kvm breakage

2023-07-11 Thread Palmer Dabbelt
On Tue, 11 Jul 2023 09:43:48 PDT (-0700), Richard Henderson wrote: Hiya, This breakage crept in while cross-riscv64-system was otherwise broken in configure: https://gitlab.com/qemu-project/qemu/-/jobs/4633277557#L4165 ../target/riscv/kvm.c:209:38: error: ‘KVM_RISCV_ISA_EXT_ZICBOZ’ undeclared

[PATCH for-8.1] accel/tcg: Zero-pad PC in TCG CPU exec trace lines

2023-07-11 Thread Peter Maydell
In commit f0a08b0913befbd we changed the type of the PC from target_ulong to vaddr. In doing so we inadvertently dropped the zero-padding on the PC in trace lines (the second item inside the [] in these lines). They used to look like this on AArch64, for instance: Trace 0: 0x7f226100 [00

Re: [PATCH 1/3] block: add subcluster_size field to BlockDriverInfo

2023-07-11 Thread Denis V. Lunev
On 6/26/23 18:08, Andrey Drobyshev wrote: This is going to be used in the subsequent commit as requests alignment (in particular, during copy-on-read). This value only makes sense for the formats which support subclusters (currently QCOW2 only). If this field isn't set by driver's own bdrv_get_

  1   2   >