[PATCH] include/hw/riscv/sifive_e.h: Fix the type of parent_obj of SiFiveEState.

2022-08-19 Thread Tommy Wu
Fix the type of parent_obj of SiFiveEState from 'SysBusDevice' to 'MachineState'. Because the parent of SiFiveEState is 'MachineState'. Signed-off-by: Tommy Wu --- include/hw/riscv/sifive_e.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/riscv/sifive_e.h b/includ

Re: [PATCH v2] hw/i386: place setup_data at fixed place in memory

2022-08-19 Thread Ard Biesheuvel
On Fri, 19 Aug 2022 at 08:41, Gerd Hoffmann wrote: > > On Thu, Aug 18, 2022 at 05:38:37PM +0200, Jason A. Donenfeld wrote: > > Hey Gerd, > > > > > Joining the party late (and still catching up the thread). Given we > > > don't need that anyway with EFI, only with legacy BIOS: Can't that just > >

Re: [PATCH for-7.2 2/2] ppc/pnv: fix QOM parenting of user creatable root ports

2022-08-19 Thread Cédric Le Goater
On 8/19/22 00:45, Daniel Henrique Barboza wrote: User creatable root ports are being parented by the 'peripheral' or the 'peripheral-anon' container. This happens because this is the regular QOM schema for sysbus devices that are added via the command line. Let's make this QOM hierarchy similar

Re: [RFC PATCH v2 4/8] qapi: golang: Generate qapi's union types in Go

2022-08-19 Thread Victor Toso
Hi, On Wed, Aug 17, 2022 at 06:25:56PM +0200, Victor Toso wrote: > On Wed, Jul 06, 2022 at 10:48:06AM +0100, Daniel P. Berrangé wrote: > > On Wed, Jul 06, 2022 at 10:37:54AM +0100, Daniel P. Berrangé wrote: > > > On Wed, Jul 06, 2022 at 04:28:16AM -0500, Andrea Bolognani wrote: > > > > You're righ

[PATCH v2] target/riscv: Use official extension names for AIA CSRs

2022-08-19 Thread Anup Patel
The arch review of AIA spec is completed and we now have official extension names for AIA: Smaia (M-mode AIA CSRs) and Ssaia (S-mode AIA CSRs). Refer, section 1.6 of the latest AIA v0.3.1 stable specification at https://github.com/riscv/riscv-aia/releases/download/0.3.1-draft.32/riscv-interrupts-0

Re: [PATCH v2] ci: Upgrade msys2 release to 20220603

2022-08-19 Thread Thomas Huth
On 16/08/2022 20.53, 罗勇刚(Yonggang Luo) wrote: I have reason to think that's msys2-64 bit failed because out of memory I tried to show the memory size of the windows docker, it's result are 6224352KB, that's less than 6GB? https://gitlab.com/lygstate/qemu/-/jobs/2891399652

Re: [RFC 5/8] vdpa: Add vdpa memory listener

2022-08-19 Thread Eugenio Perez Martin
On Fri, Aug 19, 2022 at 8:29 AM Jason Wang wrote: > > On Thu, Aug 11, 2022 at 2:42 AM Eugenio Pérez wrote: > > > > This enable net/vdpa to restart the full device when a migration is > > started or stopped. > > > > Signed-off-by: Eugenio Pérez > > I have the following questions > > 1) any reason

Re: [PULL 1/3] linux-user: un-parent OBJECT(cpu) when closing thread

2022-08-19 Thread Alex Bennée
Richard Henderson writes: > On 8/16/22 05:26, Alex Bennée wrote: >> While forcing the CPU to unrealize by hand does trigger the clean-up >> code we never fully free resources because refcount never reaches >> zero. This is because QOM automatically added objects without an >> explicit parent to

Re: [BUG] cxl can not create region

2022-08-19 Thread Jonathan Cameron via
On Thu, 18 Aug 2022 17:37:40 +0100 Jonathan Cameron via wrote: > On Wed, 17 Aug 2022 17:16:19 +0100 > Jonathan Cameron wrote: > > > On Thu, 11 Aug 2022 17:46:55 -0700 > > Dan Williams wrote: > > > > > Dan Williams wrote: > > > > Bobo WL wrote: > > > > > Hi Dan, > > > > > > > > >

Re: [RFC 5/8] vdpa: Add vdpa memory listener

2022-08-19 Thread Jason Wang
On Fri, Aug 19, 2022 at 4:30 PM Eugenio Perez Martin wrote: > > On Fri, Aug 19, 2022 at 8:29 AM Jason Wang wrote: > > > > On Thu, Aug 11, 2022 at 2:42 AM Eugenio Pérez wrote: > > > > > > This enable net/vdpa to restart the full device when a migration is > > > started or stopped. > > > > > > Sig

Re: [PATCH for-7.2 2/2] ppc/pnv: fix QOM parenting of user creatable root ports

2022-08-19 Thread Daniel Henrique Barboza
On 8/19/22 04:19, Cédric Le Goater wrote: On 8/19/22 00:45, Daniel Henrique Barboza wrote: User creatable root ports are being parented by the 'peripheral' or the 'peripheral-anon' container. This happens because this is the regular QOM schema for sysbus devices that are added via the command

[PULL 1/1] kvm: fix segfault with query-stats-schemas and -M none

2022-08-19 Thread Paolo Bonzini
-M none creates a guest without a vCPU, causing the following error: $ ./qemu-system-x86_64 -qmp stdio -M none -accel kvm {execute:qmp_capabilities} {"return": {}} {execute: query-stats-schemas} Segmentation fault (core dumped) Fix it by not querying the vCPU stats if first_cpu is NULL. Signed-o

Re: [PATCH 7/7] target/riscv: Honour -semihosting-config userspace=on and enable=on

2022-08-19 Thread Peter Maydell
On Fri, 19 Aug 2022 at 01:55, Alistair Francis wrote: > > On Thu, Aug 18, 2022 at 11:58 PM Peter Maydell > wrote: > > Do you have an opinion on whether there are likely to be many > > users who are using riscv semihosting without explicitly enabling it > > on the command line ? > > I don't think

[PULL 0/1] query-stats-schemas crash fix for QEMU 7.1

2022-08-19 Thread Paolo Bonzini
The following changes since commit c7208a6e0d049f9e8af15df908168a79b1f99685: Update version for v7.1.0-rc3 release (2022-08-16 20:45:19 -0500) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to fetch changes up to a9197ad2101cfc885cc316a

Re: [PATCH v7 04/12] multifd: Count the number of bytes sent correctly

2022-08-19 Thread Juan Quintela
Leonardo Brás wrote: > On Tue, 2022-08-02 at 08:38 +0200, Juan Quintela wrote: >> Current code asumes that all pages are whole. That is not true for >> example for compression already. Fix it for creating a new field >> ->sent_bytes that includes it. >> >> All ram_counters are used only from th

Re: [PATCH for-7.2 v2 10/20] hw/ppc: set machine->fdt in spapr machine

2022-08-19 Thread Daniel Henrique Barboza
On 8/18/22 23:11, Alexey Kardashevskiy wrote: On 05/08/2022 19:39, Daniel Henrique Barboza wrote: The pSeries machine never bothered with the common machine->fdt attribute. We do all the FDT related work using spapr->fdt_blob. We're going to introduce HMP commands to read and save the FDT,

[PATCH for-7.2 v2 1/2] ppc/pnv: consolidate pnv_parent_*_fixup() helpers

2022-08-19 Thread Daniel Henrique Barboza
We have 2 helpers that amends the QOM and parent bus of a given object, repectively. These 2 helpers are called together, and not by accident. Due to QOM internals, doing an object_unparent() will result in the device being removed from its parent bus. This means that changing the QOM parent requir

[PATCH for-7.2 v2 0/2] ppc/pnv: fix root port QOM parenting

2022-08-19 Thread Daniel Henrique Barboza
Hi, Second version removes pnv_phb_attach_root_port() in patch 2 as suggested by Cedric. The patches are based on ppc-7.2: https://gitlab.com/danielhb/qemu/-/tree/ppc-7.2 Changes from v1: - patch 2: - removed pnv_phb_attach_root_port() as suggested by Cedric v1 link: https://lists.gnu.org/ar

Re: [PATCH v7 05/12] migration: Make ram_save_target_page() a pointer

2022-08-19 Thread Juan Quintela
Leonardo Brás wrote: > On Tue, 2022-08-02 at 08:39 +0200, Juan Quintela wrote: >> We are going to create a new function for multifd latest in the series. >> >> Signed-off-by: Juan Quintela >> Reviewed-by: Dr. David Alan Gilbert >> Signed-off-by: Juan Quintela > > Double Signed-off-by again. >

[PATCH for-7.2 v2 2/2] ppc/pnv: fix QOM parenting of user creatable root ports

2022-08-19 Thread Daniel Henrique Barboza
User creatable root ports are being parented by the 'peripheral' or the 'peripheral-anon' container. This happens because this is the regular QOM schema for sysbus devices that are added via the command line. Let's make this QOM hierarchy similar to what we have with default root ports, i.e. the r

Re: [PATCH 0/9] parallels: Refactor the code of images checks and fix a bug

2022-08-19 Thread Denis V. Lunev
On 18.08.2022 17:14, Alexander Ivanov wrote: Fix image inflation when offset in BAT is out of image. Replace whole BAT syncing by flushing only dirty blocks. Move all the checks outside the main check function in separate functions Use WITH_QEMU_LOCK_GUARD for simplier code. v4 changes: M

Re: [PATCH v7 06/12] multifd: Make flags field thread local

2022-08-19 Thread Juan Quintela
Leonardo Brás wrote: > On Tue, 2022-08-02 at 08:39 +0200, Juan Quintela wrote: >> Use of flags with respect to locking was incensistant. For the >> sending side: >> - it was set to 0 with mutex held on the multifd channel. >> - MULTIFD_FLAG_SYNC was set with mutex held on the migration thread. >>

Re: [PATCH] .gitlab-ci.d/buildtest.yml: Increase the check-gprof-gcov job timeout

2022-08-19 Thread Alex Bennée
Thomas Huth writes: > On 18/08/2022 09.07, Alex Bennée wrote: >> Bin Meng writes: >> >>> Current project timeout is 1 hour, but the check-gprof-gcov job never >>> completes within 1 hour. Increase the job timeout to 90 minutes. >> I've tried to do some data mining on this test which seems to

Re: [RFC 5/8] vdpa: Add vdpa memory listener

2022-08-19 Thread Eugenio Perez Martin
On Fri, Aug 19, 2022 at 11:01 AM Jason Wang wrote: > > On Fri, Aug 19, 2022 at 4:30 PM Eugenio Perez Martin > wrote: > > > > On Fri, Aug 19, 2022 at 8:29 AM Jason Wang wrote: > > > > > > On Thu, Aug 11, 2022 at 2:42 AM Eugenio Pérez wrote: > > > > > > > > This enable net/vdpa to restart the ful

[PATCH 0/6] target/arm: Fix v8 AArch32 RAZ ID regs; implement FEAT_ETS

2022-08-19 Thread Peter Maydell
The main aim of this patchset is to implement FEAT_ETS. FEAT_ETS provides tighter guarantees on some memory orderings involving translation table walks that permit guest code to skip the context-synchronization event they would otherwise need to do after a TLB maintenance operation. QEMU already pr

[PATCH 4/6] target/arm: Implement ID_DFR1

2022-08-19 Thread Peter Maydell
In Armv8.6, a new AArch32 ID register ID_DFR1 is defined; implement it. We don't have any CPUs with features that they need to advertise here yet, but plumbing in the ID register gives it the right name when debugging and will help in future when we do add a CPU that has non-zero ID_DFR1 fields. S

[PATCH 2/6] target/arm: Sort KVM reads of AArch32 ID registers into encoding order

2022-08-19 Thread Peter Maydell
The code that reads the AArch32 ID registers from KVM in kvm_arm_get_host_cpu_features() does so almost but not quite in encoding order. Move the read of ID_PFR2 down so it's really in encoding order. Signed-off-by: Peter Maydell --- target/arm/kvm64.c | 4 ++-- 1 file changed, 2 insertions(+),

[PATCH 5/6] target/arm: Advertise FEAT_ETS for '-cpu max'

2022-08-19 Thread Peter Maydell
The architectural feature FEAT_ETS (Enhanced Translation Synchronization) is a set of tightened guarantees about memory ordering involving translation table walks: * if memory access RW1 is ordered-before memory access RW2 then it is also ordered-before any translation table walk generated by

[PATCH 6/6] target/arm: Add missing space in comment

2022-08-19 Thread Peter Maydell
Fix a missing space before a comment terminator. Signed-off-by: Peter Maydell --- target/arm/cpu_tcg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c index f63f8cdd954..b714c61d940 100644 --- a/target/arm/cpu_tcg.c +++ b/target/arm

[PATCH 1/6] target/arm: Make cpregs 0, c0, c{3-15}, {0-7} correctly RAZ in v8

2022-08-19 Thread Peter Maydell
In the AArch32 ID register scheme, coprocessor registers with encoding cp15, 0, c0, c{0-7}, {0-7} are all in the space covered by what in v6 and v7 was called the "CPUID scheme", and are supposed to RAZ if they're not allocated to a specific ID register. For our pre-v8 CPUs we get this right, beca

[PATCH 3/6] target/arm: Implement ID_MMFR5

2022-08-19 Thread Peter Maydell
In Armv8.6 a new AArch32 ID register ID_MMFR5 is defined. Implement this; we want to be able to use it to report to the guest that we implement FEAT_ETS. Signed-off-by: Peter Maydell --- target/arm/cpu.h| 1 + target/arm/helper.c | 4 ++-- target/arm/kvm64.c | 2 ++ 3 files changed, 5 inser

Re: [PATCH v7 07/12] multifd: Prepare to send a packet without the mutex held

2022-08-19 Thread Juan Quintela
Leonardo Brás wrote: > On Tue, 2022-08-02 at 08:39 +0200, Juan Quintela wrote: >> We do the send_prepare() and the fill of the head packet without the >> mutex held. It will help a lot for compression and later in the >> series for zero pages. >> >> Notice that we can use p->pages without holdin

Re: [PATCH for-7.2 v2 2/2] ppc/pnv: fix QOM parenting of user creatable root ports

2022-08-19 Thread Cédric Le Goater
On 8/19/22 11:47, Daniel Henrique Barboza wrote: User creatable root ports are being parented by the 'peripheral' or the 'peripheral-anon' container. This happens because this is the regular QOM schema for sysbus devices that are added via the command line. Let's make this QOM hierarchy similar

Re: [PATCH v7 08/12] multifd: Add capability to enable/disable zero_page

2022-08-19 Thread Juan Quintela
Leonardo Brás wrote: > On Tue, 2022-08-02 at 08:39 +0200, Juan Quintela wrote: >> We have to enable it by default until we introduce the new code. >> >> Signed-off-by: Juan Quintela >> >> --- >> >> Change it to a capability. As capabilities are off by default, have >> to change MULTIFD_ZERO_P

Re: [PATCH 9/9] parallels: Replace qemu_co_mutex_lock by WITH_QEMU_LOCK_GUARD

2022-08-19 Thread Denis V. Lunev
On 18.08.2022 17:14, Alexander Ivanov wrote: Replace the way we use mutex in parallels_co_check() for simplier and less error prone code. Signed-off-by: Alexander Ivanov --- block/parallels.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/blo

Re: [PATCH 6/9] parallels: Move check of cluster outside image to a separate function

2022-08-19 Thread Denis V. Lunev
On 18.08.2022 17:14, Alexander Ivanov wrote: We will add more and more checks so we need a better code structure in parallels_co_check. Let each check performs in a separate loop in a separate helper. s->data_end fix relates to out-of-image check so move it to the helper too. Signed-off-by: Alex

Re: [PATCH 2/9] parallels: Fix data_end field value in parallels_co_check()

2022-08-19 Thread Denis V. Lunev
On 18.08.2022 17:14, Alexander Ivanov wrote: When an image is opened for check there is no error if an offset in the BAT points outside the image. In such a way we can repair the image. Out-of-image offsets are repaired in the check, but data_end field still points outside. Fix this field by file

[PATCH v5 1/3] ui/cocoa: Run qemu_init in the main thread

2022-08-19 Thread Akihiko Odaki
This work is based on: https://patchew.org/QEMU/20220317125534.38706-1-philippe.mathieu.da...@gmail.com/ Simplify the initialization dance by running qemu_init() in the main thread before the Cocoa event loop starts. The secondary thread only runs only qemu_main_loop() and qemu_cleanup(). This fi

[PATCH v5 0/3] ui/cocoa: Run qemu_init in the main thread

2022-08-19 Thread Akihiko Odaki
This work is based on: https://patchew.org/QEMU/20220317125534.38706-1-philippe.mathieu.da...@gmail.com/ Simplify the initialization dance by running qemu_init() in the main thread before the Cocoa event loop starts. The secondary thread only runs only qemu_main_loop() and qemu_cleanup(). This fi

[PATCH v5 3/3] meson: Allow to enable gtk and sdl while cocoa is enabled

2022-08-19 Thread Akihiko Odaki
As ui/cocoa does no longer override main(), ui/gtk and ui/sdl can be enabled even ui/cocoa is enabled. Signed-off-by: Akihiko Odaki Reviewed-by: Peter Maydell Reviewed-by: Paolo Bonzini --- meson.build | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/meson.build b

[PATCH v5 2/3] Revert "main-loop: Disable block backend global state assertion on Cocoa"

2022-08-19 Thread Akihiko Odaki
This reverts commit 47281859f66bdab1974fb122cab2cbb4a1c9af7f. Signed-off-by: Akihiko Odaki Reviewed-by: Emanuele Giuseppe Esposito Reviewed-by: Peter Maydell Reviewed-by: Paolo Bonzini --- include/qemu/main-loop.h | 13 - 1 file changed, 13 deletions(-) diff --git a/include/qemu/

Re: Using Unicamp's Minicloud for the QEMU CI

2022-08-19 Thread Alex Bennée
Peter Maydell writes: > On Thu, 18 Aug 2022 at 17:11, Lucas Mateus Martins Araujo e Castro > wrote: >> Lucas wrote: >>> I would like gauge the interest in using Minicloud's infrastructure[1] >>> for the CI, talking with some people from there they are interested. >>> It has both ppc64 and pp64

Re: [RFC PATCH 03/13] target/ppc: move interrupt masking out of ppc_hw_interrupt

2022-08-19 Thread Fabiano Rosas
"Matheus K. Ferst" writes: > On 15/08/2022 17:09, Fabiano Rosas wrote: >> Matheus Ferst writes: >> >>> Move the interrupt masking logic to a new method, ppc_pending_interrupt, >>> and only handle the interrupt processing in ppc_hw_interrupt. >>> >>> Signed-off-by: Matheus Ferst >>> --- >>> t

[PULL for 7.1] Fix proberi instruction for qemu-hppa-user

2022-08-19 Thread Helge Deller
Peter & Richard, would you please pull this one-line fix for target-hppa ? It fixes a mistranslation of the "proberi" hppa assembler instruction when run as linux-user. Without the fix many debian packages won't build in a hppa-chroot. There is no need to extend the release cycle of qemu-7.1 due

Re: [PULL 1/3] linux-user: un-parent OBJECT(cpu) when closing thread

2022-08-19 Thread Richard Henderson
On 8/19/22 01:37, Alex Bennée wrote: This has caused a regression in arm/aarch64. We hard-code ARMCPRegInfo pointers into TranslationBlocks, for calling into helper_{get,set}cp_reg{,64}. So we have a race condition between whichever cpu thread translates the code first (encoding the pointer), a

Re: [PATCH v2] target/riscv: Use official extension names for AIA CSRs

2022-08-19 Thread Richard Henderson
On 8/19/22 00:31, Anup Patel wrote: static int aia_hmode(CPURISCVState *env, int csrno) { -if (!riscv_feature(env, RISCV_FEATURE_AIA)) { +CPUState *cs = env_cpu(env); +RISCVCPU *cpu = RISCV_CPU(cs); Better as RISCVCPU *cpu = env_archcpu(env); r~

Re: [RFC PATCH v2 4/8] qapi: golang: Generate qapi's union types in Go

2022-08-19 Thread Andrea Bolognani
On Fri, Aug 19, 2022 at 09:20:52AM +0200, Victor Toso wrote: > > > On Wed, Jul 06, 2022 at 10:37:54AM +0100, Daniel P. Berrangé wrote: > > > > On Wed, Jul 06, 2022 at 04:28:16AM -0500, Andrea Bolognani wrote: > > > > > You're right, that is undesirable. What about something like this? > > > > > > >

[PATCH v2 02/11] chardev/baum: Use definitions to avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé We know 'x * y' will be at most 'X_MAX * Y_MAX' (which is not a big value, it is actually 84). Instead of having the compiler use variable-length array, declare an array able to hold the maximum 'x * y'. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André

[PATCH v2 00/11] misc: Remove variable-length arrays on the stack

2022-08-19 Thread Peter Maydell
This is a resend of a subset of patches from a series that Philippe sent out last year: https://patchew.org/QEMU/20210505211047.1496765-1-phi...@redhat.com/ Basically I just pulled out the patches which: (1) trivially applied on a rebase (2) had got a Reviewed-by: or at least an Acked-by: since

[PATCH v2 03/11] chardev/baum: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Reviewed-by: Samuel Thibault Signed-off-by: Peter Maydell --- chardev/baum.c | 3 ++- 1 file changed, 2 insertions(+)

[PATCH v2 09/11] hw/usb/hcd-ohci: Use definition to avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé The compiler isn't clever enough to figure 'width' is a constant, so help it by using a definitions instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- hw/usb/hcd-ohci.c | 7 --- 1 file changed, 4 ins

[PATCH v2 05/11] hw/net/e1000e_core: Use definition to avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé The compiler isn't clever enough to figure 'min_buf_size' is a constant, so help it by using a definitions instead. Signed-off-by: Philippe Mathieu-Daudé Acked-by: Jason Wang Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- hw/net/e1000e_core.c |

[PATCH v2 01/11] chardev/baum: Replace magic values by X_MAX / Y_MAX definitions

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Replace '84' magic value by the X_MAX definition, and '1' by Y_MAX. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Reviewed-by: Samuel Thibault Signed-off-by: Peter Maydell --- chardev/baum.c | 11 +++ 1 file changed, 7 insertions(+

[PATCH v2 07/11] hw/intc/xics: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson Reviewed-by: Greg Kurz Signed-off-by: Peter Maydell --- hw/intc/xics.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH v2 08/11] hw/i386/multiboot: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Replace the snprintf() call by g_strdup_printf(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- hw/i386/multiboot.c | 5 ++--- 1 fi

[PATCH v2 06/11] hw/ppc/pnv: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Acked-by: David Gibson Signed-off-by: Peter Maydell Reviewed-by: Peter Maydell --- hw/ppc/pnv.c | 4 ++-- hw/ppc/spapr.c |

[PATCH v2 04/11] io/channel-websock: Replace strlen(const_str) by sizeof(const_str) - 1

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé The combined_key[... QIO_CHANNEL_WEBSOCK_GUID_LEN ...] array in qio_channel_websock_handshake_send_res_ok() expands to a call to strlen(QIO_CHANNEL_WEBSOCK_GUID), and the compiler doesn't realize the string is const, so consider combined_key[] being a variable-length

[PATCH v2 10/11] ui/curses: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- ui/curses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/cu

[PATCH v2 11/11] tests/unit/test-vmstate: Avoid dynamic stack allocation

2022-08-19 Thread Peter Maydell
From: Philippe Mathieu-Daudé Use autofree heap allocation instead of variable-length array on the stack. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Peter Maydell --- tests/unit/test-vmstate.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-

Re: [PATCH] esp: Handle CMD_BUSRESET by resetting the SCSI bus

2022-08-19 Thread Paolo Bonzini
Queued, thanks. Paolo

Re: [PATCH v10 18/21] job.c: enable job lock/unlock and remove Aiocontext locks

2022-08-19 Thread Vladimir Sementsov-Ogievskiy
On 8/18/22 10:46, Emanuele Giuseppe Esposito wrote: Am 17/08/2022 um 20:54 schrieb Vladimir Sementsov-Ogievskiy: On 8/16/22 15:52, Emanuele Giuseppe Esposito wrote:    } @@ -501,8 +481,12 @@ void job_unref_locked(Job *job)> assert(!job->txn);      if (job->driver->free) { + 

Re: [PATCH v2] target/arm: Add cortex-a35

2022-08-19 Thread Peter Maydell
On Fri, 19 Aug 2022 at 01:20, Hao Wu wrote: > > Add cortex A35 core and enable it for virt board. > > Signed-off-by: Hao Wu > Reviewed-by: Joe Komlodi Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH 2/2] block: make serializing requests functions 'void'

2022-08-19 Thread Vladimir Sementsov-Ogievskiy
On 8/17/22 11:37, Denis V. Lunev wrote: Return codes of the following functions are never used in the code: * bdrv_wait_serialising_requests_locked * bdrv_wait_serialising_requests * bdrv_make_request_serialising Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Hanna Reitz CC: Stefan Hajnoczi CC

Re: [PATCH 1/2] block: use bdrv_is_sg() helper instead of raw bs->sg reading

2022-08-19 Thread Vladimir Sementsov-Ogievskiy
On 8/17/22 11:37, Denis V. Lunev wrote: I believe that if the helper exists, it must be used always for reading of the value. It breaks expectations in the other case. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Hanna Reitz CC: Stefan Hajnoczi CC: Fam Zheng CC: Ronnie Sahlberg CC: Paolo Bon

Re: [RFC PATCH 06/13] target/ppc: remove embedded interrupts from ppc_pending_interrupt_p9

2022-08-19 Thread Fabiano Rosas
"Matheus K. Ferst" writes: > On 15/08/2022 18:23, Fabiano Rosas wrote: >> Matheus Ferst writes: >> >>> Critical Input, Watchdog Timer, and Fixed Interval Timer are only >>> defined for embedded CPUs. The Programmable Interval Timer is 40x-only. >>> >>> Signed-off-by: Matheus Ferst >>> --- >>>

Re: [PATCH 1/2] scsi: Add buf_len parameter to scsi_req_new()

2022-08-19 Thread Paolo Bonzini
On 8/17/22 07:34, John Millikin wrote: The sigil SCSI_CMD_BUF_LEN_TODO() is used to indicate that the buffer length calculation is TODO it should be replaced by a better value, such as the length of a successful DMA read. Let's just do it right: diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi5

Re: [PATCH 1/2] block: pass OnOffAuto instead of bool to block_acct_setup()

2022-08-19 Thread Vladimir Sementsov-Ogievskiy
On 8/17/22 12:28, Denis V. Lunev wrote: We would have one more place for block_acct_setup() calling, which should not corrupt original value. Signed-off-by: Denis V. Lunev CC: Peter Krempa CC: Markus Armbruster CC: John Snow CC: Kevin Wolf CC: Hanna Reitz CC: Vladimir Sementsov-Ogievskiy

Re: [qemu-web PATCH] Add signing pubkey for python-qemu-qmp package

2022-08-19 Thread Paolo Bonzini
On 8/18/22 18:53, John Snow wrote: Add the pubkey currently used for signing PyPI releases of qemu.qmp to a stable location where it can be referenced by e.g. Fedora RPM specfiles. At present, the key happens to just simply be my own -- but future releases may be signed by a different key. In th

Re: [PATCH v1 0/2] i386: KVM: Fix 'system_reset' failures when vCPU is in VMX root operation

2022-08-19 Thread Paolo Bonzini
On 8/18/22 17:01, Vitaly Kuznetsov wrote: Changes since RFC: - Call kvm_put_msr_feature_control() before kvm_put_sregs2() to achieve the same result [Paolo]. - Add Maxim's R-b to PATCH1. It was discovered that Windows 11 with WSL2 (Hyper-V) enabled guests fail to reboot when QEMU's 'system_res

Re: [PATCH 0/4] Speed up migration tests

2022-08-19 Thread Alex Bennée
Thomas Huth writes: > We are currently facing the problem that the "gcov-gprof" CI jobs > in the gitlab-CI are running way too long - which happens since > the migration-tests have been enabled there recently. > > These patches now speed up the migration tests, so that the > CI job should be fi

Re: [RFC PATCH v2 2/8] qapi: golang: Generate qapi's alternate types in Go

2022-08-19 Thread Andrea Bolognani
On Wed, Aug 17, 2022 at 04:04:19PM +0200, Victor Toso wrote: > On Tue, Jul 05, 2022 at 08:45:06AM -0700, Andrea Bolognani wrote: > > On Fri, Jun 17, 2022 at 02:19:26PM +0200, Victor Toso wrote: > > > func (s *BlockdevRef) UnmarshalJSON(data []byte) error { > > > // Check for json-null first > >

Re: [PULL 0/1] query-stats-schemas crash fix for QEMU 7.1

2022-08-19 Thread Richard Henderson
On 8/19/22 02:12, Paolo Bonzini wrote: The following changes since commit c7208a6e0d049f9e8af15df908168a79b1f99685: Update version for v7.1.0-rc3 release (2022-08-16 20:45:19 -0500) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you to

Python test QMP Server implementation / version reply

2022-08-19 Thread John Snow
Hi Eric: Once upon a time I mentioned writing a QMP server implementation in Python. Now that the dust of the fork has (mostly) settled, I've rebased and uploaded that WIP here: https://gitlab.com/jsnow/python-qemu-qmp/-/commits/create_server/ Tracking issue: https://gitlab.com/qemu-project/pyth

[PATCH 0/7] vDPA shadow virtqueue iova tree fixes.

2022-08-19 Thread Eugenio Pérez
Collection of iova tree fixes detected preparing live migration with real devices and multiqueue. These cannot be triggered in simple setups (vdpa_sim_net, no display, no device reset with different features) but it's possible to trigger them with real devices or if the kernel fails some step like

[PATCH 7/7] vdpa: Use ring hwaddr at vhost_vdpa_svq_unmap_ring

2022-08-19 Thread Eugenio Pérez
Reduce code duplication. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index 07d00f5284..45d6e86b45 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/

[PATCH 2/7] vdpa: do not save failed dma maps in SVQ iova tree

2022-08-19 Thread Eugenio Pérez
If a map fails for whatever reason, it must not be saved in the tree. Otherwise, qemu will try to unmap it in cleanup, leaving to more errors. Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ") Reported-by: Lei Yang Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/

[PATCH 5/7] vdpa: Make SVQ vring unmapping return void

2022-08-19 Thread Eugenio Pérez
Nothing actually reads the return value, but an error in cleaning some entries could cause device stop to abort, making a restart impossible. Better ignore explicitely the return value. Reported-by: Lei Yang Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ") Signed-off-by: Eugenio P

[PATCH 6/7] vhost: Always store new kick fd on vhost_svq_set_svq_kick_fd

2022-08-19 Thread Eugenio Pérez
We can unbind twice a file descriptor if we call twice vhost_svq_set_svq_kick_fd because of this. Since it comes from vhost and not from SVQ, that file descriptor could be a different thing that guest's vhost notifier. Likewise, it can happens the same if a guest start and stop the device multiple

[PATCH 02/20] ppc4xx: Introduce Ppc4xxSdramBank struct

2022-08-19 Thread BALATON Zoltan
Instead of storing sdram bank parameters in unrelated arrays put them in a struct so it's clear they belong to the same bank and simplify the state struct using this bank type. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 49 +- hw/ppc/ppc4xx_devs.c

[PATCH 3/7] util: make a copy of iova_tree_remove_parameter

2022-08-19 Thread Eugenio Pérez
It's convenient to call iova_tree_remove from a map returned from iova_tree_find or iova_tree_find_iova. With the current code this is not possible, since we will free it, and then we will try to search for it again. Fix it making a copy of the argument. Not applying a fixes tag, since there is no

[PATCH 4/7] vdpa: Remove SVQ vring from iova_tree at shutdown

2022-08-19 Thread Eugenio Pérez
Although the device will be reset before usage, the right thing to do is to clean it. Reported-by: Lei Yang Fixes: 34e3c94eda ("vdpa: Add custom IOTLB translations to SVQ") Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-vdpa.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

[PATCH 1/7] vdpa: Skip the maps not in the iova tree

2022-08-19 Thread Eugenio Pérez
Next patch will skip the registering of dma maps that the vdpa device rejects in the iova tree. We need to consider that here or we cause a SIGSEGV accessing result. Reported-by: Lei Yang Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-vdpa.c | 4 1 file changed, 4 i

[PATCH 03/20] ppc4xx_sdram: Get rid of the init RAM hack

2022-08-19 Thread BALATON Zoltan
The do_init parameter of ppc4xx_sdram_init() is used to map memory regions that is normally done by the firmware by programming the SDRAM controller. This is needed when booting a kernel directly from -kernel without a firmware. Do this from board code accesing normal SDRAM controller registers the

[PATCH 04/20] ppc4xx: Use Ppc4xxSdramBank in ppc4xx_sdram_banks()

2022-08-19 Thread BALATON Zoltan
Change ppc4xx_sdram_banks() to take one Ppc4xxSdramBank array instead of the separate arrays and adjust ppc4xx_sdram_init() and ppc440_sdram_init() accordingly as well as machines using these. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc405.h | 4 +--- hw/ppc/ppc405_uc.c | 10 +

[PATCH 06/20] ppc4xx_sdram: Move size check to ppc4xx_sdram_init()

2022-08-19 Thread BALATON Zoltan
Instead of checking if memory size is valid in board code move this check to ppc4xx_sdram_init() as this is a restriction imposed by the SDRAM controller. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc405.h | 2 -- hw/ppc/ppc405_boards.c | 10 -- hw/ppc/ppc405_uc.c | 11 ++--

[PATCH 11/20] ppc440_sdram: Get rid of the init RAM hack

2022-08-19 Thread BALATON Zoltan
Remove the do_init parameter of ppc440_sdram_init and enable SDRAM controller from the board via DCR access instead. Firmware does this so it may not be needed when booting firmware only with -kernel but we enable it unconditionally to preserve previous behaviour. Signed-off-by: BALATON Zoltan --

[PATCH 05/20] ppc440_bamboo: Add missing 4 MiB valid memory size

2022-08-19 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_bamboo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index 2aac8a3fe9..2bd5e41140 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -51,7 +51,7 @@ #define PPC

[PATCH 01/20] ppc440_bamboo: Remove unnecessary memsets

2022-08-19 Thread BALATON Zoltan
In ppc4xx_sdram_init() the struct is allocated with g_new0() so no need to clear its elements. In the bamboo machine init memset can be replaced with array initialiser which is shorter. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_bamboo.c | 6 ++ hw/ppc/ppc4xx_devs.c | 8 ++-- 2 fi

[PATCH 00/20] ppc4xx_sdram QOMify and clean ups

2022-08-19 Thread BALATON Zoltan
Hello, This is based on gitlab.com/danielhb/qemu/tree/ppc-7.2 This is the end of the QOMify series started by Cédric. This series handles the SDRAM controller models to clean them up, QOMify and unify them and at least partially clean up the mess that has accumulated around these in the past. Thi

[PATCH v9 00/12] NIC vhost-vdpa state restore via Shadow CVQ

2022-08-19 Thread Eugenio Pérez
CVQ of net vhost-vdpa devices can be intercepted since the addition of x-svq. The virtio-net device model is updated. The migration was blocked because although the state can be megrated between VMM it was not possible to restore on the destination NIC. This series add support for SVQ to inject ex

[PATCH 10/20] ppc440_sdram: Implement enable bit in the DDR2 SDRAM controller

2022-08-19 Thread BALATON Zoltan
To allow removing the do_init hack we need to improve the DDR2 SDRAM controller model to handle the enable/disable bit that it ignored so far. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 34 -- 1 file changed, 32 insertions(+), 2 deletions(-) diff --gi

[PATCH 08/20] ppc4xx_sdram: Drop extra zeros for readability

2022-08-19 Thread BALATON Zoltan
Constants that are written zero padded for no good reason are hard to read, it's easier to see what is meant if it's just 0 or 1 instead. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc4xx_devs.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff

[PATCH 13/20] ppc4xx_sdram: Rename functions to prevent name clashes

2022-08-19 Thread BALATON Zoltan
Rename functions to avoid name clashes when moving the DDR2 controller model currently called ppc440_sdram to ppc4xx_devs. This also more clearly shows which function belongs to which model. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 69 ++--

[PATCH 09/20] ppc440_sdram: Split off map/unmap of sdram banks for later reuse

2022-08-19 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 3507c35b63..c33f91e134 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -561,26 +561,

[PATCH v9 03/12] vhost: Delete useless read memory barrier

2022-08-19 Thread Eugenio Pérez
As discussed in previous series [1], this memory barrier is useless with the atomic read of used idx at vhost_svq_more_used. Deleting it. [1] https://lists.nongnu.org/archive/html/qemu-devel/2022-07/msg02616.html Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- hw/virtio/vhost-shadow-virt

[PATCH 15/20] ppc440_sdram: QOM'ify

2022-08-19 Thread BALATON Zoltan
Change the ppc440_sdram model to a QOM class derived from the PPC4xx-dcr-device and name it ppc4xx-sdram-ddr2. This is mostly modelling the DDR2 SDRAM controller found in the 460EX (used on the sam460ex board). Newer SoCs (regardless of their PPC core, e.g. 405EX) may have this controller but we on

[PATCH v9 06/12] vhost_net: Add NetClientInfo stop callback

2022-08-19 Thread Eugenio Pérez
Used by the backend to perform actions after the device is stopped. In particular, vdpa net use it to unmap CVQ buffers to the device, cleaning the actions performed in prepare(). Signed-off-by: Eugenio Pérez Acked-by: Jason Wang --- v9: Replace performend by performed in patch message --- inc

[PATCH 07/20] ppc4xx_sdram: QOM'ify

2022-08-19 Thread BALATON Zoltan
Change the ppc4xx_sdram model to a QOM class derived from the PPC4xx-dcr-device and name it ppc4xx-sdram-ddr. This is mostly modelling the DDR SDRAM controller found in the 440EP (used on the bamboo board) but also backward compatible with the older DDR controllers on some 405 SoCs so we also use i

[PATCH 12/20] ppc440_sdram: Rename local variable for readibility

2022-08-19 Thread BALATON Zoltan
Rename local sdram variable in ppc440_sdram_init to s for readibility. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index bd3d60f278..72eb75d

[PATCH 14/20] ppc440_sdram: Move RAM size check to ppc440_sdram_init

2022-08-19 Thread BALATON Zoltan
Move the check for valid memory sizes from board to sdram contrller init. Board now only checks for additinal restrictions imposed by firmware then sdram init checks for valid sizes for SoC. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440.h| 4 ++-- hw/ppc/ppc440_uc.c | 15 +++

  1   2   >