[PATCH 26/26] test-coroutine: add missing coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
From: Marc-André Lureau Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Signed-off-by: Marc-André Lureau Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini ---

[PATCH 11/26] nfs: add missing coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 09/26] iscsi: add missing coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/iscsi.c | 2 +- 1 file changed, 1

[PATCH 02/26] block: add missing coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Signed-off-by: Paolo Bonzini --- block.c | 6 +++--- block/block-backend.c | 10 +- block/io.c|

[PATCH 12/26] nvme: add missing coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini --- block/nvme.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)

[PATCH 01/26] block/nvme: separate nvme_get_free_req cases for coroutine/non-coroutine context

2022-09-22 Thread Paolo Bonzini
nvme_get_free_req has very difference semantics when called in coroutine context (where it waits) and in non-coroutine context (where it doesn't). Split the two cases to make it clear what is being requested. Cc: qemu-bl...@nongnu.org Reviewed-by: Alberto Faria Signed-off-by: Paolo Bonzini ---

[PATCH 07/26] blkverify: add missing coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/blkverify.c | 2 +- 1 file changed, 1

[PATCH 03/26] qcow2: remove incorrect coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
This is incorrect because qcow2_mark_clean() calls qcow2_flush_caches(). qcow2_mark_clean() is called from non-coroutine context in qcow2_inactivate() and qcow2_amend_options(). Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/qcow2-refcount.c | 4 ++--

[PATCH 04/26] nbd: remove incorrect coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
nbd_co_establish_connection_cancel() cancels a coroutine but is not called from coroutine context itself, for example in nbd_cancel_in_flight() and in timer callbacks reconnect_delay_timer_cb() and open_timer_cb(). Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini

[PATCH v3] x86: add etc/phys-bits fw_cfg file

2022-09-22 Thread Gerd Hoffmann
In case phys bits are functional and can be used by the guest (aka host-phys-bits=on) add a fw_cfg file carrying the value. This can be used by the guest firmware for address space configuration. This is only enabled for 7.2+ machine types for live migration compatibility reasons.

[PATCH v3 00/26] block: fix coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
As discussed at KVM Forum 2022, I am reposting this series to add more coroutine_fn annotations. Fixing the annotations enables static analysis of which functions are coroutine-only and which are mixed (coroutine/non-coroutine). A lot of the patches are similar to the ones that Marc-André Lureau

[PATCH 06/26] blkdebug: add missing coroutine_fn annotations

2022-09-22 Thread Paolo Bonzini
Callers of coroutine_fn must be coroutine_fn themselves, or the call must be within "if (qemu_in_coroutine())". Apply coroutine_fn to functions where this holds. Reviewed-by: Alberto Faria Reviewed-by: Eric Blake Signed-off-by: Paolo Bonzini --- block/blkdebug.c | 14 +++--- 1 file

[PATCH 3/3] tests/qtest: sifive-e-aon-watchdog-test.c : Add QTest of watchdog of sifive_e

2022-09-22 Thread Tommy Wu
Add some simple tests of the watchdog timer in the always-on domain device of HiFive 1 rev b. Signed-off-by: Tommy Wu --- tests/qtest/meson.build | 3 + tests/qtest/sifive-e-aon-watchdog-test.c | 400 +++ 2 files changed, 403 insertions(+) create mode

[PATCH 1/3] hw/misc: sifive_e_aon: Support the watchdog timer of HiFive 1 rev b.

2022-09-22 Thread Tommy Wu
The watchdog timer is in the always-on domain device of HiFive 1 rev b, so this patch added the AON device to the sifive_e machine. This patch only implemented the functionality of the watchdog timer. Signed-off-by: Tommy Wu --- hw/misc/Kconfig| 3 + hw/misc/meson.build

[PATCH 0/3] Implement the watchdog timer of HiFive 1 rev b.

2022-09-22 Thread Tommy Wu
The HiFive 1 rev b includes a watchdog module based on a 32-bit counter. The watchdog timer is in the always-on domain device of HiFive 1 rev b, so this patch added the AON device to the sifive_e machine. This patch only implemented the functionality of the watchdog timer, not all the

[PATCH 2/3] hw/riscv: sifive_e: Support the watchdog timer of HiFive 1 rev b.

2022-09-22 Thread Tommy Wu
Create the AON device when we realize the sifive_e machine. This patch only implemented the functionality of the watchdog timer, not all the functionality of the AON device. Signed-off-by: Tommy Wu --- hw/riscv/Kconfig| 1 + hw/riscv/sifive_e.c | 5 +++--

Re: [PATCH v4 2/3] module: add Error arguments to module_load_one and module_load_qom_one

2022-09-22 Thread Daniel P . Berrangé
On Thu, Sep 22, 2022 at 08:07:43AM +0200, Markus Armbruster wrote: > Ease of use matters, too. When sticking to the rule leads to awkward > code, we should stop and think. Should we deviate from the rule? Or > can we avoid that by tweaking the interface? > > Philippe's proposed interface

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

2022-09-22 Thread Tommy Wu
To the maintainers: Thank Alistair and Jim for the review. Bernhard Beschow sent the same patch : https://lists.gnu.org/archive/html/qemu-riscv/2022-09/msg00126.html It seems that this simple patch is helpful. Could you help us to merge this patch? Thanks for your great help! Regards, Tommy Wu

Re: [PATCH] hw/riscv/sifive_e: Fix inheritance of SiFiveEState

2022-09-22 Thread Frank Chang
Hi Bernhard, I think there's already a similar patch for this bug fix: https://www.mail-archive.com/qemu-devel@nongnu.org/msg905424.html Regards, Frank Chang On Thu, Sep 22, 2022 at 3:53 PM Bernhard Beschow wrote: > SiFiveEState inherits from SysBusDevice while it's TypeInfo claims it to >

[PATCH] hw/riscv/sifive_e: Fix inheritance of SiFiveEState

2022-09-22 Thread Bernhard Beschow
SiFiveEState inherits from SysBusDevice while it's TypeInfo claims it to inherit from TYPE_MACHINE. This is an inconsistency which can cause undefined behavior such as memory corruption. Change SiFiveEState to inherit from MachineState since it is registered as a machine. Fixes: 0869490b1c

Re: [PATCH 1/9] hw/riscv/sifive_e: Fix inheritance of SiFiveEState

2022-09-22 Thread B
Am 21. September 2022 04:55:02 UTC schrieb Markus Armbruster : >Bernhard Beschow writes: > >> Am 20. September 2022 11:36:47 UTC schrieb Markus Armbruster >> : >>>Alistair Francis writes: >>> On Tue, Sep 20, 2022 at 9:18 AM Bernhard Beschow wrote: > > SiFiveEState inherits

Re: [PATCH] qga: fix possible memory leak

2022-09-22 Thread Konstantin Kostiuk
On Wed, Sep 21, 2022 at 5:53 PM Markus Armbruster wrote: > luzhipeng writes: > > > From: lu zhipeng > > > > Signed-off-by: lu zhipeng > > --- > > qga/main.c | 19 ++- > > 1 file changed, 14 insertions(+), 5 deletions(-) > > > > diff --git a/qga/main.c b/qga/main.c > > index

Re: [PATCH v5 1/4] x86: return modified setup_data only if read as memory, not as file

2022-09-22 Thread Paolo Bonzini
On Wed, 21 Sep 2022 11:31:31 +0200, Jason A. Donenfeld wrote: > If setup_data is being read into a specific memory location, then > generally the setup_data address parameter is read first, so that the > caller knows where to read it into. In that case, we should return > setup_data containing the

Re: [PATCH RFC 0/7] hostmem: NUMA-aware memory preallocation using ThreadContext

2022-09-22 Thread Michal Prívozník
On 9/21/22 16:54, David Hildenbrand wrote: > On 21.09.22 16:44, Michal Prívozník wrote: >> On 7/21/22 14:07, David Hildenbrand wrote: >>> >> >> Ping? Is there any plan how to move forward? I have libvirt patches >> ready to consume this and I'd like to prune my old local branches :-) > > Heh, I

Re: [PATCH v4 2/3] module: add Error arguments to module_load_one and module_load_qom_one

2022-09-22 Thread Markus Armbruster
Claudio Fontana writes: > On 9/21/22 14:16, Markus Armbruster wrote: >> Philippe Mathieu-Daudé writes: >> >>> On 16/9/22 11:27, Markus Armbruster wrote: Claudio Fontana writes: > improve error handling during module load, by changing: > > bool module_load_one(const char

<    1   2   3   4