Re: [PATCH v2 2/3] thread-pool: replace semaphore with condition variable

2022-05-13 Thread Nicolas Saenz Julienne
Hi Paolo, On Thu, 2022-05-12 at 12:43 +0200, Paolo Bonzini wrote: [...] > diff --git a/util/thread-pool.c b/util/thread-pool.c > index 4979f30ca3..da189d9338 100644 > --- a/util/thread-pool.c > +++ b/util/thread-pool.c > @@ -57,7 +57,7 @@ struct ThreadPool { > QEMUBH *completion_bh; >

[PATCH qemu v4 09/10] target/riscv: rvv: Add mask agnostic for vector permutation instructions

2022-05-13 Thread ~eopxd
From: Yueh-Ting (eop) Chen Signed-off-by: eop Chen Reviewed-by: Frank Chang Reviewed-by: Weiwei Li --- target/riscv/insn_trans/trans_rvv.c.inc | 1 + target/riscv/vector_helper.c| 26 +++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/target

Re: [RFC PATCH qemu] spapr/docs: Add a few words about x-vof

2022-05-13 Thread Daniel Henrique Barboza
On 5/13/22 04:45, Alexey Kardashevskiy wrote: On 5/12/22 23:40, Daniel Henrique Barboza wrote: On 5/12/22 00:10, Alexey Kardashevskiy wrote: On 5/12/22 06:42, Daniel Henrique Barboza wrote: On 5/6/22 02:51, Alexey Kardashevskiy wrote: The alternative small firmware needs a few word

[PATCH qemu v4 00/10] Add mask agnostic behavior for rvv instructions

2022-05-13 Thread ~eopxd
According to v-spec, mask agnostic behavior can be either kept as undisturbed or set elements' bits to all 1s. To distinguish the difference of mask policies, QEMU should be able to simulate the mask agnostic behavior as "set mask elements' bits to all 1s". There are multiple possibility for agnos

[PATCH qemu v4 07/10] target/riscv: rvv: Add mask agnostic for vector floating-point instructions

2022-05-13 Thread ~eopxd
From: Yueh-Ting (eop) Chen Signed-off-by: eop Chen Reviewed-by: Frank Chang Reviewed-by: Weiwei Li --- target/riscv/insn_trans/trans_rvv.c.inc | 12 target/riscv/vector_helper.c| 26 + 2 files changed, 38 insertions(+) diff --git a/target/risc

Re: [External] [PATCH v5 5/9] crypto: Implement RSA algorithm by hogweed

2022-05-13 Thread 何磊
> On May 13, 2022, at 6:55 PM, Daniel P. Berrangé wrote: > > On Thu, Apr 28, 2022 at 09:59:39PM +0800, zhenwei pi wrote: >> From: Lei He >> >> Implement RSA algorithm by hogweed from nettle. Thus QEMU supports >> a 'real' RSA backend to handle request from guest side. It's >> important to te

[PATCH qemu v4 10/10] target/riscv: rvv: Add option 'rvv_ma_all_1s' to enable optional mask agnostic behavior

2022-05-13 Thread ~eopxd
From: eopXD According to v-spec, mask agnostic behavior can be either kept as undisturbed or set elements' bits to all 1s. To distinguish the difference of mask policies, QEMU should be able to simulate the mask agnostic behavior as "set mask elements' bits to all 1s". There are multiple possibi

Re: [PATCH v4 4/5] i386/pc: relocate 4g start to 1T where applicable

2022-05-13 Thread Michael S. Tsirkin
On Wed, Apr 20, 2022 at 09:11:37PM +0100, Joao Martins wrote: > It is assumed that the whole GPA space is available to be DMA > addressable, within a given address space limit, expect for a > tiny region before the 4G. Since Linux v5.4, VFIO validates > whether the selected GPA is indeed valid i.e.

Re: [External] [PATCH v5 5/9] crypto: Implement RSA algorithm by hogweed

2022-05-13 Thread Daniel P . Berrangé
On Fri, May 13, 2022 at 08:26:14PM +0800, 何磊 wrote: > > > > On May 13, 2022, at 6:55 PM, Daniel P. Berrangé wrote: > > > > On Thu, Apr 28, 2022 at 09:59:39PM +0800, zhenwei pi wrote: > >> From: Lei He > >> > >> Implement RSA algorithm by hogweed from nettle. Thus QEMU supports > >> a 'real' R

Re: [PATCH v2 2/3] thread-pool: replace semaphore with condition variable

2022-05-13 Thread Paolo Bonzini
On 5/13/22 13:56, Nicolas Saenz Julienne wrote: pool->idle_threads++; -    qemu_mutex_unlock(&pool->lock); -    ret = qemu_sem_timedwait(&pool->sem, 1); -    qemu_mutex_lock(&pool->lock); +    ret = qemu_cond_timedwait(&pool->request_cond, &pool-

Re: [PATCH v2 1/8] qmp: Support for querying stats

2022-05-13 Thread Markus Armbruster
Paolo Bonzini writes: > From: Mark Kanda > > Introduce QMP support for querying stats. Provide a framework for adding new > stats and support for the following commands: > > - query-stats > Returns a list of all stats per target type (only VM and vCPU to start), with > additional options for spe

[PATCH] target/arm: Make number of counters in PMCR follow the CPU

2022-05-13 Thread Peter Maydell
Currently we give all the v7-and-up CPUs a PMU with 4 counters. This means that we don't provide the 6 counters that are required by the Arm BSA (Base System Architecture) specification if the CPU supports the Virtualization extensions. Instead of having a single PMCR_NUM_COUNTERS, make each CPU

Re: [PATCH 2/2] acpi/nvdimm: Fix aml_or() and aml_and() in if clause

2022-05-13 Thread Michael S. Tsirkin
On Tue, Apr 12, 2022 at 02:57:53PM +0800, Robert Hoo wrote: > It should be some typo originally, where in If condition, using bitwise > and/or, rather than logical and/or. > > The resulting change in AML code: > > If (((Local6 == Zero) | (Arg0 != Local0))) > ==> > If (((Local6 == Zero) || (Arg0 !

Re: [PATCH v2 3/8] qmp: add filtering of statistics by target vCPU

2022-05-13 Thread Markus Armbruster
Paolo Bonzini writes: > Introduce a simple filtering of statistics, that allows to retrieve > statistics for a subset of the guest vCPUs. This will be used for > example by the HMP monitor, in order to retrieve the statistics > for the currently selected CPU. > > Example: > { "execute": "query-s

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread Kevin Wolf
Am 13.05.2022 um 10:35 hat Daniel P. Berrangé geschrieben: > On Thu, May 12, 2022 at 08:06:00PM -0400, John Snow wrote: > > RFC: This is a very early, crude attempt at switching over to an > > external Python package dependency for QMP. This series does not > > actually make the switch in and of it

Re: [PATCH 1/8] qmp: Support for querying stats

2022-05-13 Thread Markus Armbruster
Paolo Bonzini writes: > On 5/5/22 15:28, Markus Armbruster wrote: >> Double-checking (pardon my ignorance): we're basically exposing the host >> kernel's KVM stats via QMP, with the option of extending it to other >> sources of stats in the future. Correct? > > Yes. As long as KVM is the only s

[PATCH 0/2] hw/arm/virt: fix dtb nits spotted by dtc

2022-05-13 Thread Peter Maydell
If you dump the DTB generated by the virt board using -machine dumpdtb=file.dtb and then decompile it with dtc -I dtb -O dts -o file.dts file.dtb dtc will complain about some harmless but wrong constructs in the dtb: Warning (unique_unit_address): /flash@0: duplicate unit-address (also used in

[PATCH 2/2] hw/arm/virt: Drop #size-cells and #address-cells from gpio-keys dtb node

2022-05-13 Thread Peter Maydell
The virt board generates a gpio-keys node in the dtb, but it incorrectly gives this node #size-cells and #address-cells properties. If you dump the dtb with 'machine dumpdtb=file.dtb' and run it through dtc, dtc will warn about this: Warning (avoid_unnecessary_addr_size): /gpio-keys: unnecessary

[PATCH 1/2] hw/arm/virt: Fix incorrect non-secure flash dtb node name

2022-05-13 Thread Peter Maydell
In the virt board with secure=on we put two nodes in the dtb for flash devices: one for the secure-only flash, and one for the non-secure flash. We get the reg properties for these correct, but in the DT node name, which by convention includes the base address of devices, we used the wrong address.

[PATCH] target/arm/helper.c: Delete stray obsolete comment

2022-05-13 Thread Peter Maydell
In commit 88ce6c6ee85d we switched from directly fishing the number of breakpoints and watchpoints out of the ID register fields to abstracting out functions to do this job, but we forgot to delete the now-obsolete comment in define_debug_regs() about the relation between the ID field value and the

Re: [PATCH 1/4] target/i386: Fix sanity check on max APIC ID / X2APIC enablement

2022-05-13 Thread Michael S. Tsirkin
On Mon, Mar 14, 2022 at 02:25:41PM +, David Woodhouse wrote: > The check on x86ms->apic_id_limit in pc_machine_done() had two problems. > > Firstly, we need KVM to support the X2APIC API in order to allow IRQ > delivery to APICs >= 255. So we need to call/check kvm_enable_x2apic(), > which was

Re: [PATCH v3] hw: m25p80: allow write_enable latch get/set

2022-05-13 Thread Cédric Le Goater
Thomas, and others, Are you ok with the qtest extension proposed by Iris ? If so, I can take them through an aspeed PR. Thanks, C. On 5/13/22 07:50, Iris Chen via wrote: The write_enable latch property is not currently exposed. This commit makes it a modifiable property. Signed-off-by: Iris

Re: [PATCH 1/8] qmp: Support for querying stats

2022-05-13 Thread Paolo Bonzini
On 5/13/22 15:10, Markus Armbruster wrote: Paolo Bonzini writes: On 5/5/22 15:28, Markus Armbruster wrote: This means we'll acquire yet another introspection system, unrelated to the introspection systems we already have in QEMU. ... ^^^ needs justification. Explain why passing the kernel's

Re: [RFC PATCH 3/9] tests: install "qemu" namespace package into venv

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 4:26 AM Paolo Bonzini wrote: > On 5/13/22 02:06, John Snow wrote: > > diff --git a/tests/requirements.txt b/tests/requirements.txt > > index a21b59b4439..0ba561b6bdf 100644 > > --- a/tests/requirements.txt > > +++ b/tests/requirements.txt > > @@ -1,5 +1,6 @@ > > # Add Pyth

Re: [RFC PATCH 4/9] tests: silence pip upgrade warnings during venv creation

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 4:27 AM Paolo Bonzini wrote: > On 5/13/22 02:06, John Snow wrote: > > diff --git a/tests/Makefile.include b/tests/Makefile.include > > index dbbf1ba535b..dfb678d379f 100644 > > --- a/tests/Makefile.include > > +++ b/tests/Makefile.include > > @@ -109,11 +109,11 @@ $(TESTS_VE

Re: [PATCH v2 1/8] qmp: Support for querying stats

2022-05-13 Thread Paolo Bonzini
On 5/13/22 14:52, Markus Armbruster wrote: +# @StatsResult: +# +# @provider: provider for this set of statistics. +# @qom-path: QOM path of the object for which the statistics are returned Since @qom-path is optional, we better document when it's present. In the review thread for v1, you explai

Re: [RFC PATCH 1/9] python: update for mypy 0.950

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 4:42 AM Paolo Bonzini wrote: > On 5/13/22 02:06, John Snow wrote: > > typeshed (included in mypy) recently updated to improve the typing for > > WriteTransport objects. I was working around this, but now there's a > > version where I shouldn't work around it. > > > > Unfortu

[PATCH] acpi/erst: fix fallthrough code upon validation failure

2022-05-13 Thread Ani Sinha
At any step when any validation fail in check_erst_backend_storage(), there is no need to continue further through other validation checks. Further, by continuing even when record_size is 0, we run the risk of triggering a divide by zero error if we continued with other validation checks. Hence, we

Re: [RFC PATCH 6/9] tests: add check-venv as a dependency of check and check-block

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 4:41 AM Paolo Bonzini wrote: > On 5/13/22 02:06, John Snow wrote: > > meson, create the python venv for block tests. > > +.PHONY: check-block > > +check-block: check-venv > > + @echo # Without some rule, this doesn't run at all. Why? > > + > > + > > # Consolidated t

Re: [PATCH v2] qga: add guest-get-diskstats command for Linux guests

2022-05-13 Thread Konstantin Kostiuk
On Fri, May 13, 2022 at 1:50 PM Konstantin Kostiuk wrote: > > > On Fri, May 13, 2022 at 1:40 PM luzhipeng wrote: > >> Add a new 'guest-get-diskstats' command for report disk io statistics >> for Linux guests. This can be usefull for getting io flow or handling >> IO fault, no need to enter guest

Re: [PATCH 1/8] qmp: Support for querying stats

2022-05-13 Thread Markus Armbruster
Paolo Bonzini writes: > On 5/13/22 15:10, Markus Armbruster wrote: >> Paolo Bonzini writes: >>> On 5/5/22 15:28, Markus Armbruster wrote: This means we'll acquire yet another introspection system, unrelated to the introspection systems we already have in QEMU. >> >> ... ^^^ needs just

Re: [PATCH v3] hw: m25p80: allow write_enable latch get/set

2022-05-13 Thread Thomas Huth
On 13/05/2022 15.54, Cédric Le Goater wrote: Thomas, and others, Are you ok with the qtest extension proposed by Iris ? If so, I can take them through an aspeed PR. Fine for me! On 5/13/22 07:50, Iris Chen via wrote: The write_enable latch property is not currently exposed. This commit mak

Re: [RFC PATCH 9/9] iotests: use tests/venv for running tests

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 4:38 AM Paolo Bonzini wrote: > On 5/13/22 02:06, John Snow wrote: > > Essentially, this: > > > > (A) adjusts the python binary to be the one found in the venv (which is > > a symlink to the python binary chosen at configure time) > > > > (B) adds a new VIRTUAL_ENV export var

Re: [PATCH v2 1/8] qmp: Support for querying stats

2022-05-13 Thread Markus Armbruster
Paolo Bonzini writes: > On 5/13/22 14:52, Markus Armbruster wrote: >>> +# @StatsResult: >>> +# >>> +# @provider: provider for this set of statistics. >>> +# @qom-path: QOM path of the object for which the statistics are returned >> Since @qom-path is optional, we better document when it's present

[PATCH] tests/qtest: kill off QEMU with SIGKILL when qtest exits abnormally

2022-05-13 Thread Daniel P . Berrangé
If a qtest program exits without calling qtest_quit(), then the QEMU emulator process will remain running in the background forever. Unfortunately this scenario is exactly what will happen when a g_assert() check triggers an abort(). Prior to switching to use of 'meson test', this problem would c

RE: [PATCH v1 0/4] xlnx-zcu102: fix the display port.

2022-05-13 Thread Frederic Konrad
Ping Can this be applied? Here is the patchew link: https://patchew.org/QEMU/20220503152545.1100386-1-fkon...@xilinx.com/ Best Regards, Fred > -Original Message- > From: frederic.kon...@xilinx.com > Sent: 03 May 2022 16:26 > To: qemu-devel@nongnu.org > Cc: alist...@alistair23.me; edgar

Re: Re: [PATCH v2] qga: add guest-get-diskstats command for Linux guests

2022-05-13 Thread luzhip...@cestc.cn
OK, indeed leak memory thanks, luzhip...@cestc.cn From: Konstantin Kostiuk Date: 2022-05-13 22:33 To: luzhipeng CC: qemu-devel; Michael Roth; Marc-André Lureau; Daniel P . Berrangé; Michal Privoznik Subject: Re: [PATCH v2] qga: add guest-get-diskstats command for Linux guests On Fri, May 1

Re: [PATCH] tests/qtest: kill off QEMU with SIGKILL when qtest exits abnormally

2022-05-13 Thread Thomas Huth
On 13/05/2022 16.37, Daniel P. Berrangé wrote: If a qtest program exits without calling qtest_quit(), then the QEMU emulator process will remain running in the background forever. Unfortunately this scenario is exactly what will happen when a g_assert() check triggers an abort(). Prior to switc

Re: [PATCH] tests/qtest: kill off QEMU with SIGKILL when qtest exits abnormally

2022-05-13 Thread Thomas Huth
On 13/05/2022 16.47, Thomas Huth wrote: On 13/05/2022 16.37, Daniel P. Berrangé wrote: If a qtest program exits without calling qtest_quit(), then the QEMU emulator process will remain running in the background forever. Unfortunately this scenario is exactly what will happen when a g_assert() c

Re: [PATCH 6/7] block: Implement bdrv_{pread, pwrite, pwrite_zeroes}() using generated_co_wrapper

2022-05-13 Thread Alberto Faria
On Fri, May 13, 2022 at 8:41 AM Paolo Bonzini wrote: > This is different from bdrv_co_pwrite_zeroes in that it does not clear > BDRV_REQ_MAY_UNMAP; but that's a bugfix really. > > It also doesn't call trace_bdrv_co_pwrite_zeroes, which is another bugfix. I'll mention this in the commit message.

Re: [PATCH 3/7] block: Make bdrv_{pread, pwrite}() return 0 on success

2022-05-13 Thread Alberto Faria
On Fri, May 13, 2022 at 9:22 AM Paolo Bonzini wrote: > The callers only check the return code of vhdx_log_peek_hdr, > vhdx_log_read_sectors, vhdx_log_write_sectors with ret < 0. But looking > at the callers: > > - vhdx_log_read_desc propagates ret directly from a successful > vhdx_log_read_sector

Re: sbsa board boot with neoverse-n1

2022-05-13 Thread Richard Henderson
On 5/12/22 22:59, Itaru Kitayama wrote: Richard, I'm wondering what options you use to bring up sbsa board with neoverse-n1 as I am only able to do it with cortex-a57, no other CPU types works. I didn't attempt to boot it, because I don't have firmware for it. I only added it to the list of cpu

Re: [PATCH v3] hw: m25p80: allow write_enable latch get/set

2022-05-13 Thread Cédric Le Goater
On 5/13/22 16:37, Thomas Huth wrote: On 13/05/2022 15.54, Cédric Le Goater wrote: Thomas, and others, Are you ok with the qtest extension proposed by Iris ? If so, I can take them through an aspeed PR. Fine for me! On 5/13/22 07:50, Iris Chen via wrote: The write_enable latch property is

Re: [PATCH v4 4/5] i386/pc: relocate 4g start to 1T where applicable

2022-05-13 Thread Joao Martins
On 5/13/22 13:33, Michael S. Tsirkin wrote: > On Wed, Apr 20, 2022 at 09:11:37PM +0100, Joao Martins wrote: >> It is assumed that the whole GPA space is available to be DMA >> addressable, within a given address space limit, expect for a >> tiny region before the 4G. Since Linux v5.4, VFIO validate

Re: [PATCH] target/arm/helper.c: Delete stray obsolete comment

2022-05-13 Thread Alex Bennée
Peter Maydell writes: > In commit 88ce6c6ee85d we switched from directly fishing the number > of breakpoints and watchpoints out of the ID register fields to > abstracting out functions to do this job, but we forgot to delete the > now-obsolete comment in define_debug_regs() about the relation

Re: [PATCH] target/arm/helper.c: Delete stray obsolete comment

2022-05-13 Thread Richard Henderson
On 5/13/22 06:18, Peter Maydell wrote: In commit 88ce6c6ee85d we switched from directly fishing the number of breakpoints and watchpoints out of the ID register fields to abstracting out functions to do this job, but we forgot to delete the now-obsolete comment in define_debug_regs() about the re

RE: About restoring the state in vhost-vdpa device

2022-05-13 Thread Parav Pandit
> From: Eugenio Perez Martin > Sent: Wednesday, May 11, 2022 3:44 PM > > This is a proposal to restore the state of the vhost-vdpa device at the > destination after a live migration. It uses as many available features both > from the device and from qemu as possible so we keep the communication

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 4:35 AM Daniel P. Berrangé wrote: > On Thu, May 12, 2022 at 08:06:00PM -0400, John Snow wrote: > > RFC: This is a very early, crude attempt at switching over to an > > external Python package dependency for QMP. This series does not > > actually make the switch in and of its

Re: [PULL 11/13] coroutine-ucontext: use QEMU_DEFINE_STATIC_CO_TLS()

2022-05-13 Thread Peter Maydell
On Wed, 4 May 2022 at 15:34, Kevin Wolf wrote: > > From: Stefan Hajnoczi > > Thread-Local Storage variables cannot be used directly from coroutine > code because the compiler may optimize TLS variable accesses across > qemu_coroutine_yield() calls. When the coroutine is re-entered from > another

Re: sbsa board boot with neoverse-n1

2022-05-13 Thread Itaru Kitayama
Thanks Richard I’ll look into it. On Sat, May 14, 2022 at 0:03 Richard Henderson wrote: > On 5/12/22 22:59, Itaru Kitayama wrote: > > Richard, > > I'm wondering what options you use to bring up sbsa board with > neoverse-n1 > > as I am only able to do it with cortex-a57, no other CPU types works

Re: [RFC PATCH 9/9] iotests: use tests/venv for running tests

2022-05-13 Thread Paolo Bonzini
On 5/13/22 16:38, John Snow wrote: It *should*, because "#!/usr/bin/env python3" is the preferred shebang for Python scripts. https://peps.python.org/pep-0394/ 'python3' "should" be available. 'python' may not be. Probably the "python" name in Makefile for

Re: [PATCH 2/2] hw/arm/virt: Drop #size-cells and #address-cells from gpio-keys dtb node

2022-05-13 Thread Richard Henderson
On 5/13/22 06:13, Peter Maydell wrote: The virt board generates a gpio-keys node in the dtb, but it incorrectly gives this node #size-cells and #address-cells properties. If you dump the dtb with 'machine dumpdtb=file.dtb' and run it through dtc, dtc will warn about this: Warning (avoid_unnecess

Re: [PATCH 1/2] hw/arm/virt: Fix incorrect non-secure flash dtb node name

2022-05-13 Thread Richard Henderson
On 5/13/22 06:13, Peter Maydell wrote: In the virt board with secure=on we put two nodes in the dtb for flash devices: one for the secure-only flash, and one for the non-secure flash. We get the reg properties for these correct, but in the DT node name, which by convention includes the base addre

Re: [RFC PATCH 6/9] tests: add check-venv as a dependency of check and check-block

2022-05-13 Thread Paolo Bonzini
On 5/13/22 16:12, John Snow wrote: I think you need instead: # The do-meson-check and do-meson-bench targets are defined in Makefile.mtest do-meson-check do-meson-bench: check-venv and I would even add "all" to the targets that create the virtual environment. Paolo

Re: [PATCH] tests/qtest: kill off QEMU with SIGKILL when qtest exits abnormally

2022-05-13 Thread Daniel P . Berrangé
On Fri, May 13, 2022 at 04:49:09PM +0200, Thomas Huth wrote: > On 13/05/2022 16.47, Thomas Huth wrote: > > On 13/05/2022 16.37, Daniel P. Berrangé wrote: > > > If a qtest program exits without calling qtest_quit(), then the > > > QEMU emulator process will remain running in the background forever.

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 6:21 AM Paolo Bonzini wrote: > On 5/13/22 02:06, John Snow wrote: > > The only downside I am really frowning at is that I will have to > > replicate some "update the venv if it's outdated" logic that is usually > > handled by the Make system in the venv bootstrapper. Still,

Re: [PATCH v2 68/74] hw/rx: Handle a kernel file that is ELF

2022-05-13 Thread Peter Maydell
On Tue, 3 May 2022 at 21:52, Richard Henderson wrote: > > Attempt to load the kernel with load_elf. If this fails with > ELF_LOAD_NOT_ELF, continue to treat the kernel as a raw image. > > This will be handy for running semihosting programs. > > Signed-off-by: Richard Henderson I know nothing of

Re: [PATCH] target/arm: Make number of counters in PMCR follow the CPU

2022-05-13 Thread Richard Henderson
On 5/13/22 05:28, Peter Maydell wrote: Currently we give all the v7-and-up CPUs a PMU with 4 counters. This means that we don't provide the 6 counters that are required by the Arm BSA (Base System Architecture) specification if the CPU supports the Virtualization extensions. Instead of having a

[PATCH v2 0/2] tests/libqtest: fix cleanup of QEMU processes and add robustness

2022-05-13 Thread Daniel P . Berrangé
This fixes the existing logic that was supposed to be cleaning up running QEMU processes when g_assert fires. It then further adds use of a Linux specific prctl as a safety net if the ABRT handler couldn't convince QEMU to quit with SIGTERM, or if the test program crashes with SEGV. Daniel P. Berr

Re: [PATCH v2 68/74] hw/rx: Handle a kernel file that is ELF

2022-05-13 Thread Richard Henderson
On 5/13/22 08:44, Peter Maydell wrote: On Tue, 3 May 2022 at 21:52, Richard Henderson wrote: Attempt to load the kernel with load_elf. If this fails with ELF_LOAD_NOT_ELF, continue to treat the kernel as a raw image. This will be handy for running semihosting programs. Signed-off-by: Richar

[PATCH v2 1/2] tests/qtest: fix registration of ABRT handler for QEMU cleanup

2022-05-13 Thread Daniel P . Berrangé
qtest_init registers a hook to cleanup the running QEMU process should g_assert() fire before qtest_quit is called. When the first hook is registered, it is supposed to triggere registration of the SIGABRT handler. Unfortunately the logic in hook_list_is_empty is inverted, so the SIGABRT handler ne

Re: [PATCH 1/8] qmp: Support for querying stats

2022-05-13 Thread Paolo Bonzini
On 5/13/22 16:35, Markus Armbruster wrote: Friday afternoon, worst time for word-smithing... Feel free to ask again on Monday:) a suggested place? For example, do you think it would fit better in the query-stats or query-stats-schemas documentation? I think query-stats-schemas is good enoug

[PATCH v2 2/2] tests/qtest: use prctl(PR_SET_PDEATHSIG) as fallback to kill QEMU

2022-05-13 Thread Daniel P . Berrangé
Although we register a ABRT handler to kill off QEMU when g_assert() triggers, we want an extra safety net. The QEMU process might be non-functional and thus not have responded to SIGTERM. The test script might also have crashed with SEGV, in which case the cleanup handlers won't ever run. Using t

[PATCH v2 00/10] Implement bdrv_{pread, pwrite, pwrite_sync, pwrite_zeroes}() using generated_co_wrapper

2022-05-13 Thread Alberto Faria
Start by making the interfaces of analogous non-coroutine and coroutine functions consistent with each other, then implement the non-coroutine ones using generated_co_wrapper. For the bdrv_pwrite_sync() case, also add the missing bdrv_co_pwrite_sync() function. Changes v1 --> v2: - Drop unnecessa

[PATCH v2 01/10] block: Add a 'flags' param to bdrv_{pread, pwrite, pwrite_sync}()

2022-05-13 Thread Alberto Faria
For consistency with other I/O functions, and in preparation to implement them using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression child, offset, buf, bytes; @@ - bdrv_pread(child, offset, buf, bytes) + bdrv_pread(child, offset, buf, bytes, 0)

[PATCH v2 06/10] block: Make 'bytes' param of bdrv_co_{pread, pwrite, preadv, pwritev}() an int64_t

2022-05-13 Thread Alberto Faria
For consistency with other I/O functions, and in preparation to implement bdrv_{pread,pwrite}() using generated_co_wrapper. unsigned int fits in int64_t, so all callers remain correct. Signed-off-by: Alberto Faria Reviewed-by: Paolo Bonzini --- block/coroutines.h | 4 ++-- include/bl

[PATCH v2 07/10] block: Implement bdrv_{pread, pwrite, pwrite_zeroes}() using generated_co_wrapper

2022-05-13 Thread Alberto Faria
bdrv_pwrite_zeroes() now also calls trace_bdrv_co_pwrite_zeroes() and clears the BDRV_REQ_MAY_UNMAP flag when appropriate, which it didn't previously. Signed-off-by: Alberto Faria Reviewed-by: Paolo Bonzini --- block/io.c | 41 include/bloc

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 6:29 AM Daniel P. Berrangé wrote: > On Fri, May 13, 2022 at 09:35:23AM +0100, Daniel P. Berrangé wrote: > > On Thu, May 12, 2022 at 08:06:00PM -0400, John Snow wrote: > > > RFC: This is a very early, crude attempt at switching over to an > > > external Python package depende

[PATCH v2 02/10] block: Change bdrv_{pread, pwrite, pwrite_sync}() param order

2022-05-13 Thread Alberto Faria
Swap 'buf' and 'bytes' around for consistency with bdrv_co_{pread,pwrite}(), and in preparation to implement these functions using generated_co_wrapper. Callers were updated using this Coccinelle script: @@ expression child, offset, buf, bytes, flags; @@ - bdrv_pread(child, offset, buf, b

Re: [PULL 11/13] coroutine-ucontext: use QEMU_DEFINE_STATIC_CO_TLS()

2022-05-13 Thread Kevin Wolf
Am 13.05.2022 um 17:27 hat Peter Maydell geschrieben: > On Wed, 4 May 2022 at 15:34, Kevin Wolf wrote: > > > > From: Stefan Hajnoczi > > > > Thread-Local Storage variables cannot be used directly from coroutine > > code because the compiler may optimize TLS variable accesses across > > qemu_corou

[PATCH v2 10/10] block/qcow2: Use bdrv_pwrite_sync() in qcow2_mark_dirty()

2022-05-13 Thread Alberto Faria
Use bdrv_pwrite_sync() instead of calling bdrv_pwrite() and bdrv_flush() separately. Signed-off-by: Alberto Faria --- block/qcow2.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index f2fb54c51f..90a2dd406b 100644 --- a/block/qcow2.c +

[PATCH v2 05/10] block: Make bdrv_co_pwrite() take a const buffer

2022-05-13 Thread Alberto Faria
It does not mutate the buffer. Signed-off-by: Alberto Faria Reviewed-by: Paolo Bonzini --- include/block/block_int-io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h index bb454200e5..d4d3bed783 100644 --- a/inclu

Re: [RFC PATCH 9/9] iotests: use tests/venv for running tests

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 11:33 AM Paolo Bonzini wrote: > On 5/13/22 16:38, John Snow wrote: > > It *should*, because "#!/usr/bin/env python3" is the preferred shebang > > for Python scripts. > > > > https://peps.python.org/pep-0394/ > > > > 'python3' "should" be a

[PULL 1/1] linux-headers: Update to v5.18-rc6

2022-05-13 Thread Alex Williamson
Update to c5eb0a61238d ("Linux 5.18-rc6"). Mechanical search and replace of vfio defines with white space massaging. Signed-off-by: Alex Williamson --- hw/vfio/common.c |6 hw/vfio/migration.c| 27 + include/standard-heade

[PATCH v2 08/10] block: Add bdrv_co_pwrite_sync()

2022-05-13 Thread Alberto Faria
Also convert bdrv_pwrite_sync() to being implemented using generated_co_wrapper. Signed-off-by: Alberto Faria --- block/io.c | 9 + include/block/block-io.h | 8 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/block/io.c b/block/io.c index ecd1c2a53

Re: [PULL 06/15] target/s390x: vxeh2: vector string search

2022-05-13 Thread Peter Maydell
On Wed, 4 May 2022 at 12:55, Thomas Huth wrote: > > From: David Miller Hi; Coverity thinks there might be an unintentional overflow in a shift in this function (CID 1488734). This particular Coverity heuristic seems to be very prone to false positives, so if you think it's wrong I'll just mark i

[PATCH v2 03/10] block: Make bdrv_{pread, pwrite}() return 0 on success

2022-05-13 Thread Alberto Faria
They currently return the value of their 'bytes' parameter on success. Make them return 0 instead, for consistency with other I/O functions and in preparation to implement them using generated_co_wrapper. This also makes it clear that short reads/writes are not possible. The few callers that rely

Re: [RFC PATCH 6/9] tests: add check-venv as a dependency of check and check-block

2022-05-13 Thread John Snow
On Fri, May 13, 2022, 11:34 AM Paolo Bonzini wrote: > On 5/13/22 16:12, John Snow wrote: > > > > I think you need instead: > > > > # The do-meson-check and do-meson-bench targets are defined in > > Makefile.mtest > > do-meson-check do-meson-bench: check-venv > > > > and I woul

Re: [PATCH qemu v4 02/10] target/riscv: rvv: Add mask agnostic for vector load / store instructions

2022-05-13 Thread Weiwei Li
在 2022/3/17 下午3:47, ~eopxd 写道: From: Yueh-Ting (eop) Chen Signed-off-by: eop Chen Reviewed-by: Frank Chang --- target/riscv/insn_trans/trans_rvv.c.inc | 5 target/riscv/vector_helper.c| 35 + 2 files changed, 29 insertions(+), 11 deletions(-)

[PATCH v2 04/10] crypto: Make block callbacks return 0 on success

2022-05-13 Thread Alberto Faria
They currently return the value of their headerlen/buflen parameter on success. Returning 0 instead makes it clear that short reads/writes are not possible. Signed-off-by: Alberto Faria --- block/crypto.c | 52 +- block/qcow2.c | 2

Re: [PULL 06/15] target/s390x: vxeh2: vector string search

2022-05-13 Thread Richard Henderson
On 5/13/22 08:54, Peter Maydell wrote: +s390_vec_write_element64(v1, 0, k << es); Specifically here, because k is 32 bit but s390_vec_write_element64() takes a uint64_t argument, we will do the shift as a signed 32 bit value before widening to 64 bits, so if the values of 'k' and 'es' are s

[PATCH] configure: remove another dead variable

2022-05-13 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index c8b5b99532..dda25f05bf 100755 --- a/configure +++ b/configure @@ -1992,7 +1992,6 @@ fi if test "$static" = "yes" ; then echo "CONFIG_STATIC=y" >> $config_host_mak fi -qem

Re: [PATCH v2 1/2] tests/qtest: fix registration of ABRT handler for QEMU cleanup

2022-05-13 Thread Thomas Huth
On 13/05/2022 17.49, Daniel P. Berrangé wrote: qtest_init registers a hook to cleanup the running QEMU process should g_assert() fire before qtest_quit is called. When the first hook is registered, it is supposed to triggere registration of the SIGABRT handler. Unfortunately the logic in hook_lis

[PATCH v2 09/10] block: Use bdrv_co_pwrite_sync() when caller is coroutine_fn

2022-05-13 Thread Alberto Faria
Convert uses of bdrv_pwrite_sync() into bdrv_co_pwrite_sync() when the callers are already coroutine_fn. Signed-off-by: Alberto Faria --- block/parallels.c | 2 +- block/qcow2-snapshot.c | 6 +++--- block/qcow2.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --gi

Re: [PATCH v8 07/12] target/riscv: Support mcycle/minstret write operation

2022-05-13 Thread Atish Kumar Patra
On Thu, May 12, 2022 at 11:29 PM Frank Chang wrote: > > On Thu, May 12, 2022 at 6:01 AM Atish Patra wrote: >> >> From: Atish Patra >> >> mcycle/minstret are actually WARL registers and can be written with any >> given value. With SBI PMU extension, it will be used to store a initial >> value pro

Re: [PULL 06/15] target/s390x: vxeh2: vector string search

2022-05-13 Thread Peter Maydell
On Fri, 13 May 2022 at 17:16, Richard Henderson wrote: > > On 5/13/22 08:54, Peter Maydell wrote: > >> +s390_vec_write_element64(v1, 0, k << es); > > > > Specifically here, because k is 32 bit but s390_vec_write_element64() > > takes a uint64_t argument, we will do the shift as a signed 32 bit

[PULL 0/1] Linux header update to v5.18-rc6

2022-05-13 Thread Alex Williamson
The following changes since commit 9de5f2b40860c5f8295e73fea9922df6f0b8d89a: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2022-05-12 10:52:15 -0700) are available in the Git repository at: https://gitlab.com/alex.williamson/qemu.git tags/linux-headers-v5.18-rc6

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread Paolo Bonzini
On 5/13/22 17:39, John Snow wrote: On Fri, May 13, 2022, 6:21 AM Paolo Bonzini > wrote: On 5/13/22 02:06, John Snow wrote: > The only downside I am really frowning at is that I will have to > replicate some "update the venv if it's outdated" logic that i

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread Daniel P . Berrangé
On Fri, May 13, 2022 at 11:55:18AM -0400, John Snow wrote: > On Fri, May 13, 2022, 6:29 AM Daniel P. Berrangé > wrote: > > > On Fri, May 13, 2022 at 09:35:23AM +0100, Daniel P. Berrangé wrote: > > > On Thu, May 12, 2022 at 08:06:00PM -0400, John Snow wrote: > > > > RFC: This is a very early, crud

Re: [PATCH] configure: remove another dead variable

2022-05-13 Thread Richard Henderson
On 5/13/22 09:11, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index c8b5b99532..dda25f05bf 100755 --- a/configure +++ b/configure @@ -1992,7 +1992,6 @@ fi if test "$static" = "yes" ; then echo "

Re: [PATCH v2 68/74] hw/rx: Handle a kernel file that is ELF

2022-05-13 Thread Richard Henderson
On 5/13/22 08:48, Richard Henderson wrote: On 5/13/22 08:44, Peter Maydell wrote: On Tue, 3 May 2022 at 21:52, Richard Henderson wrote: Attempt to load the kernel with load_elf.  If this fails with ELF_LOAD_NOT_ELF, continue to treat the kernel as a raw image. This will be handy for running

Re: [PATCH v2 2/2] tests/qtest: use prctl(PR_SET_PDEATHSIG) as fallback to kill QEMU

2022-05-13 Thread Thomas Huth
On 13/05/2022 17.49, Daniel P. Berrangé wrote: Although we register a ABRT handler to kill off QEMU when g_assert() triggers, we want an extra safety net. The QEMU process might be non-functional and thus not have responded to SIGTERM. The test script might also have crashed with SEGV, in which c

[PATCH] hw/tpm/tpm_tis_common.c: Assert that locty is in range

2022-05-13 Thread Peter Maydell
In tpm_tis_mmio_read(), tpm_tis_mmio_write() and tpm_tis_dump_state(), we calculate a locality index with tpm_tis_locality_from_addr() and then use it as an index into the s->loc[] array. In all these cases, the array index can't overflow because the MemoryRegion is sized to be TPM_TIS_NUM_LOCALIT

[PATCH] build: remove useless dependency

2022-05-13 Thread Paolo Bonzini
qemu-plugins.symbols is now processed in Meson. Signed-off-by: Paolo Bonzini --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index e5fd1ebdf6..b842dbccdb 100644 --- a/Makefile +++ b/Makefile @@ -165,10 +165,7 @@ ifneq ($(filter $(ninja-targets), $(ninja-cmd

Re: [PATCH qemu v4 02/10] target/riscv: rvv: Add mask agnostic for vector load / store instructions

2022-05-13 Thread Weiwei Li
在 2022/5/14 上午12:09, Weiwei Li 写道: 在 2022/3/17 下午3:47, ~eopxd 写道: From: Yueh-Ting (eop) Chen Signed-off-by: eop Chen Reviewed-by: Frank Chang ---   target/riscv/insn_trans/trans_rvv.c.inc |  5   target/riscv/vector_helper.c    | 35 +   2 files changed,

Re: [PATCH v2 2/4] kvm: Dirty ring autoconverge optmization for kvm_cpu_synchronize_kick_all

2022-05-13 Thread Peter Xu
On Sat, Apr 02, 2022 at 03:22:21PM +0800, Hyman Huang wrote: > 在 2022/3/28 9:32, wuc...@chinatelecom.cn 写道: > > @@ -879,7 +862,9 @@ static void kvm_dirty_ring_flush(void) > >* First make sure to flush the hardware buffers by kicking all > >* vcpus out in a synchronous way. > >

Re: [RFC PATCH 0/9] tests: run python tests under the build/tests/venv environment

2022-05-13 Thread Paolo Bonzini
On 5/13/22 18:07, Daniel P. Berrangé wrote: e.g. what if I want to require mypy >= 0.900 for testing, but you have a system package that requires mypy < 0.700? I would expect us to not require packages that are not present in the distros implied by https://www.qemu.org/docs/master/about/buil

Re: [PATCH v2 1/4] kvm: Dynamically adjust the rate of dirty ring reaper thread

2022-05-13 Thread Peter Xu
On Sat, Apr 02, 2022 at 03:28:13PM +0800, Chongyun Wu wrote: > > > +{ > > > +    float ratio = 0.0; > > > +    uint64_t sleep_time = 100; > > > +    enum KVMDirtyRingReaperRunLevel run_level_want; > > > +    enum KVMDirtyRingReaperSpeedControl speed_control; > > > + > > > +    /* > > > + *

Re: [PATCH] hw/tpm/tpm_tis_common.c: Assert that locty is in range

2022-05-13 Thread Philippe Mathieu-Daudé via
On Fri, May 13, 2022 at 6:43 PM Peter Maydell wrote: > > In tpm_tis_mmio_read(), tpm_tis_mmio_write() and > tpm_tis_dump_state(), we calculate a locality index with > tpm_tis_locality_from_addr() and then use it as an index into the > s->loc[] array. In all these cases, the array index can't over

Re: [PATCH] target/ppc: Fix tlbie

2022-05-13 Thread Fabiano Rosas
Leandro Lupori writes: > Commit 74c4912f097bab98 changed check_tlb_flush() to use > tlb_flush_all_cpus_synced() instead of calling tlb_flush() on each > CPU. However, as side effect of this, a CPU executing a ptesync > after a tlbie will have its TLB flushed only after exiting its > current Trans

<    1   2   3   >