Re: [PATCH] Resolves: https://gitlab.com/qemu-project/qemu/-/issues/542

2022-03-14 Thread Thomas Huth
On 12/03/2022 09.26, zzl wrote: --- hw/audio/intel-hda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 5f8a878f20..ff32936cfd 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -328,7 +328,7 @@ static void int

Re: [PATCH 3/3] tests/tcg/s390x: Test BRASL and BRCL with large negative offsets

2022-03-14 Thread Christian Borntraeger
Am 11.03.22 um 21:32 schrieb Richard Henderson: On 3/11/22 10:49, Ilya Leoshkevich wrote: +    size_t length = 0x10006; +    unsigned char *buf; +    int i; + +    buf = mmap(NULL, length, PROT_READ | PROT_WRITE | PROT_EXEC, +   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +    assert

[PATCH] i386/cpu: Remove the deprecated cpu model 'Icelake-Client'

2022-03-14 Thread Robert Hoo
Icelake, is the codename for Intel 3rd generation Xeon Scalable server processors. There isn't ever client variants. This "Icelake-Client" CPU model was added wrongly and imaginarily. It has been deprecated since v5.2, now it's time to remove it completely from code. Signed-off-by: Robert Hoo --

Re: [RESEND PATCH v3 1/7] target/riscv: Add initial support for native debug

2022-03-14 Thread Bin Meng
On Wed, Jan 19, 2022 at 11:16 AM Alistair Francis wrote: > > On Wed, Jan 5, 2022 at 1:09 PM Bin Meng wrote: > > > > From: Bin Meng > > > > This adds initial support for the native debug via the Trigger Module, > > as defined in the RISC-V Debug Specification [1]. > > Doesn't this mean we are jus

[PATCH experiment 01/16] coroutine: add missing coroutine_fn annotations for CoRwlock functions

2022-03-14 Thread Paolo Bonzini
CoRwlock can only be taken or released from a coroutine, and it can yield. Mark it as coroutine_fn. Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h index

[PATCH experiment 04/16] coroutine: introduce QemuCoLockable

2022-03-14 Thread Paolo Bonzini
In preparation for splitting "from coroutine" ("awaitable" in other languages) and "not from coroutine" functions, remove the CoMutex case from QemuLockable---thus making qemu_lockable_lock and qemu_lockable_unlock "not awaitable". To satisfy the qemu_co_queue_wait use case, introduce QemuCoLockab

[PATCH experiment 00/16] C++20 coroutine backend

2022-03-14 Thread Paolo Bonzini
It turns out that going from a prototype C++ implementation of the QEMU API, to something that could build tests/unit/test-coroutine, was just a few hours work; and once it compiled, only one line had to be changed for every test to pass. Most of the differences between C and C++ already show up h

[PATCH experiment 02/16] coroutine: qemu_coroutine_get_aio_context is not a coroutine_fn

2022-03-14 Thread Paolo Bonzini
Since it operates on a given coroutine, qemu_coroutine_get_aio_context can be called from outside coroutine context. This is for example how qio_channel_restart_read uses it. Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h | 2 +- util/qemu-coroutine.c| 2 +- 2 files changed, 2 in

Re: MAINTAINERS: macOS host support (was: MAINTAINERS: take edk2)

2022-03-14 Thread Daniel P . Berrangé
On Sat, Mar 12, 2022 at 02:51:21PM +0100, Christian Schoenebeck wrote: > On Freitag, 11. März 2022 10:26:47 CET Daniel P. Berrangé wrote: > > On Fri, Mar 11, 2022 at 10:13:24AM +0100, Christian Schoenebeck wrote: > > > On Donnerstag, 10. März 2022 12:40:06 CET Philippe Mathieu-Daudé wrote: > > > >

[PATCH experiment 06/16] use g_new0 instead of g_malloc0

2022-03-14 Thread Paolo Bonzini
Casting to/from void* must be explicit in C++. g_new0 takes care of that. Signed-off-by: Paolo Bonzini --- include/qemu/timer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 88ef114689..ee071e07d1 100644 --- a/include/qemu/

[PATCH experiment 07/16] start porting compiler.h to C++

2022-03-14 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- include/qemu/compiler.h | 4 1 file changed, 4 insertions(+) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 3baa5e3790..18848f0d49 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -72,6 +72,10 @@ int:(x) ?

[PATCH experiment 11/16] bump to C++20

2022-03-14 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- configure | 4 ++-- meson.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 886000346a..091710ec03 100755 --- a/configure +++ b/configure @@ -157,8 +157,8 @@ update_cxxflags() { # Set QEMU_CXXFLAGS from

[PATCH experiment 03/16] coroutine: small code cleanup in qemu_co_rwlock_wrlock

2022-03-14 Thread Paolo Bonzini
qemu_co_rwlock_wrlock stores the current coroutine in a loc variable, use it instead of calling qemu_coroutine_self() again. Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qemu-coroutine-lock.c b/util/qemu-coro

[PATCH experiment 08/16] tracetool: add extern "C" around generated headers

2022-03-14 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- scripts/tracetool/format/h.py | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index e94f0be7da..2d92fa8bd2 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/f

[PATCH experiment 09/16] start adding extern "C" markers

2022-03-14 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- include/block/aio.h | 5 + include/fpu/softfloat-types.h | 4 include/qemu/bitops.h | 3 +++ include/qemu/bswap.h | 10 +++--- include/qemu/coroutine.h | 4 include/qemu/host-utils.h | 4 include/qemu

[PATCH experiment 05/16] port atomic.h to C++

2022-03-14 Thread Paolo Bonzini
The functionality of typeof_strip_qual is provided by the standard library. Signed-off-by: Paolo Bonzini --- include/qemu/atomic.h | 5 + include/qemu/osdep.h | 1 + 2 files changed, 6 insertions(+) diff --git a/include/qemu/atomic.h b/include/qemu/atomic.h index 112a29910b..0889a9c5d2 100

[PATCH experiment 15/16] port QemuCoLockable to C++ coroutines

2022-03-14 Thread Paolo Bonzini
Convert "T coroutine_fn" annotations to the new type CoroutineFn, and add co_await as needed. _Generic is replaced by an overloaded constructor. C++ also does not like & on a temporary, so that is replaced by a function qemu_make_co_lockable_nonnull that hides it from the compiler. Signed-off-by

[PATCH experiment 16/16] port test-coroutine to C++ coroutines

2022-03-14 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- tests/unit/meson.build| 6 +- .../{test-coroutine.c => test-coroutine.cc} | 140 +- 2 files changed, 76 insertions(+), 70 deletions(-) rename tests/unit/{test-coroutine.c => test-coroutine.cc} (81%) diff --git a/tests/

[PATCH experiment 14/16] util: introduce C++ stackless coroutine backend

2022-03-14 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- configure | 44 +- include/qemu/coroutine.h | 445 +- include/qemu/coroutine_int.h | 8 + util/coroutine-stackless.cc | 145 ++ util/meson.build

[PATCH experiment 12/16] remove "new" keyword from trace-events

2022-03-14 Thread Paolo Bonzini
This is invalid in C++. Signed-off-by: Paolo Bonzini --- util/trace-events | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/util/trace-events b/util/trace-events index 5bc718eff7..9e23c11d11 100644 --- a/util/trace-events +++ b/util/trace-events @@ -3,8 +3,8 @

[PATCH experiment 10/16] add space between liter and string macro

2022-03-14 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- util/trace-events | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/util/trace-events b/util/trace-events index c8f53d7d9f..5bc718eff7 100644 --- a/util/trace-events +++ b/util/trace-events @@ -1,10 +1,10 @@ # See

[PATCH experiment 13/16] disable some code

2022-03-14 Thread Paolo Bonzini
Disable a lot of code that I can't be bothered to convert right now. Signed-off-by: Paolo Bonzini --- include/qemu/coroutine.h| 2 ++ qapi/qmp-dispatch.c | 2 ++ tests/unit/meson.build | 2 +- tests/unit/test-coroutine.c | 6 ++ util/async.c| 2 ++ util/

Re: [PATCH v2] block-qdict: Fix -Werror=maybe-uninitialized build failure

2022-03-14 Thread Markus Armbruster
Murilo Opsfelder Araujo writes: > Building QEMU on Fedora 37 (Rawhide Prerelease) ppc64le failed with the > following error: > > $ ../configure --prefix=/usr/local/qemu-disabletcg > --target-list=ppc-softmmu,ppc64-softmmu --disable-tcg --disable-linux-user > ... > $ make -j$(nproc) >

Re: [RESEND PATCH v3 5/7] target/riscv: csr: Hook debug CSR read/write

2022-03-14 Thread Bin Meng
On Wed, Jan 19, 2022 at 11:06 AM Alistair Francis wrote: > > On Wed, Jan 5, 2022 at 1:15 PM Bin Meng wrote: > > > > From: Bin Meng > > > > This adds debug CSR read/write support to the RISC-V CSR RW table. > > > > Signed-off-by: Bin Meng > > --- > > > > Changes in v3: > > - add riscv_trigger_in

Re: [PATCH v2] tests/avocado: starts PhoneServer upfront

2022-03-14 Thread Thomas Huth
On 11/03/2022 18.11, Beraldo Leal wrote: Race conditions can happen with the current code, because the port that was available might not be anymore by the time the server is started. By setting the port to 0, PhoneServer it will use the OS default behavior to get a free port, then we save this i

Re: [PATCH v5 0/5] user creatable pnv-phb4 devices

2022-03-14 Thread Cédric Le Goater
On 3/10/22 19:49, Thomas Huth wrote: On 11/01/2022 14.10, Daniel Henrique Barboza wrote: Hi, This version implements Cedric's review suggestions from v4. No drastic design changes were made. Changes from v4: - patches 1,3,5: unchanged - patch 2:    * renamed function to pnv_phb4_xscom_realize(

Re: [PATCH 5/5] s390x: pv: Add dump support

2022-03-14 Thread Janosch Frank
On 3/12/22 15:52, Richard Henderson wrote: On 3/10/22 03:25, Janosch Frank wrote: Sometimes dumping a guest from the outside is the only way to get the data that is needed. This can be the case if a dumping mechanism like KDUMP hasn't been configured or data needs to be fetched at a specific poi

Re: [PATCH 3/3] tests/tcg/s390x: Test BRASL and BRCL with large negative offsets

2022-03-14 Thread David Hildenbrand
On 14.03.22 09:30, Christian Borntraeger wrote: > > > Am 11.03.22 um 21:32 schrieb Richard Henderson: >> On 3/11/22 10:49, Ilya Leoshkevich wrote: >>> +    size_t length = 0x10006; >>> +    unsigned char *buf; >>> +    int i; >>> + >>> +    buf = mmap(NULL, length, PROT_READ | PROT_WRITE | PR

Re: [PATCH v2 3/3] tests/tcg/s390x: Test BRASL and BRCL with large negative offsets

2022-03-14 Thread David Hildenbrand
On 12.03.22 10:25, Ilya Leoshkevich wrote: > Add a small test in order to prevent regressions. > > Signed-off-by: Ilya Leoshkevich > --- > tests/tcg/s390x/Makefile.target| 1 + > tests/tcg/s390x/branch-relative-long.c | 60 ++ > 2 files changed, 61 insertions(+)

Re: [PATCH] x86: q35: require split irqchip for large CPU count

2022-03-14 Thread Igor Mammedov
On Fri, 11 Mar 2022 14:58:41 + David Woodhouse wrote: > On Fri, 2022-03-11 at 09:39 -0500, Igor Mammedov wrote: > > if VM is started with: > > > >-enable-kvm -smp 256 > > > > without specifying 'split' irqchip, VM might eventually boot > > but no more than 255 CPUs will be operational a

[PATCH v3 1/3] s390x/tcg: Fix BRASL with a large negative offset

2022-03-14 Thread Ilya Leoshkevich
When RI2 is 0x8000, qemu enters an infinite loop instead of jumping backwards. Fix by adding a missing cast, like in in2_ri2(). Fixes: 8ac33cdb8bfb ("Convert BRANCH AND SAVE") Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich --- target/s390x/tcg

[PATCH v3 0/3] Fix BRASL and BRCL with large negative offsets

2022-03-14 Thread Ilya Leoshkevich
Hi, I noticed that sometimes jumping backwards leads to crashes or hangs. The problem is a missing cast. Patches 1 and 2 fix the problem, patch 3 adds a test. v1: https://lists.nongnu.org/archive/html/qemu-devel/2022-03/msg03356.html v1 -> v2: - Skip the test if mmap() fails (Richard). - Replace

[PATCH v3 3/3] tests/tcg/s390x: Test BRASL and BRCL with large negative offsets

2022-03-14 Thread Ilya Leoshkevich
Add a small test in order to prevent regressions. Reviewed-by: Richard Henderson Reviewed-by: David Hildenbrand Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.target| 1 + tests/tcg/s390x/branch-relative-long.c | 68 ++ 2 files changed, 69 inserti

[PATCH v2 0/3] rSTify a few more docs; move them to QEMU Git

2022-03-14 Thread Kashyap Chamarthy
This series rST-ifies: - security-process[1] - MailingLists[2] - GettingStartedDevelopers[3] The 'security-process' page is from the QEMU web and is moved to docs/devel/ in QEMU Git. This is based on Paolo's feedback here[4]. The next two docs are converted from the Wiki. [1] https://www.

[PATCH v2 1/3] docs: rSTify "security-process" page; move it to QEMU Git

2022-03-14 Thread Kashyap Chamarthy
This is based on Paolo's suggestion[1] that the 'security-process'[2] page being a candidate for docs/devel. Converted from Markdown to rST using: $> pandoc -f markdown -t rst security-process.md \ -o security-process.rst It's a 1-1 conversion (I double-checked to the best I could).

[PATCH v2 2/3] docs: rSTify MailingLists wiki; move it to QEMU Git

2022-03-14 Thread Kashyap Chamarthy
This document is referred to from the GettingStartedDevelopers wiki which will be rSTified in a follow-up commit. Converted from Mediawiki to rST using: $> pandoc -f Mediawiki -t rst MailingLists.wiki -o mailing-lists.rst It's a 1-1 conversion (I double-checked to the best I could).

[PATCH v2 3/3] docs: rSTify GettingStartedDevelopers wiki; move it to QEMU Git

2022-03-14 Thread Kashyap Chamarthy
Converted the wiki[1] from Markdown to rST using: $> pandoc -f Mediawiki -t rst getting-started-developers.wiki -o getting-started-developers.rst It's a 1-1 conversion (I double-checked to the best I could). I've also checked that the hyperlinks work correctly post-conversion. [1] h

[PATCH v3 2/3] s390x/tcg: Fix BRCL with a large negative offset

2022-03-14 Thread Ilya Leoshkevich
When RI2 is 0x8000, qemu enters an infinite loop instead of jumping backwards. Fix by adding a missing cast, like in in2_ri2(). Fixes: 7233f2ed1717 ("target-s390: Convert BRANCH ON CONDITION") Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Signed-off-by: Ilya Leoshkevich ---

Re: [PATCH experiment 06/16] use g_new0 instead of g_malloc0

2022-03-14 Thread Markus Armbruster
Paolo Bonzini writes: > Casting to/from void* must be explicit in C++. g_new0 takes care of that. > > Signed-off-by: Paolo Bonzini > --- > include/qemu/timer.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/qemu/timer.h b/include/qemu/timer.h > index 88ef11468

Re: [PATCH v1 1/1] hw: aspeed_scu: Add AST2600 hpll calculation function

2022-03-14 Thread Cédric Le Goater
Hello Steven, On 3/14/22 10:54, Steven Lee wrote: AST2600's HPLL register offset and bit definition are different from AST2500. Add a hpll calculation function for ast2600 and modify apb frequency calculation function based on SCU200 register description in ast2600v11.pdf. It looks good. A few

Re: [PATCH v3 0/3] Fix BRASL and BRCL with large negative offsets

2022-03-14 Thread Thomas Huth
On 14/03/2022 11.42, Ilya Leoshkevich wrote: Hi, I noticed that sometimes jumping backwards leads to crashes or hangs. The problem is a missing cast. Patches 1 and 2 fix the problem, patch 3 adds a test. v1: https://lists.nongnu.org/archive/html/qemu-devel/2022-03/msg03356.html v1 -> v2: - Ski

Re: [PATCH 0/3] tcg/s390x vector fixes

2022-03-14 Thread Thomas Huth
On 10/03/2022 21.27, Richard Henderson wrote: These 3 issues were found by running risu on arm neon test cases. In the meantime, Thomas encountered one of the same with the new tests of vectorized sha512. Thanks! If you don't mind (e.g. if you don't have any other TCG patches pending), I can t

[PULL 05/12] ui/console: move console compatibility check to dcl_display_console()

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau The current checks are done at registration time only. However, if a DCL has no specific console specified, it may be switched dynamically with console_select() later on. Let's move the checks when displaychangelistener_display_console() is called, which includes registra

[PULL 00/12] dbus console fixes

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau The following changes since commit 1416688c53be6535be755b44c15fb2eb9defd20f: Merge remote-tracking branch 'remotes/mcayland/tags/q800-updates-for-7.0-20220309' into staging (2022-03-10 13:16:37 +) are available in the Git repository at: g...@gitlab.com:marcand

[PULL 09/12] ui/console: optionally update after gfx switch

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau When switching to the dummy surface, we should also call gfx_update. But when using GL, we shouldn't call it. By making it an argument to displaychangelistener_gfx_switch(), it will be explicit, and cannot be forgotten that easily. Fixes: commit ebced091 ("console: save

[PULL 02/12] ui/console: move dcl compatiblity check to a callback

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau As expected from the "compatible_dcl" comment, a simple comparison of ops isn't enough. The following patch will fix a regression introduced by this limited check by extending the compatibility callback for egl-headless. For now, this patch simply replaces the the "compat

[PULL 01/12] ui/console: move check for compatible GL context

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau Move GL context compatibility check in dpy_compatible_with(), and use recommended error reporting. Signed-off-by: Marc-André Lureau Acked-by: Gerd Hoffmann --- ui/console.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/ui/co

[PULL 10/12] ui/dbus: fix texture sharing

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau The DBus listener naively create, update and destroy textures without taking into account other listeners. The texture were shared, but texture update was unnecessarily duplicated. Teach DisplayGLCtx to do optionally shared texture handling. This is only implemented for D

[PULL 06/12] ui/shader: fix potential leak of shader on error

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau Value of 0 for program and shaders are silently ignored and indicate error. Signed-off-by: Marc-André Lureau Acked-by: Gerd Hoffmann --- ui/shader.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/shader.c b/ui/shader.c index e8b8d321b7c7..

[PULL 03/12] ui/console: egl-headless is compatible with non-gl listeners

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau Fix a regression introduced by commit 5e79d516e ("ui: split the GL context in a different object"). Reported-by: Akihiko Odaki Signed-off-by: Marc-André Lureau Acked-by: Gerd Hoffmann --- ui/egl-headless.c | 8 1 file changed, 8 insertions(+) diff --git a/ui

[PULL 11/12] ui/dbus: do not send 2d scanout until gfx_update

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau gfx_switch() is called to set the new_surface, not necessarily to display it. It should be displayed after gfx_update(). Send the whole scanout only in this case. Signed-off-by: Marc-André Lureau Acked-by: Gerd Hoffmann --- ui/dbus-listener.c | 37 -

[PULL 04/12] ui/dbus: associate the DBusDisplayConsole listener with the given console

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau DBusDisplayConsole is specific to a given QemuConsole. Fixes: commit 142ca628 ("ui: add a D-Bus display backend") Reported-by: Akihiko Odaki Signed-off-by: Marc-André Lureau Acked-by: Gerd Hoffmann --- ui/dbus.h | 3 +++ ui/dbus-console.c | 27 +--

[PULL 12/12] ui/console: call gfx_switch() even if the current scanout is GL

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau egl-headless depends on the backing surface to be set before texture are set and updated. Display it (update=true) iff the current scanout kind is SURFACE. Reported-by: Akihiko Odaki Signed-off-by: Marc-André Lureau Acked-by: Gerd Hoffmann --- ui/console.c | 7 ---

[PULL 08/12] ui/console: add a dpy_gfx_switch callback helper

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau Slight code improvement. Signed-off-by: Marc-André Lureau Acked-by: Gerd Hoffmann --- ui/console.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ui/console.c b/ui/console.c index d3ecbb215736..102fcf0a5068 100644 --- a/ui

Re: [PATCH] x86: q35: require split irqchip for large CPU count

2022-03-14 Thread David Woodhouse
On Mon, 2022-03-14 at 11:35 +0100, Igor Mammedov wrote: > On Fri, 11 Mar 2022 14:58:41 + > David Woodhouse < > dw...@infradead.org > > wrote: > > > On Fri, 2022-03-11 at 09:39 -0500, Igor Mammedov wrote: > > > if VM is started with: > > > > > >-enable-kvm -smp 256 > > > > > > without spe

[PATCH v2 10/10] tests/qemu-iotests/030: test_stream_parallel should use auto_finalize=False

2022-03-14 Thread Emanuele Giuseppe Esposito
First, use run_job() instead of the current logic to run the stream job. Then, use auto_finalize=False to be sure that the job is not automatically deleted once it is done. In this way, if the job finishes before we want, it is not finalized yet so the other commands can still execute without fail

[PATCH v2 09/10] child_job_drained_poll: override polling condition only when in home thread

2022-03-14 Thread Emanuele Giuseppe Esposito
drv->drained_poll() is only implemented in mirror, and allows it to drain from within the coroutine. The mirror implementation uses in_drain flag to recognize when it is draining from coroutine, and consequently avoid deadlocking (wait the poll condition in child_job_drained_poll to wait for itself

[PATCH v2 07/10] test-bdrv-drain.c: remove test_detach_by_parent_cb()

2022-03-14 Thread Emanuele Giuseppe Esposito
This test uses a callback of an I/O function (blk_aio_preadv) to modify the graph, using bdrv_attach_child. This is simply not allowed anymore. I/O cannot change the graph. Before "block/io.c: make bdrv_do_drained_begin_quiesce static and introduce bdrv_drained_begin_no_poll", the test would simpl

[PATCH v2 05/10] block.c: bdrv_replace_child_noperm: first call ->attach(), and then add child

2022-03-14 Thread Emanuele Giuseppe Esposito
Doing the opposite can make adding the child node to a non-drained node, as apply_subtree_drain is only done in ->attach() and thus make assert_bdrv_graph_writable fail. This can happen for example during a transaction rollback (test 245, test_io_with_graph_changes): 1. a node is removed from the

[PATCH v2 02/10] bdrv_parent_drained_begin_single: handle calls from coroutine context

2022-03-14 Thread Emanuele Giuseppe Esposito
bdrv_parent_drained_begin_single() is also called by bdrv_replace_child_noperm(). The latter is often called from coroutines, for example in bdrv_co_create_opts() callbacks. This can potentially create deadlocks, because if the drain_saldo in bdrv_replace_child_noperm is > 0, the coroutine will st

[PATCH v2 06/10] test-bdrv-drain.c: adapt test to support additional subtree drains

2022-03-14 Thread Emanuele Giuseppe Esposito
There will be a problem in this test when we will add subtree drains in bdrv_replace_child_noperm: test_detach_indirect is only interested in observing the first call to .drained_begin. In the original test, there was only a single subtree drain; however, with additional drains introduced in bdrv_

[PATCH] ppc/pnv: Remove user-created PHB{3,4,5} devices

2022-03-14 Thread Cédric Le Goater
On a real system with POWER{8,9,10} processors, PHBs are sub-units of the processor, they can be deactivated by firmware but not plugged in or out like a PCI adapter on a slot. Nevertheless, having user-created PHBs in QEMU seemed to be a good idea for testing purposes : 1. having a limited set o

[PATCH v2 04/10] block.c: bdrv_replace_child_noperm: first remove the child, and then call ->detach()

2022-03-14 Thread Emanuele Giuseppe Esposito
Doing the opposite can make ->detach() (more precisely bdrv_unapply_subtree_drain() in bdrv_child_cb_detach) undo the subtree_drain just performed to protect the removal of the child from the graph, thus making the fully-enabled assert_bdrv_graph_writable fail. Note that assert_bdrv_graph_writable

Re: [PATCH experiment 08/16] tracetool: add extern "C" around generated headers

2022-03-14 Thread Philippe Mathieu-Daudé
On 14/3/22 10:31, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- scripts/tracetool/format/h.py | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index e94f0be7da..2d92fa8bd2 100644 --- a/scripts/trac

[PULL 07/12] ui/shader: free associated programs

2022-03-14 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Acked-by: Gerd Hoffmann --- ui/shader.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/shader.c b/ui/shader.c index 4c80fc831f68..ab448c41d4c6 100644 --- a/ui/shader.c +++ b/ui/shader.c @@ -172,5 +172,8 @@ void qemu_gl_fini_sh

Re: [PATCH experiment 03/16] coroutine: small code cleanup in qemu_co_rwlock_wrlock

2022-03-14 Thread Philippe Mathieu-Daudé
On 14/3/22 10:31, Paolo Bonzini wrote: qemu_co_rwlock_wrlock stores the current coroutine in a loc variable, use it instead of calling qemu_coroutine_self() again. Signed-off-by: Paolo Bonzini --- util/qemu-coroutine-lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by:

[PATCH v6 07/18] jobs: add job lock in find_* functions

2022-03-14 Thread Emanuele Giuseppe Esposito
Both blockdev.c and job-qmp.c have TOC/TOU conditions, because they first search for the job and then perform an action on it. Therefore, we need to do the search + action under the same job mutex critical section. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. Signed

[PATCH v6 04/18] aio-wait.h: introduce AIO_WAIT_WHILE_UNLOCKED

2022-03-14 Thread Emanuele Giuseppe Esposito
Same as AIO_WAIT_WHILE macro, but if we are in the Main loop do not release and then acquire ctx_ 's aiocontext. Once all Aiocontext locks go away, this macro will replace AIO_WAIT_WHILE. Reviewed-by: Stefan Hajnoczi Signed-off-by: Emanuele Giuseppe Esposito --- include/block/aio-wait.h | 17 +

Re: [PATCH v2 2/4] Introduce event-loop-base abstract class

2022-03-14 Thread Stefan Hajnoczi
On Fri, Mar 11, 2022 at 11:17:22AM +0100, Nicolas Saenz Julienne wrote: > On Thu, 2022-03-10 at 10:25 +, Stefan Hajnoczi wrote: > > On Thu, Mar 03, 2022 at 03:58:20PM +0100, Nicolas Saenz Julienne wrote: > > > @@ -2935,13 +2947,6 @@ qemu_syms = custom_target('qemu.syms', output: > > > 'qemu.sy

[PATCH v6 11/18] job.h: rename job API functions called with job_mutex held

2022-03-14 Thread Emanuele Giuseppe Esposito
With the *nop* job_lock/unlock placed, rename the job functions of the job API that are always under job_mutex, adding "_locked" suffix. List of functions that get this suffix: job_txn_unref job_txn_add_job job_ref job_unref job_enter_cond job_finish_sync job_is_

[PATCH v6 09/18] block/mirror.c: use of job helpers in drivers to avoid TOC/TOU

2022-03-14 Thread Emanuele Giuseppe Esposito
Once job lock is used and aiocontext is removed, mirror has to perform job operations under the same critical section, using the helpers prepared in previous commit. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by:

[PATCH v2 03/10] block/io.c: fix bdrv_child_cb_drained_begin invocations from a coroutine

2022-03-14 Thread Emanuele Giuseppe Esposito
Using bdrv_do_drained_begin_quiesce() in bdrv_child_cb_drained_begin() is not a good idea: the callback might be called when running a drain in a coroutine, and bdrv_drained_begin_poll() does not handle that case, resulting in assertion failure. Instead, bdrv_do_drained_begin with no recursion and

[PATCH v6 15/18] job: detect change of aiocontext within job coroutine

2022-03-14 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini We want to make sure access of job->aio_context is always done under either BQL or job_mutex. The problem is that using aio_co_enter(job->aiocontext, job->co) in job_start and job_enter_cond makes the coroutine immediately resume, so we can't hold the job lock. And caching it

[PATCH v6 16/18] jobs: protect job.aio_context with BQL and job_mutex

2022-03-14 Thread Emanuele Giuseppe Esposito
In order to make it thread safe, implement a "fake rwlock", where we allow reads under BQL *or* job_mutex held, but writes only under BQL *and* job_mutex. The only write we have is in child_job_set_aio_ctx, which always happens under drain (so the job is paused). For this reason, introduce job_set

[PATCH v2 00/10] block: bug fixes in preparation of AioContext removal

2022-03-14 Thread Emanuele Giuseppe Esposito
This serie aims to remove and clean up some bugs that came up when trying to replace the AioContext lock and still protect BlockDriverState fields. They were part of the serie "Removal of Aiocontext lock through drains: protect bdrv_replace_child_noperm", but since that serie is still a work in pr

[PATCH v6 01/18] job.c: make job_mutex and job_lock/unlock() public

2022-03-14 Thread Emanuele Giuseppe Esposito
job mutex will be used to protect the job struct elements and list, replacing AioContext locks. Right now use a shared lock for all jobs, in order to keep things simple. Once the AioContext lock is gone, we can introduce per-job locks. To simplify the switch from aiocontext to job lock, introduce

[PATCH v6 13/18] job.h: define unlocked functions

2022-03-14 Thread Emanuele Giuseppe Esposito
All these functions assume that the lock is not held, and acquire it internally. These functions will be useful when job_lock is globally applied, as they will allow callers to access the job struct fields without worrying about the job lock. Update also the comments in blockjob.c (and move them

[PATCH v2 01/10] drains: create bh only when polling

2022-03-14 Thread Emanuele Giuseppe Esposito
We need to prevent coroutines from calling BDRV_POLL_WHILE, because it can create deadlocks. This is done by firstly creating a bottom half and then yielding. The bh is then scheduled in the main loop, performs the drain and polling, and then resumes the coroutine. The problem is that currently we

[PATCH v6 10/18] jobs: rename static functions called with job_mutex held

2022-03-14 Thread Emanuele Giuseppe Esposito
With the *nop* job_lock/unlock placed, rename the static functions that are always under job_mutex, adding "_locked" suffix. List of functions that get this suffix: job_txn_refjob_txn_del_job job_txn_apply job_state_transition job_should_pause job_event_cance

Re: [PATCH experiment 00/35] stackless coroutine backend

2022-03-14 Thread Stefan Hajnoczi
On Sun, Mar 13, 2022 at 04:18:40PM +0100, Paolo Bonzini wrote: > On 3/11/22 13:17, Daniel P. Berrangé wrote: > The question is what is easier to maintain, stack switching code that is > becoming less and less portable (status quo with SafeStack, CET and the TLS > issues that Stefan has worked on),

[PATCH v2 08/10] tests/unit/test-bdrv-drain.c: graph setup functions can't run in coroutines

2022-03-14 Thread Emanuele Giuseppe Esposito
Graph initialization functions like blk_new(), bdrv_new() and so on should not run in a coroutine. In fact, they might invoke a drain (for example blk_insert_bs eventually calls bdrv_replace_child_noperm) that in turn can invoke callbacks like bdrv_do_drained_begin_quiesce(), that asserts exactly t

Re: [PATCH experiment 08/16] tracetool: add extern "C" around generated headers

2022-03-14 Thread Paolo Bonzini
On 3/14/22 14:33, Philippe Mathieu-Daudé wrote: On 14/3/22 10:31, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini ---   scripts/tracetool/format/h.py | 8 +++-   1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py ind

[PATCH v6 08/18] jobs: use job locks also in the unit tests

2022-03-14 Thread Emanuele Giuseppe Esposito
Add missing job synchronization in the unit tests, with explicit locks. Note: at this stage, job_{lock/unlock} and job lock guard macros are *nop*. Signed-off-by: Emanuele Giuseppe Esposito --- tests/unit/test-bdrv-drain.c | 76 - tests/unit/test-block-iothread.c |

Re: [PATCH v2 2/3] docs: rSTify MailingLists wiki; move it to QEMU Git

2022-03-14 Thread Philippe Mathieu-Daudé
Hi Kashyap, On 14/3/22 11:49, Kashyap Chamarthy wrote: This document is referred to from the GettingStartedDevelopers wiki which will be rSTified in a follow-up commit. Converted from Mediawiki to rST using: $> pandoc -f Mediawiki -t rst MailingLists.wiki -o mailing-lists.rst It

Re: [PATCH] x86: q35: require split irqchip for large CPU count

2022-03-14 Thread Daniel P . Berrangé
On Mon, Mar 14, 2022 at 12:59:38PM +, David Woodhouse wrote: > On Mon, 2022-03-14 at 11:35 +0100, Igor Mammedov wrote: > > On Fri, 11 Mar 2022 14:58:41 + > > David Woodhouse < > > dw...@infradead.org > > > wrote: > > > > > On Fri, 2022-03-11 at 09:39 -0500, Igor Mammedov wrote: > > > > if

[PATCH v6 14/18] commit and mirror: create new nodes using bdrv_get_aio_context, and not the job aiocontext

2022-03-14 Thread Emanuele Giuseppe Esposito
We are always using the given bs AioContext, so there is no need to take the job ones (which is identical anyways). This also reduces the point we need to check when protecting job.aio_context field. Reviewed-by: Stefan Hajnoczi Signed-off-by: Emanuele Giuseppe Esposito --- block/commit.c | 4 +

Re: [PATCH] ppc/pnv: Remove user-created PHB{3,4,5} devices

2022-03-14 Thread Daniel Henrique Barboza
On 3/14/22 10:05, Cédric Le Goater wrote: On a real system with POWER{8,9,10} processors, PHBs are sub-units of the processor, they can be deactivated by firmware but not plugged in or out like a PCI adapter on a slot. Nevertheless, having user-created PHBs in QEMU seemed to be a good idea for

[PULL 0/1] I2C patches for 2022-03-14

2022-03-14 Thread Philippe Mathieu-Daudé
com/philmd/qemu.git tags/i2c-20220314 for you to fetch changes up to 1cbab82e9d1bdb2c7b9ef46a396fdc03ea3fa04c: hw/nvram: at24 return 0xff if 1 byte address (2022-03-14 14:48:35 +0100) I2C patch queue - Fix AT24 EEPROM partial writ

Re: [PULL v2 00/12] Hexagon (target/hexagon) queue

2022-03-14 Thread Peter Maydell
On Sat, 12 Mar 2022 at 20:13, Taylor Simpson wrote: > > The following changes since commit 1416688c53be6535be755b44c15fb2eb9defd20f: > > Merge remote-tracking branch > 'remotes/mcayland/tags/q800-updates-for-7.0-20220309' into staging > (2022-03-10 13:16:37 +) > > are available in the Git

Re: [PATCH experiment 12/16] remove "new" keyword from trace-events

2022-03-14 Thread Philippe Mathieu-Daudé
On 14/3/22 10:31, Paolo Bonzini wrote: This is invalid in C++. Signed-off-by: Paolo Bonzini --- util/trace-events | 16 1 file changed, 8 insertions(+), 8 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH v1 1/1] hw: aspeed_scu: Add AST2600 hpll calculation function

2022-03-14 Thread Steven Lee
AST2600's HPLL register offset and bit definition are different from AST2500. Add a hpll calculation function for ast2600 and modify apb frequency calculation function based on SCU200 register description in ast2600v11.pdf. Signed-off-by: Steven Lee --- hw/misc/aspeed_scu.c | 43

[PATCH-for-7.0 v3] softmmu: List CPU types again

2022-03-14 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé Commit e0220bb5b2 made cpus.c target-agnostic but didn't notice the cpu_list() function is only defined in target-specific code in "cpu.h". Move list_cpus() declaration to "exec/cpu-common.h" because this function is not softmmu-specific and can also be used by user-m

Re: [PATCH v2] block-qdict: Fix -Werror=maybe-uninitialized build failure

2022-03-14 Thread Philippe Mathieu-Daudé
On 11/3/22 23:16, Murilo Opsfelder Araujo wrote: Building QEMU on Fedora 37 (Rawhide Prerelease) ppc64le failed with the following error: $ ../configure --prefix=/usr/local/qemu-disabletcg --target-list=ppc-softmmu,ppc64-softmmu --disable-tcg --disable-linux-user ... $ make -j$(n

[PATCH v1 0/1] hw: aspeed_scu: Add AST2600 hpll calculation function

2022-03-14 Thread Steven Lee
AST2600's HPLL register offset and bit definition are different from AST2500. The patch series adds a hpll calculation function for ast2600 and modify apb frequency calculation function based on SCU200 register description and note in ast2600v11.pdf. Please help to review. Thanks, Steven Steve

Re: [PATCH v2 2/4] Introduce event-loop-base abstract class

2022-03-14 Thread Nicolas Saenz Julienne
On Mon, 2022-03-14 at 13:33 +, Stefan Hajnoczi wrote: > On Fri, Mar 11, 2022 at 11:17:22AM +0100, Nicolas Saenz Julienne wrote: > > On Thu, 2022-03-10 at 10:25 +, Stefan Hajnoczi wrote: > > > On Thu, Mar 03, 2022 at 03:58:20PM +0100, Nicolas Saenz Julienne wrote: > > > > @@ -2935,13 +2947,6

[PATCH] MAINTAINERS: change Vladimir's email address

2022-03-14 Thread Vladimir Sementsov-Ogievskiy
Old vsement...@virtuozzo.com is not accessible anymore. Signed-off-by: Vladimir Sementsov-Ogievskiy --- Hi all! That's my new address: v.sementsov...@ya.ru , the old one is not available anymore. I've also subscribed this new address for qemu-devel mailing list, but not yet get any message fro

Re: [PATCH v2 4/4] util/event-loop-base: Introduce options to set the thread pool size

2022-03-14 Thread Stefan Hajnoczi
On Fri, Mar 11, 2022 at 11:40:30AM +0100, Nicolas Saenz Julienne wrote: > On Thu, 2022-03-10 at 10:45 +, Stefan Hajnoczi wrote: > > On Thu, Mar 03, 2022 at 04:13:07PM +0100, Nicolas Saenz Julienne wrote: > > > @@ -537,10 +546,19 @@ > > > # 0 means that the engine will use its d

Re: [PATCH] ppc/pnv: Remove user-created PHB{3,4,5} devices

2022-03-14 Thread Frederic Barrat
On 14/03/2022 14:05, Cédric Le Goater wrote: On a real system with POWER{8,9,10} processors, PHBs are sub-units of the processor, they can be deactivated by firmware but not plugged in or out like a PCI adapter on a slot. Nevertheless, having user-created PHBs in QEMU seemed to be a good idea

[PATCH v6 03/18] job.c: API functions not used outside should be static

2022-03-14 Thread Emanuele Giuseppe Esposito
job_event_* functions can all be static, as they are not used outside job.c. Same applies for job_txn_add_job(). Signed-off-by: Emanuele Giuseppe Esposito --- include/qemu/job.h | 18 -- job.c | 22 +++--- 2 files changed, 19 insertions(+), 21 deleti

[PATCH v6 00/18] job: replace AioContext lock with job_mutex

2022-03-14 Thread Emanuele Giuseppe Esposito
In this series, we want to remove the AioContext lock and instead use the already existent job_mutex to protect the job structures and list. This is part of the work to get rid of AioContext lock usage in favour of smaller granularity locks. In order to simplify reviewer's job, job lock/unlock fun

  1   2   3   4   >