Re: [PATCH v2 1/3] target/arm: Restrict v8M IDAU to TCG

2021-03-09 Thread Philippe Mathieu-Daudé
On 3/9/21 2:41 PM, Claudio Fontana wrote: > On 2/21/21 11:26 PM, Philippe Mathieu-Daudé wrote: >> IDAU is specific to M-profile. KVM only supports A-profile. >> Restrict this interface to TCG, as it is pointless (and >> confusing) on a KVM-only build. >> >> Reviewed-by: Richard Henderson >> Review

[PATCH v2 4/4] tests/tcg: add HeapInfo checking to semihosting test

2021-03-09 Thread Alex Bennée
Query the SYS_HEAPINFO semicall and do some basic verification of the information via libc calls. Signed-off-by: Alex Bennée --- .../multiarch/arm-compat-semi/semihosting.c | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/tests/tcg/multiarch/arm-compat-se

[PATCH v2 3/4] semihosting/arm-compat-semi: deref parameter register for SYS_HEAPINFO

2021-03-09 Thread Alex Bennée
As per the spec: the PARAMETER REGISTER contains the address of a pointer to a four-field data block. So we need to follow the pointer and place the results of SYS_HEAPINFO there. Bug: https://bugs.launchpad.net/bugs/1915925 Cc: Bug 1915925 <1915...@bugs.launchpad.net> Cc: Keith Packard Sig

[PATCH v2 2/4] semihosting/arm-compat-semi: unify GET/SET_ARG helpers

2021-03-09 Thread Alex Bennée
>From the semihosting point of view what we want to know is the current mode of the processor. Unify this into a single helper and allow us to use the same GET/SET_ARG helpers for the rest of the code. Note: we aren't currently testing riscv32 due to missing toolchain for check-tcg tests. Signed-

Re: [PATCH] scsi: fix sense code for EREMOTEIO

2021-03-09 Thread Paolo Bonzini
On 09/03/21 15:14, Philippe Mathieu-Daudé wrote: SENSE_CODE(LUN_COMM_FAILURE) has an ABORTED COMMAND sense key, so it results in a retry in Linux. To ensure that EREMOTEIO is forwarded to the guest, use a HARDWARE ERROR sense key instead. Note that the code before commit d7a84021d was incorrect

Re: Malfunctionning qemu-system-arm ?

2021-03-09 Thread Alistair Francis
On Mon, Feb 15, 2021 at 11:37 AM vincent Dupaquis wrote: > > Hello, > > I am using qemu-system-arm with a netduino2 target, supposingly > integrating a STM32F2xx chip. > > I tested using the STM HAL in order to make a simple program run, > and I just failed to have it running correctly

Re: [PATCH v2 2/3] target/m68k: reformat m68k_features enum

2021-03-09 Thread Richard Henderson
On 3/8/21 4:11 AM, Mark Cave-Ayland wrote: Move the feature comment from after the feature name to the preceding line to allow for longer feature names and descriptions without hitting the 80 character line limit. Signed-off-by: Mark Cave-Ayland --- Reviewed-by: Richard Henderson r~

Re: [RFC PATCH 11/42] target/mips/tx79: Move PCPYH opcode to decodetree

2021-03-09 Thread Richard Henderson
On 3/8/21 3:57 AM, Philippe Mathieu-Daudé wrote: On 3/8/21 11:48 AM, Philippe Mathieu-Daudé wrote: On 2/15/21 5:26 PM, Richard Henderson wrote: On 2/14/21 9:58 AM, Philippe Mathieu-Daudé wrote: +if (a->rt == 0) { +tcg_gen_movi_i64(cpu_gpr[a->rd], 0); +tcg_gen_movi_i64(cpu_g

Re: [PATCH v2 3/3] target/m68k: add M68K_FEATURE_UNALIGNED_DATA feature

2021-03-09 Thread Richard Henderson
On 3/8/21 4:11 AM, Mark Cave-Ayland wrote: According to the M68040UM Appendix D the requirement for data accesses to be word aligned is only for the 68000, 68008 and 68010 CPUs. Later CPUs from the 68020 onwards will allow unaligned data accesses but at the cost of being less efficient. Add a ne

[RFC v5 00/36] arm cleanup experiment for kvm-only build

2021-03-09 Thread Claudio Fontana
Here a new version of the series that enables kvm-only builds. The goal here is to enable the KVM-only build. The split of additional kvm code to kvm/ is planned for the next series, along with the splitting of the accelerator-specific extensions to the cpu class, once all tests are ok. The rebas

[RFC v5 01/36] target/arm: move translate modules to tcg/

2021-03-09 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/arm/{ => tcg}/translate-a64.h | 0 target/arm/{ => tcg}/translate.h | 0 target/arm/{ => tcg}/a32-uncond.decode| 0 target/arm/{ => tcg}/a32.decode | 0 target/arm/{ => tcg}/m-nocp.decode

[RFC v5 03/36] arm: tcg: only build under CONFIG_TCG

2021-03-09 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/arm/tcg/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/arm/tcg/meson.build b/target/arm/tcg/meson.build index 0bd4e9d954..3b4146d079 100644 --- a/target/arm/tcg/meson.build +++

[RFC v5 16/36] target/arm: split vfp state setting from tcg helpers

2021-03-09 Thread Claudio Fontana
cpu-vfp.c: vfp_get_fpsr and vfp_set_fpsr are needed also for KVM, so create a new cpu-vfp.c tcg/cpu-vfp.c: vfp_get_fpscr_from_host and vv are TCG-only, so we move the implementation to tcg/cpu-vfp.c kvm/helper-stubs.c: vfp_get_fpscr_from_host and vv stubs for KVM. Signe

[RFC v5 04/36] target/arm: tcg: add sysemu and user subsirs

2021-03-09 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- target/arm/tcg/meson.build| 3 +++ target/arm/tcg/sysemu/meson.build | 3 +++ target/arm/tcg/user/meson.build | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 target/arm/tcg/sysemu/meson.build create mode 100644 target/arm/tcg/user/meson.

[RFC v5 02/36] target/arm: move helpers to tcg/

2021-03-09 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson [claudio: moved vec_internal.h and op_addsub.h to tcg/ too] Signed-off-by: Claudio Fontana --- meson.build | 1 + target/arm/{ => tcg}/op_addsub.h | 0 target/arm/tcg/trace.h | 1 + tar

[RFC v5 19/36] target/arm: move arm_sctlr away from tcg helpers

2021-03-09 Thread Claudio Fontana
this function is used for kvm too, add it to the cpu-common module. Signed-off-by: Claudio Fontana --- target/arm/cpu-common.c | 11 +++ target/arm/tcg/helper.c | 11 --- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/target/arm/cpu-common.c b/target/arm/cpu-com

[RFC v5 08/36] target/arm: cpu-mmu: fix comment style

2021-03-09 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- target/arm/cpu-mmu.h| 3 +- target/arm/cpu-mmu-sysemu.c | 149 2 files changed, 101 insertions(+), 51 deletions(-) diff --git a/target/arm/cpu-mmu.h b/target/arm/cpu-mmu.h index fdedc8fb92..01b060613a 100644 --- a/

[RFC v5 05/36] target/arm: only build psci for TCG

2021-03-09 Thread Claudio Fontana
We do not move psci.c to tcg/ because we expect other hypervisors to use it (waiting for HVF enablement). Signed-off-by: Claudio Fontana Cc: Alexander Graf --- target/arm/meson.build | 4 1 file changed, 4 insertions(+) diff --git a/target/arm/meson.build b/target/arm/meson.build index 01

[RFC v5 18/36] target/arm: move sve_zcr_len_for_el to common_cpu

2021-03-09 Thread Claudio Fontana
it is required by arch-dump.c and cpu.c, so apparently we need this for KVM too Signed-off-by: Claudio Fontana --- target/arm/cpu-common.c | 43 + target/arm/tcg/helper.c | 33 --- 2 files changed, 43 insertions(+), 33 deletions

[RFC v5 06/36] target/arm: split off cpu-sysemu.c

2021-03-09 Thread Claudio Fontana
move work is needed later on to split things into tcg-specific portions and kvm-specific portions of this Signed-off-by: Claudio Fontana --- target/arm/internals.h | 8 ++- target/arm/cpu-sysemu.c | 105 target/arm/cpu.c| 83 --

[RFC v5 10/36] target/arm: cpregs: fix style (mostly just comments)

2021-03-09 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- target/arm/cpregs.h | 54 ++--- target/arm/cpregs.c | 60 ++ target/arm/tcg/cpregs.c | 253 ++-- 3 files changed, 241 insertions(+), 126 deletions(-) diff --git a/target/arm/cpregs.h b/target/arm/cpregs.

[RFC v5 11/36] target/arm: move cpu definitions to common cpu module

2021-03-09 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- target/arm/cpu-common.c | 41 + target/arm/tcg/helper.c | 29 - target/arm/meson.build | 1 + 3 files changed, 42 insertions(+), 29 deletions(-) create mode 100644 target/arm/cpu-common.c di

[RFC v5 13/36] target/arm: kvm: add stubs for some helpers

2021-03-09 Thread Claudio Fontana
at least the armv7m one should go away with proper configuration changes (only enabling possible boards for KVM). Signed-off-by: Claudio Fontana --- target/arm/kvm/helper-stubs.c | 27 +++ target/arm/kvm/meson.build| 3 +++ target/arm/meson.build| 1 + 3 fil

[RFC v5 12/36] target/arm: only perform TCG cpu and machine inits if TCG enabled

2021-03-09 Thread Claudio Fontana
of note, cpreg lists were previously initialized by TCG first, and then thrown away and replaced with the data coming from KVM. Now we just initialize once, either for TCG or for KVM. Signed-off-by: Claudio Fontana --- target/arm/cpu.c | 32 ++-- target/arm/kvm.c

[RFC v5 15/36] target/arm: add temporary stub for arm_rebuild_hflags

2021-03-09 Thread Claudio Fontana
this should go away once the configuration and hw/arm is clean Signed-off-by: Claudio Fontana --- hw/arm/boot.c | 5 - target/arm/arm-powerctl.c | 8 +--- target/arm/kvm/helper-stubs.c | 6 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/hw/arm/

[RFC v5 26/36] target/arm: wrap call to aarch64_sve_change_el in tcg_enabled()

2021-03-09 Thread Claudio Fontana
After this patch it is possible to build only kvm: ./configure --disable-tcg --enable-kvm Signed-off-by: Claudio Fontana --- target/arm/cpu-sysemu.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/target/arm/cpu-sysemu.c b/target/arm/cpu-sysemu.c index eb928832a

[RFC v5 14/36] target/arm: move cpsr_read, cpsr_write to cpu_common

2021-03-09 Thread Claudio Fontana
we need as a result to move switch_mode too, so we put an implementation into cpu_user and cpu_sysemu. Signed-off-by: Claudio Fontana --- target/arm/cpu.h| 2 + target/arm/cpu-common.c | 192 +++ target/arm/cpu-sysemu.c | 30 ++ target/arm/cpu-user.

[RFC v5 22/36] target/arm: split 32bit cpu models from cpu.c to cpu32.c

2021-03-09 Thread Claudio Fontana
just like we have cpu64.c for the 64bit cpu models, spawn a cpu32.c from cpu.c. cpu.c will continue to contain the common parts. Note that we need to build cpu32 also for TARGET_AARCH64, because qemu-system-aarch64 is supposed to be able to run non-aarch64 cpus too. Signed-off-by: Claudio Fontan

[RFC v5 17/36] target/arm: move arm_mmu_idx* to cpu-mmu

2021-03-09 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- target/arm/cpu-mmu.c| 95 + target/arm/tcg/helper.c | 95 - 2 files changed, 95 insertions(+), 95 deletions(-) diff --git a/target/arm/cpu-mmu.c b/target/arm/cpu-mmu.c index f46

[RFC v5 28/36] target/arm: move kvm-const.h, kvm.c, kvm64.c, kvm_arm.h to kvm/

2021-03-09 Thread Claudio Fontana
From: Claudio Fontana and adapt the code including the header references, and trace-events / trace.h Signed-off-by: Claudio Fontana --- meson.build | 2 +- target/arm/cpu.h | 2 +- target/arm/{ => kvm}/kvm-consts.h | 0 target/arm/{ => kvm}/kvm_arm.h

[RFC v5 20/36] target/arm: move arm_cpu_list to common_cpu

2021-03-09 Thread Claudio Fontana
Signed-off-by: Claudio Fontana Reviewed-by: Richard Henderson --- target/arm/cpu-common.c | 42 + target/arm/tcg/helper.c | 41 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/target/arm/cpu-common.

[RFC v5 25/36] target/arm: cpu: fix style

2021-03-09 Thread Claudio Fontana
Signed-off-by: Claudio Fontana --- target/arm/cpu-sysemu.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/target/arm/cpu-sysemu.c b/target/arm/cpu-sysemu.c index 126263dbf4..eb928832a9 100644 --- a/target/arm/cpu-sysemu.c +++ b/target/arm/cpu-sysemu.c @@ -3

[RFC v5 35/36] tests: do not run qom-test on all machines for ARM KVM-only

2021-03-09 Thread Claudio Fontana
on ARM we currently list and build all machines, even when building KVM-only, without TCG. Until we fix this (and we only list and build machines that are compatible with KVM), only test specifically using the "virt" machine in this case. Signed-off-by: Claudio Fontana Cc: Philippe Mathieu-Daudé

[RFC v5 23/36] target/arm: move sve_exception_el out of TCG helpers

2021-03-09 Thread Claudio Fontana
we need this for KVM too. Signed-off-by: Claudio Fontana --- target/arm/cpu-sysemu.c | 60 target/arm/cpu-user.c | 5 target/arm/tcg/helper.c | 61 - 3 files changed, 65 insertions(+), 61 deletions(-) diff

[RFC v5 29/36] target/arm: cleanup cpu includes

2021-03-09 Thread Claudio Fontana
From: Claudio Fontana cpu.c, cpu32.c, cpu64.c, tcg/sysemu/tcg-cpu.c, all need a good cleanup when it comes to included header files. Signed-off-by: Claudio Fontana --- target/arm/cpu.c| 8 ++-- target/arm/cpu32.c | 14 -- target/arm/cpu64.c

[RFC v5 21/36] target/arm: move aarch64_sync_32_to_64 (and vv) to cpu code

2021-03-09 Thread Claudio Fontana
and arm_phys_excp_target_el since it is tied up inside the same #ifdef block. aarch64_sync_32_to_64 and aarch64_sync_64_to_32 are mixed in with the TCG helpers, but they shouldn't, as they are needed for KVM too. kvm_arch_get_registers() { if (!is_a64(env)) { aarch64_sync_64_to_32(env

[PATCH RESEND 2/6] hw/mips/gt64xxx: Simplify ISD MemoryRegion read/write handlers

2021-03-09 Thread Philippe Mathieu-Daudé
The ISD MemoryRegion is implemented for 32-bit accesses. Simplify it by setting the MemoryRegionOps::impl min/max access size fields. Since the region is registered with a size of 0x1000 bytes, we can remove the hwaddr mask. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/gt64xxx_pci.c | 10 +

[RFC v5 24/36] target/arm: move TCG cpu and models inside tcg/

2021-03-09 Thread Claudio Fontana
to avoid confusion, move the TCG-only 32bit cpu models definitions inside tcg/tcg-cpu-models.c The 64bit cpu models (a53/a57/a72/max) remain in cpu64.c . Signed-off-by: Claudio Fontana --- target/arm/cpu.h | 1 - target/arm/internals.h| 5

[RFC v5 32/36] tests: restrict TCG-only arm-cpu-features tests to TCG builds

2021-03-09 Thread Claudio Fontana
sve_tests_sve_max_vq_8, sve_tests_sve_off, test_query_cpu_model_expansion all require TCG to run. Skip them for KVM-only builds. Signed-off-by: Claudio Fontana --- tests/qtest/arm-cpu-features.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/qtest/arm

[RFC v5 27/36] target/arm: remove kvm include file for PSCI and arm-powerctl

2021-03-09 Thread Claudio Fontana
From: Claudio Fontana The QEMU PSCI implementation is not used for KVM, we do not need the kvm constants header. Signed-off-by: Claudio Fontana --- target/arm/arm-powerctl.h | 2 -- target/arm/psci.c | 1 - 2 files changed, 3 deletions(-) diff --git a/target/arm/arm-powerctl.h b/targe

[PATCH RESEND 4/6] hw/mips/gt64xxx: Rename trace events related to interrupt registers

2021-03-09 Thread Philippe Mathieu-Daudé
We want to trace all register accesses. First rename the current gt64120_read / gt64120_write events with '_intreg' suffix, as they are restricted to interrupt registers. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/gt64xxx_pci.c | 16 hw/mips/trace-events | 4 ++-- 2 fil

[RFC v5 36/36] revert commit 6e937ba7f8fb90d66cb3781f7fed32fb4239556a

2021-03-09 Thread Claudio Fontana
this change breaks all tests, need to revert for now. Author: Philippe Mathieu-Daudé Date: Sun Feb 21 23:26:15 2021 +0100 target/arm: Restrict v8M IDAU to TCG Signed-off-by: Claudio Fontana --- target/arm/cpu.c| 7 +++ target/arm/tcg/tcg-cpu-models.c | 8 2 file

[RFC v5 31/36] tests/qtest: skip bios-tables-test test_acpi_oem_fields_virt for KVM

2021-03-09 Thread Claudio Fontana
test is TCG-only. Signed-off-by: Claudio Fontana Cc: Philippe Mathieu-Daudé --- tests/qtest/bios-tables-test.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index e020c83d2a..bd7b85909c 100644 --- a/tests/qtest/bios-ta

[RFC v5 30/36] target/arm: remove broad "else" statements when checking accels

2021-03-09 Thread Claudio Fontana
There might be more than just KVM and TCG in the future, so where appropriate, replace broad "else" statements with the appropriate if (accel_enabled()) check. Also invert some checks for !kvm_enabled() or !tcg_enabled() where it seems appropriate to do so. Note that to make qtest happy we need t

Re: [PATCH v3 2/3] migration/ram: Reduce unnecessary rate limiting

2021-03-09 Thread Kunkun Jiang
Hi, On 2021/3/9 5:12, Peter Xu wrote: On Mon, Mar 08, 2021 at 06:34:58PM +0800, Kunkun Jiang wrote: Hi, On 2021/3/5 22:22, Peter Xu wrote: Kunkun, On Fri, Mar 05, 2021 at 03:50:34PM +0800, Kunkun Jiang wrote: When the host page is a huge page and something is sent in the current iteration,

[RFC v5 34/36] tests: device-introspect-test: cope with ARM TCG-only devices

2021-03-09 Thread Claudio Fontana
Skip the test_device_intro_concrete for now for ARM KVM-only build, as on ARM we currently build devices for ARM that are not compatible with a KVM-only build. We can remove this workaround when we fix this in KConfig etc, and we only list and build machines that are compatible with KVM for KVM-on

[RFC v5 33/36] tests: do not run test-hmp on all machines for ARM KVM-only

2021-03-09 Thread Claudio Fontana
on ARM we currently list and build all machines, even when building KVM-only, without TCG. Until we fix this (and we only list and build machines that are compatible with KVM), only test specifically using the "virt" machine in this case. Signed-off-by: Claudio Fontana Cc: Philippe Mathieu-Daudé

[PATCH RESEND 0/6] hw/mips/gt64120: Minor fixes

2021-03-09 Thread Philippe Mathieu-Daudé
Trivial fixes extracted from another series which became too big, so I prefer to send them in a previous step. (This is a resend for Zoltan). Philippe Mathieu-Daudé (6): hw/mips/gt64xxx: Initialize ISD I/O memory region in DeviceRealize() hw/mips/gt64xxx: Simplify ISD MemoryRegion read/write

[PATCH RESEND 3/6] hw/mips/gt64xxx: Fix typos in qemu_log_mask() formats

2021-03-09 Thread Philippe Mathieu-Daudé
Fix the following typos: - GT_PCI1_CFGDATA is not a timer register but a PCI one, - zero-padding flag is out of the format Fixes: 641ca2bfcd5 ("hw/mips/gt64xxx_pci: Use qemu_log_mask() instead of debug printf()") Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/gt64xxx_pci.c | 20 ++---

[PATCH RESEND 1/6] hw/mips/gt64xxx: Initialize ISD I/O memory region in DeviceRealize()

2021-03-09 Thread Philippe Mathieu-Daudé
The ISD I/O region belongs to the TYPE_GT64120_PCI_HOST_BRIDGE, so initialize it before it is realized, not after. Rename the region as 'gt64120-isd' so it is clearer to realize it belongs to the GT64120 in the memory tree view. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/gt64xxx_pci.c | 1

Re: [PATCH] storage-daemon: Call job_cancel_sync_all() on shutdown

2021-03-09 Thread Eric Blake
On 3/9/21 6:18 AM, Kevin Wolf wrote: > bdrv_close_all() asserts that no jobs are running any more, so we need > to cancel all jobs first to avoid failing the assertion. > > Fixes: b55a3c8860b763b62b2cc2f4a6f55379977bbde5 > Reported-by: Nini Gu > Signed-off-by: Kevin Wolf > --- > storage-daemon/

[PATCH RESEND 5/6] hw/mips/gt64xxx: Trace accesses to ISD registers

2021-03-09 Thread Philippe Mathieu-Daudé
Trace all accesses to Internal Space Decode (ISD) registers. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/gt64xxx_pci.c | 2 ++ hw/mips/trace-events | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index 9a12d00d1e1..43349d6837d 100644 --

[PATCH RESEND 6/6] hw/mips/gt64xxx: Let the GT64120 manage the lower 512MiB hole

2021-03-09 Thread Philippe Mathieu-Daudé
Per the comment in the Malta board, the [0x.-0x2000.] range is decoded by the GT64120, so move the "empty_slot" there. Signed-off-by: Philippe Mathieu-Daudé --- hw/mips/gt64xxx_pci.c | 8 hw/mips/malta.c | 7 --- 2 files changed, 8 insertions(+), 7 deletions(-) di

[PATCH v2 2/6] block/vdi: Don't assume that blocks are larger than VdiHeader

2021-03-09 Thread David Edmondson
Given that the block size is read from the header of the VDI file, a wide variety of sizes might be seen. Rather than re-using a block sized memory region when writing the VDI header, allocate an appropriately sized buffer. Signed-off-by: David Edmondson --- block/vdi.c | 10 ++ 1 file c

[RFC PATCH v2 00/22] target/mips: Reintroduce the R5900 CPU (without testing)

2021-03-09 Thread Philippe Mathieu-Daudé
First part (TCG, testing postponed) of RFC v1: https://www.mail-archive.com/qemu-devel@nongnu.org/msg782449.html 3 patches can still be improved for performance, but the improvement is not yet addressed in this series. Other patches are good enough for review. https://gitlab.com/philmd/qemu/-/com

[RFC PATCH v2 03/22] target/mips/translate: Make gen_rdhwr() public

2021-03-09 Thread Philippe Mathieu-Daudé
We will use gen_rdhwr() outside of translate.c, make it public. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-28-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/translate.h | 2 ++ target/mips/translate.c | 2 +-

Re: [RFC RESEND PATCH 0/4] hw/arm/virt-acpi-build: Introduce iommu option for pci root bus

2021-03-09 Thread Auger Eric
Hi, On 2/27/21 9:33 AM, Wang Xingang wrote: > From: Xingang Wang > > These patches add support for configure iommu on/off for pci root bus, > including primary bus and pxb root bus. At present, All root bus will go > through iommu when iommu is configured, which is not flexible. > > So this add

[PATCH v2 3/6] coroutine/mutex: Store the coroutine in the CoWaitRecord only once

2021-03-09 Thread David Edmondson
When taking the slow path for mutex acquisition, set the coroutine value in the CoWaitRecord in push_waiter(), rather than both there and in the caller. Reviewed-by: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Edmondson --- util/qemu-coroutine-lock.c | 1 - 1 file ch

Re: [PATCH] cadence_gem: switch to use qemu_receive_packet() for loopback

2021-03-09 Thread Alistair Francis
On Mon, Mar 1, 2021 at 2:34 PM Alexander Bulekov wrote: > > This patch switches to use qemu_receive_packet() which can detect > reentrancy and return early. > > Signed-off-by: Alexander Bulekov Reviewed-by: Alistair Francis Alistair > --- > hw/net/cadence_gem.c | 2 +- > 1 file changed, 1 in

[RFC PATCH v2 05/22] target/mips/tx79: Move PCPYH opcode to decodetree

2021-03-09 Thread Philippe Mathieu-Daudé
Move the existing PCPYH opcode (Parallel Copy Halfword) to decodetree. Remove unnecessary code / comments. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-12-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tx79.deco

[PATCH v2 1/6] block/vdi: When writing new bmap entry fails, don't leak the buffer

2021-03-09 Thread David Edmondson
If a new bitmap entry is allocated, requiring the entire block to be written, avoiding leaking the buffer allocated for the block should the write fail. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Edmondson --- block/vdi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/v

[PATCH v2 6/6] coroutine/rwlock: Avoid thundering herd when unlocking

2021-03-09 Thread David Edmondson
Given that we know whether the queued coroutines are reader hopefuls or writer hopefuls, avoid marking all of the queued coroutines as runnable when unlocking, choosing instead to wake a single queued writer or all queued readers. Suggested-by: Paolo Bonzini Signed-off-by: David Edmondson --- u

[PATCH] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed)

2021-03-09 Thread Thomas Huth
When trying to remove the -usbdevice option, there were complaints that "-usbdevice braille" is still a very useful shortcut for some people. Thus we never remove this option. Since it's not such a big burden to keep it around, and it's also convenient in the sense that you don't have to worry to e

[RFC PATCH v2 09/22] target/mips/tx79: Introduce PAND/POR/PXOR/PNOR opcodes (parallel logic)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the parallel logic opcodes: - PAND (Parallel AND) - POR (Parallel OR) - PXOR (Parallel XOR) - PNOR (Parallel NOR) Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-16-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH v2 0/6] coroutine rwlock downgrade fix, minor VDI changes

2021-03-09 Thread David Edmondson
Stressing the VDI code with qemu-img: qemu-img convert -p -W -m 16 -O vdi input.qcow2 output.vdi leads to a hang relatively quickly on a machine with sufficient CPUs. A similar test targetting either raw or qcow2 formats, or avoiding out-of-order writes, completes fine. At the point of the han

[PATCH v2 4/6] test-coroutine: Add rwlock downgrade test

2021-03-09 Thread David Edmondson
Test that downgrading an rwlock does not result in a failure to schedule coroutines queued on the rwlock. The diagram associated with test_co_rwlock_downgrade() describes the intended behaviour, but what is observed currently corresponds to: | c1 | c2 | c3 | c4 | |--

Re: [PATCH] hw/char: disable ibex uart receive if the buffer is full

2021-03-09 Thread Alistair Francis
On Tue, Mar 9, 2021 at 2:27 AM Alexander Wagner wrote: > > > On 08.03.21 14:47, Alistair Francis wrote: > >> hw/char/ibex_uart.c | 20 +++- > >> include/hw/char/ibex_uart.h | 4 > >> 2 files changed, 19 insertions(+), 5 deletions(-) > >> > >> diff --git a/hw/char/

[RFC PATCH v2 10/22] target/mips/tx79: Introduce PSUB* opcodes (Parallel Subtract)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the 'Parallel Subtract' opcodes: - PSUBB (Parallel Subtract Byte) - PSUBH (Parallel Subtract Halfword) - PSUBW (Parallel Subtract Word) Signed-off-by: Philippe Mathieu-Daudé --- v2: Uses tcg_gen_vec_sub{8,16,32}_i64 from tcg/tcg-op-gvec.h (rth) --- target/mips/tx79.decode | 6

Re: [PATCH] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed)

2021-03-09 Thread Paolo Bonzini
On 09/03/21 15:29, Thomas Huth wrote: When trying to remove the -usbdevice option, there were complaints that "-usbdevice braille" is still a very useful shortcut for some people. Thus we never remove this option. Since it's not such a big burden to keep it around, and it's also convenient in the

Re: [PATCH] target/mips: Use gen_load_gpr[_hi]() when possible

2021-03-09 Thread Philippe Mathieu-Daudé
On 3/8/21 2:16 PM, Philippe Mathieu-Daudé wrote: > Use gen_load_gpr[_hi]() instead of open coding it. > > Patch generated using the following spatch script: > > @gen_load_gpr@ > identifier reg_idx; > expression tcg_reg; > @@ > -if (reg_idx == 0) { > -tcg_gen_movi_tl(tcg_reg, 0); >

[RFC PATCH v2 14/22] target/mips/tx79: Introduce PCGT* (Parallel Compare for Greater Than)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the 'Parallel Compare for Greater Than' opcodes: - PCGTB (Parallel Compare for Greater Than Byte) - PCGTH (Parallel Compare for Greater Than Halfword) - PCGTW (Parallel Compare for Greater Than Word) Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210214175912.732946-21-f4...@a

Re: Malfunctionning qemu-system-arm ?

2021-03-09 Thread Liviu Ionescu
> On 15 Feb 2021, at 17:09, vincent Dupaquis > wrote: > > ... stuck on the starting HAL_init() call. HAL requires, amongst other things, the clock registers, since it sets the PLLs for the desired frequencies. xPack QEMU Arm [1] implements these registers, and is able to properly run the

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Thomas Huth
On 09/03/2021 15.05, Keqian Zhu wrote: On 2021/3/9 21:48, Thomas Huth wrote: On 17/12/2020 02.49, Keqian Zhu wrote: The parameters start and size are transfered from QEMU memory emulation layer. It can promise that they are TARGET_PAGE_SIZE aligned. However, KVM needs they are qemu_real_page_

Re: [PATCH v2 1/3] target/arm: Restrict v8M IDAU to TCG

2021-03-09 Thread Claudio Fontana
On 3/9/21 3:18 PM, Philippe Mathieu-Daudé wrote: > On 3/9/21 2:41 PM, Claudio Fontana wrote: >> On 2/21/21 11:26 PM, Philippe Mathieu-Daudé wrote: >>> IDAU is specific to M-profile. KVM only supports A-profile. >>> Restrict this interface to TCG, as it is pointless (and >>> confusing) on a KVM-only

[RFC PATCH v2 17/22] target/mips/tx79: Introduce PEXE[HW] opcodes (Parallel Exchange Even)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the PEXEH (Parallel Exchange Even Halfword) and PEXEW (Parallel Exchange Even Word) opcodes. Signed-off-by: Philippe Mathieu-Daudé --- v2: unoptimized, see: https://www.mail-archive.com/qemu-devel@nongnu.org/msg782831.html --- target/mips/tx79.decode | 2 ++ target/mips/tx79_tran

Re: [PATCH] plugins: Expose physical addresses instead of device offsets

2021-03-09 Thread Aaron Lindsay
On Mar 09 10:08, Peter Maydell wrote: > On Mon, 8 Mar 2021 at 20:14, Aaron Lindsay > wrote: > > > > This allows plugins to query for full virtual-to-physical address > > translation for a given `qemu_plugin_hwaddr` and stops exposing the > > offset within the device itself. As this change breaks

[RFC PATCH v2 01/22] target/mips/tx79: Move MFHI1 / MFLO1 opcodes to decodetree

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce decodetree structure to decode the tx79 opcodes. Start it by moving the existing MFHI1 and MFLO1 opcodes. Remove unnecessary comments. As the TX79 share opcodes with the TX19/TX39/TX49 CPUs, we introduce the decode_ext_txx9() dispatcher where we will add the other decoders later. Signed

[RFC PATCH v2 02/22] target/mips/tx79: Move MTHI1 / MTLO1 opcodes to decodetree

2021-03-09 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-10-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tx79.decode | 3 +++ target/mips/translate.c | 25 - target/mips/tx79_translate.c

[RFC PATCH v2 19/22] target/mips/tx79: Introduce LQ opcode (Load Quadword)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the LQ opcode (Load Quadword) and remove unreachable code. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-26-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tx79.decode | 8 target/mips/tra

[PATCH v2 5/6] coroutine/rwlock: Wake writers in preference to readers

2021-03-09 Thread David Edmondson
A feature of the current rwlock is that if multiple coroutines hold a reader lock, all must be runnable. The unlock implementation relies on this, choosing to wake a single coroutine when the final read lock holder exits the critical section, assuming that it will wake a coroutine attempting to acq

[RFC PATCH v2 06/22] target/mips/tx79: Move PCPYLD / PCPYUD opcodes to decodetree

2021-03-09 Thread Philippe Mathieu-Daudé
Move PCPYLD (Parallel Copy Lower Doubleword) and PCPYUD (Parallel Copy Upper Doubleword) to decodetree. Remove unnecessary code / comments. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-13-f4...@amsat.org> Signed-off-by: Philippe Mathieu-

[RFC PATCH v2 04/22] target/mips/translate: Simplify PCPYH using deposit_i64()

2021-03-09 Thread Philippe Mathieu-Daudé
Simplify the PCPYH (Parallel Copy Halfword) instruction by using multiple calls to deposit_i64() which can be optimized by some TCG backends. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-11-f4...@amsat.or

[RFC PATCH v2 07/22] target/mips: Remove 'C790 Multimedia Instructions' dead code

2021-03-09 Thread Philippe Mathieu-Daudé
We have almost 400 lines of code full of /* TODO */ comments which end calling gen_reserved_instruction(). As we are not going to implement them, and all the caller's switch() default cases already call gen_reserved_instruction(), we can remove this altogether. Signed-off-by: Philippe Mathieu-Dau

[RFC PATCH v2 08/22] target/mips/tx79: Salvage instructions description comment

2021-03-09 Thread Philippe Mathieu-Daudé
This comment describing the tx79 opcodes is helpful. As we will implement these instructions in tx79_translate.c, move the comment there. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-15-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Da

[RFC PATCH v2 11/22] target/mips/tx79: Introduce PEXTUW (Parallel Extend Upper from Word)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the PEXTUW opcode (Parallel Extend Upper from Word). Signed-off-by: Philippe Mathieu-Daudé --- v2: Introduce gen_pextw (rth) --- target/mips/tx79.decode | 4 target/mips/tx79_translate.c | 30 ++ 2 files changed, 34 insertions(+) diff --git a/tar

Re: [PATCH v2 1/3] target/arm: Add support for FEAT_TLBIRANGE

2021-03-09 Thread Rebecca Cran
On 3/8/21 4:11 PM, Rebecca Cran wrote: ARMv8.4 adds the mandatory FEAT_TLBIRANGE. It provides TLBI maintenance instructions that apply to a range of input addresses. Signed-off-by: Rebecca Cran I realized this only partially addresses the feedback from v1. Specifically, it still doesn't take

[RFC PATCH v2 13/22] target/mips/tx79: Introduce PCEQ* opcodes (Parallel Compare for Equal)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the 'Parallel Compare for Equal' opcodes: - PCEQB (Parallel Compare for Equal Byte) - PCEQH (Parallel Compare for Equal Halfword) - PCEQW (Parallel Compare for Equal Word) Signed-off-by: Philippe Mathieu-Daudé --- v2: unoptimized, see: https://www.mail-archive.com/qemu-devel@nongnu.

[RFC PATCH v2 12/22] target/mips/tx79: Introduce PEXTL[BHW] opcodes (Parallel Extend Lower)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the 'Parallel Extend Lower' opcodes: - PEXTLB (Parallel Extend Upper from Byte) - PEXTLH (Parallel Extend Upper from Halfword) - PEXTLW (Parallel Extend Upper from Word) Signed-off-by: Philippe Mathieu-Daudé --- v2: Uses gen_pextw, still unoptimized, see: https://www.mail-archive.co

Re: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread Dr. David Alan Gilbert
* Thomas Huth (th...@redhat.com) wrote: > On 09/03/2021 15.05, Keqian Zhu wrote: > > > > > > On 2021/3/9 21:48, Thomas Huth wrote: > > > On 17/12/2020 02.49, Keqian Zhu wrote: > > > > The parameters start and size are transfered from QEMU memory > > > > emulation layer. It can promise that they a

[RFC PATCH v2 20/22] target/mips/tx79: Introduce SQ opcode (Store Quadword)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the SQ opcode (Store Quadword). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-27-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tx79.decode | 1 + target/mips/tx79_translate.c | 27 +++

[RFC PATCH v2 15/22] target/mips/tx79: Introduce PPACW opcode (Parallel Pack to Word)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the PPACW opcode (Parallel Pack to Word). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-22-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tx79.decode | 1 + target/mips/tx79_translate.c | 30 +

[RFC PATCH v2 18/22] target/mips/tx79: Introduce PROT3W opcode (Parallel Rotate 3 Words)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the PROT3W opcode (Parallel Rotate 3 Words). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20210214175912.732946-25-f4...@amsat.org> Signed-off-by: Philippe Mathieu-Daudé --- target/mips/tx79.decode | 1 + target/mips/tx79_translate.c | 28 ++

RE: [PATCH v2 2/2] accel: kvm: Add aligment assert for kvm_log_clear_one_slot

2021-03-09 Thread zhukeqian
Thanks for your bug report. I was just off work, will dig into it tomorrow. thanks :) Keqian On 09/03/2021 15.05, Keqian Zhu wrote: > > > On 2021/3/9 21:48, Thomas Huth wrote: >> On 17/12/2020 02.49, Keqian Zhu wrote: >>> The parameters start and size are transfered from QEMU memory >>> emula

[RFC PATCH v2 16/22] target/mips/tx79: Introduce PINTEH (Parallel Interleave Even Halfword)

2021-03-09 Thread Philippe Mathieu-Daudé
Introduce the PINTEH opcode (Parallel Interleave Even Halfword). Signed-off-by: Philippe Mathieu-Daudé --- v2: Use trans_parallel_arith (rth) --- target/mips/tx79.decode | 1 + target/mips/tx79_translate.c | 22 ++ 2 files changed, 23 insertions(+) diff --git a/target/

[RFC PATCH v2 22/22] target/mips: Reintroduce the R5900 CPU

2021-03-09 Thread Philippe Mathieu-Daudé
Now that we have the minimum prerequisites to support the R5900 CPU, we can reintroduce it. While we are reverting commit 823f2897bdd ("Disable R5900 support"), we effectively cherry-pick commit ed4f49ba9bb ("target/mips: Define the R5900 CPU"). This reverts commit 823f2897bdd78185f3ba33292a25105

Re: [PATCH] coroutine: add libucontext as external library

2021-03-09 Thread Stefan Hajnoczi
On Mon, Mar 08, 2021 at 07:26:36PM -0800, Joelle van Dyne wrote: > iOS does not support ucontext natively for aarch64 and the sigaltstack is > also unsupported (even worse, it fails silently, see: > https://openradar.appspot.com/13002712 ) > > As a workaround we include a library implementation of

Re: [PATCH 4/4] virtiofsd: Release vu_dispatch_lock when stopping queue

2021-03-09 Thread Stefan Hajnoczi
On Mon, Mar 08, 2021 at 01:31:41PM +0100, Greg Kurz wrote: > QEMU can stop a virtqueue by sending a VHOST_USER_GET_VRING_BASE request > to virtiofsd. As with all other vhost-user protocol messages, the thread > that runs the main event loop in virtiofsd takes the vu_dispatch lock in > write mode. T

[RFC PATCH v2 21/22] target/mips/tx79: Move RDHWR usermode kludge to trans_SQ()

2021-03-09 Thread Philippe Mathieu-Daudé
Now than SQ is properly implemented, we can move the RDHWR kludge required to have usermode working with recent glibc. Signed-off-by: Philippe Mathieu-Daudé --- v2: { RDHWR_user } (rth) --- target/mips/tx79.decode | 5 +++- target/mips/translate.c | 56

Re: [PATCH 1/4] vhost-user: Introduce nested event loop in vhost_user_read()

2021-03-09 Thread Stefan Hajnoczi
On Mon, Mar 08, 2021 at 01:31:38PM +0100, Greg Kurz wrote: > A deadlock condition potentially exists if a vhost-user process needs > to request something to QEMU on the slave channel while processing a > vhost-user message. > > This doesn't seem to affect any vhost-user implementation so far, but

Re: [PATCH 2/4] vhost-user: Convert slave channel to QIOChannelSocket

2021-03-09 Thread Stefan Hajnoczi
On Mon, Mar 08, 2021 at 01:31:39PM +0100, Greg Kurz wrote: > +g_autofree int *fd = NULL; > +size_t fdsize = 0; > +int i; > > /* Read header */ > iov.iov_base = &hdr; > iov.iov_len = VHOST_USER_HDR_SIZE; > > do { > -size = recvmsg(u->slave_fd, &msgh, 0); >

<    1   2   3   4   5   6   7   >