Re: [PATCH v2] target/s390x/tcg: SPX: check validity of new prefix

2022-07-06 Thread Thomas Huth
On 30/06/2022 11.43, Janis Schoetterl-Glausch wrote: According to the architecture, SET PREFIX must try to access the new prefix area and recognize an addressing exception if the area is not accessible. For qemu this check prevents a crash in cpu_map_lowcore after an inaccessible prefix area has

[PATCH v2 1/3] libvduse: Fix the incorrect function name

2022-07-06 Thread Xie Yongji
In vduse_name_is_valid(), we actually check whether the name is invalid or not. So let's change the function name to vduse_name_is_invalid() to match the behavior. Signed-off-by: Xie Yongji Reviewed-by: Markus Armbruster --- subprojects/libvduse/libvduse.c | 6 +++--- 1 file changed, 3 insertio

[PATCH v2 2/3] libvduse: Replace strcpy() with strncpy()

2022-07-06 Thread Xie Yongji
Coverity reported a string overflow issue since we copied "name" to "dev_config->name" without checking the length. This should be a false positive since we already checked the length of "name" in vduse_name_is_invalid(). But anyway, let's replace strcpy() with strncpy() (as a general library, we'd

Re: [PATCH] iotests: fix copy-before-write for macOS and FreeBSD

2022-07-06 Thread Hanna Reitz
On 05.07.22 17:37, Vladimir Sementsov-Ogievskiy wrote: strerror() represents ETIMEDOUT a bit different in Linux and macOS / FreeBSD. Let's support the latter too. Fixes: 9d05a87b77 ("iotests: copy-before-write: add cases for cbw-timeout option") Signed-off-by: Vladimir Sementsov-Ogievskiy ---

[PATCH v2 3/3] libvduse: Pass positive value to strerror()

2022-07-06 Thread Xie Yongji
The value passed to strerror() should be positive. So let's fix it. Fixes: Coverity CID 1490226, 1490223 Signed-off-by: Xie Yongji Reviewed-by: Richard Henderson Reviewed-by: Markus Armbruster --- subprojects/libvduse/libvduse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -

Re: [PATCH v8 05/20] job.c: add job_lock/unlock while keeping job.h intact

2022-07-06 Thread Stefan Hajnoczi
On Tue, Jul 05, 2022 at 10:07:40AM +0200, Emanuele Giuseppe Esposito wrote: > > > Am 05/07/2022 um 09:39 schrieb Stefan Hajnoczi: > > On Wed, Jun 29, 2022 at 10:15:23AM -0400, Emanuele Giuseppe Esposito wrote: > >> +void job_ref(Job *job) > >> +{ > >> +JOB_LOCK_GUARD(); > >> +job_ref_lock

Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates

2022-07-06 Thread Jinhao Fan
at 1:11 AM, Klaus Jensen wrote: > On Jul 5 22:24, Jinhao Fan wrote: >> Add property "ioeventfd" which is enabled by default. When this is >> enabled, updates on the doorbell registers will cause KVM to signal >> an event to the QEMU main loop to handle the doorbell updates. >> Therefore, instead

Re: [PATCH v3 1/1] qga: add command 'guest-get-cpustats'

2022-07-06 Thread Marc-André Lureau
Hi On Wed, Jul 6, 2022 at 1:56 PM zhenwei pi wrote: > > A vCPU thread always reaches 100% utilization when: > - guest uses idle=poll > - disable HLT vm-exit > - enable MWAIT > > Add new guest agent command 'guest-get-cpustats' to get guest CPU > statistics, we can know the guest workload and how

Re: [PATCH] iotests: fix copy-before-write for macOS and FreeBSD

2022-07-06 Thread Vladimir Sementsov-Ogievskiy
On 7/6/22 13:26, Hanna Reitz wrote: On 05.07.22 17:37, Vladimir Sementsov-Ogievskiy wrote: strerror() represents ETIMEDOUT a bit different in Linux and macOS / FreeBSD. Let's support the latter too. Fixes: 9d05a87b77 ("iotests: copy-before-write: add cases for cbw-timeout option") Signed-off-b

Re: [PATCH v4] hw/nvme: Use ioeventfd to handle doorbell updates

2022-07-06 Thread Jinhao Fan
at 2:43 AM, Keith Busch wrote: > On Tue, Jul 05, 2022 at 07:11:36PM +0200, Klaus Jensen wrote: >> On Jul 5 22:24, Jinhao Fan wrote: >>> @@ -1374,7 +1374,14 @@ static void nvme_enqueue_req_completion(NvmeCQueue >>> *cq, NvmeRequest *req) >>> >>> QTAILQ_REMOVE(&req->sq->out_req_list, req, en

Re: [RFC PATCH] qobject: Rewrite implementation of QDict for in-order traversal

2022-07-06 Thread Markus Armbruster
Markus Armbruster writes: > QDict is implemented as a simple hash table of fixed size. Observe: > > * Slow for large n. Not sure this matters. > > * A QDict with n entries takes 4120 + n * 32 bytes on my box. Wastes > space for small n, which is a common case. > > * Order of traversal depend

[PULL 2/2] m68k: virt: pass RNG seed via bootinfo block

2022-07-06 Thread Laurent Vivier
From: "Jason A. Donenfeld" This commit wires up bootinfo's RNG seed attribute so that Linux VMs can have their RNG seeded from the earliest possible time in boot, just like the "rng-seed" device tree property on those platforms. The link contains the corresponding Linux patch. Link: https://lore

[PULL 0/2] M68k for 7.1 patches

2022-07-06 Thread Laurent Vivier
r-7.1-pull-request for you to fetch changes up to a988465d0eb7e2ee31a3679bbe3fbe71681820da: m68k: virt: pass RNG seed via bootinfo block (2022-07-06 12:30:41 +0200) Pull request m68k 20220706 pass RNG seed via boot

[PULL 1/2] m68k: use correct variable name in boot info string macro

2022-07-06 Thread Laurent Vivier
From: "Jason A. Donenfeld" Every time this macro is used, the caller is passing in "parameters_base", so this bug wasn't spotted. But the actual macro variable name is "base", so use that instead. Signed-off-by: Jason A. Donenfeld Reviewed-by: Laurent Vivier Message-Id: <20220625152318.120849-

Re: [RFC PATCH] qobject: Rewrite implementation of QDict for in-order traversal

2022-07-06 Thread Mark Cave-Ayland
On 06/07/2022 12:35, Markus Armbruster wrote: Markus Armbruster writes: QDict is implemented as a simple hash table of fixed size. Observe: * Slow for large n. Not sure this matters. * A QDict with n entries takes 4120 + n * 32 bytes on my box. Wastes space for small n, which is a com

Re: [RFC v1] util/aio: Keep notification disabled as much as possible

2022-07-06 Thread Stefan Hajnoczi
On Fri, Jul 01, 2022 at 05:13:48PM +0800, Chao Gao wrote: > When measuring FIO read performance (cache=writethrough, bs=4k, iodepth=64) in > VMs, we observe ~80K/s notifications (e.g., EPT_MISCONFIG) from guest to qemu. It's not clear to me what caused the frequent poll_set_started(ctx, false) cal

Re: [PATCH v8 08/20] blockjob.h: introduce block_job _locked() APIs

2022-07-06 Thread Emanuele Giuseppe Esposito
Am 05/07/2022 um 17:01 schrieb Vladimir Sementsov-Ogievskiy: > On 6/29/22 17:15, Emanuele Giuseppe Esposito wrote: >> Just as done with job.h, create _locked() functions in blockjob.h > > We modify not only blockjob.h, I'd s/blockjob.h/blockjob/ in subject. > > Also, we start to introduce _loc

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

2022-07-06 Thread Andrea Bolognani
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: > > > func (s *GuestPanicInformation) UnmarshalJSON(data []byte) error { > > > tmp

Re: [PATCH v8 08/20] blockjob.h: introduce block_job _locked() APIs

2022-07-06 Thread Vladimir Sementsov-Ogievskiy
On 7/6/22 15:05, Emanuele Giuseppe Esposito wrote: Am 05/07/2022 um 17:01 schrieb Vladimir Sementsov-Ogievskiy: On 6/29/22 17:15, Emanuele Giuseppe Esposito wrote: Just as done with job.h, create _locked() functions in blockjob.h We modify not only blockjob.h, I'd s/blockjob.h/blockjob/ in

Re: [PATCH v8 08/20] blockjob.h: introduce block_job _locked() APIs

2022-07-06 Thread Emanuele Giuseppe Esposito
Am 06/07/2022 um 14:23 schrieb Vladimir Sementsov-Ogievskiy: > On 7/6/22 15:05, Emanuele Giuseppe Esposito wrote: >> >> >> Am 05/07/2022 um 17:01 schrieb Vladimir Sementsov-Ogievskiy: >>> On 6/29/22 17:15, Emanuele Giuseppe Esposito wrote: Just as done with job.h, create _locked() functions

Re: [PATCH v3 1/1] qga: add command 'guest-get-cpustats'

2022-07-06 Thread Markus Armbruster
Marc-André Lureau writes: > Hi > > On Wed, Jul 6, 2022 at 1:56 PM zhenwei pi wrote: >> >> A vCPU thread always reaches 100% utilization when: >> - guest uses idle=poll >> - disable HLT vm-exit >> - enable MWAIT >> >> Add new guest agent command 'guest-get-cpustats' to get guest CPU >> statistics

Re: [PATCH v8 08/20] blockjob.h: introduce block_job _locked() APIs

2022-07-06 Thread Emanuele Giuseppe Esposito
Am 06/07/2022 um 14:36 schrieb Emanuele Giuseppe Esposito: > > > Am 06/07/2022 um 14:23 schrieb Vladimir Sementsov-Ogievskiy: >> On 7/6/22 15:05, Emanuele Giuseppe Esposito wrote: >>> >>> >>> Am 05/07/2022 um 17:01 schrieb Vladimir Sementsov-Ogievskiy: On 6/29/22 17:15, Emanuele Giuseppe

Re: [PATCH v2 05/15] hw/virtio: add boilerplate for vhost-user-gpio device

2022-07-06 Thread Alex Bennée
Vincent Whitchurch writes: > On Tue, May 24, 2022 at 04:40:46PM +0100, Alex Bennée wrote: >> +static int vu_gpio_start(VirtIODevice *vdev) >> +{ >> +BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev))); >> +VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(qbus); >> +VHostUserGPIO *gpio =

Re: [PATCH] target/ppc/cpu-models: Remove the "default" CPU alias

2022-07-06 Thread Daniel Henrique Barboza
On 7/6/22 03:31, Thomas Huth wrote: On 05/07/2022 17.53, Peter Maydell wrote: On Tue, 5 Jul 2022 at 16:13, Thomas Huth wrote: QEMU emulates a *lot* of PowerPC-based machines - having a CPU that is named "default" and cannot be used with most of those machines sounds just wrong. Thus let's

Re: [RFC v1] util/aio: Keep notification disabled as much as possible

2022-07-06 Thread Chao Gao
On Wed, Jul 06, 2022 at 12:59:29PM +0100, Stefan Hajnoczi wrote: >On Fri, Jul 01, 2022 at 05:13:48PM +0800, Chao Gao wrote: >> When measuring FIO read performance (cache=writethrough, bs=4k, iodepth=64) >> in >> VMs, we observe ~80K/s notifications (e.g., EPT_MISCONFIG) from guest to >> qemu. > >

Re: [PATCH v6 05/13] qapi: net: add stream and dgram netdevs

2022-07-06 Thread Markus Armbruster
Laurent Vivier writes: > Copied from socket netdev file and modified to use SocketAddress > to be able to introduce new features like unix socket. > > "udp" and "mcast" are squashed into dgram netdev, multicast is detected > according to the IP address type. > "listen" and "connect" modes are man

Re: [PATCH] iotests: fix copy-before-write for macOS and FreeBSD

2022-07-06 Thread Vladimir Sementsov-Ogievskiy
On 7/6/22 13:26, Hanna Reitz wrote: On 05.07.22 17:37, Vladimir Sementsov-Ogievskiy wrote: strerror() represents ETIMEDOUT a bit different in Linux and macOS / FreeBSD. Let's support the latter too. Fixes: 9d05a87b77 ("iotests: copy-before-write: add cases for cbw-timeout option") Signed-off-b

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

2022-07-06 Thread Andrea Bolognani
On Tue, Jul 05, 2022 at 05:47:25PM +0100, Daniel P. Berrangé wrote: > On Tue, Jul 05, 2022 at 08:45:54AM -0700, Andrea Bolognani wrote: > > On Fri, Jun 17, 2022 at 02:19:29PM +0200, Victor Toso wrote: > > > func (s *AcpiDeviceOstEvent) GetTimestamp() Timestamp { > > > return s.EventTimestamp >

Re: Adjusting the default ROM option for SEV guests

2022-07-06 Thread Claudio Fontana
Hello all any comment on this one? It seems it would make sense to disable option roms for SEV by default in QEMU, any feedback anyone? Thanks, Claudio On 5/11/22 13:30, Vasily Ulyanov wrote: > Hello QEMU devs, > > Currently to launch an SEV guest there are certain requirements for the VM > c

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

2022-07-06 Thread Daniel P . Berrangé
On Wed, Jul 06, 2022 at 09:53:43AM -0500, Andrea Bolognani wrote: > On Tue, Jul 05, 2022 at 05:47:25PM +0100, Daniel P. Berrangé wrote: > > On Tue, Jul 05, 2022 at 08:45:54AM -0700, Andrea Bolognani wrote: > > > On Fri, Jun 17, 2022 at 02:19:29PM +0200, Victor Toso wrote: > > > > func (s *AcpiDevic

[PATCH] configure: Restrict TCG to emulation

2022-07-06 Thread Thomas Huth
From: Philippe Mathieu-Daudé If we don't need to emulate any target, we certainly don't need TCG. This should also help to compile again with ".../configure --enable-tools --disable-system --disable-user" on systems that do not have a TCG backend. Signed-off-by: Philippe Mathieu-Daudé [thuth:

Re: [PATCH v5 07/45] target/arm: Mark PMULL, FMMLA as non-streaming

2022-07-06 Thread Peter Maydell
On Wed, 6 Jul 2022 at 09:55, Richard Henderson wrote: > > Mark these as a non-streaming instructions, which should trap > if full a64 support is not enabled in streaming mode. > > Signed-off-by: Richard Henderson > --- Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v5 03/45] target/arm: Trap non-streaming usage when Streaming SVE is active

2022-07-06 Thread Peter Maydell
On Wed, 6 Jul 2022 at 09:38, Richard Henderson wrote: > > This new behaviour is in the ARM pseudocode function > AArch64.CheckFPAdvSIMDEnabled, which applies to AArch32 > via AArch32.CheckAdvSIMDOrFPEnabled when the EL to which > the trap would be delivered is in AArch64 mode. > > Given that ARMv9

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

2022-07-06 Thread Andrea Bolognani
On Wed, Jul 06, 2022 at 04:07:43PM +0100, Daniel P. Berrangé wrote: > On Wed, Jul 06, 2022 at 09:53:43AM -0500, Andrea Bolognani wrote: > > Yeah but we're generating structs for all possible events ourselves > > and we don't really expect external implementations of this > > interface so I don't se

Re: copy-before-write test failing

2022-07-06 Thread Thomas Huth
On 05/07/2022 11.03, Thomas Huth wrote: On 14/06/2022 12.29, Vladimir Sementsov-Ogievskiy wrote: From: Vladimir Sementsov-Ogievskiy Add two simple test-cases: timeout failure with break-snapshot-on-cbw-error behavior and similar with break-guest-write-on-cbw-error behavior. Signed-off-by: Vla

Re: [PATCH 1/8] hw/i2c/pca954x: Add method to get channels

2022-07-06 Thread Patrick Venture
On Mon, Jul 4, 2022 at 10:46 PM Cédric Le Goater wrote: > On 7/4/22 23:54, Peter Delevoryas wrote: > > I added this helper in the Aspeed machine file a while ago to help > > initialize fuji-bmc i2c devices. This moves it to the official pca954x > > file so that other files can use it. > > > > Thi

Re: [PATCH RESEND] python/machine: Fix AF_UNIX path too long on macOS

2022-07-06 Thread Peter Delevoryas
On Wed, Jul 06, 2022 at 09:02:14AM +0100, Daniel P. Berrangé wrote: > On Tue, Jul 05, 2022 at 02:46:59PM -0700, Peter Delevoryas wrote: > > I noticed that I can't run any avocado tests on macOS because the QMP > > unix socket path is too long: > > > > I think the path limit for unix sockets on ma

Re: [PATCH v5 19/45] target/arm: Implement SME MOVA

2022-07-06 Thread Peter Maydell
On Wed, 6 Jul 2022 at 10:11, Richard Henderson wrote: > > We can reuse the SVE functions for implementing moves to/from > horizontal tile slices, but we need new ones for moves to/from > vertical tile slices. > > Signed-off-by: Richard Henderson > +/* > + * Move Zreg vector to ZArray column. >

Re: [PATCH v2 9/9] docs: aspeed: Add fby35 multi-SoC machine section

2022-07-06 Thread Peter Delevoryas
On Wed, Jul 06, 2022 at 08:21:12AM +, Joel Stanley wrote: > On Tue, 5 Jul 2022 at 19:14, Peter Delevoryas wrote: > > > > Signed-off-by: Peter Delevoryas > > Reviewed-by: Joel Stanley > > > --- > > docs/system/arm/aspeed.rst | 48 ++ > > 1 file changed,

Re: [PATCH v5 20/45] target/arm: Implement SME LD1, ST1

2022-07-06 Thread Peter Maydell
On Wed, 6 Jul 2022 at 10:21, Richard Henderson wrote: > > We cannot reuse the SVE functions for LD[1-4] and ST[1-4], > because those functions accept only a Zreg register number. > For SME, we want to pass a pointer into ZA storage. > > Signed-off-by: Richard Henderson > --- Reviewed-by: Peter M

Re: [PATCH] iotests: fix copy-before-write for macOS and FreeBSD

2022-07-06 Thread Hanna Reitz
On 06.07.22 16:46, Vladimir Sementsov-Ogievskiy wrote: On 7/6/22 13:26, Hanna Reitz wrote: On 05.07.22 17:37, Vladimir Sementsov-Ogievskiy wrote: strerror() represents ETIMEDOUT a bit different in Linux and macOS / FreeBSD. Let's support the latter too. Fixes: 9d05a87b77 ("iotests: copy-before

Re: [PATCH v5 23/45] target/arm: Implement SME ADDHA, ADDVA

2022-07-06 Thread Peter Maydell
On Wed, 6 Jul 2022 at 10:17, Richard Henderson wrote: > > Signed-off-by: Richard Henderson > +void HELPER(sme_addha_s)(void *vzda, void *vzn, void *vpn, > + void *vpm, uint32_t desc) > +{ > +intptr_t row, col, oprsz = simd_oprsz(desc) / 4; > +uint64_t *pn = vpn, *

Re: [PATCH v5 35/45] linux-user/aarch64: Add SM bit to SVE signal context

2022-07-06 Thread Peter Maydell
On Wed, 6 Jul 2022 at 10:32, Richard Henderson wrote: > > Make sure to zero the currently reserved fields. > > Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell thanks -- PMM

Re: [PATCH v5 37/45] linux-user/aarch64: Do not allow duplicate or short sve records

2022-07-06 Thread Peter Maydell
On Wed, 6 Jul 2022 at 10:33, Richard Henderson wrote: > > In parse_user_sigframe, the kernel rejects duplicate sve records, > or records that are smaller than the header. We were silently > allowing these cases to pass, dropping the record. > > Signed-off-by: Richard Henderson Reviewed-by: Pete

Re: copy-before-write test failing

2022-07-06 Thread Vladimir Sementsov-Ogievskiy
On 7/6/22 19:22, Thomas Huth wrote: On 05/07/2022 11.03, Thomas Huth wrote: On 14/06/2022 12.29, Vladimir Sementsov-Ogievskiy wrote: From: Vladimir Sementsov-Ogievskiy Add two simple test-cases: timeout failure with break-snapshot-on-cbw-error behavior and similar with break-guest-write-on-cb

[PATCH] iotests/copy-before-write: specify required_fmts

2022-07-06 Thread Vladimir Sementsov-Ogievskiy
Declare that we need copy-before-write filter to avoid failure when filter is not whitelisted. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/copy-before-write | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/tests/copy-before-wri

Re: [PATCH 4/9] target/ppc: use g_autofree in kvmppc_read_int_cpu_dt()

2022-07-06 Thread Daniel Henrique Barboza
On 7/2/22 03:20, Cédric Le Goater wrote: On 6/30/22 21:42, Daniel Henrique Barboza wrote: This spares us a g_free() call. Let's also not use 'val' and return the value of kvmppc_read_int_dt() directly. Signed-off-by: Daniel Henrique Barboza ---   target/ppc/kvm.c | 8 +++-   1 file chang

[PATCH] docs: aspeed: Minor updates

2022-07-06 Thread Cédric Le Goater
Some more controllers have been modeled recently. Reflect that in the list of supported devices. New machines were also added. Signed-off-by: Cédric Le Goater --- docs/system/arm/aspeed.rst | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/system/arm/aspeed

Re: [PATCH v8 08/20] blockjob.h: introduce block_job _locked() APIs

2022-07-06 Thread Vladimir Sementsov-Ogievskiy
On 7/6/22 15:59, Emanuele Giuseppe Esposito wrote: Am 06/07/2022 um 14:36 schrieb Emanuele Giuseppe Esposito: Am 06/07/2022 um 14:23 schrieb Vladimir Sementsov-Ogievskiy: On 7/6/22 15:05, Emanuele Giuseppe Esposito wrote: Am 05/07/2022 um 17:01 schrieb Vladimir Sementsov-Ogievskiy: On 6

Re: [PATCH] target/ppc: Fix MPC8555 and MPC8560 core type to e500v1

2022-07-06 Thread Daniel Henrique Barboza
On 7/3/22 16:50, Pali Rohár wrote: Commit 80d11f4467c4 ("Add definitions for Freescale PowerPC implementations") changed core type of MPC8555 and MPC8560 from e500v1 to e500v2. But both MPC8555 and MPC8560 have just e500v1 cores, there are no features of e500v2 cores. It can be verified by re

Re: [PATCH V8 28/39] vfio-pci: cpr part 2 (msi)

2022-07-06 Thread Steven Sistare
On 6/29/2022 4:19 PM, Alex Williamson wrote: > On Wed, 15 Jun 2022 07:52:15 -0700 > Steve Sistare wrote: > >> Finish cpr for vfio-pci MSI/MSI-X devices by preserving eventfd's and >> vector state. >> >> Signed-off-by: Steve Sistare >> --- >> hw/vfio/pci.c | 122 >> +

Re: [PATCH V8 27/39] vfio-pci: cpr part 1 (fd and dma)

2022-07-06 Thread Steven Sistare
On 6/29/2022 3:14 PM, Alex Williamson wrote: > On Wed, 15 Jun 2022 07:52:14 -0700 > Steve Sistare wrote: > >> Enable vfio-pci devices to be saved and restored across an exec restart >> of qemu. >> >> At vfio creation time, save the value of vfio container, group, and device >> descriptors in cpr

Re: [PATCH V8 29/39] vfio-pci: cpr part 3 (intx)

2022-07-06 Thread Steven Sistare
On 6/29/2022 4:43 PM, Alex Williamson wrote: > On Wed, 15 Jun 2022 07:52:16 -0700 > Steve Sistare wrote: > >> Preserve vfio INTX state across cpr restart. Preserve VFIOINTx fields as >> follows: >> pin : Recover this from the vfio config in kernel space >> interrupt : Preserve its eventfd de

Re: [PATCH v2 0/4] target/s390x: Exit tb after executing ex_value

2022-07-06 Thread Thomas Huth
On 02/07/2022 08.02, Richard Henderson wrote: Ok, version 1 didn't work, so once more with feeling. Can you give it a try, Sven? r~ Richard Henderson (4): target/s390x: Remove DISAS_GOTO_TB target/s390x: Remove DISAS_PC_STALE target/s390x: Remove DISAS_PC_STALE_NOCHAIN target/s390

Re: [PATCH V8 30/39] vfio-pci: recover from unmap-all-vaddr failure

2022-07-06 Thread Steven Sistare
On 6/29/2022 6:58 PM, Alex Williamson wrote: > On Wed, 15 Jun 2022 07:52:17 -0700 > Steve Sistare wrote: > >> If vfio_cpr_save fails to unmap all vaddr's, then recover by walking all >> flat sections to restore the vaddr for each. Do so by invoking the >> vfio listener callback, and passing a ne

Re: [PATCH] iotests/copy-before-write: specify required_fmts

2022-07-06 Thread Thomas Huth
On 06/07/2022 19.08, Vladimir Sementsov-Ogievskiy wrote: Declare that we need copy-before-write filter to avoid failure when filter is not whitelisted. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/tests/copy-before-write | 3 ++- 1 file changed, 2 insertions(+), 1 delet

Re: [PATCH] hw/pci/pci_bridge: ensure PCIe slots have only one slot

2022-07-06 Thread Vladimir Sementsov-Ogievskiy
On 7/4/22 13:25, Roman Kagan wrote: It's possible to create non-working configurations by attaching a device to a derivative of PCIe slot (pcie-root-port, ioh3420, etc) and specifying a slot number other that zero, e.g.: -device pcie-root-port,id=s0,... \ -device virtio-blk-pci,bus=s0,

[RFC PATCH v9 04/23] vhost: Get vring base from vq, not svq

2022-07-06 Thread Eugenio Pérez
The used idx used to match with this, but it will not match from the moment we introduce svq_inject. Rewind all the descriptors not used by vdpa device and get the vq state properly. Signed-off-by: Eugenio Pérez --- include/hw/virtio/virtio.h | 1 + hw/virtio/vhost-vdpa.c | 7 +++ hw/vir

[RFC PATCH v9 05/23] vhost: Add ShadowVirtQueueStart operation

2022-07-06 Thread Eugenio Pérez
It allows to run commands at SVQ start. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 18 +- hw/virtio/vhost-shadow-virtqueue.c | 8 +++- hw/virtio/vhost-vdpa.c | 17 - 3 files changed, 40 insertions(+), 3 deletions(-) dif

[RFC PATCH v9 08/23] vhost: Decouple vhost_svq_add_split from VirtQueueElement

2022-07-06 Thread Eugenio Pérez
VirtQueueElement comes from the guest, but we're heading SVQ to be able to inject element without the guest's knowledge. To do so, make this accept sg buffers directly, instead of using VirtQueueElement. Add vhost_svq_add_element to maintain element convenience Signed-off-by: Eugenio Pérez ---

[RFC PATCH v9 01/23] vhost: Return earlier if used buffers overrun

2022-07-06 Thread Eugenio Pérez
Previous function misses the just picked avail buffer from the queue. This way keeps blocking the used queue forever, but is cleaner to check before calling to vhost_svq_get_buf. Fixes: 100890f7cad50 ("vhost: Shadow virtqueue buffers forwarding") Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-

[RFC PATCH v9 13/23] vhost: Add vhost_svq_inject

2022-07-06 Thread Eugenio Pérez
This allows qemu to inject buffers to the device. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 2 ++ hw/virtio/vhost-shadow-virtqueue.c | 34 ++ 2 files changed, 36 insertions(+) diff --git a/hw/virtio/vhost-shadow-virtqueue.h b/hw/virtio/v

[RFC PATCH v9 00/23] Net Control VQ support in SVQ

2022-07-06 Thread Eugenio Pérez
Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. Shadow VirtQueue (SVQ) already makes possible migration of virtqueue states, effectively intercepting them so qemu can track what regions of me

[RFC PATCH v9 02/23] vhost: move descriptor translation to vhost_svq_vring_write_descs

2022-07-06 Thread Eugenio Pérez
It's done for both in and out descriptors so it's better placed here. Acked-by: Jason Wang Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 39 +- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c

[RFC PATCH v9 06/23] virtio-net: Expose ctrl virtqueue logic

2022-07-06 Thread Eugenio Pérez
This allows external vhost-net devices to modify the state of the VirtIO device model once vhost-vdpa device has acknowledge the control commands. Signed-off-by: Eugenio Pérez --- include/hw/virtio/virtio-net.h | 4 ++ hw/net/virtio-net.c| 84 -- 2 fi

[RFC PATCH v9 09/23] vhost: Add SVQElement

2022-07-06 Thread Eugenio Pérez
This will allow SVQ to add metadata to the different queue elements. To simplify changes, only store actual element at this patch. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 8 -- hw/virtio/vhost-shadow-virtqueue.c | 41 -- 2 files chan

[RFC PATCH v9 20/23] vdpa: Buffer CVQ support on shadow virtqueue

2022-07-06 Thread Eugenio Pérez
Introduce the control virtqueue support for vDPA shadow virtqueue. This is needed for advanced networking features like multiqueue. Virtio-net control VQ will copy the descriptors to qemu's VA, so we avoid TOCTOU with the guest's or device's memory every time there is a device model change. When

[RFC PATCH v9 07/23] vhost: add vhost_svq_push_elem

2022-07-06 Thread Eugenio Pérez
This function allows external SVQ users to return guest's available buffers. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 2 ++ hw/virtio/vhost-shadow-virtqueue.c | 16 2 files changed, 18 insertions(+) diff --git a/hw/virtio/vhost-shadow-virtqueue.h

[RFC PATCH v9 11/23] vhost: Move last chain id to SVQ element

2022-07-06 Thread Eugenio Pérez
We will allow SVQ user to store opaque data for each element, so its easier if we store this kind of information just at avail. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 3 +++ hw/virtio/vhost-shadow-virtqueue.c | 14 -- 2 files changed, 11 insertions(+),

[RFC PATCH v9 03/23] vdpa: delay set_vring_ready after DRIVER_OK

2022-07-06 Thread Eugenio Pérez
To restore the device in the destination of a live migration we send the commands through control virtqueue. For a device to read CVQ it must have received DRIVER_OK status bit. However this open a window where the device could start receiving packets in rx queue 0 before it receive the RSS config

[RFC PATCH v9 14/23] vhost: add vhost_svq_poll

2022-07-06 Thread Eugenio Pérez
It allows the Shadow Control VirtQueue to wait the device to use the commands that restore the net device state after a live migration. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 1 + hw/virtio/vhost-shadow-virtqueue.c | 54 -- 2 files chan

[RFC PATCH v9 12/23] vhost: Add opaque member to SVQElement

2022-07-06 Thread Eugenio Pérez
When qemu injects buffers to the vdpa device it will be used to maintain contextual data. If SVQ has no operation, it will be used to maintain the VirtQueueElement pointer. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 3 ++- hw/virtio/vhost-shadow-virtqueue.c | 13 +

[RFC PATCH v9 16/23] vhost: Add svq avail_handler callback

2022-07-06 Thread Eugenio Pérez
This allows external handlers to be aware of new buffers that the guest places in the virtqueue. When this callback is defined the ownership of guest's virtqueue element is transferred to the callback. This means that if the user wants to forward the descriptor it needs to manually inject it. The

[RFC PATCH v9 10/23] vhost: Reorder vhost_svq_last_desc_of_chain

2022-07-06 Thread Eugenio Pérez
SVQ is going to store it in SVQElement, so we need it before add functions. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-

[RFC PATCH v9 19/23] vdpa: Extract get features part from vhost_vdpa_get_max_queue_pairs

2022-07-06 Thread Eugenio Pérez
To know the device features is needed for CVQ SVQ, so SVQ knows if it can handle all commands or not. Extract from vhost_vdpa_get_max_queue_pairs so we can reuse it. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 30 -- 1 file changed, 20 insertions(+), 10 deleti

[RFC PATCH v9 15/23] vhost: Add custom used buffer callback

2022-07-06 Thread Eugenio Pérez
The callback allows SVQ users to know the VirtQueue requests and responses. QEMU can use this to synchronize virtio device model state, allowing to migrate it with minimum changes to the migration code. If callbacks are specified at svq creation, the buffers need to be injected to the device using

[RFC PATCH v9 23/23] vdpa: Add x-svq to NetdevVhostVDPAOptions

2022-07-06 Thread Eugenio Pérez
Finally offering the possibility to enable SVQ from the command line. Signed-off-by: Eugenio Pérez --- qapi/net.json| 9 +- net/vhost-vdpa.c | 72 ++-- 2 files changed, 77 insertions(+), 4 deletions(-) diff --git a/qapi/net.json b/qapi/net.js

[RFC PATCH v9 21/23] vdpa: Add vhost_vdpa_start_control_svq

2022-07-06 Thread Eugenio Pérez
As a first step we only enable CVQ first than others. Future patches add state restore. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c index e415cc8de5..77d013833f 100644 --- a/net/vho

[RFC PATCH v9 17/23] vhost: add detach SVQ operation

2022-07-06 Thread Eugenio Pérez
To notify the caller it needs to discard the element. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 11 +++ hw/virtio/vhost-shadow-virtqueue.c | 11 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.h b/hw

[RFC PATCH v9 22/23] vdpa: Inject virtio-net mac address via CVQ at start

2022-07-06 Thread Eugenio Pérez
This is needed so the destination vdpa device see the same state a the guest set in the source. Signed-off-by: Eugenio Pérez --- net/vhost-vdpa.c | 49 +++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa

[RFC PATCH v9 18/23] vdpa: Export vhost_vdpa_dma_map and unmap calls

2022-07-06 Thread Eugenio Pérez
Shadow CVQ will copy buffers on qemu VA, so we avoid TOCTOU attacks that can set a different state in qemu device model and vdpa device. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost-vdpa.h | 4 hw/virtio/vhost-vdpa.c | 7 +++ 2 files changed, 7 insertions(+), 4 delet

[PATCH v2 5/5] target/ppc: exit(1) on failure in kvmppc_get_clockfreq()

2022-07-06 Thread Daniel Henrique Barboza
When running under KVM accel it is expected to have 'clock-frequency' in the DT. Not having this attribute is too risky for both the machine emulation and userspace. We have a way of telling whether this error scenario might happen or not via kvmppc_read_int_cpu_dt() now being able to report error

[PATCH v2 0/5] cleanup error handling in kvmppc_read_int_cpu_dt()

2022-07-06 Thread Daniel Henrique Barboza
Hi, In this second version the biggest change is that I decided to error_fatal inside kvmppc_get_clockfreq(). After the discussions in v1 [1] it became clear that falling back to a default value when 'clock-frequency' is missing is a bad idea. Not because of the default value per se, but for the

[PATCH v2 2/5] target/ppc: add errp to kvmppc_read_int_cpu_dt()

2022-07-06 Thread Daniel Henrique Barboza
The function can't just return 0 whether an error happened and call it a day. We must provide a way of letting callers know if the zero return is legitimate or due to an error. Add an Error pointer to kvmppc_read_int_cpu_dt() that will be filled with an appropriate error, if one occurs. Callers ar

[PATCH v2 1/5] target/ppc/kvm.c: do not return -1 on uint64_t return

2022-07-06 Thread Daniel Henrique Barboza
kvmppc_read_int_dt() and kvmppc_read_int_cpu_dt() return an uint64_t, while returning -1 when an error occurs. kvmppc_read_int_cpu_dt() claims that it will return 0 if anything wrong happens, but it's returning -1 if kmvppc_find_cpu_dt() fails. The elephant in the room is that returning -1 while c

[PATCH v2 4/5] target/ppc: use g_autofree in kvmppc_read_int_cpu_dt()

2022-07-06 Thread Daniel Henrique Barboza
This spares us a g_free() call. Let's also not use 'val' and return the value of kvmppc_read_int_dt() directly. Signed-off-by: Daniel Henrique Barboza --- target/ppc/kvm.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 7611e9

[PATCH v2 3/5] target/ppc: Add error reporting when opening file fails

2022-07-06 Thread Daniel Henrique Barboza
From: jianchunfu Add error reporting before return when opening file fails in kvmppc_read_int_dt(). Signed-off-by: jianchunfu Reviewed-by: Cédric Le Goater [danielhb: use error_setg() instead of fprintf] Signed-off-by: Daniel Henrique Barboza --- target/ppc/kvm.c | 5 +++-- 1 file changed, 3

Re: [PATCH] hw/pci/pci_bridge: ensure PCIe slots have only one slot

2022-07-06 Thread Roman Kagan
On Wed, Jul 06, 2022 at 09:38:39PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 7/4/22 13:25, Roman Kagan wrote: > > It's possible to create non-working configurations by attaching a device > > to a derivative of PCIe slot (pcie-root-port, ioh3420, etc) and > > specifying a slot number other tha

[PULL 00/34] ppc queue

2022-07-06 Thread Daniel Henrique Barboza
The following changes since commit 180c2f24d5e8eada41e012a3899d29bb695aae06: Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into staging (2022-07-06 10:41:34 +0530) are available in the Git repository at: https://gitlab.com/danielhb/qemu.git tags/pull-ppc-202

[PULL 02/34] ppc/pnv: attach phb3/phb4 root ports in QOM tree

2022-07-06 Thread Daniel Henrique Barboza
At this moment we leave the pnv-phb3(4)-root-port unattached in QOM: /unattached (container) (...) /device[2] (pnv-phb3-root-port) /bus master container[0] (memory-region) /bus master[0] (memory-region) /pci_bridge_io[0] (memory-region) /pci_bridge_io[1] (memory-regio

[PULL 06/34] ppc/pnv: make pnv_chip_power8_pic_print_info() use chip8->phbs[]

2022-07-06 Thread Daniel Henrique Barboza
It's inneficient to scroll all child objects when we have all PHBs available in chip8->phbs[]. pnv_chip_power8_pic_print_info_child() ended up folded into pic_print_info() for simplicity. Reviewed-by: Frederic Barrat Signed-off-by: Daniel Henrique Barboza Message-Id: <20220621173436.165912-7-da

[PULL 09/34] target/ppc: Change FPSCR_* to follow POWER ISA numbering convention

2022-07-06 Thread Daniel Henrique Barboza
From: Víctor Colombo FPSCR_* bit values in QEMU are in the 'inverted' order from what Power ISA defines (e.g. FPSCR.FI is bit 46 but is defined as 17 in cpu.h). Now that PPC_BIT_NR macro was introduced to fix this situation for the MSR bits, we can use it for the FPSCR bits too. Also, adjust the

[PULL 01/34] ppc/pnv: move root port attach to pnv_phb4_realize()

2022-07-06 Thread Daniel Henrique Barboza
Creating a root port is something related to the PHB, not the PEC. It also makes the logic more in line with what pnv-phb3 does. Reviewed-by: Frederic Barrat Reviewed-by: Cédric Le Goater Signed-off-by: Daniel Henrique Barboza Message-Id: <20220621173436.165912-2-danielhb...@gmail.com> --- hw/

[PULL 03/34] ppc/pnv: assign pnv-phb-root-port chassis/slot earlier

2022-07-06 Thread Daniel Henrique Barboza
It is not advisable to execute an object_dynamic_cast() to poke into bus->qbus.parent and follow it up with a C cast into the PnvPHB type we think we got. In fact this is not needed. There is nothing sophisticated being done with the PHB object retrieved during root_port_realize() for both PHB3 an

[PULL 14/34] target/ppc: use int128.h methods in vaddecuq and vaddeuqm

2022-07-06 Thread Daniel Henrique Barboza
From: Matheus Ferst And also move the insns to decodetree and remove the now unused avr_qw_addc method. Signed-off-by: Matheus Ferst Reviewed-by: Víctor Colombo Message-Id: <20220606150037.338931-4-matheus.fe...@eldorado.org.br> Signed-off-by: Daniel Henrique Barboza --- target/ppc/helper.h

[PULL 15/34] target/ppc: use int128.h methods in vaddcuq

2022-07-06 Thread Daniel Henrique Barboza
From: Matheus Ferst And also move the insn to decodetree. Signed-off-by: Matheus Ferst Reviewed-by: Víctor Colombo Message-Id: <20220606150037.338931-5-matheus.fe...@eldorado.org.br> Signed-off-by: Daniel Henrique Barboza --- target/ppc/helper.h | 2 +- target/ppc/insn32.dec

[PULL 05/34] ppc/pnv: make pnv_ics_resend() use chip8->phbs[]

2022-07-06 Thread Daniel Henrique Barboza
pnv_ics_resend() is scrolling through all the child objects of the chip to search for the PHBs. It's faster and simpler to just use the phbs[] array. pnv_ics_resend_child() was folded into pnv_ics_resend() since it's too simple to justify its own function. Reviewed-by: Cédric Le Goater Reviewed-

[PULL 07/34] ppc/pnv: remove 'INTERFACE_PCIE_DEVICE' from phb3 root bus

2022-07-06 Thread Daniel Henrique Barboza
It's unneeded. No other PCIE_BUS implements this interface. Reviewed-by: Frederic Barrat Fixes: 9ae1329ee2fe ("ppc/pnv: Add models for POWER8 PHB3 PCIe Host bridge") Signed-off-by: Daniel Henrique Barboza Message-Id: <20220621173436.165912-8-danielhb...@gmail.com> --- hw/pci-host/pnv_phb3.c | 4

[PULL 17/34] target/ppc: use int128.h methods in vsubecuq and vsubeuqm

2022-07-06 Thread Daniel Henrique Barboza
From: Matheus Ferst And also move the insns to decodetree. Signed-off-by: Matheus Ferst Reviewed-by: Víctor Colombo Message-Id: <20220606150037.338931-7-matheus.fe...@eldorado.org.br> Signed-off-by: Daniel Henrique Barboza --- target/ppc/helper.h | 4 +-- target/ppc/insn32.d

[PULL 27/34] tests/tcg/ppc64: Add mffsce test

2022-07-06 Thread Daniel Henrique Barboza
From: Víctor Colombo Add mffsce test to check both the return value and the new fpscr stored in the cpu. Signed-off-by: Víctor Colombo Reviewed-by: Matheus Ferst Message-Id: <20220629162904.105060-8-victor.colo...@eldorado.org.br> Signed-off-by: Daniel Henrique Barboza --- tests/tcg/ppc64/Ma

<    1   2   3   >