[PATCH v2 1/1] fix cmpxchg and lock cmpxchg instruction

2022-03-21 Thread Wei Li
One question is that we can reduce more code duplication if we use - if(foo){ tcg_gen_atomic_cmpxchg_tl(oldv, s->A0, cmpv, newv, s->mem_index, ot | MO_LE); gen_extu(ot, oldv); gen_extu(ot, cmpv); }else{

[PATCH v2 0/1] cmpxchg and lock cmpxchg should not touch accumulator

2022-03-21 Thread Wei Li
Bug: https://gitlab.com/qemu-project/qemu/-/issues/508 This series fix a bug reported on issues 508. The problem is cmpxchg and lock cmpxchg would touch accumulator when they should not do that. Changes from v1 * cmpxchg uses the lock cmpxchg path whenever mod != 3 to reduce code duplication.

Re: [RFC PATCH] vhost_net: should not use max_queue_pairs for non-mq guest

2022-03-21 Thread Jason Wang
On Sat, Mar 19, 2022 at 12:14 PM Si-Wei Liu wrote: > > With MQ enabled vdpa device and non-MQ supporting guest e.g. > booting vdpa with mq=on over OVMF of single vqp, it's easy > to hit assert failure as the following: > > ../hw/virtio/vhost-vdpa.c:560: vhost_vdpa_get_vq_index: Assertion `idx >=

Re: [PATCH v1 0/1] hw/gpio Add ASPEED GPIO model for AST1030

2022-03-21 Thread Jamin Lin
The 03/21/2022 10:55, Cédric Le Goater wrote: > Hello Jamin, > > On 3/21/22 10:14, Jamin Lin wrote: > > 1. Add GPIO read/write trace event. > > 2. Support GPIO index mode for write operation. > > It did not support GPIO index mode for read operation. > > 3. AST1030 integrates one set of Parallel

Re: [PATCH v1 1/1] test/avocado/machine_aspeed.py: Add ast1030 test case

2022-03-21 Thread Jamin Lin
The 03/21/2022 17:39, Thomas Huth wrote: > On 21/03/2022 10.16, Jamin Lin wrote: > > Add test case to test "ast1030-evb" machine with zephyr os > > > > Signed-off-by: Jamin Lin > > --- > > tests/avocado/machine_aspeed.py | 36 + > > 1 file changed, 36

[PATCH v1 1/9] aspeed/adc: Add AST1030 support

2022-03-21 Thread Jamin Lin
From: Steven Lee Per ast1030_v7.pdf, AST1030 ADC engine is identical to AST2600's ADC. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Signed-off-by: Steven Lee --- hw/adc/aspeed_adc.c | 16 include/hw/adc/aspeed_adc.h | 1 + 2 files changed, 17 insertions(+)

[PATCH v1 8/9] aspeed: Add an AST1030 eval board

2022-03-21 Thread Jamin Lin
From: Steven Lee The image should be supplied with ELF binary. $ qemu-system-arm -M ast1030-evb -kernel zephyr.elf -nographic Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Signed-off-by: Steven Lee --- hw/arm/aspeed.c | 2 +- hw/arm/aspeed_minibmc.c | 129

[PATCH v1 5/9] aspeed/timer: Add AST1030 support.

2022-03-21 Thread Jamin Lin
From: Steven Lee ast1030 tmc(timer controller) is identical to ast2600 tmc. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Signed-off-by: Steven Lee --- hw/timer/aspeed_timer.c | 17 + include/hw/timer/aspeed_timer.h | 1 + 2 files changed, 18 insertions(+) diff

[PATCH v1 7/9] aspeed/soc : Add AST1030 support

2022-03-21 Thread Jamin Lin
From: Steven Lee The embeded core of AST1030 SoC is ARM Coretex M4. It is hard to be integrated in the common Aspeed Soc framework. We introduce a new ast1030 class with instance_init and realize handlers. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Signed-off-by: Steven Lee ---

[PATCH v1 9/9] test/avocado/machine_aspeed.py: Add ast1030 test case

2022-03-21 Thread Jamin Lin
Add test case to test "ast1030-evb" machine with zephyr os Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Signed-off-by: Steven Lee --- tests/avocado/machine_aspeed.py | 36 + 1 file changed, 36 insertions(+) create mode 100644

[PATCH v1 2/9] aspeed/smc: Add AST1030 support

2022-03-21 Thread Jamin Lin
From: Steven Lee AST1030 spi controller's address decoding unit is 1MB that is identical to ast2600, but fmc address decoding unit is 512kb. Introduce seg_to_reg and reg_to_seg handlers for ast1030 fmc controller. In addition, add ast1030 fmc, spi1, and spi2 class init handler. Signed-off-by:

[PATCH v1 4/9] aspeed/wdt: Add AST1030 support

2022-03-21 Thread Jamin Lin
From: Steven Lee AST1030 wdt controller is similiar to AST2600's wdt, but it has extra registers. Introduce ast1030 object class and increse the number of regs(offset) of ast1030 model. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Signed-off-by: Steven Lee --- hw/watchdog/wdt_aspeed.c

[PATCH v1 0/9] Add support for AST1030 SoC

2022-03-21 Thread Jamin Lin
The patch series supports ADC, SCU, SMC, TIMER, and WDT for AST1030 SoC. Add avocado test case for "ast1030-evb" machine. Test steps: 1. Download image from https://github.com/AspeedTech-BMC/zephyr/releases/download/v00.01.04/ast1030-evb-demo.zip 2. Extract the zip file to obtain zephyr.elf

[PATCH v1 6/9] aspeed/scu: Add AST1030 support

2022-03-21 Thread Jamin Lin
From: Steven Lee Per ast1030_v07.pdf, AST1030 SOC doesn't have SCU300, the pclk divider selection is defined in SCU310[11:8]. Add a get_apb_freq function and a class init handler for ast1030. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Signed-off-by: Steven Lee --- hw/misc/aspeed_scu.c

[PATCH v1 3/9] aspeed/wdt: Fix ast2500/ast2600 default reload value.

2022-03-21 Thread Jamin Lin
From: Steven Lee Per ast2500_2520_datasheet_v1.8 and ast2600v11.pdf, the default value of WDT00 and WDT04 is 0x014FB180 for ast2500/ast2600. Add default_status and default_reload_value attributes for storing counter status and reload value as they are different from ast2400. Signed-off-by: Troy

Re: [PATCH for-7.1 0/9] spapr: add drc->index, remove spapr_drc_index()

2022-03-21 Thread David Gibson
On Mon, Mar 21, 2022 at 04:58:47AM -0300, Daniel Henrique Barboza wrote: > > > On 3/21/22 00:55, David Gibson wrote: > > On Fri, Mar 18, 2022 at 02:33:11PM -0300, Daniel Henrique Barboza wrote: > > > Hi, > > > > > > I decided to make this change after realizing that (1) spapr_drc_index() > > >

[PATCH v4 09/11] target/s390x: add S390_FEAT_VECTOR_ENH2 to qemu CPU model

2022-03-21 Thread David Miller
Signed-off-by: David Miller Signed-off-by: Richard Henderson --- target/s390x/gen-features.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 22846121c4..499a3b10a8 100644 --- a/target/s390x/gen-features.c +++

[PATCH v4 10/11] tests/tcg/s390x: Tests for Vector Enhancements Facility 2

2022-03-21 Thread David Miller
Signed-off-by: David Miller Signed-off-by: Richard Henderson --- tests/tcg/s390x/Makefile.target | 8 ++ tests/tcg/s390x/vxeh2_vcvt.c| 97 + tests/tcg/s390x/vxeh2_vlstr.c | 146 tests/tcg/s390x/vxeh2_vs.c | 91

[PATCH v4 06/11] target/s390x: vxeh2: vector {load, store} elements reversed

2022-03-21 Thread David Miller
Signed-off-by: David Miller Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand --- target/s390x/tcg/insn-data.def | 4 ++ target/s390x/tcg/translate_vx.c.inc | 84 + 2 files changed, 88 insertions(+) diff --git a/target/s390x/tcg/insn-data.def

[PATCH v4 07/11] target/s390x: vxeh2: vector {load, store} byte reversed elements

2022-03-21 Thread David Miller
Signed-off-by: David Miller Signed-off-by: Richard Henderson --- target/s390x/tcg/insn-data.def | 4 + target/s390x/tcg/translate_vx.c.inc | 115 2 files changed, 119 insertions(+) diff --git a/target/s390x/tcg/insn-data.def b/target/s390x/tcg/insn-data.def

[PATCH v4 01/11] tcg: Implement tcg_gen_{h,w}swap_{i32,i64}

2022-03-21 Thread David Miller
From: Richard Henderson Swap half-words (16-bit) and words (32-bit) within a larger value. Mirrors functions of the same names within include/qemu/bitops.h. Signed-off-by: Richard Henderson Reviewed-by: David Miller Reviewed-by: David Hildenbrand --- include/tcg/tcg-op.h | 6 ++

[PATCH v4 08/11] target/s390x: vxeh2: vector {load, store} byte reversed element

2022-03-21 Thread David Miller
Signed-off-by: David Miller Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand --- target/s390x/tcg/insn-data.def | 12 target/s390x/tcg/translate_vx.c.inc | 85 + 2 files changed, 97 insertions(+) diff --git a/target/s390x/tcg/insn-data.def

[PATCH v4 03/11] target/s390x: vxeh2: vector string search

2022-03-21 Thread David Miller
Signed-off-by: David Miller Signed-off-by: Richard Henderson --- target/s390x/helper.h| 6 ++ target/s390x/tcg/insn-data.def | 2 + target/s390x/tcg/translate.c | 3 +- target/s390x/tcg/translate_vx.c.inc | 25 +++ target/s390x/tcg/vec_string_helper.c | 99

[PATCH v4 04/11] target/s390x: vxeh2: Update for changes to vector shifts

2022-03-21 Thread David Miller
Signed-off-by: David Miller Signed-off-by: Richard Henderson --- target/s390x/helper.h | 3 ++ target/s390x/tcg/insn-data.def | 12 ++--- target/s390x/tcg/translate_vx.c.inc | 75 - target/s390x/tcg/vec_int_helper.c | 55 + 4

[PATCH v4 05/11] target/s390x: vxeh2: vector shift double by bit

2022-03-21 Thread David Miller
Signed-off-by: David Miller Signed-off-by: Richard Henderson --- target/s390x/tcg/insn-data.def | 6 +++- target/s390x/tcg/translate_vx.c.inc | 55 + 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/target/s390x/tcg/insn-data.def

[PATCH v4 00/11] s390x/tcg: Implement Vector-Enhancements Facility 2

2022-03-21 Thread David Miller
Implement Vector-Enhancements Facility 2 for s390x resolves: https://gitlab.com/qemu-project/qemu/-/issues/738 implements: VECTOR LOAD ELEMENTS REVERSED (VLER) VECTOR LOAD BYTE REVERSED ELEMENTS (VLBR) VECTOR LOAD BYTE REVERSED ELEMENT (VLEBRH,

[PATCH v4 11/11] target/s390x: Fix writeback to v1 in helper_vstl

2022-03-21 Thread David Miller
From: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: David Miller Reviewed-by: David Hildenbrand --- target/s390x/tcg/vec_helper.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/s390x/tcg/vec_helper.c b/target/s390x/tcg/vec_helper.c index ededf13cf0..48d86722b2

[PATCH v4 02/11] target/s390x: vxeh2: vector convert short/32b

2022-03-21 Thread David Miller
Signed-off-by: David Miller Signed-off-by: Richard Henderson Reviewed-by: David Hildenbrand --- target/s390x/helper.h | 4 +++ target/s390x/tcg/translate_vx.c.inc | 44 ++--- target/s390x/tcg/vec_fpu_helper.c | 31 3 files changed,

Re: [PATCH v1 11/13] contrib/vhost-user-blk: fix 32 bit build and enable

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 16:30, Alex Bennée wrote: We were not building the vhost-user-blk server due to 32 bit compilation problems. The problem was due to format string types so fix that and then enable the build. Tweak the rule to follow the same rules as other vhost-user daemons. Signed-off-by: Alex

Re: [PATCH v1 08/13] libvhost-user: expose vu_request_to_string

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 16:30, Alex Bennée wrote: This is useful for more human readable debug messages in vhost-user programs. Signed-off-by: Alex Bennée --- subprojects/libvhost-user/libvhost-user.h | 9 + subprojects/libvhost-user/libvhost-user.c | 2 +- 2 files changed, 10 insertions(+), 1

Re: [PATCH v1 04/13] docs: vhost-user: clean up request/reply description

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 16:30, Alex Bennée wrote: From: Paolo Bonzini It is not necessary to mention which side is sending/receiving each payload; it is more interesting to say which is the request and which is the reply. This also matches what vhost-user-gpu.rst already does. While at it, ensure that

Re: [PATCH v1 03/13] hw/virtio: add vhost_user_[read|write] trace points

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 16:30, Alex Bennée wrote: These are useful when trying to debug the initial vhost-user negotiation, especially when it hard to get logging from the low level library on the other side. Signed-off-by: Alex Bennée --- v2 - fixed arguments --- hw/virtio/vhost-user.c | 4

Re: [PATCH v1 01/13] hw/virtio: move virtio-pci.h into shared include space

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 16:30, Alex Bennée wrote: This allows other device classes that will be exposed via PCI to be able to do so in the appropriate hw/ directory. I resisted the temptation to re-order headers to be more aesthetically pleasing. Signed-off-by: Alex Bennée Message-Id:

Re: [PATCH v3 3/5] softmmu/cpus: Free cpu->halt_cond in generic_destroy_vcpu_thread()

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 15:14, Mark Kanda wrote: vCPU hotunplug related leak reported by Valgrind: ==102631== 56 bytes in 1 blocks are definitely lost in loss record 5,089 of 8,555 ==102631==at 0x4C3ADBB: calloc (vg_replace_malloc.c:1117) ==102631==by 0x69EE4CD: g_malloc0 (in

Re: [PATCH v3 5/5] i386/cpu: Free env->xsave_buf in KVM and HVF destory_vcpu_thread routines

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 23:04, Philippe Mathieu-Daudé wrote: On 21/3/22 15:14, Mark Kanda wrote: Create KVM and HVF specific destory_vcpu_thread() routines to free Typo "destroy" env->xsave_buf. vCPU hotunplug related leak reported by Valgrind: ==132362== 4,096 bytes in 1 blocks are definitely lost in

Re: [PATCH v3 4/5] cpu: Free cpu->cpu_ases in cpu_address_space_destroy()

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 23:03, Philippe Mathieu-Daudé wrote: On 21/3/22 15:14, Mark Kanda wrote: Create cpu_address_space_destroy() to free a CPU's cpu_ases list. vCPU hotunplug related leak reported by Valgrind: ==132362== 216 bytes in 1 blocks are definitely lost in loss record 7,119 of 8,549

Re: [PATCH-for-7.0] qemu/main-loop: Disable block backend global state assertion on Darwin

2022-03-21 Thread Akihiko Odaki
On 2022/03/21 23:55, Philippe Mathieu-Daudé wrote: From: Philippe Mathieu-Daudé Since commit 0439c5a462 ("block/block-backend.c: assertions for block-backend") QEMU crashes on Darwin hosts, example on macOS: $ qemu-system-i386 Assertion failed: (qemu_in_main_thread()), function

Re: [PATCH v3 2/5] softmmu/cpus: Free cpu->thread in generic_destroy_vcpu_thread()

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 15:14, Mark Kanda wrote: Free cpu->thread in a new AccelOpsClass::destroy_vcpu_thread() handler generic_destroy_vcpu_thread(). vCPU hotunplug related leak reported by Valgrind: ==102631== 8 bytes in 1 blocks are definitely lost in loss record 1,037 of 8,555 ==102631==at

Re: [PATCH v3 5/5] i386/cpu: Free env->xsave_buf in KVM and HVF destory_vcpu_thread routines

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 15:14, Mark Kanda wrote: Create KVM and HVF specific destory_vcpu_thread() routines to free Typo "destroy" env->xsave_buf. vCPU hotunplug related leak reported by Valgrind: ==132362== 4,096 bytes in 1 blocks are definitely lost in loss record 8,440 of 8,549 ==132362==at

Re: [RFC PATCH v3 17/36] pflash_cfi01/tdx: Introduce ram_mode of pflash for TDVF

2022-03-21 Thread Isaku Yamahata
On Mon, Mar 21, 2022 at 04:54:51PM +0800, Xiaoyao Li wrote: > On 3/18/2022 10:07 PM, Philippe Mathieu-Daudé wrote: > > Hi, > > > > On 17/3/22 14:58, Xiaoyao Li wrote: > > > TDX VM needs to boot with Trust Domain Virtual Firmware (TDVF). Unlike > > > that OVMF is mapped as rom device, TDVF needs

Re: [PATCH v3 4/5] cpu: Free cpu->cpu_ases in cpu_address_space_destroy()

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 15:14, Mark Kanda wrote: Create cpu_address_space_destroy() to free a CPU's cpu_ases list. vCPU hotunplug related leak reported by Valgrind: ==132362== 216 bytes in 1 blocks are definitely lost in loss record 7,119 of 8,549 ==132362==at 0x4C3ADBB: calloc

Re: [PATCH v3 2/2] ui/cocoa: Create menus in iothread

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 05:10, Akihiko Odaki wrote: Commit 0439c5a4623d674efa0c72abd62ca6e98bb7cf87 introduced an assertion that blk_all_next is called in the main thread. The function is called in the following chain: - blk_all_next - qmp_query_block - addRemovableDevicesMenuItems - main This change moves

Re: [PATCH v3 1/2] ui/cocoa: Move create_initial_menus

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 05:10, Akihiko Odaki wrote: The following change would make it use add_console_menu_entries and addRemovableDevicesMenuItems so it should come after them. Signed-off-by: Akihiko Odaki --- ui/cocoa.m | 178 ++--- 1 file changed, 89

Re: [PATCH] memory: Make memory_region_readd_subregion() properly handle mapped aliases

2022-03-21 Thread Niek Linnenbank
Hi Paolo, Peter, With the 7.0 release approaching, just a friendly reminder that the patch in this thread is not yet in master (2058fdbe81e2985c226a026851dd26b146d3395c). It's currently preventing the orangepi-pc board to boot SD card images from U-Boot, terminating with an assert:

Re: [PATCH v1 7/8] semihosting: clean up handling of expanded argv

2022-03-21 Thread Philippe Mathieu-Daudé
On 15/3/22 15:15, Daniel P. Berrangé wrote: On Tue, Mar 15, 2022 at 01:59:59PM +, Alex Bennée wrote: Philippe Mathieu-Daudé writes: On 15/3/22 13:12, Alex Bennée wrote: Another cleanup patch tripped over the fact we weren't being careful in our casting. Fix the casts, allow for a

[PULL 3/3] block/nbd.c: Fixed IO request coroutine not being wakeup when kill NBD server

2022-03-21 Thread Eric Blake
From: Rao Lei During the IO stress test, the IO request coroutine has a probability that is can't be awakened when the NBD server is killed. The GDB stack is as follows: (gdb) bt 0 0x7f2ff990cbf6 in __ppoll (fds=0x55575de85000, nfds=1, timeout=, sigmask=0x0) at

[PULL 0/3] NBD patches for -rc1

2022-03-21 Thread Eric Blake
The following changes since commit 2028ab513bf0232841a909e1368309858919dbcc: Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2022-03-21 15:27:13 +) are available in the Git repository at: https://repo.or.cz/qemu/ericb.git tags/pull-nbd-2022-03-21 for

[PULL 1/3] MAINTAINERS: change Vladimir's email address

2022-03-21 Thread Eric Blake
From: Vladimir Sementsov-Ogievskiy Old vsement...@virtuozzo.com is not accessible anymore. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20220316092702.426629-1-v.sementsov...@mail.ru> Signed-off-by: Eric Blake --- MAINTAINERS | 12 ++-- 1 file changed, 6 insertions(+), 6

[PULL 2/3] docs: Consistent typography for options of qemu-nbd

2022-03-21 Thread Eric Blake
Prefer the :option:`--name` form when cross-referencing other options from the qemu-nbd documentation. Signed-off-by: Eric Blake Message-Id: <20220314203818.3681277-2-ebl...@redhat.com> Reviewed-by: Daniel P. Berrangé --- docs/tools/qemu-nbd.rst | 12 ++-- 1 file changed, 6

Re: [PATCH v5 18/18] iotests: make qemu_img_log and img_info_log raise on error

2022-03-21 Thread Eric Blake
On Mon, Mar 21, 2022 at 04:16:18PM -0400, John Snow wrote: > Add a `check: bool = True` parameter to both functions and make their > qemu_img() invocations raise on error by default. > > users of img_info_log: > 206, 207, 210, 211, 212, 213, 237, 242, 266, 274, 302 > > users of qemu_img_log: >

Re: [PATCH v5 17/18] iotests: remove qemu_img_pipe_and_status()

2022-03-21 Thread Eric Blake
On Mon, Mar 21, 2022 at 04:16:17PM -0400, John Snow wrote: > With the exceptional 'create' calls removed in the prior commit, change > qemu_img_log() and img_info_log() to call qemu_img() directly > instead. > > For now, allow these calls to qemu-img to return non-zero on the basis > that any

Re: [PULL 0/4] Miscellaneous patches patches for 2022-03-21

2022-03-21 Thread Peter Maydell
On Mon, 21 Mar 2022 at 14:59, Markus Armbruster wrote: > > If it's too late for trivial cleanup, I'll respin this with the last > patch dropped. > > The following changes since commit 2058fdbe81e2985c226a026851dd26b146d3395c: > > Merge tag 'fixes-20220318-pull-request' of

Re: [PATCH v2 0/4] iotests: finalize switch to async QMP

2022-03-21 Thread John Snow
On Mon, Mar 21, 2022 at 4:33 PM John Snow wrote: > > GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-qmp-legacy-switch-pt1b > CI: https://gitlab.com/jsnow/qemu/-/pipelines/495951187 > > This series isolates the iotests-centric changes required to switch to > the new QMP library. It doesn't

[PATCH 07/10] python: remove the old QMP package

2022-03-21 Thread John Snow
Thank you for your service! Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal --- python/PACKAGE.rst | 4 +- python/README.rst | 2 +- python/qemu/qmp/README.rst | 9 - python/qemu/qmp/__init__.py | 396

Re: Memory leak in via_isa_realize()

2022-03-21 Thread BALATON Zoltan
On Mon, 21 Mar 2022, Cédric Le Goater wrote: On 3/21/22 13:11, BALATON Zoltan wrote: On Mon, 21 Mar 2022, Peter Maydell wrote: On Mon, 21 Mar 2022 at 10:31, Thomas Huth wrote: FYI, I'm seeing a memory leak in via_isa_realize() when building QEMU with sanitizers enabled or when running QEMU

[PATCH 09/10] python: rename qemu.aqmp to qemu.qmp

2022-03-21 Thread John Snow
Now that we are fully switched over to the new QMP library, move it back over the old namespace. This is being done primarily so that we may upload this package simply as "qemu.qmp" without introducing confusion over whether or not "aqmp" is a new protocol or not. The trade-off is increased

[PATCH 08/10] python: re-enable pylint duplicate-code warnings

2022-03-21 Thread John Snow
With the old library gone, there's nothing duplicated in the tree, so the warning suppression can be removed. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal --- python/setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/python/setup.cfg

[PATCH 06/10] python/aqmp: copy qmp docstrings to qemu.aqmp.legacy

2022-03-21 Thread John Snow
Copy the docstrings out of qemu.qmp, adjusting them as necessary to more accurately reflect the current state of this class. (Licensing: This is copying and modifying GPLv2-only licensed docstrings into a GPLv2-only file.) Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy

[PATCH 05/10] python/aqmp: fully separate from qmp.QEMUMonitorProtocol

2022-03-21 Thread John Snow
After this patch, qemu.aqmp.legacy.QEMUMonitorProtocol no longer inherits from qemu.qmp.QEMUMonitorProtocol. To do this, several inherited methods need to be explicitly re-defined. (Licensing: This is copying and modifying GPLv2-only code into a GPLv2-only file.) Signed-off-by: John Snow

[PATCH 10/10] python: rename 'aqmp-tui' to 'qmp-tui'

2022-03-21 Thread John Snow
This is the last vestige of the "aqmp" moniker surviving in the tree; remove it. Signed-off-by: John Snow Reviewed-by: Beraldo Leal --- python/qemu/qmp/{aqmp_tui.py => qmp_tui.py} | 12 ++-- python/setup.cfg| 6 +++--- 2 files changed, 9 insertions(+), 9

[PATCH 02/10] python/aqmp: relicense as GPLv2+

2022-03-21 Thread John Snow
I am the sole author of all of the async QMP code (python/qemu/aqmp) with the following exceptions: python/qemu/aqmp/qmp_shell.py and python/qemu/aqmp/legacy.py were written by Luiz Capitulino (et al) and are already licensed separately as GPLv2 (only). aqmp_tui.py was written by Niteesh Babu G

[PATCH 04/10] python/aqmp: take QMPBadPortError and parse_address from qemu.qmp

2022-03-21 Thread John Snow
Shift these definitions over from the qmp package to the async qmp package. (Licensing: this is a lateral move, from GPLv2 (only) to GPLv2 (only)) Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal --- python/qemu/aqmp/aqmp_tui.py | 3 +--

[PATCH 00/10] Python: Remove synchronous QMP library

2022-03-21 Thread John Snow
Based-On: <20220321203315.909411-1-js...@redhat.com> GitLab: https://gitlab.com/jsnow/qemu/-/tree/python-qmp-legacy-switch-pt1c CI: https://gitlab.com/jsnow/qemu/-/pipelines/497561638 This series finalizes swapping out the old QMP library for the new one. It's been through about two release

[PATCH 01/10] python/aqmp: add explicit GPLv2 license to legacy.py

2022-03-21 Thread John Snow
The legacy.py module is heavily based on the QMP module by Luiz Capitulino (et al) which is licensed as explicit GPLv2-only. The async QMP package is currently licensed similarly, but I intend to relicense the async package to the more flexible GPLv2+. In preparation for that change, make the

[PATCH 03/10] python: temporarily silence pylint duplicate-code warnings

2022-03-21 Thread John Snow
The next several commits copy some code from qemu.qmp to qemu.aqmp, then delete qemu.qmp. In the interim, to prevent test failures, the duplicate code detection needs to be silenced to prevent bisect problems with CI testing. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy

Re: [EXT] Re: QEMU+KVM on RISC-V + Hypervisor Extension

2022-03-21 Thread Palmer Dabbelt
On Sun, 20 Mar 2022 22:43:07 PDT (-0700), alistai...@gmail.com wrote: On Thu, Mar 17, 2022 at 7:46 PM Peter Maydell wrote: On Wed, 16 Mar 2022 at 22:23, Alistair Francis wrote: > Hmm... This seems like a bug. We shouldn't allow the user to specify a > `-bios` option if using KVM. Would you

[PATCH v2 3/4] iotests/mirror-top-perms: switch to AQMP

2022-03-21 Thread John Snow
We don't have to maintain compatibility with both QMP libraries anymore, so we can just remove the old exception. While we're here, take advantage of the extra fields present in the VMLaunchFailure exception that machine.py now raises. (Note: I'm leaving the logging suppression here unchanged. I

[PATCH v2 0/4] iotests: finalize switch to async QMP

2022-03-21 Thread John Snow
GitLab: https://gitlab.com/jsnow/qemu/-/commits/python-qmp-legacy-switch-pt1b CI: https://gitlab.com/jsnow/qemu/-/pipelines/495951187 This series isolates the iotests-centric changes required to switch to the new QMP library. It doesn't do a whole lot! This is a re-send just being sent for the

Re: Memory leak in via_isa_realize()

2022-03-21 Thread Peter Maydell
On Mon, 21 Mar 2022 at 18:55, Cédric Le Goater wrote: > I introduced quite a few of these calls, > >hw/ppc/pnv_lpc.c:irqs = qemu_allocate_irqs(handler, lpc, ISA_NUM_IRQS); >hw/ppc/pnv_psi.c:psi->qirqs = qemu_allocate_irqs(ics_set_irq, ics, > ics->nr_irqs); >hw/ppc/pnv_psi.c:

Re: [PATCH v2] MAINTAINERS: change Vladimir's email address

2022-03-21 Thread Eric Blake
On Mon, Mar 21, 2022 at 11:31:18PM +0300, Vladimir Sementsov-Ogievskiy wrote: > 21.03.2022 23:12, Eric Blake wrote: > > On Thu, Mar 17, 2022 at 11:24:28AM +0300, Vladimir Sementsov-Ogievskiy > > wrote: > > > 17.03.2022 00:36, Eric Blake wrote: > > > > On Wed, Mar 16, 2022 at 12:27:02PM +0300,

[PATCH v2 1/4] python/machine: permanently switch to AQMP

2022-03-21 Thread John Snow
Remove the QEMU_PYTHON_LEGACY_QMP environment variable, making the switch from sync qmp to async qmp permanent. Update exceptions and import paths as necessary. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Acked-by: Hanna Reitz ---

[PATCH v2 4/4] iotests: switch to AQMP

2022-03-21 Thread John Snow
iotests is already using async QMP, but to finalize the switchover we only need to update any remaining import paths to rely solely on the new library instead. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Acked-by: Hanna Reitz ---

[PATCH v2 2/4] scripts/bench-block-job: switch to AQMP

2022-03-21 Thread John Snow
For this commit, we only need to remove accommodations for the synchronous QMP library. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Beraldo Leal Acked-by: Hanna Reitz --- scripts/simplebench/bench_block_job.py | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH v5 16/18] iotests: replace qemu_img_log('create', ...) calls

2022-03-21 Thread John Snow
qemu_img_log() calls into qemu_img_pipe(), which always removes output for 'create' commands on success anyway. Replace all of these calls to the simpler qemu_img_create(...) which doesn't log, but raises a detailed exception object on failure instead. Blank lines are removed from output files

[PATCH v5 14/18] iotests: remove remaining calls to qemu_img_pipe()

2022-03-21 Thread John Snow
As part of moving all python iotest invocations of qemu-img onto a single qemu_img() implementation, remove a few lingering uses of qemu_img_pipe() from outside of iotests.py itself. Several cases here rely on the knowledge that qemu_img_pipe() suppresses *all* output on a successful case when

Re: [PATCH v2] MAINTAINERS: change Vladimir's email address

2022-03-21 Thread Vladimir Sementsov-Ogievskiy
21.03.2022 23:12, Eric Blake wrote: On Thu, Mar 17, 2022 at 11:24:28AM +0300, Vladimir Sementsov-Ogievskiy wrote: 17.03.2022 00:36, Eric Blake wrote: On Wed, Mar 16, 2022 at 12:27:02PM +0300, Vladimir Sementsov-Ogievskiy wrote: Old vsement...@virtuozzo.com is not accessible anymore.

[PATCH v5 13/18] iotests/149: Remove qemu_img_pipe() call

2022-03-21 Thread John Snow
qemu_img_pipe calls blank their output when the command being run is a 'create' call and the command succeeds. Thus, the normative output for this command in iotest 149 is to print a blank line. We can remove the logging from this invocation and use a checked invocation, but we still need to

[PATCH v5 11/18] iotests: change supports_quorum to use qemu_img

2022-03-21 Thread John Snow
Similar to other recent changes: use the qemu_img() invocation that supports throwing loud, nasty exceptions when it fails for surprising reasons. (Why would "--help" ever fail? I don't know, but eliminating *all* calls to qemu-img that do not go through qemu_img() is my goal, so qemu_img_pipe()

[PATCH v5 18/18] iotests: make qemu_img_log and img_info_log raise on error

2022-03-21 Thread John Snow
Add a `check: bool = True` parameter to both functions and make their qemu_img() invocations raise on error by default. users of img_info_log: 206, 207, 210, 211, 212, 213, 237, 242, 266, 274, 302 users of qemu_img_log: 044, 209, 274, 302, 304 iotests 242 and 266 need to use check=False for

[PATCH v5 15/18] iotests: use qemu_img() in has_working_luks()

2022-03-21 Thread John Snow
Admittedly a mostly lateral move, but qemu_img() is essentially the replacement for qemu_img_pipe_and_status(). It will give slightly better diagnostics on crash. Signed-off-by: John Snow Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 18 +- 1 file changed, 9

[PATCH v5 07/18] iotests: use qemu_img_json() when applicable

2022-03-21 Thread John Snow
qemu_img_json() gives better diagnostic information on failure. Signed-off-by: John Snow Reviewed-by: Hanna Reitz --- tests/qemu-iotests/iotests.py | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index

[PATCH v5 17/18] iotests: remove qemu_img_pipe_and_status()

2022-03-21 Thread John Snow
With the exceptional 'create' calls removed in the prior commit, change qemu_img_log() and img_info_log() to call qemu_img() directly instead. For now, allow these calls to qemu-img to return non-zero on the basis that any unusual output will be logged anyway. The very next commit begins to

[PATCH v5 10/18] iotests: add qemu_img_map() function

2022-03-21 Thread John Snow
Add a qemu_img_map() function by analogy with qemu_img_measure(), qemu_img_check(), and qemu_img_info() that all return JSON information. Replace calls to qemu_img_pipe('map', '--output=json', ...) with this new function, which provides better diagnostic information on failure. Note: The output

[PATCH v5 03/18] iotests: Remove explicit checks for qemu_img() == 0

2022-03-21 Thread John Snow
qemu_img() returning zero ought to be the rule, not the exception. Remove all explicit checks against the condition in preparation for making non-zero returns an Exception. Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Hanna Reitz --- tests/qemu-iotests/163

[PATCH v5 09/18] iotests/remove-bitmap-from-backing: use qemu_img_info()

2022-03-21 Thread John Snow
This removes two more usages of qemu_img_pipe() and replaces them with calls to qemu_img(), which provides better diagnostic information on failure. Signed-off-by: John Snow Reviewed-by: Hanna Reitz --- tests/qemu-iotests/tests/remove-bitmap-from-backing | 6 +++--- 1 file changed, 3

[PATCH v5 12/18] iotests: replace unchecked calls to qemu_img_pipe()

2022-03-21 Thread John Snow
qemu_img_pipe() discards the return code from qemu-img in favor of returning just its output. Some tests using this function don't save, log, or check the output either, though, which is unsafe. Replace all of these calls with a checked version. Tests affected are 194, 202, 203, 234, 262, and

[PATCH v5 06/18] iotests: add qemu_img_json()

2022-03-21 Thread John Snow
qemu_img_json() is a new helper built on top of qemu_img() that tries to pull a valid JSON document out of the stdout stream. In the event that the return code is negative (the program crashed), or the code is greater than zero and did not produce valid JSON output, the VerboseProcessError raised

[PATCH v5 08/18] iotests: add qemu_img_info()

2022-03-21 Thread John Snow
Add qemu_img_info() by analogy with qemu_img_measure() and qemu_img_check(). Modify image_size() to use this function instead to take advantage of the better diagnostic information on failure provided (ultimately) by qemu_img(). Signed-off-by: John Snow Reviewed-by: Hanna Reitz ---

[PATCH v5 01/18] python/utils: add add_visual_margin() text decoration utility

2022-03-21 Thread John Snow
>>> print(add_visual_margin(msg, width=72, name="Commit Message")) ┏━ Commit Message ━━ ┃ add_visual_margin() takes a chunk of text and wraps it in a visual ┃ container that force-wraps to a specified width. An optional title ┃ label may be

[PATCH v5 02/18] python/utils: add VerboseProcessError

2022-03-21 Thread John Snow
This adds an Exception that extends the Python stdlib subprocess.CalledProcessError. The difference is that the str() method of this exception also adds the stdout/stderr logs. In effect, if this exception goes unhandled, Python will print the output in a visually distinct wrapper to the terminal

[PATCH v5 05/18] iotests: fortify compare_images() against crashes

2022-03-21 Thread John Snow
Fortify compare_images() to be more discerning about the status codes it receives. If qemu_img() returns an exit code that implies it didn't actually perform the comparison, treat that as an exceptional circumstance and force the caller to be aware of the peril. If a negative test is desired

[PATCH v5 00/18] iotests: add enhanced debugging info to qemu-img failures

2022-03-21 Thread John Snow
V5 hotfix: - Quote the subprocess.CompletedProcess[str] type annotations, Python 3.6 chokes on them at runtime :( - Reduce line length in the text decoration fn, even though check-patch still doesn't like it. - Reflow docstring for qemu_img.* V5 CI:

[PATCH v5 04/18] iotests: make qemu_img raise on non-zero rc by default

2022-03-21 Thread John Snow
re-write qemu_img() as a function that will by default raise a VerboseProcessException (extended from CalledProcessException) on non-zero return codes. This will produce a stack trace that will show the command line arguments and return code from the failed process run. Users that want something

Re: [PATCH v2] MAINTAINERS: change Vladimir's email address

2022-03-21 Thread Eric Blake
On Thu, Mar 17, 2022 at 11:24:28AM +0300, Vladimir Sementsov-Ogievskiy wrote: > 17.03.2022 00:36, Eric Blake wrote: > > On Wed, Mar 16, 2022 at 12:27:02PM +0300, Vladimir Sementsov-Ogievskiy > > wrote: > > > Old vsement...@virtuozzo.com is not accessible anymore. > > > > > > Signed-off-by:

Re: [PATCH 15/15] iotests: make qemu_io_log() check return codes by default

2022-03-21 Thread John Snow
On Mon, Mar 21, 2022 at 2:22 PM Eric Blake wrote: > > On Fri, Mar 18, 2022 at 04:36:55PM -0400, John Snow wrote: > > Just like qemu_img_log(), upgrade qemu_io_log() to enforce a return code > > of zero by default. > > > > Affected tests: 242 245 255 274 303 307 nbd-reconnect-on-open > > > >

Re: [PATCH 14/15] iotests: remove qemu_io_silent() and qemu_io_silent_check().

2022-03-21 Thread John Snow
On Mon, Mar 21, 2022 at 2:16 PM Eric Blake wrote: > > On Fri, Mar 18, 2022 at 04:36:54PM -0400, John Snow wrote: > > Like qemu-img, qemu-io returning 0 should be the norm and not the > > exception. Remove all calls to qemu_io_silent that just assert the > > return code is zero (That's every last

Re: Memory leak in via_isa_realize()

2022-03-21 Thread Philippe Mathieu-Daudé
On 21/3/22 19:55, Cédric Le Goater wrote: On 3/21/22 14:04, Philippe Mathieu-Daudé wrote: Cc'ing Bernhard who did a similar cleanup recently. Same problem happens with qemu-system-ppc64 and the pegasos2 machine. No clue how to properly fix this... is it safe to free the pointer at the end

RE: [PATCH v8 12/12] target/hexagon: import additional tests

2022-03-21 Thread Taylor Simpson
> -Original Message- > From: Anton Johansson > Sent: Wednesday, February 9, 2022 11:03 AM > To: qemu-devel@nongnu.org > Cc: a...@rev.ng; Taylor Simpson ; Brian Cain > ; Michael Lambert ; > bab...@rev.ng; ni...@rev.ng; richard.hender...@linaro.org > Subject: [PATCH v8 12/12]

Re: Memory leak in via_isa_realize()

2022-03-21 Thread Cédric Le Goater
On 3/21/22 13:11, BALATON Zoltan wrote: On Mon, 21 Mar 2022, Peter Maydell wrote: On Mon, 21 Mar 2022 at 10:31, Thomas Huth wrote: FYI, I'm seeing a memory leak in via_isa_realize() when building QEMU with sanitizers enabled or when running QEMU through valgrind: Same problem happens with

Re: Memory leak in via_isa_realize()

2022-03-21 Thread Cédric Le Goater
On 3/21/22 14:04, Philippe Mathieu-Daudé wrote: Cc'ing Bernhard who did a similar cleanup recently. On 21/3/22 11:31, Thomas Huth wrote:   Hi! FYI, I'm seeing a memory leak in via_isa_realize() when building QEMU with sanitizers enabled or when running QEMU through valgrind: $ valgrind

  1   2   3   >