[PATCH-for-6.0] target/mips: Correct the license text

2021-04-18 Thread Philippe Mathieu-Daudé
The license is the 'GNU General Public License v2.0 or later', not 'and': This program is free software; you can redistribute it and/ori modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your op

Re: any remaining for-6.0 issues?

2021-04-18 Thread Mark Cave-Ayland
On 17/04/2021 20:46, Peter Maydell wrote: On 14/04/2021 13:48, Thomas Huth wrote: I've seen some intermittend, non-reproducible crashes with usermode QEMU in some of my CI runs, e.g.: https://gitlab.com/thuth/qemu/-/jobs/1178256498#L3876 https://gitlab.com/thuth/qemu/-/jobs/1146276208#L3241

[PATCH v5 1/1] docs/devel: Add VFIO device migration documentation

2021-04-18 Thread Tarun Gupta
Document interfaces used for VFIO device migration. Added flow of state changes during live migration with VFIO device. Reviewed-by: Cornelia Huck Co-developed-by: Kirti Wankhede Signed-off-by: Kirti Wankhede Signed-off-by: Tarun Gupta --- Tested by building docs with new vfio-migration.rst fi

[Bug 1924912] [NEW] VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash

2021-04-18 Thread kleines Filmröllchen
Public bug reported: I ran SerenityOS out of WSL2 with native Windows QEMU. The system runs fine on the Linux QEMU (with Windows X-Server). However, with Windows QEMU I get a hard crash after the following output: ``` [#0 colonel(0:0)]: Scheduler[0]: idle

[Bug 1924914] [NEW] Running sway in a QEMU VM results in a GPU hang of the guest (virtio-gpu driver)

2021-04-18 Thread Diego Viola
Public bug reported: System is Arch Linux (guest and host OS). Problem: Basically, when using sway on a guest and running certain applications via Xwayland (on the guest), the GUI will freeze and won't be usable anymore, I can still ssh to the guest and run commands. This is the command I use t

[Bug 1924912] Re: VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash

2021-04-18 Thread Stefan Weil
Did you build your own Windows binary based on the official sources? Or did you use a precompiled binary? If yes, which one? Please describe the exact steps to reproduce the issue. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. http

[Bug 1924914] Re: Running sway in a QEMU VM results in a GPU hang of the guest (virtio-gpu driver)

2021-04-18 Thread Diego Viola
I can't get it to happen with -vga qxl. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1924914 Title: Running sway in a QEMU VM results in a GPU hang of the guest (virtio- gpu driver) Status in Q

[Bug 1924912] Re: VirtIO drivers don't work on Windows: "GLib: Too many handles to wait for!" crash

2021-04-18 Thread kleines Filmröllchen
I used the pre-built binaries with the versions described above. I did not change any install options so this can be reproduced after using the official install binaries for each version. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU

Re: [PATCH RFC] migration: warn about non-migratable configurations unless '--no-migration' was specified

2021-04-18 Thread Peter Maydell
On Thu, 15 Apr 2021 at 16:46, Vitaly Kuznetsov wrote: > When a migration blocker is added nothing is reported to the user, > inability to migrate such guest may come as a late surprise. As a bare > minimum, we can print a warning. To not pollute the output for those, who > have no intention to mig

[PATCH 00/26] target/mips: Re-org to allow KVM-only builds

2021-04-18 Thread Philippe Mathieu-Daudé
TL;DR: This series restrict TCG-specific objects by moving them to the tcg/ subdir. Code is moved around to satisfy 3 cases: { generic sysemu / tcg sysemu / tcg user}. Hi, This series move the MIPS TCG files under target/mips/tcg/. tcg/ is split into {sysemu and user}, and code common to both us

[PATCH 01/26] target/mips: Simplify meson TCG rules

2021-04-18 Thread Philippe Mathieu-Daudé
We already have the mips_tcg_ss source set for TCG-specific files, use it for mxu_translate.c and tx79_translate.c to simplify a bit. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/mips/meson.build

Re: [PULL 0/7] queue of proposed rc4 fixes

2021-04-18 Thread Alex Bennée
Peter Maydell writes: > This pullreq contains fixes for the remaining "not fixed yet" issues > in the 6.0 Planning page: > * Fix compile failures of C++ files with new glib headers > * mps3-an547: Use correct Cortex-M55 CPU and don't disable its FPU > * accel/tcg: Fix assertion failure execu

[PATCH 04/26] target/mips: Make CPU/FPU regnames[] arrays global

2021-04-18 Thread Philippe Mathieu-Daudé
The CPU/FPU regnames[] arrays is used in mips_tcg_init() and mips_cpu_dump_state(), which while being in translate.c is not specific to TCG. To be able to move mips_cpu_dump_state() to cpu.c, which is compiled for all accelerator, we need to make the regnames[] arrays global to target/mips/ by dec

[PATCH 03/26] target/mips: Move msa_reset() to new source file

2021-04-18 Thread Philippe Mathieu-Daudé
mips_cpu_reset() is used by all accelerators, and calls msa_reset(), which is defined in msa_helper.c. Beside msa_reset(), the rest of msa_helper.c is only useful to the TCG accelerator. To be able to restrict this helper file to TCG, we need to move msa_reset() out of it. Signed-off-by: Philippe

[PATCH 02/26] target/mips: Move IEEE rounding mode array to new source file

2021-04-18 Thread Philippe Mathieu-Daudé
restore_msa_fp_status() is declared inlined in fpu_helper.h, and uses the ieee_rm[] array. Therefore any code calling restore_msa_fp_status() must have access to this ieee_rm[] array. kvm_mips_get_fpu_registers(), which is in target/mips/kvm.c, calls restore_msa_fp_status. Except this tiny array,

[PATCH 05/26] target/mips: Restrict mips_cpu_dump_state() to cpu.c

2021-04-18 Thread Philippe Mathieu-Daudé
As mips_cpu_dump_state() is only used once to initialize the CPUClass::dump_state handler, we can move it to cpu.c to keep it symbol local. Beside, this handler is used by all accelerators, while the translate.c file targets TCG. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h

[PATCH 06/26] target/mips: Extract load/store helpers to ldst_helper.c

2021-04-18 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/mips/ldst_helper.c | 304 ++ target/mips/op_helper.c | 274 -- target/mips/meson.build | 1 + 3 files changed, 305 insertions(+), 274 deletions(-) create mode 100644 target/

[PATCH 09/26] target/mips: Add simple user-mode mips_cpu_do_interrupt()

2021-04-18 Thread Philippe Mathieu-Daudé
The #ifdef'ry hides that the user-mode implementation of mips_cpu_do_interrupt() simply sets exception_index = EXCP_NONE. Add this simple implementation to tcg/user/helper.c, and the corresponding Meson machinery to build this file when user emulation is configured. Signed-off-by: Philippe Mathie

[PATCH 11/26] target/mips: Move cpu_signal_handler definition around

2021-04-18 Thread Philippe Mathieu-Daudé
We have 2 blocks guarded with #ifdef for sysemu, which are simply separated by the cpu_signal_handler definition. To simplify the following commits which involve various changes in internal.h, first join the sysemu-guarded blocks. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h

[PATCH 10/26] target/mips: Add simple user-mode mips_cpu_tlb_fill()

2021-04-18 Thread Philippe Mathieu-Daudé
tlb_helper.c's #ifdef'ry hides a quite simple user-mode implementation of mips_cpu_tlb_fill(). Copy the user-mode implementation (without #ifdef'ry) to tcg/user/helper.c and simplify tlb_helper.c's #ifdef'ry. This will allow us to restrict tlb_helper.c to sysemu. Signed-off-by: Philippe Mathieu-

[PATCH 07/26] meson: Introduce meson_user_arch source set for arch-specific user-mode

2021-04-18 Thread Philippe Mathieu-Daudé
Similarly to the 'target_softmmu_arch' source set which allows to restrict target-specific sources to system emulation, add the equivalent 'meson_user_arch' set for user emulation. Signed-off-by: Philippe Mathieu-Daudé --- Cc: Paolo Bonzini --- meson.build | 6 ++ 1 file changed, 6 insertio

[PATCH 12/26] target/mips: Move sysemu specific files under sysemu/ subfolder

2021-04-18 Thread Philippe Mathieu-Daudé
Move sysemu-specific files under the new sysemu/ subfolder and adapt the Meson machinery. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/{ => sysemu}/addr.c | 0 target/mips/{ => sysemu}/cp0_timer.c | 0 target/mips/{ => sysemu}/machine.c | 0 target/mips/meson.build

[PATCH 14/26] target/mips: Move sysemu TCG-specific code to tcg/sysemu/ subfolder

2021-04-18 Thread Philippe Mathieu-Daudé
Declare cpu_mips_get_random() and update_pagemask() on local scope, and move cp0_helper.c and mips-semi.c to the new tcg/sysemu/ folder, adapting the Meson machinery. Move the opcode definitions to tcg/sysemu_helper.h.inc. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/helper.h

[PATCH 17/26] target/mips: Restrict CPUMIPSTLBContext::map_address() handlers scope

2021-04-18 Thread Philippe Mathieu-Daudé
The 3 map_address() handlers are local to tlb_helper.c, no need to have their prototype declared publically. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 6 -- target/mips/tcg/sysemu/tlb_helper.c | 13 +++-- 2 files changed, 7 insertions(+), 12 del

[PATCH 08/26] target/mips: Introduce tcg-internal.h for TCG specific declarations

2021-04-18 Thread Philippe Mathieu-Daudé
We will gradually move TCG-specific declarations to a new local header: "tcg-internal.h". To keep review simple, first add this header with 2 TCG prototypes, which we are going to move in the next 2 commits. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 7 +++ t

[PATCH 13/26] target/mips: Move code related to physical addressing to sysemu/phys.c

2021-04-18 Thread Philippe Mathieu-Daudé
Declare get_physical_address() with local scope and move it along with mips_cpu_get_phys_page_debug() to sysemu/phys.c new file. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 25 +++- target/mips/sysemu/physaddr.c | 257 + target/mip

[PATCH 15/26] target/mips: Restrict mmu_init() to TCG

2021-04-18 Thread Philippe Mathieu-Daudé
mmu_init() is only required by TCG accelerator. Restrict its declaration and call to TCG. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 3 --- target/mips/tcg/tcg-internal.h | 2 ++ target/mips/cpu.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(

[PATCH 20/26] target/mips: Move TLB management helpers to tcg/sysemu/tlb_helper.c

2021-04-18 Thread Philippe Mathieu-Daudé
Move TLB management helpers to tcg/sysemu/tlb_helper.c. Signed-off-by: Philippe Mathieu-Daudé --- 4 checkpatch errors: ERROR: space prohibited after that '&' (ctx:WxW) #414: FILE: target/mips/tcg/sysemu/tlb_helper.c:71: +tlb->XI0 = (env->CP0_EntryLo0 >> CP0EnLo_XI) & 1;

[PATCH 23/26] target/mips: Move helper.h -> tcg/helper.h.inc

2021-04-18 Thread Philippe Mathieu-Daudé
TCG frontend "exec/helper-head.h" expects each target to declare its helpers in 'target/$TARGET/helper.h'. To ease maintenance we rather to have all TCG specific files under our tcg/ sub directory. Move the current 'helper.h' there, and add a one-line 'helper.h' which re-include it. Signed-off-by

[PATCH 16/26] target/mips: Move tlb_helper.c to tcg/sysemu/

2021-04-18 Thread Philippe Mathieu-Daudé
Move tlb_helper.c to the tcg/sysemu/ subdir, along with the following 3 declarations to tcg-internal.h: - cpu_mips_tlb_flush() - cpu_mips_translate_address() - r4k_invalidate_tlb() Simplify tlb_helper.c #ifdef'ry because files in tcg/sysemu/ are only build when sysemu mode is configured. Signed-o

[PATCH 18/26] target/mips: Move Special opcodes to tcg/sysemu/special_helper.c

2021-04-18 Thread Philippe Mathieu-Daudé
Move the Special opcodes helpers to tcg/sysemu/special_helper.c. Since mips_io_recompile_replay_branch() is set as CPUClass::io_recompile_replay_branch handler in cpu.c, we need to declare its prototype in "tcg-internal.h". Signed-off-by: Philippe Mathieu-Daudé --- target/mips/helper.h

[PATCH 22/26] target/mips: Move CP0 helpers to sysemu/cp0.c

2021-04-18 Thread Philippe Mathieu-Daudé
Opcodes accessing Coprocessor 0 are privileged. Move the CP0 helpers to sysemu/ and simplify the #ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 9 +-- target/mips/cpu.c | 103 --- target/mips/sysemu/cp0.c | 123 +

[PATCH 19/26] target/mips: Move helper_cache() to tcg/sysemu/special_helper.c

2021-04-18 Thread Philippe Mathieu-Daudé
Move helper_cache() to tcg/sysemu/special_helper.c. The CACHE opcode is privileged and is not accessible in user emulation. However we get a link failure when restricting the symbol to sysemu. For now, add a stub to satisfy linking, which abort if ever called. Signed-off-by: Philippe Mathieu-Daud

[PATCH 25/26] hw/mips: Restrict non-virtualized machines to TCG

2021-04-18 Thread Philippe Mathieu-Daudé
Only the malta and loongson3-virt machines support KVM. Restrict the other machines to TCG: - mipssim - magnum - pica61 - fuloong2e - boston Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/meson.build | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/mip

[PATCH 24/26] target/mips: Move TCG source files under tcg/ sub directory

2021-04-18 Thread Philippe Mathieu-Daudé
To ease maintenance, move all TCG specific files under the tcg/ sub-directory. Adapt the Meson machinery. The following prototypes: - mips_tcg_init() - mips_cpu_do_unaligned_access() - mips_cpu_do_transaction_failed() can now be restricted to the "tcg-internal.h" header. Signed-off-by: Philippe M

[PATCH 21/26] target/mips: Move exception management code to exception.c

2021-04-18 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 13 --- target/mips/tcg/tcg-internal.h | 14 +++ target/mips/cpu.c | 113 -- target/mips/exception.c| 169 + target/mips/op_helper.c| 37 -

[PATCH 26/26] gitlab-ci: Add KVM mips64el cross-build jobs

2021-04-18 Thread Philippe Mathieu-Daudé
Add a new job to cross-build the mips64el target without the TCG accelerator (IOW: only KVM accelerator enabled). Only build the mips64el target which is known to work and has users. Signed-off-by: Philippe Mathieu-Daudé --- .gitlab-ci.d/crossbuilds.yml | 8 1 file changed, 8 insertion

Re: [PATCH 00/26] target/mips: Re-org to allow KVM-only builds

2021-04-18 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20210418163134.1133100-1-f4...@amsat.org/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20210418163134.1133100-1-f4...@amsat.org Subject: [PATCH 00/26] target/mips: Re-org to allow

[PATCH v2] hw/mips/jazz: Remove confusing ifdef'ry

2021-04-18 Thread Philippe Mathieu-Daudé
The jazz machine is not used under user emulation and does not support KVM. Simplify the ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Claudio Fontana Message-Id: <20210226132723.3969650-3-f4...@amsat.org> --- v2: Rebased. Based-on: <20210418163134

Re: [PATCH v2] hw/mips/jazz: Remove confusing ifdef'ry

2021-04-18 Thread Richard Henderson
On 4/18/21 9:51 AM, Philippe Mathieu-Daudé wrote: The jazz machine is not used under user emulation and does not support KVM. Simplify the ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Claudio Fontana Message-Id:<20210226132723.3969650-3-f4...@amsat.

Re: [PATCH 01/26] target/mips: Simplify meson TCG rules

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: We already have the mips_tcg_ss source set for TCG-specific files, use it for mxu_translate.c and tx79_translate.c to simplify a bit. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/meson.build | 5 ++--- 1 file changed, 2 insertions(+),

Re: [PATCH 02/26] target/mips: Move IEEE rounding mode array to new source file

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: restore_msa_fp_status() is declared inlined in fpu_helper.h, and uses the ieee_rm[] array. Therefore any code calling restore_msa_fp_status() must have access to this ieee_rm[] array. kvm_mips_get_fpu_registers(), which is in target/mips/kvm.c, c

Re: [PATCH 03/26] target/mips: Move msa_reset() to new source file

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: mips_cpu_reset() is used by all accelerators, and calls msa_reset(), which is defined in msa_helper.c. Beside msa_reset(), the rest of msa_helper.c is only useful to the TCG accelerator. To be able to restrict this helper file to TCG, we need to

Re: [PATCH 04/26] target/mips: Make CPU/FPU regnames[] arrays global

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: +const char * const regnames[32] = { +"r0", "at", "v0", "v1", "a0", "a1", "a2", "a3", +"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", +"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", +"t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra"

Re: [PATCH 05/26] target/mips: Restrict mips_cpu_dump_state() to cpu.c

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: As mips_cpu_dump_state() is only used once to initialize the CPUClass::dump_state handler, we can move it to cpu.c to keep it symbol local. Beside, this handler is used by all accelerators, while the translate.c file targets TCG. Signed-off-by: P

Re: [PATCH 06/26] target/mips: Extract load/store helpers to ldst_helper.c

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: +static inline hwaddr do_translate_address(CPUMIPSState *env, + target_ulong address, + MMUAccessType access_type, + uintptr

Re: [PATCH 07/26] meson: Introduce meson_user_arch source set for arch-specific user-mode

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Similarly to the 'target_softmmu_arch' source set which allows to restrict target-specific sources to system emulation, add the equivalent 'meson_user_arch' set for user emulation. You didn't call it meson_user_arch in the end. Last minute chan

Re: [PATCH 11/26] target/mips: Move cpu_signal_handler definition around

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: We have 2 blocks guarded with #ifdef for sysemu, which are simply separated by the cpu_signal_handler definition. To simplify the following commits which involve various changes in internal.h, first join the sysemu-guarded blocks. Signed-off-by:

Re: [PATCH 08/26] target/mips: Introduce tcg-internal.h for TCG specific declarations

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: We will gradually move TCG-specific declarations to a new local header: "tcg-internal.h". To keep review simple, first add this header with 2 TCG prototypes, which we are going to move in the next 2 commits. Signed-off-by: Philippe Mathieu-Daudé

Re: [PATCH 12/26] target/mips: Move sysemu specific files under sysemu/ subfolder

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Move sysemu-specific files under the new sysemu/ subfolder and adapt the Meson machinery. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/{ => sysemu}/addr.c | 0 target/mips/{ => sysemu}/cp0_timer.c | 0 target/mips/{ => sysemu}

Re: [PATCH 13/26] target/mips: Move code related to physical addressing to sysemu/phys.c

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Declare get_physical_address() with local scope and move it along with mips_cpu_get_phys_page_debug() to sysemu/phys.c new file. You used physaddr.c in the end. Otherwise, Reviewed-by: Richard Henderson r~ Signed-off-by: Philippe Mathieu-

Re: [PATCH 14/26] target/mips: Move sysemu TCG-specific code to tcg/sysemu/ subfolder

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Declare cpu_mips_get_random() and update_pagemask() on local scope, What is "local scope"? Anyway, I don't see what this has to do with the rest of the code movement. r~ and move cp0_helper.c and mips-semi.c to the new tcg/sysemu/ folder,

Re: [PATCH 15/26] target/mips: Restrict mmu_init() to TCG

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: mmu_init() is only required by TCG accelerator. Restrict its declaration and call to TCG. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 3 --- target/mips/tcg/tcg-internal.h | 2 ++ target/mips/cpu.c

Re: [PATCH 16/26] target/mips: Move tlb_helper.c to tcg/sysemu/

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Move tlb_helper.c to the tcg/sysemu/ subdir, along with the following 3 declarations to tcg-internal.h: - cpu_mips_tlb_flush() - cpu_mips_translate_address() - r4k_invalidate_tlb() Simplify tlb_helper.c #ifdef'ry because files in tcg/sysemu/ are

Re: [PATCH 17/26] target/mips: Restrict CPUMIPSTLBContext::map_address() handlers scope

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: The 3 map_address() handlers are local to tlb_helper.c, no need to have their prototype declared publically. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 6 -- target/mips/tcg/sysemu/tlb_helper.c | 13 ++

Re: [PATCH 18/26] target/mips: Move Special opcodes to tcg/sysemu/special_helper.c

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Move the Special opcodes helpers to tcg/sysemu/special_helper.c. Since mips_io_recompile_replay_branch() is set as CPUClass::io_recompile_replay_branch handler in cpu.c, we need to declare its prototype in "tcg-internal.h". Signed-off-by: Philip

Re: [PATCH v2] hw/mips/jazz: Remove confusing ifdef'ry

2021-04-18 Thread Philippe Mathieu-Daudé
On 4/18/21 8:48 PM, Richard Henderson wrote: > On 4/18/21 9:51 AM, Philippe Mathieu-Daudé wrote: >> The jazz machine is not used under user emulation and >> does not support KVM. Simplify the ifdef'ry. >> >> Signed-off-by: Philippe Mathieu-Daudé >> Reviewed-by: Richard Henderson >> Reviewed-by: Cla

Re: [PATCH 19/26] target/mips: Move helper_cache() to tcg/sysemu/special_helper.c

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Move helper_cache() to tcg/sysemu/special_helper.c. The CACHE opcode is privileged and is not accessible in user emulation. However we get a link failure when restricting the symbol to sysemu. For now, add a stub to satisfy linking, which abort i

Re: [PATCH 20/26] target/mips: Move TLB management helpers to tcg/sysemu/tlb_helper.c

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Move TLB management helpers to tcg/sysemu/tlb_helper.c. Signed-off-by: Philippe Mathieu-Daudé --- 4 checkpatch errors: ERROR: space prohibited after that '&' (ctx:WxW) #414: FILE: target/mips/tcg/sysemu/tlb_helper.c:71: +tlb->XI0 =

Re: Resetting non-qdev children in a 3-phase reset device

2021-04-18 Thread Philippe Mathieu-Daudé
+Markus On 4/9/21 8:13 PM, Peter Maydell wrote: > I wanted to convert the hw/misc/mps2-scc.c device from old-style > to 3-phase reset as a prerequisite for another change to the device, > but I ran into a problem because currently it has some TYPE_DEVICE > QOM child objects, the LEDs. Because TYPE

Re: [PATCH 19/26] target/mips: Move helper_cache() to tcg/sysemu/special_helper.c

2021-04-18 Thread Philippe Mathieu-Daudé
On 4/18/21 9:52 PM, Richard Henderson wrote: > On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: >> Move helper_cache() to tcg/sysemu/special_helper.c. >> >> The CACHE opcode is privileged and is not accessible in user >> emulation. However we get a link failure when restricting the >> symbol to sy

Re: [PATCH 21/26] target/mips: Move exception management code to exception.c

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 13 --- target/mips/tcg/tcg-internal.h | 14 +++ target/mips/cpu.c | 113 -- target/mips/exception.c| 169 ++

Re: [PATCH 22/26] target/mips: Move CP0 helpers to sysemu/cp0.c

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Opcodes accessing Coprocessor 0 are privileged. Move the CP0 helpers to sysemu/ and simplify the #ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 9 +-- target/mips/cpu.c | 103 --

Re: [PATCH 23/26] target/mips: Move helper.h -> tcg/helper.h.inc

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: TCG frontend "exec/helper-head.h" expects each target to declare its helpers in 'target/$TARGET/helper.h'. To ease maintenance we rather to have all TCG specific files under our tcg/ sub directory. Move the current 'helper.h' there, and add a one

Re: [PATCH 24/26] target/mips: Move TCG source files under tcg/ sub directory

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: To ease maintenance, move all TCG specific files under the tcg/ sub-directory. Adapt the Meson machinery. The following prototypes: - mips_tcg_init() - mips_cpu_do_unaligned_access() - mips_cpu_do_transaction_failed() can now be restricted to the

Re: [PATCH 26/26] gitlab-ci: Add KVM mips64el cross-build jobs

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Add a new job to cross-build the mips64el target without the TCG accelerator (IOW: only KVM accelerator enabled). Only build the mips64el target which is known to work and has users. Signed-off-by: Philippe Mathieu-Daudé --- .gitlab-ci.d/cross

Re: [PATCH 25/26] hw/mips: Restrict non-virtualized machines to TCG

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: Only the malta and loongson3-virt machines support KVM. Restrict the other machines to TCG: - mipssim - magnum - pica61 - fuloong2e - boston Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/meson.build | 11 +++ 1 file cha

Re: [PATCH 09/26] target/mips: Add simple user-mode mips_cpu_do_interrupt()

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: target/mips/tcg/user/helper.c| 28 Since only this and the next helper go in here, perhaps continue to call it tlb_helper.c? Otherwise, Reviewed-by: Richard Henderson r~

Re: [PATCH 10/26] target/mips: Add simple user-mode mips_cpu_tlb_fill()

2021-04-18 Thread Richard Henderson
On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: tlb_helper.c's #ifdef'ry hides a quite simple user-mode implementation of mips_cpu_tlb_fill(). Copy the user-mode implementation (without #ifdef'ry) to tcg/user/helper.c and simplify tlb_helper.c's #ifdef'ry. This will allow us to restrict tlb_h

Re: [PATCH v4 01/12] tcg: expose TCGCond manipulation routines

2021-04-18 Thread Richard Henderson
On 4/15/21 9:34 AM, Alessandro Di Federico wrote: From: Alessandro Di Federico This commit moves into a separate file routines used to manipulate TCGCond. These will be employed by the idef-parser. Signed-off-by: Alessandro Di Federico Signed-off-by: Paolo Montesel --- include/tcg/tcg-cond.h

Re: [PATCH v4 02/12] target/hexagon: update MAINTAINERS for idef-parser

2021-04-18 Thread Richard Henderson
On 4/15/21 9:34 AM, Alessandro Di Federico wrote: From: Alessandro Di Federico Signed-off-by: Alessandro Di Federico --- MAINTAINERS | 8 1 file changed, 8 insertions(+) Reviewed-by: Richard Henderson r~

Re: [PATCH v4 04/12] target/hexagon: make slot number an unsigned

2021-04-18 Thread Richard Henderson
On 4/15/21 9:34 AM, Alessandro Di Federico wrote: From: Paolo Montesel Signed-off-by: Alessandro Di Federico Signed-off-by: Paolo Montesel --- target/hexagon/genptr.c | 6 -- target/hexagon/macros.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) Acked-by: Richard Henderson

Re: [PATCH v4 05/12] target/hexagon: make helper functions non-static

2021-04-18 Thread Richard Henderson
On 4/15/21 9:34 AM, Alessandro Di Federico wrote: From: Paolo Montesel Make certain helper functions non-static, making them available outside genptr.c. These functions are required by code generated by the idef-parser. Signed-off-by: Alessandro Di Federico Signed-off-by: Paolo Montesel --- t

Re: [PATCH 23/26] target/mips: Move helper.h -> tcg/helper.h.inc

2021-04-18 Thread Philippe Mathieu-Daudé
On 4/18/21 10:34 PM, Richard Henderson wrote: > On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: >> TCG frontend "exec/helper-head.h" expects each target to declare >> its helpers in 'target/$TARGET/helper.h'. To ease maintenance we >> rather to have all TCG specific files under our tcg/ sub direc

Re: [PATCH v4 06/12] target/hexagon: introduce new helper functions

2021-04-18 Thread Richard Henderson
On 4/15/21 9:34 AM, Alessandro Di Federico wrote: +void gen_store32(TCGv vaddr, TCGv src, tcg_target_long width, unsigned slot) +{ +tcg_gen_mov_tl(hex_store_addr[slot], vaddr); +tcg_gen_movi_tl(hex_store_width[slot], width); +tcg_gen_mov_tl(hex_store_val32[slot], src); +} + +void gen_

Re: [PATCH v4 07/12] target/hexagon: expose next PC in DisasContext

2021-04-18 Thread Richard Henderson
On 4/15/21 9:34 AM, Alessandro Di Federico wrote: From: Paolo Montesel Signed-off-by: Alessandro Di Federico Signed-off-by: Paolo Montesel --- target/hexagon/translate.c | 3 ++- target/hexagon/translate.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Richard Henderso

Re: [PATCH v4 08/12] target/hexagon: prepare input for the idef-parser

2021-04-18 Thread Richard Henderson
On 4/15/21 9:34 AM, Alessandro Di Federico wrote: +++ b/target/hexagon/idef-parser/prepare @@ -0,0 +1,24 @@ +#!/bin/bash + +# +# Copyright(c) 2019-2021 rev.ng Srls. All Rights Reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Les

[Bug 1921061] Re: Corsair iCUE Install Fails, qemu VM Reboots

2021-04-18 Thread Russell Morris
Hi, Slight update - as I decided to passthru my NIC as well => driver install there also causes a VM (Windows 10) reboot. Seems all driver installs fail? Running on the latest master, QEMU emulator version 5.2.93 (v6.0.0-rc3). Thanks! -- You received this bug notification because you are a mem

Re: [PATCH 14/26] target/mips: Move sysemu TCG-specific code to tcg/sysemu/ subfolder

2021-04-18 Thread Philippe Mathieu-Daudé
On 4/18/21 9:35 PM, Richard Henderson wrote: > On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: >> Declare cpu_mips_get_random() and update_pagemask() on local scope, > > What is "local scope"?  Anyway, I don't see what this has to do with the > rest of the code movement. I guess I meant 'TCG'.

Re: [PATCH 06/26] target/mips: Extract load/store helpers to ldst_helper.c

2021-04-18 Thread Philippe Mathieu-Daudé
On 4/18/21 9:08 PM, Richard Henderson wrote: > On 4/18/21 9:31 AM, Philippe Mathieu-Daudé wrote: >> +static inline hwaddr do_translate_address(CPUMIPSState *env, >> +  target_ulong address, >> +  MMUAccessType access_ty

[PATCH v2 05/29] target/mips: Optimize CPU/FPU regnames[] arrays

2021-04-18 Thread Philippe Mathieu-Daudé
Since all entries are no more than 4 bytes (including nul terminator), can save space and pie runtime relocations by declaring regnames[] as array of 4 const char. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 4 ++-- target/mips/cpu.c |

[PATCH v2 00/29] target/mips: Re-org to allow KVM-only builds

2021-04-18 Thread Philippe Mathieu-Daudé
TL;DR: This series restrict TCG-specific objects by moving them to the tcg/ subdir. Code is moved around to satisfy 3 cases: { generic sysemu / tcg sysemu / tcg user}. Since v1: - Addressed Richard review comments - Added Richard R-b tag Missing review: 5, 7, 8, 17, 18, 23 Hi, This series move

[PATCH v2 07/29] target/mips: Turn printfpr() macro into a proper function

2021-04-18 Thread Philippe Mathieu-Daudé
Turn printfpr() macro into a proper function: fpu_dump_fpr(). Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.c | 48 ++- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/target/mips/cpu.c b/tar

[PATCH v2 01/29] target/mips: Simplify meson TCG rules

2021-04-18 Thread Philippe Mathieu-Daudé
We already have the mips_tcg_ss source set for TCG-specific files, use it for mxu_translate.c and tx79_translate.c to simplify a bit. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[PATCH v2 04/29] target/mips: Make CPU/FPU regnames[] arrays global

2021-04-18 Thread Philippe Mathieu-Daudé
The CPU/FPU regnames[] arrays is used in mips_tcg_init() and mips_cpu_dump_state(), which while being in translate.c is not specific to TCG. To be able to move mips_cpu_dump_state() to cpu.c, which is compiled for all accelerator, we need to make the regnames[] arrays global to target/mips/ by dec

[PATCH v2 08/29] target/mips: Declare mips_cpu_set_error_pc() inlined in "internal.h"

2021-04-18 Thread Philippe Mathieu-Daudé
Rename set_pc() as mips_cpu_set_error_pc(), declare it inlined and use it in cpu.c and op_helper.c. Reported-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 11 +++ target/mips/cpu.c | 8 +--- target/mips/op_helper.c | 16 +++-

[PATCH v2 12/29] target/mips: Add simple user-mode mips_cpu_do_interrupt()

2021-04-18 Thread Philippe Mathieu-Daudé
The #ifdef'ry hides that the user-mode implementation of mips_cpu_do_interrupt() simply sets exception_index = EXCP_NONE. Add this simple implementation to tcg/user/tlb_helper.c, and the corresponding Meson machinery to build this file when user emulation is configured. Reviewed-by: Richard Hende

[PATCH v2 02/29] target/mips: Move IEEE rounding mode array to new source file

2021-04-18 Thread Philippe Mathieu-Daudé
restore_msa_fp_status() is declared inlined in fpu_helper.h, and uses the ieee_rm[] array. Therefore any code calling restore_msa_fp_status() must have access to this ieee_rm[] array. kvm_mips_get_fpu_registers(), which is in target/mips/kvm.c, calls restore_msa_fp_status. Except this tiny array,

[PATCH v2 11/29] target/mips: Introduce tcg-internal.h for TCG specific declarations

2021-04-18 Thread Philippe Mathieu-Daudé
We will gradually move TCG-specific declarations to a new local header: "tcg-internal.h". To keep review simple, first add this header with 2 TCG prototypes, which we are going to move in the next 2 commits. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/in

[PATCH v2 09/29] target/mips: Extract load/store helpers to ldst_helper.c

2021-04-18 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/ldst_helper.c | 304 ++ target/mips/op_helper.c | 274 -- target/mips/meson.build | 1 + 3 files changed, 305 insertions(+), 274 deletion

[PATCH v2 13/29] target/mips: Add simple user-mode mips_cpu_tlb_fill()

2021-04-18 Thread Philippe Mathieu-Daudé
tlb_helper.c's #ifdef'ry hides a quite simple user-mode implementation of mips_cpu_tlb_fill(). Copy the user-mode implementation (without #ifdef'ry) to tcg/user/helper.c and simplify tlb_helper.c's #ifdef'ry. This will allow us to restrict tlb_helper.c to sysemu. Reviewed-by: Richard Henderson

[PATCH v2 03/29] target/mips: Move msa_reset() to new source file

2021-04-18 Thread Philippe Mathieu-Daudé
mips_cpu_reset() is used by all accelerators, and calls msa_reset(), which is defined in msa_helper.c. Beside msa_reset(), the rest of msa_helper.c is only useful to the TCG accelerator. To be able to restrict this helper file to TCG, we need to move msa_reset() out of it. Reviewed-by: Richard He

[PATCH v2 14/29] target/mips: Move cpu_signal_handler definition around

2021-04-18 Thread Philippe Mathieu-Daudé
We have 2 blocks guarded with #ifdef for sysemu, which are simply separated by the cpu_signal_handler definition. To simplify the following commits which involve various changes in internal.h, first join the sysemu-guarded blocks. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Da

[PATCH v2 16/29] target/mips: Move physical addressing code to sysemu/physaddr.c

2021-04-18 Thread Philippe Mathieu-Daudé
Declare get_physical_address() with local scope and move it along with mips_cpu_get_phys_page_debug() to sysemu/physaddr.c new file. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- v2: phys.c -> physaddr.c in description (rth) --- target/mips/internal.h | 25 ++

[PATCH v2 06/29] target/mips: Restrict mips_cpu_dump_state() to cpu.c

2021-04-18 Thread Philippe Mathieu-Daudé
As mips_cpu_dump_state() is only used once to initialize the CPUClass::dump_state handler, we can move it to cpu.c to keep it symbol local. Beside, this handler is used by all accelerators, while the translate.c file targets TCG. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud

[PATCH v2 19/29] target/mips: Restrict mmu_init() to TCG

2021-04-18 Thread Philippe Mathieu-Daudé
mmu_init() is only required by TCG accelerator. Restrict its declaration and call to TCG. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 3 --- target/mips/tcg/tcg-internal.h | 2 ++ target/mips/cpu.c | 2 +- 3 files change

[PATCH v2 10/29] meson: Introduce meson_user_arch source set for arch-specific user-mode

2021-04-18 Thread Philippe Mathieu-Daudé
Similarly to the 'target_softmmu_arch' source set which allows to restrict target-specific sources to system emulation, add the equivalent 'target_user_arch' set for user emulation. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- v2: meson_user_arch -> target_user_arch i

[PATCH v2 17/29] target/mips: Restrict cpu_mips_get_random() / update_pagemask() to TCG

2021-04-18 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 4 target/mips/tcg/tcg-internal.h | 9 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 8789ffb319f..d7980ba9a94 100644 --- a/target/mips/i

[PATCH v2 21/29] target/mips: Restrict CPUMIPSTLBContext::map_address() handlers scope

2021-04-18 Thread Philippe Mathieu-Daudé
The 3 map_address() handlers are local to tlb_helper.c, no need to have their prototype declared publically. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/internal.h | 6 -- target/mips/tcg/sysemu/tlb_helper.c | 13 +++-- 2 files

[PATCH v2 15/29] target/mips: Move sysemu specific files under sysemu/ subfolder

2021-04-18 Thread Philippe Mathieu-Daudé
Move sysemu-specific files under the new sysemu/ subfolder and adapt the Meson machinery. Update the KVM MIPS entry in MAINTAINERS. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- v2: Update MAINTAINERS --- target/mips/{ => sysemu}/addr.c | 0 target/mips/{ => sys

  1   2   >