[PATCH v2 2/5] target/ppc: change xs[n]madd[am]sp to use float64r32_muladd

2022-03-03 Thread matheus . ferst
From: Matheus Ferst Change VSX Scalar Multiply-Add/Subtract Type-A/M Single Precision helpers to use float64r32_muladd. This method should correctly handle all rounding modes, so the workaround for float_round_nearest_even can be dropped. Reviewed-by: Richard Henderson Signed-off-by: Matheus Fe

[PATCH v2 1/5] tests/tcg/ppc64le: use inline asm instead of __builtin_mtfsf

2022-03-03 Thread matheus . ferst
From: Matheus Ferst LLVM/Clang does not support __builtin_mtfsf. Acked-by: Alex Bennée Signed-off-by: Matheus Ferst --- tests/tcg/ppc64le/mtfsf.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tests/tcg/ppc64le/mtfsf.c b/tests/tcg/ppc64le/mtfsf.c inde

[PATCH v2 0/5] tests/tcg/ppc64le: fix the build of TCG tests with Clang

2022-03-03 Thread matheus . ferst
From: Matheus Ferst As the configuration scripts used -mbig and -mlittle, building PPC tests with Clang was silently skipped. With the patch to fix these options[1], "make check-tcg" fails because of build and runtime errors. This patch series tries to fix some of these problems. The first patch

Re: [PATCH V7 10/29] machine: memfd-alloc option

2022-03-03 Thread Michael S. Tsirkin
On Wed, Dec 22, 2021 at 11:05:15AM -0800, Steve Sistare wrote: > Allocate anonymous memory using memfd_create if the memfd-alloc machine > option is set. > > Signed-off-by: Steve Sistare > --- > hw/core/machine.c | 19 +++ > include/hw/boards.h | 1 + > qemu-options.hx |

[PATCH 2/2] virtiofsd: Support FUSE_SYNCFS on unannounced submounts

2022-03-03 Thread Greg Kurz
This adds the missing bits to support FUSE_SYNCFS in the case submounts aren't announced to the client. Iterate over all submounts and call syncfs() on them. Since syncfs() can block for an indefinite time, we cannot call it with lo->mutex held as it would prevent the server to process other reque

[PATCH 1/2] virtiofsd: Track submounts

2022-03-03 Thread Greg Kurz
If the server doesn't announce submounts to the client, it needs to track them internally to properly support FUSE_SYNCFS. lo_do_lookup() already knows how to detect them : it is a directory with a different device ID or mount ID than its parent. Use the same logic and put submount inodes into a de

[PATCH 0/2] virtiofsd: Support FUSE_SYNCFS on unannounced submounts

2022-03-03 Thread Greg Kurz
This is the current patches I have : one to track submounts and the other to call syncfs() on them. Tested on simple cases only. I won't be able to work on this anymore, so I'm posting for the records. Anyone is welcome to pick it up as there won't be a v2 from my side. Cheers, -- Greg Greg Kur

Re: [PATCH v2 1/3] block: Make bdrv_refresh_limits() non-recursive

2022-03-03 Thread Kevin Wolf
Am 16.02.2022 um 11:53 hat Hanna Reitz geschrieben: > bdrv_refresh_limits() recurses down to the node's children. That does > not seem necessary: When we refresh limits on some node, and then > recurse down and were to change one of its children's BlockLimits, then > that would mean we noticed the

Re: [PATCH 4/9] util/oslib-win32: Return NULL on qemu_try_memalign() with zero size

2022-03-03 Thread Peter Maydell
On Sun, 27 Feb 2022 at 18:36, Richard Henderson wrote: > > On 2/27/22 02:54, Peter Maydell wrote: > >>> +if (size) { > >>> +ptr = _aligned_malloc(size, alignment); > >>> +} else { > >>> +ptr = NULL; > >>> +} > >> > >> Oh, should we set errno to something here? > >> Othe

[PATCH v2 3/4] qsd: Add --daemonize

2022-03-03 Thread Hanna Reitz
To implement this, we reuse the existing daemonizing functions from the system emulator, which mainly do the following: - Fork off a child process, and set up a pipe between parent and child - The parent process waits until the child sends a status byte over the pipe (0 means that the child was s

Re: [PATCH v1 1/2] s390x/tcg: Implement Vector-Enhancements Facility 2 for s390x

2022-03-03 Thread David Miller
> Too many changes in one patch. > You need to split these into smaller, logical units. Can you give some guideline on that? IE: change to two, the shifts and reversed loads into two patches or more on line count of each patch? . > Tabs, and more later. The tabs should not happen at all, I disa

[PATCH v2 2/4] qsd: Add pre-init argument parsing pass

2022-03-03 Thread Hanna Reitz
In contrast to qemu-nbd (where it is called --fork) and the system emulator, QSD does not have a --daemonize switch yet. Just like them, QSD allows setting up block devices and exports on the command line. When doing so, it is often necessary for whoever invoked the QSD to wait until these exports

[PATCH v2 0/4] qsd: Add --daemonize; and add job quit tests

2022-03-03 Thread Hanna Reitz
Hi, v1 cover letter: https://lists.nongnu.org/archive/html/qemu-block/2021-12/msg00499.html In v2, I followed Vladimir’s suggestion to look into whether we could reuse os_daemonize(). Indeed we can, and it makes patch 3 (formerly 2) much simpler! I decided to leave patch 2 (formerly 1) largel

[PATCH v2 4/4] iotests/185: Add post-READY quit tests

2022-03-03 Thread Hanna Reitz
185 tests quitting qemu while a block job is active. It does not specifically test quitting qemu while a mirror or active commit job is in its READY phase. Add two test cases for this, where we respectively mirror or commit to an external QSD instance, which provides a throttled block device. qe

[PATCH v2 1/4] os-posix: Add os_set_daemonize()

2022-03-03 Thread Hanna Reitz
The daemonizing functions in os-posix (os_daemonize() and os_setup_post()) only daemonize the process if the static `daemonize` variable is set. Right now, it can only be set by os_parse_cmd_args(). In order to use os_daemonize() and os_setup_post() from the storage daemon to have it be daemonize

Re: [PATCH v2 09/14] vhost: Add VhostIOVATree

2022-03-03 Thread Eugenio Perez Martin
On Mon, Feb 28, 2022 at 8:06 AM Jason Wang wrote: > > > 在 2022/2/27 下午9:41, Eugenio Pérez 写道: > > This tree is able to look for a translated address from an IOVA address. > > > > At first glance it is similar to util/iova-tree. However, SVQ working on > > devices with limited IOVA space need more

Re: [PATCH V7 02/29] migration: fix populate_vfio_info

2022-03-03 Thread Steven Sistare
On 3/3/2022 11:21 AM, Peter Maydell wrote: > On Thu, 3 Mar 2022 at 15:55, Steven Sistare wrote: >> >> On 2/24/2022 1:42 PM, Peter Maydell wrote: >>> ...it also seems to be making a no-change-of-behaviour rewrite >>> of the rest of the file. Is there a reason I'm missing for doing >>> that ? > >>

Re: [PATCH v4 08/14] none-machine: add 'ram-addr' property

2022-03-03 Thread Damien Hedde
On 3/3/22 15:41, Philippe Mathieu-Daudé wrote: On 23/2/22 10:07, Damien Hedde wrote: Add the property to configure a the base address of the ram. The default value remains zero. This commit is needed to use the 'none' machine as a base, and subsequently to dynamically populate it using qapi

Re: [PATCH v4 1/2] tpm: CRB: Use ram_device for "tpm-crb-cmd" region

2022-03-03 Thread Marc-André Lureau
Hi On Thu, Mar 3, 2022 at 6:41 PM Eric Auger wrote: > Hi Stefan, > > On 2/8/22 6:58 PM, Eric Auger wrote: > > Hi Stefan, > > > > On 2/8/22 6:16 PM, Stefan Berger wrote: > >> > >> On 2/8/22 08:38, Eric Auger wrote: > >>> Representing the CRB cmd/response buffer as a standard > >>> RAM region caus

Re: [PATCH v6 06/43] hw/cxl/device: Implement basic mailbox (8.2.8.4)

2022-03-03 Thread Jonathan Cameron via
On Tue, 01 Mar 2022 15:32:02 + Alex Bennée wrote: > Jonathan Cameron writes: > > > From: Ben Widawsky > > > > This is the beginning of implementing mailbox support for CXL 2.0 > > devices. The implementation recognizes when the doorbell is rung, > > handles the command/payload, clears the

[PATCH v3 0/5] target/nios2: Shadow register set, EIC and VIC

2022-03-03 Thread Amir Gonnen
Based-on: 20220227182125.21809-1-richard.hender...@linaro.org ("target/nios2: Rewrite interrupt handling") Implement nios2 Shadow register set, EIC and VIC. Currently nios2 on QEMU contains an internal Interrupt Controller. The nios2 architecture can support a more powerful External Interrupt Con

Re: [PATCH v2 6/9] tcg/aarch64: Support TCG_TARGET_SIGNED_ADDR32

2022-03-03 Thread Peter Maydell
On Thu, 3 Mar 2022 at 15:43, Richard Henderson wrote: > > On 3/3/22 05:04, Peter Maydell wrote: > >> if (USE_GUEST_BASE) { > >> tcg_out_qemu_ld_direct(s, memop, ext, data_reg, > >> - TCG_REG_GUEST_BASE, otype, addr_reg); > >> +

[PATCH v3 2/5] target/nios2: Shadow register set

2022-03-03 Thread Amir Gonnen
Implement shadow register set and related instructions rdprs, wrprs. Fix eret to update either status or sstatus according to current register set. eret also changes register set when needed. Signed-off-by: Amir Gonnen --- target/nios2/cpu.c | 1 + target/nios2/cpu.h | 48 ++

Re: [PATCH 1/2] target/arm/translate-neon: UNDEF if VLD1/VST1 stride bits are non-zero

2022-03-03 Thread Richard Henderson
On 3/3/22 01:37, Peter Maydell wrote: For VLD1/VST1 (single element to one lane) we are only accessing one register, and so the 'stride' is meaningless. The bits that would specify stride (insn bit [4] for size=1, bit [6] for size=2) are specified to be zero in the encoding (which would correspo

[PATCH 12/12] tests/qemu-iotests: validate NBD TLS with UNIX sockets and PSK

2022-03-03 Thread Daniel P . Berrangé
This validates that connections to an NBD server running on a UNIX socket can use TLS with pre-shared keys (PSK). Signed-off-by: Daniel P. Berrangé --- tests/qemu-iotests/233| 28 tests/qemu-iotests/233.out| 17 + tests/qemu-iotests/common

Re: [PATCH 4/5] avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500

2022-03-03 Thread Cédric Le Goater
On 3/3/22 16:35, Daniel Henrique Barboza wrote: Some ppc64 hosts (e.g. IBM POWER hosts) aren't able to run the e500 machine using KVM accel. Skip this test if TCG accel isn't available. Cc: Cleber Rosa Signed-off-by: Daniel Henrique Barboza Reviewed-by: Cédric Le Goater Thanks, C. ---

Re: [PATCH 3/5] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9

2022-03-03 Thread Cédric Le Goater
On 3/3/22 16:35, Daniel Henrique Barboza wrote: The PowerNV8/9 machines does not work with KVM acceleration, meaning that boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8/9 tests will always fail when QEMU is compiled with --disable-tcg: ERROR 1-tests/avocado/boot_linux_console.py:BootLi

[PATCH 10/12] tests/qemu-iotests: validate NBD TLS with hostname mismatch

2022-03-03 Thread Daniel P . Berrangé
This validates that connections to an NBD server where the certificate hostname does not match will fail. It further validates that using the new 'tls-hostname' override option can solve the failure. Signed-off-by: Daniel P. Berrangé --- tests/qemu-iotests/233| 18 ++ tes

[PATCH 09/12] tests/qemu-iotests: convert NBD TLS test to use standard filters

2022-03-03 Thread Daniel P . Berrangé
Using standard filters is more future proof than rolling our own. Signed-off-by: Daniel P. Berrangé --- tests/qemu-iotests/233 | 29 - tests/qemu-iotests/233.out | 9 - 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/tests/qemu-iotests/23

[PATCH 06/12] tests/qemu-iotests: add QEMU_IOTESTS_REGEN=1 to update reference file

2022-03-03 Thread Daniel P . Berrangé
When developing an I/O test it is typical to add some logic to the test script, run it to view the output diff, and then apply the output diff to the reference file. This can be drastically simplified by letting the test runner update the reference file in place. By setting 'QEMU_IOTESTS_REGEN=1',

[PATCH 05/12] block/nbd: don't restrict TLS usage to IP sockets

2022-03-03 Thread Daniel P . Berrangé
The TLS usage for NBD was restricted to IP sockets because validating x509 certificates requires knowledge of the hostname that the client is connecting to. TLS does not have to use x509 certificates though, as PSK (pre-shared keys) provide an alternative credential option. These have no requireme

Re: [PATCH V7 02/29] migration: fix populate_vfio_info

2022-03-03 Thread Peter Maydell
On Thu, 3 Mar 2022 at 15:55, Steven Sistare wrote: > > On 2/24/2022 1:42 PM, Peter Maydell wrote: > > ...it also seems to be making a no-change-of-behaviour rewrite > > of the rest of the file. Is there a reason I'm missing for doing > > that ? > I'll change the commit message to explain: > >

[PATCH 11/12] tests/qemu-iotests: validate NBD TLS with UNIX sockets

2022-03-03 Thread Daniel P . Berrangé
This validates that connections to an NBD server running on a UNIX socket can use TLS, and require a TLS hostname override to pass certificate validation. Signed-off-by: Daniel P. Berrangé --- tests/qemu-iotests/233 | 24 tests/qemu-iotests/233.out | 15 +

[PATCH 04/12] qemu-nbd: add --tls-hostname option for TLS certificate validation

2022-03-03 Thread Daniel P . Berrangé
When using the --list option, qemu-nbd acts as an NBD client rather than a server. As such when using TLS, it has a need to validate the server certificate. This adds a --tls-hostname option which can be used to override the default hostname used for certificate validation. Signed-off-by: Daniel P

[PATCH 02/12] block: pass desired TLS hostname through from block driver client

2022-03-03 Thread Daniel P . Berrangé
In commit a71d597b989fd701b923f09b3c20ac4fcaa55e81 Author: Vladimir Sementsov-Ogievskiy Date: Thu Jun 10 13:08:00 2021 +0300 block/nbd: reuse nbd_co_do_establish_connection() in nbd_open() the use of the 'hostname' field from the BDRVNBDState struct was lost, and 'nbd_connect' just

[PATCH 08/12] tests/qemu-iotests: introduce filter for qemu-nbd export list

2022-03-03 Thread Daniel P . Berrangé
Introduce a filter for the output of qemu-nbd export list so it can be reused in multiple tests. The filter is a bit more permissive that what test 241 currently uses, as its allows printing of the export count, along with any possible error messages that might be emitted. Signed-off-by: Daniel P

[PATCH 03/12] block/nbd: support override of hostname for TLS certificate validation

2022-03-03 Thread Daniel P . Berrangé
When connecting to an NBD server with TLS and x509 credentials, the client must validate the hostname it uses for the connection, against that published in the server's certificate. If the client is tunnelling its connection over some other channel, however, the hostname it uses may not match the i

[PATCH 00/12] nbd: enable use of TLS on non-TCP transports and other TLS improvements

2022-03-03 Thread Daniel P . Berrangé
This series was principally motivated by a desire to enabl use of TLS on non-TCP transports. For x509 certificates this means we need a way to set the hostname to use for validation. This also lets us override the hostname when connecting on a TCP transport that is tunnelled or port-forwarded. It a

Re: [PATCH 2/2] target/arm/translate-neon: Simplify align field check for VLD3

2022-03-03 Thread Richard Henderson
On 3/3/22 01:37, Peter Maydell wrote: For VLD3 (single 3-element structure to one lane), there is no alignment specification and the alignment bits in the instruction must be zero. This is bit [4] for the size=0 and size=1 cases, and bits [5:4] for the size=2 case. We do this check correctly in

[PATCH 07/12] tests/qemu-iotests: expand _filter_nbd rules

2022-03-03 Thread Daniel P . Berrangé
Some tests will want to use 'localhost' instead of '127.0.0.1', and some will use the image options syntax rather than the classic URI syntax. Signed-off-by: Daniel P. Berrangé --- tests/qemu-iotests/common.filter | 4 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/common.

[PATCH 01/12] crypto: mandate a hostname when checking x509 creds on a client

2022-03-03 Thread Daniel P . Berrangé
Currently the TLS session object assumes that the caller will always provide a hostname when using x509 creds on a client endpoint. This relies on the caller to detect and report an error if the user has configured QEMU with x509 credentials on a UNIX socket. The migration code has such a check, bu

Re: [PATCH V7 10/29] machine: memfd-alloc option

2022-03-03 Thread Steven Sistare
On 2/24/2022 12:56 PM, Dr. David Alan Gilbert wrote: > * Steve Sistare (steven.sist...@oracle.com) wrote: >> Allocate anonymous memory using memfd_create if the memfd-alloc machine >> option is set. >> >> Signed-off-by: Steve Sistare > > So other than the minor error nit that Guoyi spotted, I thi

Re: [PATCH V7 05/29] vl: start on wakeup request

2022-03-03 Thread Steven Sistare
On 2/24/2022 1:51 PM, Dr. David Alan Gilbert wrote: > * Steve Sistare (steven.sist...@oracle.com) wrote: >> If qemu starts and loads a VM in the suspended state, then a later wakeup >> request will set the state to running, which is not sufficient to initialize >> the vm, as vm_start was never call

Re: [PATCH V7 29/29] cpr: only-cpr-capable option

2022-03-03 Thread Steven Sistare
On 2/18/2022 4:43 AM, Guoyi Tu wrote: > On Wed, 2021-12-22 at 11:05 -0800, Steve Sistare wrote: >> Add the only-cpr-capable option, which causes qemu to exit with an >> error >> if any devices that are not capable of cpr are added. This >> guarantees that >> a cpr-exec operation will not fail with

[PATCH v3 5/5] hw/nios2: Machine with a Vectored Interrupt Controller

2022-03-03 Thread Amir Gonnen
Demonstrate how to use nios2 VIC on a machine. Introduce a new machine "10m50-ghrd-vic" which is based on "10m50-ghrd" with a VIC attached and internal interrupt controller removed. When VIC is present, irq0 connects the VIC to the cpu, intc_present is set to false to disable the internal interrup

Re: [PATCH V7 28/29] chardev: cpr for sockets

2022-03-03 Thread Steven Sistare
On 2/18/2022 4:03 AM, Guoyi Tu wrote: > On Wed, 2021-12-22 at 11:05 -0800, Steve Sistare wrote: >> Save accepted socket fds before cpr-save, and look for them after >> cpr-load. >> in the environment after cpr-load. Reject cpr-exec if a socket >> enables >> the TLS or websocket option. Allow a mo

Re: [PATCH V7 10/29] machine: memfd-alloc option

2022-03-03 Thread Steven Sistare
On 2/18/2022 3:05 AM, Guoyi Tu wrote: > On Wed, 2021-12-22 at 11:05 -0800, Steve Sistare wrote: >> Allocate anonymous memory using memfd_create if the memfd-alloc >> machine >> option is set. >> >> Signed-off-by: Steve Sistare >> --- >> hw/core/machine.c | 19 +++ >> include/hw/

Re: [PATCH V7 04/29] migration: simplify savevm

2022-03-03 Thread Steven Sistare
On 2/24/2022 1:25 PM, Dr. David Alan Gilbert wrote: > * Steve Sistare (steven.sist...@oracle.com) wrote: >> Use qemu_file_open to simplify a few functions in savevm.c. >> No functional change. >> >> Signed-off-by: Steve Sistare > > So I think this is mostly OK, but a couple of minor tidyups below

Re: [PATCH v15 3/8] net/vmnet: implement shared mode (vmnet-shared)

2022-03-03 Thread Vladislav Yaroshchuk
On Tue, Mar 1, 2022 at 11:21 AM Akihiko Odaki wrote: > On 2022/03/01 17:09, Vladislav Yaroshchuk wrote: > > > Not sure that only one field is enough, cause > > > we may have two states on bh execution start: > > > 1. There are packets in vmnet buffer s->packets_buf > > >

[PATCH v3 4/5] hw/intc: Vectored Interrupt Controller (VIC)

2022-03-03 Thread Amir Gonnen
Implement nios2 Vectored Interrupt Controller (VIC). VIC is connected to EIC. It needs to update rha, ril, rrs and rnmi fields on Nios2CPU before raising an IRQ. For that purpose, VIC has a "cpu" property which should refer to the nios2 cpu and set by the board that connects VIC. Signed-off-by: Am

Re: [PATCH v2 6/9] tcg/aarch64: Support TCG_TARGET_SIGNED_ADDR32

2022-03-03 Thread Richard Henderson
On 3/3/22 05:04, Peter Maydell wrote: if (USE_GUEST_BASE) { tcg_out_qemu_ld_direct(s, memop, ext, data_reg, - TCG_REG_GUEST_BASE, otype, addr_reg); + TCG_REG_GUEST_BASE, option, addr_reg); } else { tcg_out

Re: [PATCH V7 03/29] migration: qemu file wrappers

2022-03-03 Thread Steven Sistare
On 2/24/2022 1:21 PM, Dr. David Alan Gilbert wrote: > * Steve Sistare (steven.sist...@oracle.com) wrote: >> Add qemu_file_open and qemu_fd_open to create QEMUFile objects for unix >> files and file descriptors. >> >> Signed-off-by: Steve Sistare >> --- >> migration/qemu-file-channel.c | 36 ++

Re: [PATCH v2 09/10] esp: include the current PDMA callback in the migration stream

2022-03-03 Thread Peter Maydell
On Wed, 2 Mar 2022 at 21:38, Mark Cave-Ayland wrote: > > This involves (re)adding a PDMA-specific subsection to hold the reference to > the > current PDMA callback. > > Signed-off-by: Mark Cave-Ayland > --- > hw/scsi/esp.c | 23 +++ > 1 file changed, 23 insertions(+) > > dif

[PATCH v3 3/5] target/nios2: Exteral Interrupt Controller (EIC)

2022-03-03 Thread Amir Gonnen
Implement Exteral Interrupt Controller interface (EIC). Added intc_present property, true by default. When set to false, nios2 uses the EIC interface when handling IRQ. When set to true (default) it uses the internal interrupt controller. When nios2 recieves irq, it first checks intc_present to dec

Re: [PATCH V7 02/29] migration: fix populate_vfio_info

2022-03-03 Thread Steven Sistare
On 2/24/2022 1:42 PM, Peter Maydell wrote: > On Wed, 22 Dec 2021 at 19:45, Steve Sistare wrote: >> >> Include CONFIG_DEVICES so that populate_vfio_info is instantiated for >> CONFIG_VFIO. > > The commit message says "include CONFIG_DEVICES"... > >> Signed-off-by: Steve Sistare >> --- >> migrat

[PATCH 5/5] avocado/replay_kernel.py: make tcg-icount check in run_vm()

2022-03-03 Thread Daniel Henrique Barboza
The icount framework relies on TCG availability. If QEMU is built with --disable-tcg we won't have icount either, and then this test will fail with the following message in an IBM POWER9 host: tests/avocado/replay_kernel.py:ReplayKernelNormal.test_ppc64_pseries: ERROR: ConnectError: Failed to esta

[PATCH 2/5] qtest/meson.build: check CONFIG_TCG for boot-serial-test in qtests_ppc

2022-03-03 Thread Daniel Henrique Barboza
'boot-serial-test' does not work with a QEMU built with --disable-tcg in a IBM POWER9 host. The reason is that without TCG QEMU will default to KVM acceleration, but then the KVM module in IBM POWER hosts aren't able to handle other CPUs. The result is that the test will break with a KVM error whe

[PATCH v3 1/5] target/nios2: Check supervisor on eret

2022-03-03 Thread Amir Gonnen
eret instruction is only allowed in supervisor mode. Signed-off-by: Amir Gonnen --- target/nios2/translate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/nios2/translate.c b/target/nios2/translate.c index ce3aacf59d..007c17e6e9 100644 --- a/target/nios2/translate.c +++ b/target/n

[PATCH 4/5] avocado/boot_linux_console.py: check tcg accel in test_ppc64_e500

2022-03-03 Thread Daniel Henrique Barboza
Some ppc64 hosts (e.g. IBM POWER hosts) aren't able to run the e500 machine using KVM accel. Skip this test if TCG accel isn't available. Cc: Cleber Rosa Signed-off-by: Daniel Henrique Barboza --- tests/avocado/boot_linux_console.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/av

Re: [PATCH V7 01/29] memory: qemu_check_ram_volatile

2022-03-03 Thread Steven Sistare
On 2/24/2022 1:28 PM, Dr. David Alan Gilbert wrote: > * Steve Sistare (steven.sist...@oracle.com) wrote: >> Add a function that returns an error if any ram_list block represents >> volatile memory. >> >> Signed-off-by: Steve Sistare >> --- >> include/exec/memory.h | 8 >> softmmu/memory

[PATCH 3/5] avocado/boot_linux_console.py: check for tcg in test_ppc_powernv8/9

2022-03-03 Thread Daniel Henrique Barboza
The PowerNV8/9 machines does not work with KVM acceleration, meaning that boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8/9 tests will always fail when QEMU is compiled with --disable-tcg: ERROR 1-tests/avocado/boot_linux_console.py:BootLinuxConsole.test_ppc_powernv8 -> VMLaunchFailure: C

[PATCH 0/5] --disable-tcg qtest/avocado fixes for ppc64

2022-03-03 Thread Daniel Henrique Barboza
Hi, 'make check' and 'make check-avocado' in a ppc64 host, using a QEMU built with --disable-tcg, fails in a handful of tests/files due to the lack of TCG support not being accounted for. The tests usually fall back to KVM acceleration, and when running in an IBM POWER server this accel type isn't

[PATCH 1/5] qtest/meson.build: check CONFIG_TCG for prom-env-test in qtests_ppc

2022-03-03 Thread Daniel Henrique Barboza
'prom-env-test' is a TCG test that will fail if QEMU is compiled with --disable-tcg: $ QTEST_QEMU_BINARY=./qemu-system-ppc64 ./tests/qtest/prom-env-test /ppc64/prom-env/mac99: qemu-system-ppc64: -accel tcg: invalid accelerator tcg (... hangs indefinitely ...) Fix it by checking CONFIG_TCG before

Re: [PATCH v2 03/10] macfb: increase number of registers saved in MacfbState

2022-03-03 Thread Peter Maydell
On Thu, 3 Mar 2022 at 15:25, Peter Maydell wrote: > > On Wed, 2 Mar 2022 at 21:31, Mark Cave-Ayland > wrote: > > > > The MacOS toolbox ROM accesses a number of addresses between 0x0 and 0x200 > > during > > initialisation and resolution changes. Whilst the function of many of these > > registers

[PATCH v8 26/31] block_int-common.h: assertions in the callers of BlockDriver function pointers

2022-03-03 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- block.c| 17 + block/create.c | 2 ++ 2 files changed, 19 insertions(+) diff --git a/block.c b/block.c index 4a3447b2a0..5afdbe3060 100644 --- a/block.c +++ b/block.c @@ -529,6 +529,7 @@ static void coroutine_fn bdrv_create_c

Re: [PATCH v2 01/10] macfb: add VMStateDescription for MacfbNubusState and MacfbSysBusState

2022-03-03 Thread Peter Maydell
On Wed, 2 Mar 2022 at 21:41, Mark Cave-Ayland wrote: > > Currently when QEMU tries to migrate the macfb framebuffer it crashes randomly > because the opaque provided by the DeviceClass vmsd property for both devices > is set to MacfbState rather than MacfbNubusState or MacfbSysBusState as > approp

Re: [PATCH v2 04/10] macfb: add VMStateDescription fields for display type and VBL timer

2022-03-03 Thread Peter Maydell
On Wed, 2 Mar 2022 at 21:31, Mark Cave-Ayland wrote: > > These fields are required in the migration stream to restore macfb state > correctly. > > Signed-off-by: Mark Cave-Ayland > --- > hw/display/macfb.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/hw/display/macfb.c b/hw/display

[PATCH v8 29/31] block-backend-common.h: split function pointers in BlockDevOps

2022-03-03 Thread Emanuele Giuseppe Esposito
Assertions in the callers of the function pointrs are already added by previous patches. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé --- include/sysemu/block-backend-common.h | 28 ++- 1 file changed, 23 ins

[PATCH v8 30/31] job.h: split function pointers in JobDriver

2022-03-03 Thread Emanuele Giuseppe Esposito
The job API will be handled separately in another serie. Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/job.h | 22 ++ 1 file changed, 22 insertions(+) diff --git a/include/qemu/job.h b/include/qemu/job.h index 6e67b6977f..c105b31076 100644 --- a/include/qemu/job

[PATCH v8 22/31] include/block/snapshot: global state API + assertions

2022-03-03 Thread Emanuele Giuseppe Esposito
Snapshots run also under the BQL, so they all are in the global state API. The aiocontext lock that they hold is currently an overkill and in future could be removed. Signed-off-by: Emanuele Giuseppe Esposito --- block/snapshot.c | 28 include/block/snapshot.

[PATCH v8 21/31] assertions for blockdev.h global state API

2022-03-03 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- block/block-backend.c | 3 +++ blockdev.c| 16 2 files changed, 19 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c index 2ab1274dfe..bf77c4a8fa 100644 --- a/block/block-backend.c +++ b/block/bloc

[PATCH v8 31/31] job.h: assertions in the callers of JobDriver function pointers

2022-03-03 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- job.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/job.c b/job.c index 54db80df66..075c6f3a20 100644 --- a/job.c +++ b/job.c @@ -381,6 +381,8 @@ void job_ref(Job *job) void job_unref(Job *job) { +GLOBAL_STATE_CODE(); +

Re: [PATCH v2 05/10] macfb: set initial value of mode control registers in macfb_common_realize()

2022-03-03 Thread Peter Maydell
On Wed, 2 Mar 2022 at 21:35, Mark Cave-Ayland wrote: > > If booting Linux directly in the q800 machine using -kernel rather than using > a > MacOS toolbox ROM, the mode control registers are never initialised, > causing macfb_mode_write() to fail to determine the current resolution after > migrat

[PATCH v8 23/31] block/copy-before-write.h: global state API + assertions

2022-03-03 Thread Emanuele Giuseppe Esposito
copy-before-write functions always run under BQL. Signed-off-by: Emanuele Giuseppe Esposito --- block/copy-before-write.c | 2 ++ block/copy-before-write.h | 7 +++ 2 files changed, 9 insertions(+) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index c30a5ff8de..80b7684d

[PATCH v8 25/31] block_int-common.h: split function pointers in BlockDriver

2022-03-03 Thread Emanuele Giuseppe Esposito
Similar to the header split, also the function pointers in BlockDriver can be split in I/O and global state. Signed-off-by: Emanuele Giuseppe Esposito --- include/block/block_int-common.h | 445 --- 1 file changed, 237 insertions(+), 208 deletions(-) diff --git a/inc

[PATCH v8 20/31] include/sysemu/blockdev.h: global state API

2022-03-03 Thread Emanuele Giuseppe Esposito
blockdev functions run always under the BQL lock. Signed-off-by: Emanuele Giuseppe Esposito --- include/sysemu/blockdev.h | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h index f9fb54d437..3211b16513 100644 -

Re: [PATCH v2 03/10] macfb: increase number of registers saved in MacfbState

2022-03-03 Thread Peter Maydell
On Wed, 2 Mar 2022 at 21:31, Mark Cave-Ayland wrote: > > The MacOS toolbox ROM accesses a number of addresses between 0x0 and 0x200 > during > initialisation and resolution changes. Whilst the function of many of these > registers is unknown, it is worth the minimal cost of saving these extra >

[PATCH v8 24/31] block/coroutines: I/O and "I/O or GS" API

2022-03-03 Thread Emanuele Giuseppe Esposito
block coroutines functions run in different aiocontext, and are not protected by the BQL. Therefore are I/O. On the other side, generated_co_wrapper functions use BDRV_POLL_WHILE, meaning the caller can either be the main loop or a specific iothread. Signed-off-by: Emanuele Giuseppe Esposito ---

[PATCH v8 17/31] block.c: add assertions to static functions

2022-03-03 Thread Emanuele Giuseppe Esposito
Following the assertion derived from the API split, propagate the assertion also in the static functions. Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 46 ++- block/block-backend.c | 3 +++ 2 files changed, 48 insertions(+), 1 del

[PATCH v8 09/31] IO_CODE and IO_OR_GS_CODE for block-backend I/O API

2022-03-03 Thread Emanuele Giuseppe Esposito
Mark all I/O functions with IO_CODE, and all "I/O OR GS" with IO_OR_GS_CODE. Signed-off-by: Emanuele Giuseppe Esposito --- block/block-backend.c | 58 +++ include/sysemu/block-backend-io.h | 2 ++ 2 files changed, 60 insertions(+) diff --git a/block/bloc

[PATCH v8 19/31] assertions for blockjob.h global state API

2022-03-03 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- blockjob.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/blockjob.c b/blockjob.c index d79a52d204..4868453d74 100644 --- a/blockjob.c +++ b/blockjob.c @@ -62,6 +62,7 @@ static bool is_block_job(Job *job) BlockJob *block_job_next(Bl

[PATCH v8 27/31] block_int-common.h: split function pointers in BdrvChildClass

2022-03-03 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- include/block/block_int-common.h | 81 ++-- 1 file changed, 47 insertions(+), 34 deletions(-) diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index f05ebb0da3..5a04c778e4 100644 --- a/inclu

[PATCH v8 28/31] block_int-common.h: assertions in the callers of BdrvChildClass function pointers

2022-03-03 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 5afdbe3060..01811d6519 100644 --- a/block.c +++ b/block.c @@ -1497,7 +1497,7 @@ const BdrvChildClass child_of_bds = { AioContext *bdrv_chi

[PATCH v8 06/31] block/export/fuse.c: allow writable exports to take RESIZE permission

2022-03-03 Thread Emanuele Giuseppe Esposito
Allow writable exports to get BLK_PERM_RESIZE permission from creation, in fuse_export_create(). In this way, there is no need to give the permission in fuse_do_truncate(), which might be run in an iothread. Permissions should be set only in the main thread, so in any case if an iothread tries to

[PATCH v8 18/31] include/block/blockjob.h: global state API

2022-03-03 Thread Emanuele Giuseppe Esposito
blockjob functions run always under the BQL lock. Signed-off-by: Emanuele Giuseppe Esposito --- include/block/blockjob.h | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 87fbb3985f..6525e1

[PATCH v8 16/31] GS and IO CODE macros for blockjob_int.h

2022-03-03 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- blockjob.c | 5 + 1 file changed, 5 insertions(+) diff --git a/blockjob.c b/blockjob.c index 10815a89fe..d79a52d204 100644 --- a/blockjob.c +++ b/blockjob.c @@ -84,6 +84,7 @@ BlockJob *block_job_get(const char *id) void block_job_free(Job *job)

[PATCH v8 15/31] include/block/blockjob_int.h: split header into I/O and GS API

2022-03-03 Thread Emanuele Giuseppe Esposito
Since the I/O functions are not many, keep a single file. Also split the function pointers in BlockJobDriver. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Stefan Hajnoczi --- include/block/blockjob_int.h | 28 1 file changed, 28 insertions(+) diff --git a

[PATCH v8 13/31] IO_CODE and IO_OR_GS_CODE for block_int I/O API

2022-03-03 Thread Emanuele Giuseppe Esposito
Mark all I/O functions with IO_CODE, and all "I/O OR GS" with IO_OR_GS_CODE. Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 14 +- block/block-backend.c| 2 ++ block/dirty-bitmap.c | 3 +++ block/io.c | 13

[PATCH v8 05/31] IO_CODE and IO_OR_GS_CODE for block I/O API

2022-03-03 Thread Emanuele Giuseppe Esposito
Mark all I/O functions with IO_CODE, and all "I/O OR GS" with IO_OR_GS_CODE. Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 38 ++- block/dirty-bitmap.c | 1 + block/io.c | 43 ++-- i

[PATCH v8 07/31] include/sysemu/block-backend: split header into I/O and global state (GS) API

2022-03-03 Thread Emanuele Giuseppe Esposito
Similarly to the previous patches, split block-backend.h in block-backend-io.h and block-backend-global-state.h In addition, remove "block/block.h" include as it seems it is not necessary anymore, together with "qemu/iov.h" block-backend-common.h contains the structures shared between the two hea

[PATCH v8 14/31] block: introduce assert_bdrv_graph_writable

2022-03-03 Thread Emanuele Giuseppe Esposito
We want to be sure that the functions that write the child and parent list of a bs are under BQL and drain. BQL prevents from concurrent writings from the GS API, while drains protect from I/O. TODO: drains are missing in some functions using this assert. Therefore a proper assertion will fail. B

[PATCH v8 03/31] include/block/block: split header into I/O and global state API

2022-03-03 Thread Emanuele Giuseppe Esposito
block.h currently contains a mix of functions: some of them run under the BQL and modify the block layer graph, others are instead thread-safe and perform I/O in iothreads. Some others can only be called by either the main loop or the iothread running the AioContext (and not other iothreads), and u

[PATCH v8 11/31] include/block/block_int: split header into I/O and global state API

2022-03-03 Thread Emanuele Giuseppe Esposito
Similarly to the previous patch, split block_int.h in block_int-io.h and block_int-global-state.h block_int-common.h contains the structures shared between the two headers, and the functions that can't be categorized as I/O or global state. Assertions are added in the next patch. Signed-off-by:

[PATCH v8 02/31] main loop: macros to mark GS and I/O functions

2022-03-03 Thread Emanuele Giuseppe Esposito
Righ now, IO_CODE and IO_OR_GS_CODE are nop, as there isn't really a way to check that a function is only called in I/O. On the other side, we can use qemu_in_main_thread() to check if we are in the main loop. The usage of macros makes easy to extend them in the future without making changes in al

[PATCH v8 00/31] block layer: split block APIs in global state and I/O

2022-03-03 Thread Emanuele Giuseppe Esposito
Currently, block layer APIs like block.h contain a mix of functions that are either running in the main loop and under the BQL, or are thread-safe functions and run in iothreads performing I/O. The functions running under BQL also take care of modifying the block graph, by using drain and/or aio_co

[PATCH v8 12/31] assertions for block_int global state API

2022-03-03 Thread Emanuele Giuseppe Esposito
Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 15 +++ block/backup.c | 1 + block/block-backend.c | 3 +++ block/commit.c | 2 ++ block/dirty-bitmap.c| 1 + block/io.c |

[PATCH v8 10/31] block.c: assertions to the block layer permissions API

2022-03-03 Thread Emanuele Giuseppe Esposito
Now that we "covered" the three main cases where the permission API was being used under BQL (fuse, amend and invalidate_cache), we can safely assert for the permission functions implemented in block.c Signed-off-by: Emanuele Giuseppe Esposito --- block.c | 12 1 file changed, 12 in

[PATCH v8 01/31] main-loop.h: introduce qemu_in_main_thread()

2022-03-03 Thread Emanuele Giuseppe Esposito
When invoked from the main loop, this function is the same as qemu_mutex_iothread_locked, and returns true if the BQL is held. When invoked from iothreads or tests, it returns true only if the current AioContext is the Main Loop. This essentially just extends qemu_mutex_iothread_locked to work als

Re: [PATCH v2 3/9] accel/tcg: Support TCG_TARGET_SIGNED_ADDR32 for softmmu

2022-03-03 Thread Peter Maydell
On Sun, 27 Feb 2022 at 02:08, Richard Henderson wrote: > > When TCG_TARGET_SIGNED_ADDR32 is set, adjust the tlb addend to > allow the 32-bit guest address to be sign extended within the > 64-bit host register instead of zero extended. > > This will simplify tcg hosts like MIPS, RISC-V, and LoongAr

[PATCH v8 08/31] block/block-backend.c: assertions for block-backend

2022-03-03 Thread Emanuele Giuseppe Esposito
All the global state (GS) API functions will check that qemu_in_main_thread() returns true. If not, it means that the safety of BQL cannot be guaranteed, and they need to be moved to I/O. Signed-off-by: Emanuele Giuseppe Esposito --- block/block-backend.c | 78 ++

<    1   2   3   4   >