Re: [PATCH 1/2] target/riscv: rvv-1.0: Simplify vfwredsum code

2022-09-25 Thread Frank Chang
Reviewed-by: Frank Chang On Wed, Aug 17, 2022 at 11:32 PM Yang Liu wrote: > Remove duplicate code by wrapping vfwredsum_vs's OP function. > > Signed-off-by: Yang Liu > --- > target/riscv/vector_helper.c | 56 +++- > 1 file changed, 10 insertions(+), 46 deletion

Re: [PATCH 2/2] target/riscv: rvv-1.0: vf[w]redsum distinguish between ordered/unordered

2022-09-25 Thread Frank Chang
Reviewed-by: Frank Chang On Wed, Aug 17, 2022 at 11:45 PM Yang Liu wrote: > Starting with RVV1.0, the original vf[w]redsum_vs instruction was renamed > to vf[w]redusum_vs. The distinction between ordered and unordered is also > more consistent with other instructions, although there is no diffe

Re: [PATCH 01/10] mac_newworld: Drop some variables

2022-09-25 Thread Mark Cave-Ayland
On 17/09/2022 00:07, BALATON Zoltan wrote: Values not used frequently enough may not worth putting in a local variable, especially with names almost as long as the original value because that does not improve readability, to the contrary it makes it harder to see what value is used. Drop a few s

Re: [PATCH 02/10] mac_oldworld: Drop some more variables

2022-09-25 Thread Mark Cave-Ayland
On 17/09/2022 00:07, BALATON Zoltan wrote: Drop some more local variables additionally to commit b8df32555ce5 to match clean ups done to mac_newwold in previous patch. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_oldworld.c | 43 +-- 1 file changed, 2

Re: [PATCH 03/10] mac_{old|new}world: Set default values for some local variables

2022-09-25 Thread Mark Cave-Ayland
On 17/09/2022 00:07, BALATON Zoltan wrote: Some lines can be dropped making the code flow simpler and easier to follow by setting default values at variable declaration for some variables in both mac_oldworld.c and mac_newworld.c. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 28

[PATCH 1/2] audio: fix in.voices test

2022-09-25 Thread Helge Konetzka
Calling qemu with valid -audiodev ...,in.voices=0 results in an obsolete warning: audio: Bogus number of capture voices 0, setting to 0 This patch fixes the in.voices test. Signed-off-by: Helge Konetzka --- audio/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au

[PATCH 0/2] Fix audio voices tests

2022-09-25 Thread Helge Konetzka
Fix to remove obsolete warning on -audiodev ...,in.voices=0 and improvement for better readability of audio out.voices test Helge Konetzka (2): audio: fix in.voices test audio: improve out.voices test audio/audio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.37.3

[PATCH 2/2] audio: improve out.voices test

2022-09-25 Thread Helge Konetzka
Improve readability of audio out.voices test: If 1 is logged and set after positive test, 1 should be tested. Signed-off-by: Helge Konetzka --- audio/audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/audio.c b/audio/audio.c index 8a0ade4052..912b456058 100644 -

Re: [PATCH 04/10] mac_newworld: Simplify creation of Uninorth devices

2022-09-25 Thread Mark Cave-Ayland
On 17/09/2022 00:07, BALATON Zoltan wrote: Avoid open coding sysbus_create_simple where not necessary and reorganise code a bit to avoid some casts to make the code more readable. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 50 --- 1 fil

Re: [PATCH 05/10] mac_{old|new}world: Reduce number of QOM casts

2022-09-25 Thread Mark Cave-Ayland
On 17/09/2022 00:07, BALATON Zoltan wrote: By storing the device pointers in a variable with the right type the number of QOM casts can be reduced which also makes the code more readable. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 60 ---

Re: [PATCH 06/10] hw/ppc/mac.h: Move newworld specific atuff out from shared header

2022-09-25 Thread Mark Cave-Ayland
On 17/09/2022 00:07, BALATON Zoltan wrote: Move the parts specific to and only used by mac99 out from the shared mac.h into mac_newworld.c where they better belong. Signed-off-by: BALATON Zoltan --- hw/ppc/mac.h | 24 hw/ppc/mac_newworld.c | 19

Re: [PATCH 03/10] mac_{old|new}world: Set default values for some local variables

2022-09-25 Thread BALATON Zoltan
On Sun, 25 Sep 2022, Mark Cave-Ayland wrote: On 17/09/2022 00:07, BALATON Zoltan wrote: Some lines can be dropped making the code flow simpler and easier to follow by setting default values at variable declaration for some variables in both mac_oldworld.c and mac_newworld.c. Signed-off-by: BALA

Re: [PATCH 07/10] hw/ppc/mac.h: Move macio specific atuff out from shared header

2022-09-25 Thread Mark Cave-Ayland
On 17/09/2022 00:07, BALATON Zoltan wrote: Typo in subject: s/atuff/stuff/ Move the parts specific to and only used by macio out from the shared mac.h into macio.c where they better belong. Signed-off-by: BALATON Zoltan --- hw/misc/macio/macio.c | 26 -- hw/ppc/mac.

Re: [PATCH 08/10] hw/ppc/mac.h: Move grackle-pcihost declaration out from shared header

2022-09-25 Thread Mark Cave-Ayland
On 17/09/2022 00:07, BALATON Zoltan wrote: It is only used by mac_oldworld anyway and it already instantiates a few devices by name so this allows reducing the shared header further. Signed-off-by: BALATON Zoltan --- hw/pci-host/grackle.c | 1 + hw/ppc/mac.h | 3 --- hw/ppc/mac_ol

Re: [PATCH 04/10] mac_newworld: Simplify creation of Uninorth devices

2022-09-25 Thread BALATON Zoltan
On Sun, 25 Sep 2022, Mark Cave-Ayland wrote: On 17/09/2022 00:07, BALATON Zoltan wrote: Avoid open coding sysbus_create_simple where not necessary and reorganise code a bit to avoid some casts to make the code more readable. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 50 ++

Re: [PATCH 09/10] hw/ppc/mac.h: Move PROM and KERNEL defines to board code

2022-09-25 Thread Mark Cave-Ayland
On 17/09/2022 00:07, BALATON Zoltan wrote: The PROM_FILENAME and KERNEL_* defines are used by mac_oldworld and mac_newworld but they don't have to be identical so these could be moved to the individual boards. The NVRAM_SIZE define is not used so it can be dropped. This further reduces the mac.h

Re: [PATCH 08/10] hw/ppc/mac.h: Move grackle-pcihost declaration out from shared header

2022-09-25 Thread BALATON Zoltan
On Sun, 25 Sep 2022, Mark Cave-Ayland wrote: On 17/09/2022 00:07, BALATON Zoltan wrote: It is only used by mac_oldworld anyway and it already instantiates a few devices by name so this allows reducing the shared header further. Signed-off-by: BALATON Zoltan --- hw/pci-host/grackle.c | 1 +

Re: [PATCH 07/10] hw/ppc/mac.h: Move macio specific atuff out from shared header

2022-09-25 Thread BALATON Zoltan
On Sun, 25 Sep 2022, Mark Cave-Ayland wrote: On 17/09/2022 00:07, BALATON Zoltan wrote: Typo in subject: s/atuff/stuff/ Move the parts specific to and only used by macio out from the shared mac.h into macio.c where they better belong. Signed-off-by: BALATON Zoltan --- hw/misc/macio/macio.c |

Re: [PATCH 10/10] hw/ppc/mac.h: Rename to include/hw/nvram/mac_nvram.h

2022-09-25 Thread Mark Cave-Ayland
On 17/09/2022 00:07, BALATON Zoltan wrote: All that is left in mac.h now belongs to the nvram emulation so rename it accordingly and only include it where it is really used. Signed-off-by: BALATON Zoltan --- MAINTAINERS | 1 + hw/ide/macio.c

Re: [PATCH 03/10] mac_{old|new}world: Set default values for some local variables

2022-09-25 Thread BALATON Zoltan
On Sun, 25 Sep 2022, BALATON Zoltan wrote: On Sun, 25 Sep 2022, Mark Cave-Ayland wrote: On 17/09/2022 00:07, BALATON Zoltan wrote: Some lines can be dropped making the code flow simpler and easier to follow by setting default values at variable declaration for some variables in both mac_oldworl

Re: [PATCH v2] hw/display/tcx: Mark the VRAM dirty upon reset

2022-09-25 Thread Philippe Mathieu-Daudé via
On Sun, Feb 6, 2022 at 11:44 AM Peter Maydell wrote: > > On Sun, 6 Feb 2022 at 09:30, Mark Cave-Ayland > wrote: > > > > On 05/02/2022 15:39, Peter Maydell wrote: > > > The handling of the vram buffer seems weird in this device overall, > > > though -- the memory block is divided into three parts

Re: [PATCH v1 1/9] hw: encode accessing CPU index in MemTxAttrs

2022-09-25 Thread Richard Henderson
On 9/22/22 14:58, Alex Bennée wrote: We currently have hacks across the hw/ to reference current_cpu to work out what the current accessing CPU is. This breaks in some cases including using gdbstub to access HW state. As we have MemTxAttrs to describe details about the access lets extend it to me

Re: [PATCH v1 3/9] hw/intc/gic: use MxTxAttrs to divine accessing CPU

2022-09-25 Thread Richard Henderson
On 9/22/22 14:58, Alex Bennée wrote: Now that MxTxAttrs encodes a CPU we should use that to figure it out. This solves edge cases like accessing via gdbstub or qtest. Signed-off-by: Alex Bennée Resolves:https://gitlab.com/qemu-project/qemu/-/issues/124 --- Reviewed-by: Richard Henderson r~

Re: [PATCH v1 4/9] hw/timer: convert mptimer access to attrs to derive cpu index

2022-09-25 Thread Richard Henderson
On 9/22/22 14:58, Alex Bennée wrote: This removes the hacks to deal with empty current_cpu. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson r~

Re: [PATCH v1 5/9] configure: move detected gdb to TCG's config-host.mak

2022-09-25 Thread Richard Henderson
On 9/22/22 14:58, Alex Bennée wrote: When tests/tcg gained it's own config-host.mak we forgot to move the GDB detection. Fixes: 544f4a2578 (tests/tcg: isolate from QEMU's config-host.mak) Signed-off-by: Alex Bennée --- configure | 7 +++ 1 file changed, 7 insertions(+) Reviewed-by: Rich

Re: [PATCH v1 7/9] gdbstub: move sstep flags probing into AccelClass

2022-09-25 Thread Richard Henderson
On 9/22/22 14:58, Alex Bennée wrote: The support of single-stepping is very much dependent on support from the accelerator we are using. To avoid special casing in gdbstub move the probing out to an AccelClass function so future accelerators can put their code there. Signed-off-by: Alex Bennée C

Re: [PATCH v1 6/9] gdbstub: move into its own sub directory

2022-09-25 Thread Richard Henderson
On 9/22/22 14:58, Alex Bennée wrote: This is in preparation of future refactoring as well as cleaning up the source tree. Aside from the minor tweaks to meson and trace.h this is pure code motion. Signed-off-by: Alex Bennée --- meson.build| 4 +++- gdbstub/trace.h

Re: [PATCH v1 8/9] gdbstub: move breakpoint logic to accel ops

2022-09-25 Thread Richard Henderson
On 9/22/22 14:58, Alex Bennée wrote: As HW virtualization requires specific support to handle breakpoints lets push out special casing out of the core gdbstub code and into AccelOpsClass. This will make it easier to add other accelerator support and reduces some of the stub shenanigans. Signed-o

[PATCH v5 01/17] accel/tcg: Rename CPUIOTLBEntry to CPUTLBEntryFull

2022-09-25 Thread Richard Henderson
This structure will shortly contain more than just data for accessing MMIO. Rename the 'addr' member to 'xlat_section' to more clearly indicate its purpose. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h| 22 +++

[PATCH v5 03/17] accel/tcg: Suppress auto-invalidate in probe_access_internal

2022-09-25 Thread Richard Henderson
When PAGE_WRITE_INV is set when calling tlb_set_page, we immediately set TLB_INVALID_MASK in order to force tlb_fill to be called on the next lookup. Here in probe_access_internal, we have just called tlb_fill and eliminated true misses, thus the lookup must be valid. This allows us to remove a w

[PATCH v5 05/17] accel/tcg: Introduce tlb_set_page_full

2022-09-25 Thread Richard Henderson
Now that we have collected all of the page data into CPUTLBEntryFull, provide an interface to record that all in one go, instead of using 4 arguments. This interface allows CPUTLBEntryFull to be extended without having to change the number of arguments. Reviewed-by: Peter Maydell Reviewed-by: Ph

[PATCH v5 00/17] tcg: CPUTLBEntryFull and TARGET_TB_PCREL

2022-09-25 Thread Richard Henderson
Smooshing these two patch sets back together for review bandwidth. I hope to make this the next tcg-next pull. There are three from the first half, tlbentryfull, which are new. These are following a hallway conversation with Peter about bits in MemTxAttrs that are not actually related to memory tr

[PATCH v5 04/17] accel/tcg: Introduce probe_access_full

2022-09-25 Thread Richard Henderson
Add an interface to return the CPUTLBEntryFull struct that goes with the lookup. The result is not intended to be valid across multiple lookups, so the user must use the results immediately. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- in

[PATCH v5 06/17] include/exec: Introduce TARGET_PAGE_ENTRY_EXTRA

2022-09-25 Thread Richard Henderson
Allow the target to cache items from the guest page tables. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h

[PATCH v5 02/17] accel/tcg: Drop addr member from SavedIOTLB

2022-09-25 Thread Richard Henderson
This field is only written, not read; remove it. Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 1 - accel/tcg/cputlb.c| 7 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/hw/core/cp

[PATCH v5 07/17] target/sparc: Use tlb_set_page_full

2022-09-25 Thread Richard Henderson
Convert get_physical_address and all subroutines to use CPUTLBEntryFull, consolidating 4 pointer arguments, and providing the larger structure to the lower layers. This last will be important to the next patch. Cc: Mark Cave-Ayland Signed-off-by: Richard Henderson --- target/sparc/mmu_helper.c

[PATCH v5 08/17] accel/tcg: Move byte_swap from MemTxAttrs to CPUTLBEntryFull

2022-09-25 Thread Richard Henderson
We had previously placed this bit in MemTxAttrs because we had no other way to communicate that information to tlb_set_page*. The bit is not relevant to memory transactions, only page table entries, and now we do have a way to pass in the bit. Cc: Mark Cave-Ayland Signed-off-by: Richard Henderson

[PATCH v5 12/17] accel/tcg: Use DisasContextBase in plugin_gen_tb_start

2022-09-25 Thread Richard Henderson
Use the pc coming from db->pc_first rather than the TB. Use the cached host_addr rather than re-computing for the first page. We still need a separate lookup for the second page because it won't be computed for DisasContextBase until the translator actually performs a read from the page. Reviewe

[PATCH v5 09/17] accel/tcg: Add force_aligned to CPUTLBEntryFull

2022-09-25 Thread Richard Henderson
Support per-page natural alignment checking. This will be used by Arm for pages mapped with memory type Device. Cc: Peter Maydell Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h | 3 +++ accel/tcg/cputlb.c | 20 +--- 2 files changed, 16 insertions(+), 7 delet

[PATCH v5 13/17] accel/tcg: Do not align tb->page_addr[0]

2022-09-25 Thread Richard Henderson
Let tb->page_addr[0] contain the offset within the page of the start of the translation block. We need to recover this value anyway at various points, and it is easier to discard the page offset when it's not needed, which happens naturally via the existing find_page shift. Signed-off-by: Richard

[PATCH v5 10/17] accel/tcg: Remove PageDesc code_bitmap

2022-09-25 Thread Richard Henderson
This bitmap is created and discarded immediately. We gain nothing by its existence. Signed-off-by: Richard Henderson Message-Id: <20220822232338.1727934-2-richard.hender...@linaro.org> --- accel/tcg/translate-all.c | 78 ++- 1 file changed, 4 insertions(+), 74

[PATCH v5 14/17] include/hw/core: Create struct CPUJumpCache

2022-09-25 Thread Richard Henderson
Wrap the bare TranslationBlock pointer into a structure. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 8 ++-- accel/tcg/cpu-exec.c | 9 ++--- accel/tcg/cputlb.c| 2 +- accel/tcg/translate-all.c | 4 ++-- 4 files change

[PATCH v5 16/17] accel/tcg: Introduce TARGET_TB_PCREL

2022-09-25 Thread Richard Henderson
Prepare for targets to be able to produce TBs that can run in more than one virtual context. Signed-off-by: Richard Henderson --- include/exec/cpu-defs.h | 3 +++ include/exec/exec-all.h | 41 ++--- include/hw/core/cpu.h | 1 + accel/tcg/cpu-exec.c | 55 +++

[PATCH v5 11/17] accel/tcg: Use bool for page_find_alloc

2022-09-25 Thread Richard Henderson
Bool is more appropriate type for the alloc parameter. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/translate-all.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/accel/tcg/translate-all.c b/acce

[PATCH v5 15/17] accel/tcg: Introduce tb_pc and tb_pc_log

2022-09-25 Thread Richard Henderson
The availability of tb->pc will shortly be conditional. Introduce accessor functions to minimize ifdefs. Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 12 ++ accel/tcg/cpu-exec.c| 20 - accel/tcg/translate-all.c

[PATCH v5 17/17] accel/tcg: Split log_cpu_exec into inline and slow path

2022-09-25 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 7fe42269ea..318dbc1a2c 100644 --- a/accel/tcg/cpu-exec.c +++ b/a

[PATCH v3 00/54] tests/qtest: Enable running qtest on Windows

2022-09-25 Thread Bin Meng
In preparation to adding virtio-9p support on Windows, this series enables running qtest on Windows, so that we can run the virtio-9p tests on Windows to make sure it does not break accidently. Changes in v3: - Remove unnecessary "error = NULL" statements - Split patch "tests: Avoid using hardcode

[PATCH v3 05/54] tests/qtest: ahci-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized tests/qtest/ahci-test.c

[PATCH v3 10/54] tests/qtest: generic_fuzz: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/fuzz/generic_fuzz_configs.h | 4 ++-- 1 file changed, 2 i

[PATCH v3 01/54] tests/qtest: i440fx-test: Rewrite create_blob_file() to be portable

2022-09-25 Thread Bin Meng
From: Bin Meng Previously request_{bios, pflash} cases were skipped on win32, mainly due to create_blob_file() calling mmap() which does not exist on win32. This rewirtes create_blob_file() to be portable, so that we can enable these cases on Windows. Suggested-by: Marc-André Lureau Signed-off-

[PATCH v3 11/54] tests/qtest: virtio_blk_fuzz: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/fuzz/virtio_blk_fuzz.c | 4 ++-- 1 file changed, 2 inser

[PATCH v3 02/54] semihosting/arm-compat-semi: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng Use g_get_tmp_dir() to get the directory to use for temporary files. Signed-off-by: Bin Meng Reviewed-by: Alex Bennée --- (no changes since v1) semihosting/arm-compat-semi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/semihosting/arm-compat-semi.c b/

[PATCH v3 07/54] tests/qtest: boot-serial-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized tests/qtest/boot-serial-

[PATCH v3 03/54] tcg: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng Use g_get_tmp_dir() to get the directory to use for temporary files. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau Reviewed-by: Alex Bennée --- (no changes since v2) Changes in v2: - Use g_autofree to declare the variable tcg/tcg.c | 3 ++- 1 file changed, 2 insert

[PATCH v3 04/54] util/qemu-sockets: Use g_get_tmp_dir() to get the directory for temporary files

2022-09-25 Thread Bin Meng
From: Bin Meng Replace the existing logic to get the directory for temporary files with g_get_tmp_dir(), which works for win32 too. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v1) util/qemu-sockets.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)

[PATCH v3 09/54] tests/qtest: fdc-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/fdc-test.c | 5 +++-- 1 file changed, 3 insertions(+), 2

[PATCH v3 22/54] tests/unit: test-image-locking: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized tests/unit/test-image-lo

[PATCH v3 06/54] tests/qtest: aspeed_smc-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized tests/qtest/aspeed_smc-t

[PATCH v3 16/54] tests/qtest: qmp-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/qmp-test.c | 6 -- 1 file changed, 4 insertions(+), 2

[PATCH v3 14/54] tests/qtest: migration-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/migration-test.c | 7 --- 1 file changed, 4 insertion

[PATCH v3 21/54] tests/qtest: libqtest: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng The qtest library was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() and g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized

[PATCH v3 08/54] tests/qtest: cxl-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized tests/qtest/cxl-test.c |

[PATCH v3 13/54] tests/qtest: ide-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/ide-test.c | 10 ++ 1 file changed, 6 insertions

[PATCH v3 28/54] tests/qtest: Skip running virtio-net-test cases that require socketpair() for win32

2022-09-25 Thread Bin Meng
From: Bin Meng Some of the virtio-net-test test cases require socketpair() to do the test setup. Skip them for win32. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - Change to skip only part of the virtio-net-test cases that require socketp

[PATCH v3 23/54] tests/unit: test-qga: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/unit/test-qga.c | 2 +- 1 file changed, 1 insertion(+), 1 deleti

[PATCH v3 12/54] tests/qtest: hd-geo-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized - Use g_steal_pointer() in

[PATCH v3 24/54] tests: vhost-user-bridge: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/vhost-user-bridge.c | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH v3 25/54] block/vvfat: Unify the mkdir() call

2022-09-25 Thread Bin Meng
From: Bin Meng There is a difference in the mkdir() call for win32 and non-win32 platforms, and currently is handled in the codes with #ifdefs. glib provides a portable g_mkdir() API and we can use it to unify the codes without #ifdefs. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau -

[PATCH v3 17/54] tests/qtest: vhost-user-blk-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_get_tmp_dir() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/vhost-user-blk-test.c | 3 ++- 1 file changed, 2 insertion

[PATCH v3 32/54] tests/qtest: libqtest: Adapt global_qtest declaration for win32

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng Commit dd2107497275 ("tests/libqtest: Use libqtest-single.h in tests that require global_qtest") moved global_qtest to libqtest-single.h, by declaring global_qtest attribute to be common and weak. This trick unfortunately does not work on Windows, and building qtest test case

[PATCH v3 27/54] hw/usb: dev-mtp: Use g_mkdir()

2022-09-25 Thread Bin Meng
From: Bin Meng Use g_mkdir() to create a directory on all platforms. Signed-off-by: Bin Meng Acked-by: Gerd Hoffmann --- (no changes since v2) Changes in v2: - Change to use g_mkdir() hw/usb/dev-mtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/usb/dev-mtp.c

[PATCH v3 29/54] tests/qtest: Build test-filter-{mirror, redirector} cases for posix only

2022-09-25 Thread Bin Meng
From: Bin Meng The test-filter-{mirror,redirector} cases use socketpair() API that is only available on POSIX and should only be built for POSIX. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - Introduce a new variable qtests_filter and add t

[PATCH v3 35/54] tests/qtest: libqtest: Install signal handler via signal()

2022-09-25 Thread Bin Meng
From: Bin Meng At present the codes uses sigaction() to install signal handler with a flag SA_RESETHAND. Such usage can be covered by the signal() API that is a simplified interface to the general sigaction() facility. Update to use signal() to install the signal handler, as it is available on W

[PATCH v3 15/54] tests/qtest: pflash-cfi02-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/pflash-cfi02-test.c | 8 +--- 1 file changed, 5 inse

[PATCH v3 31/54] accel/qtest: Implement a portable qtest accelerator

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng Currently signal SIGIPI [=SIGUSR1] is used to kick the dummy CPU when qtest accelerator is used. However SIGUSR1 is unsupported on Windows. To support Windows, we add a QemuSemaphore CPUState::sem to kick the dummy CPU instead. As a result of this, the POSIX implementation via

[PATCH v3 33/54] tests/qtest: Use send/recv for socket communication

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng Socket communication in the libqtest and libqmp codes uses read() and write() which work on any file descriptor on *nix, and sockets in *nix are an example of a file descriptor. However sockets on Windows do not use *nix-style file descriptors, so read() and write() cannot be

[PATCH v3 19/54] tests/qtest: virtio-blk-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch tests/qtest/virtio-blk-test.c | 4 ++-- 1 file changed, 2 insertions

[PATCH v3 43/54] tests/qtest: migration-test: Make sure QEMU process "to" exited after migration is canceled

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng Make sure QEMU process "to" exited before launching another target for migration in the test_multifd_tcp_cancel case. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng --- Changes in v3: - Add a usleep(1) in the busy wait loop Changes in v2: - Change to a busy wait after

[PATCH v3 20/54] tests/qtest: virtio-scsi-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_file_open_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized tests/qtest/virtio-scsi-

[PATCH v3 39/54] tests/qtest: migration-test: Disable IO redirection for win32

2022-09-25 Thread Bin Meng
From: Bin Meng On Windows the QEMU executable is created via CreateProcess() and IO redirection does not work, so don't bother adding IO redirection to the command line. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - Change the place that se

[PATCH v3 34/54] tests/qtest: libqtest: Exclude the *_fds APIs for win32

2022-09-25 Thread Bin Meng
From: Bin Meng libqmp.c::qmp_fd_vsend_fds() is not available on Windows, hence any APIs in libqtest that call libqmp.c::qmp_fd_vsend_fds() should be excluded for win32 too. This includes the following: * qtest_qmp_vsend_fds() * qtest_vqmp_fds() * qtest_qmp_fds() * qtest_qmp_add_client()

[PATCH v3 40/54] tests/qtest: ide-test: Open file in binary mode

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng By default Windows opens file in text mode, while a POSIX compliant implementation treats text files and binary files the same. The fopen() 'mode' string can include the letter 'b' to indicate binary mode shall be used. POSIX spec says the character 'b' shall have no effect, b

[PATCH v3 36/54] tests/qtest: Support libqtest to build and run on Windows

2022-09-25 Thread Bin Meng
From: Bin Meng At present the libqtest codes were written to depend on several POSIX APIs, including fork(), kill() and waitpid(). Unfortunately these APIs are not available on Windows. This commit implements the corresponding functionalities using win32 native APIs. With this change, all qtest

[PATCH v3 18/54] tests/qtest: vhost-user-test: Avoid using hardcoded /tmp

2022-09-25 Thread Bin Meng
From: Bin Meng This case was written to use hardcoded /tmp directory for temporary files. Update to use g_dir_make_tmp() for a portable implementation. Signed-off-by: Bin Meng --- Changes in v3: - Split to a separate patch - Ensure g_autofree variable is initialized tests/qtest/vhost-user-te

[PATCH v3 49/54] io/channel-watch: Fix socket watch on Windows

2022-09-25 Thread Bin Meng
From: Bin Meng Random failure was observed when running qtests on Windows due to "Broken pipe" detected by qmp_fd_receive(). What happened is that the qtest executable sends testing data over a socket to the QEMU under test but no response is received. The errno of the recv() call from the qtest

[PATCH v3 38/54] tests/qtest: bios-tables-test: Adapt the case for win32

2022-09-25 Thread Bin Meng
From: Bin Meng Single quotes in the arguments (oem_id='CRASH ') are not removed in the Windows environment before it is passed to the QEMU executable. The space in the argument causes the "-acpitable" option parser to think that all of its parameters are done, hence it complains: '-acpitable'

[PATCH v3 46/54] tests/qtest: libqtest: Correct the timeout unit of blocking receive calls for win32

2022-09-25 Thread Bin Meng
From: Bin Meng Some qtest cases don't get response from the QEMU executable under test in time on Windows. It turns out that the socket receive call got timeout before it receive the complete response. The timeout value is supposed to be set to 50 seconds via the setsockopt() call, but there is

[PATCH v3 26/54] fsdev/virtfs-proxy-helper: Use g_mkdir()

2022-09-25 Thread Bin Meng
From: Bin Meng Use g_mkdir() to create a directory on all platforms. Signed-off-by: Bin Meng Reviewed-by: Christian Schoenebeck --- (no changes since v2) Changes in v2: - Change to use g_mkdir() fsdev/virtfs-proxy-helper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH v3 41/54] tests/qtest: virtio-net-failover: Disable migration tests for win32

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng These tests use the exec migration protocol, which is unsupported on Windows as of today. Disable these tests for now. Signed-off-by: Xuzhou Cheng Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v1) tests/qtest/virtio-net-failover.c | 9 +

[PATCH v3 47/54] io/channel-watch: Drop a superfluous '#ifdef WIN32'

2022-09-25 Thread Bin Meng
From: Bin Meng In the win32 version qio_channel_create_socket_watch() body there is no need to do a '#ifdef WIN32'. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v1) io/channel-watch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/io/channel-watch.c b/i

[PATCH v3 30/54] tests/qtest: qmp-test: Skip running test_qmp_oob for win32

2022-09-25 Thread Bin Meng
From: Bin Meng The test_qmp_oob test case calls mkfifo() which does not exist on win32. Exclude it. Signed-off-by: Bin Meng Reviewed-by: Thomas Huth --- (no changes since v2) Changes in v2: - Add a comment in the code to explain why test_qmp_oob test case is skipped on win32 tests/qtest/

[PATCH v3 50/54] tests/qtest: migration-test: Skip running some TLS cases for win32

2022-09-25 Thread Bin Meng
From: Bin Meng Some migration test cases use TLS to communicate, but they fail on Windows with the following error messages: qemu-system-x86_64: TLS handshake failed: Insufficient credentials for that request. qemu-system-x86_64: TLS handshake failed: Error in the pull function. query-mig

[PATCH v3 48/54] io/channel-watch: Drop the unnecessary cast

2022-09-25 Thread Bin Meng
From: Bin Meng There is no need to do a type cast on ssource->socket as it is already declared as a SOCKET. Suggested-by: Marc-André Lureau Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v2) Changes in v2: - new patch: "io/channel-watch: Drop the unnecessary ca

[PATCH v3 37/54] tests/qtest: {ahci, ide}-test: Use relative path for temporary files for win32

2022-09-25 Thread Bin Meng
From: Bin Meng These test cases uses "blkdebug:path/to/config:path/to/image" for testing. On Windows, absolute file paths contain the delimiter ':' which causes the blkdebug filename parser fail to parse filenames. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v

[PATCH v3 51/54] .gitlab-ci.d/windows.yml: Increase the timeout to 90 minutes

2022-09-25 Thread Bin Meng
From: Bin Meng commit 9f8e6cad65a6 ("gitlab-ci: Speed up the msys2-64bit job by using --without-default-devices" changed to compile QEMU with the --without-default-devices switch for the msys2-64bit job, due to the build could not complete within the project timeout (1h), and also mentioned that

[PATCH v3 53/54] tests/qtest: Enable qtest build on Windows

2022-09-25 Thread Bin Meng
From: Bin Meng Now that we have fixed various test case issues as seen when running on Windows, let's enable the qtest build on Windows. Signed-off-by: Bin Meng --- Changes in v3: - Drop the host test Changes in v2: - new patch: "tests/qtest: Enable qtest build on Windows" tests/qtest/meson

[PATCH v3 42/54] chardev/char-file: Add FILE_SHARE_WRITE when opening the file for win32

2022-09-25 Thread Bin Meng
From: Xuzhou Cheng The combination of GENERIC_WRITE and FILE_SHARE_READ options does not allow the same file to be opened again by CreateFile() from another QEMU process with the same options when the previous QEMU process still holds the file handle opened. This was triggered by running the tes

[PATCH v3 52/54] .gitlab-ci.d/windows.yml: Display meson test logs

2022-09-25 Thread Bin Meng
From: Bin Meng When CI fails we don't know what causes the failure. Displaying the meson test logs can be helpful. Signed-off-by: Bin Meng --- (no changes since v2) Changes in v2: - new patch: Display meson test logs in the Windows CI .gitlab-ci.d/windows.yml | 4 ++-- 1 file changed, 2 ins

[PATCH v2 04/13] mac_{old|new}world: Avoid else branch by setting default value

2022-09-25 Thread BALATON Zoltan
Several variables are set in if-else branches where the else branch can be removed by setting a default value at the variable declaration which leads to simlpler code that is easier to follow. Signed-off-by: BALATON Zoltan --- hw/ppc/mac_newworld.c | 19 --- hw/ppc/mac_oldworld.c

[PATCH v3 44/54] tests/qtest: microbit-test: Fix socket access for win32

2022-09-25 Thread Bin Meng
From: Bin Meng Sockets on Windows do not use *nix-style file descriptors, so write()/read()/close() do not work on Windows. Switch over to use send()/recv()/closesocket() which work with sockets on all platforms. Signed-off-by: Bin Meng Reviewed-by: Marc-André Lureau --- (no changes since v1

  1   2   >