[Bug 1880225] Re: Emulation of some arm programs fail with "Assertion `have_guest_base' failed."

2020-05-22 Thread Aleksandar Markovic
It appear that there is no problem on Intel 64-bit hosts. Perhaps the problem is manifested on all 32-bit hosts. I currently don't have access to any other 320bit host due to remote work. The arm is the only target were I noticed this happens. I checked hppa, mips, mipsel, m68k, ppc, and sh4,

[Bug 1880225] Re: Emulation of some arm programs fail with "Assertion `have_guest_base' failed."

2020-05-22 Thread Aleksandar Markovic
I just want to stress once again that the test was performed on a 32-bit Intel host. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1880225 Title: Emulation of some arm programs fail with

[Bug 1880225] Re: Emulation of some arm programs fail with "Assertion `have_guest_base' failed."

2020-05-22 Thread Aleksandar Markovic
Using bisection, it can be deduced that this behavior appears to be caused by this commit: commit ee94743034bfb443cf246eda4971bdc15d8ee066 (HEAD) Author: Alex Bennée Date: Wed May 13 18:51:28 2020 +0100 linux-user: completely re-write init_guest_space First we ensure all guest

Re: [PATCH v3 1/3] block/io: refactor coroutine wrappers

2020-05-22 Thread Vladimir Sementsov-Ogievskiy
23.05.2020 00:33, Eric Blake wrote: On 5/22/20 11:19 AM, Vladimir Sementsov-Ogievskiy wrote: Most of coroutine wrappers already follow this notation: s/of/of our/ s/notation/convention/ We have coroutine_fn bdrv_co_(), which is the core functions, and wrapper, which does polling loope is

Re: [PATCH 18/19] target/arm: Fix tsan warning in cpu.c

2020-05-22 Thread Peter Maydell
On Fri, 22 May 2020 at 22:33, Robert Foley wrote: > On Fri, 22 May 2020 at 13:44, Peter Maydell wrote: > > Every target's has_work function seems to access > > cs->interrupt_request without using atomic_read() : > > why does Arm need to do something special here? > > > > More generally, the only

Re: [PATCH v2 5/9] target/arm: Convert Neon narrowing shifts with op==8 to decodetree

2020-05-22 Thread Peter Maydell
On Fri, 22 May 2020 at 15:55, Peter Maydell wrote: > > Convert the Neon narrowing shifts where op==8 to decodetree: > * VSHRN > * VRSHRN > * VQSHRUN > * VQRSHRUN > > Signed-off-by: Peter Maydell > --- > +// todo expand out the shift-narrow and the narrow-op Oops. I fixed this todo

Re: [PATCH v3 2/3] block: declare some coroutine functions in block/coroutines.h

2020-05-22 Thread Eric Blake
On 5/22/20 11:19 AM, Vladimir Sementsov-Ogievskiy wrote: We are going to keep coroutine-wrappers code (structure-packing parameters, BDRV_POLL wrapper functions) in a separate auto-generated files. So, we'll need a header with declaration of original _co_ functions, for those which are static

Re: [PATCH 18/19] target/arm: Fix tsan warning in cpu.c

2020-05-22 Thread Robert Foley
On Fri, 22 May 2020 at 13:44, Peter Maydell wrote: > > On Fri, 22 May 2020 at 17:15, Robert Foley wrote: > > > > For example: > > WARNING: ThreadSanitizer: data race (pid=11134) > > Atomic write of size 4 at 0x7bbce0ac by main thread (mutexes: write > > M875): > > #0

Re: [PATCH v3 1/3] block/io: refactor coroutine wrappers

2020-05-22 Thread Eric Blake
On 5/22/20 11:19 AM, Vladimir Sementsov-Ogievskiy wrote: Most of coroutine wrappers already follow this notation: s/of/of our/ s/notation/convention/ We have coroutine_fn bdrv_co_(), which is the core functions, and wrapper, which does polling loope is called bdrv_(). We have

Re: [PATCH v3 0/3] coroutines: generate wrapper code

2020-05-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200522161950.2839-1-vsement...@virtuozzo.com/ Hi, This series failed the docker-mingw@fedora build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT

Re: [PATCH v3 0/3] coroutines: generate wrapper code

2020-05-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200522161950.2839-1-vsement...@virtuozzo.com/ Hi, This series failed the asan build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT BEGIN ===

Re: [PATCH v3 0/3] coroutines: generate wrapper code

2020-05-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200522161950.2839-1-vsement...@virtuozzo.com/ Hi, This series failed the docker-quick@centos7 build test. Please find the testing commands and their output below. If you have Docker installed, you can probably reproduce it locally. === TEST SCRIPT

Re: [PATCH 00/19] Add Thread Sanitizer support to QEMU

2020-05-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200522160755.886-1-robert.fo...@linaro.org/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20200522160755.886-1-robert.fo...@linaro.org Subject: [PATCH 00/19] Add Thread Sanitizer support to

Re: [PATCH v2 1/1] virtio-ccw: auto-manage VIRTIO_F_IOMMU_PLATFORM if PV

2020-05-22 Thread Halil Pasic
On Wed, 20 May 2020 12:23:24 -0400 "Michael S. Tsirkin" wrote: > On Fri, May 15, 2020 at 12:11:55AM +0200, Halil Pasic wrote: > > The virtio specification tells that the device is to present > > VIRTIO_F_ACCESS_PLATFORM (a.k.a. VIRTIO_F_IOMMU_PLATFORM) when the > > device "can only access

Re: [PATCH v7 12/12] tests/vm: Add workaround to consume console

2020-05-22 Thread Robert Foley
On Fri, 22 May 2020 at 12:31, Alex Bennée wrote: > > > Robert Foley writes: > > I think you need to look at adding: > > [sendemail] > cccmd = scripts/get_maintainer.pl --nogit-fallback > > to your .git/config to ensure maintainers get pinged when you touch > their subsystems. Eduardo and

Re: Fwd: simple qemu command not working

2020-05-22 Thread John Snow
On 5/22/20 4:32 AM, haris iqbal wrote: > Hi, > > I am having some trouble with spinning up a VM using qemu. The > description is below. Can someone please point me in the right > direction? > > -- > > Regards > -Haris > > > -- Forwarded message - > From: haris iqbal >

Re: [PATCH v3] spapr: Add a new level of NUMA for GPUs

2020-05-22 Thread Reza Arbab
On Fri, May 22, 2020 at 02:53:33PM -0500, Reza Arbab wrote: --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -889,10 +889,16 @@ static int spapr_dt_rng(void *fdt) static void spapr_dt_rtas(SpaprMachineState *spapr, void *fdt) { MachineState *ms = MACHINE(spapr); +SpaprMachineClass *smc =

[PATCH v3] spapr: Add a new level of NUMA for GPUs

2020-05-22 Thread Reza Arbab
NUMA nodes corresponding to GPU memory currently have the same affinity/distance as normal memory nodes. Add a third NUMA associativity reference point enabling us to give GPU nodes more distance. This is guest visible information, which shouldn't change under a running guest across migration

Re: [PATCH v7 10/12] tests/vm: Added a new script for centos.aarch64.

2020-05-22 Thread Robert Foley
On Fri, 22 May 2020 at 11:59, Alex Bennée wrote: > > > Robert Foley writes: > > > centos.aarch64 creates a CentOS 8 image. > > Also added a new kickstart script used to build the centos.aarch64 image. > > > > Signed-off-by: Robert Foley > > Reviewed-by: Peter Puhov > > --- > > > --- /dev/null

[Bug 1693649] Re: x86 pause misbehaves with -cpu haswell

2020-05-22 Thread Thomas Huth
Ok, thanks for checking again! So I'm closing this ticket now. ** Changed in: qemu Status: Incomplete => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1693649 Title: x86 pause

[Bug 1880225] Re: Emulation of some arm programs fail with "Assertion `have_guest_base' failed."

2020-05-22 Thread Alex Bennée
** Tags added: testcase -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1880225 Title: Emulation of some arm programs fail with "Assertion `have_guest_base' failed." Status in QEMU: New Bug

Re: [PATCH v3 09/17] block/io: support int64_t bytes in bdrv_co_p{read,write}v_part()

2020-05-22 Thread Eric Blake
On 4/30/20 6:10 AM, Vladimir Sementsov-Ogievskiy wrote: We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be

Re: [PATCH v7 09/12] tests/vm: Added a new script for ubuntu.aarch64.

2020-05-22 Thread Robert Foley
On Fri, 22 May 2020 at 11:34, Alex Bennée wrote: > > > Robert Foley writes: > > > > + > > +# efi-aarch64 probe > > +# Check for efi files needed by aarch64 VMs. > > +# By default we will use the efi included with QEMU. > > +# Allow user to override

Re: [PATCH 1/5] tests/libqos: mask out VIRTIO_F_RING_PACKED for now

2020-05-22 Thread Thomas Huth
> From: "Stefan Hajnoczi" > Sent: Friday, May 22, 2020 7:17:22 PM > > The libqos VIRTIO code does not implement the packed virtqueue layout > yet. Mask out the feature bit for now because tests have a habit of > enabling all device feature Sounds like we should rather fix these tests in the

Re: [PATCH v2 0/9] target/arm: Convert 2-reg-shift and 1-reg-imm Neon insns to decodetree

2020-05-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200522145520.6778-1-peter.mayd...@linaro.org/ Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 20200522145520.6778-1-peter.mayd...@linaro.org Subject: [PATCH v2 0/9] target/arm: Convert

Re: [Bug 1880225] [NEW] Emulation of some arm programs fail with "Assertion `have_guest_base' failed."

2020-05-22 Thread Alex Bennée
Aleksandar Markovic <1880...@bugs.launchpad.net> writes: > Public bug reported: > > This issue is observer with QEMU ToT, checked out around May 15th (but I > believe it is present in current master too), and wasn't present in QEMU > v5.0.0. > > I am using 32-bit Intel(R) Pentium(R) M processor

Re: [PATCH v3 02/17] block: use int64_t as bytes type in tracked requests

2020-05-22 Thread Eric Blake
On 4/30/20 6:10 AM, Vladimir Sementsov-Ogievskiy wrote: We are generally moving to int64_t for both offset and bytes parameters on all io paths. Main motivation is realization of 64-bit write_zeroes operation for fast zeroing large disk chunks, up to the whole disk. We chose signed type, to be

[Bug 1878915] Re: util/fdmon-io_uring.c:95: get_sqe: Assertion `ret > 1' failed.

2020-05-22 Thread felix
Confirming that I can no longer reproduce the bug with the latest master (ae3aa5da96f4ccf0c2a28851449d92db9fcfad71). I have not bisected the bug, though; at the moment I am not quite able to afford the time. -- You received this bug notification because you are a member of qemu- devel-ml, which

Re: [PATCH v7 07/12] tests/vm: Add ability to select QEMU from current build.

2020-05-22 Thread Robert Foley
Hi, These changes all seem like a good idea. I will add them in the next version of the patch. Thanks & Regards, -Rob On Fri, 22 May 2020 at 10:40, Alex Bennée wrote: > > > Robert Foley writes: > > > Added a new special variable QEMU_LOCAL=1, which > > will indicate to take the QEMU binary

[Bug 1880225] [NEW] Emulation of some arm programs fail with "Assertion `have_guest_base' failed."

2020-05-22 Thread Aleksandar Markovic
Public bug reported: This issue is observer with QEMU ToT, checked out around May 15th (but I believe it is present in current master too), and wasn't present in QEMU v5.0.0. I am using 32-bit Intel(R) Pentium(R) M processor 1.73GHz host. Arm cross-compiler is a standard cross-compiler that

[PULL 4/4] hw/block/pflash: Check return value of blk_pwrite()

2020-05-22 Thread Philippe Mathieu-Daudé
From: Mansour Ahmadi When updating the PFLASH file contents, we should check for a possible failure of blk_pwrite(). Similar to commit 3a688294e. Reported-by: Coverity (CID 1357678 CHECKED_RETURN) Signed-off-by: Mansour Ahmadi Message-Id: <20200408003552.58095-1-mansour...@gmail.com> [PMD: Add

[PULL 2/4] hw/block/pflash_cfi01: Document use of non-CFI compliant command '0x00'

2020-05-22 Thread Philippe Mathieu-Daudé
The command 0x00 is used by this model since its origin (commit 05ee37ebf630). In this commit the command is described with a amusing '/* ??? */' comment, probably meaning 'FIXME'. switch (cmd) { case 0x00: /* ??? */ ... This comment survived 12 years because the 0x00

[PULL 0/4] pflash-next patches for 2020-05-22

2020-05-22 Thread Philippe Mathieu-Daudé
-20200522 for you to fetch changes up to 1857b9db49770590483be44eb90993c42b2a5a99: hw/block/pflash: Check return value of blk_pwrite() (2020-05-22 19:38:14 +0= 200) - Remove unused timer in CFI01 flash, - Clean up code

[PULL 3/4] hw/block/pflash_cfi01: Rename 'reset_flash' label as 'mode_read_array'

2020-05-22 Thread Philippe Mathieu-Daudé
Rename the 'reset_flash' as 'mode_read_array' to make explicit we do not reset the device, we simply set its internal state machine in the READ_ARRAY mode. We do not reset the status register error bits, as a device reset would do. Reviewed-by: John Snow Reviewed-by: Alistair Francis

[PULL 1/4] hw/block/pflash_cfi01: Removed an unused timer

2020-05-22 Thread Philippe Mathieu-Daudé
The 'CFI02' NOR flash was introduced in commit 29133e9a0fff, with timing modelled. One year later, the CFI01 model was introduced (commit 05ee37ebf630) based on the CFI02 model. As noted in the header, "It does not support timings". 12 years later, we never had to model the device timings. Time to

Re: [PATCH 18/19] target/arm: Fix tsan warning in cpu.c

2020-05-22 Thread Peter Maydell
On Fri, 22 May 2020 at 17:15, Robert Foley wrote: > > For example: > WARNING: ThreadSanitizer: data race (pid=11134) > Atomic write of size 4 at 0x7bbce0ac by main thread (mutexes: write > M875): > #0 __tsan_atomic32_store (qemu-system-aarch64+0x394d84) > #1 cpu_reset_interrupt

[PATCH v4 10/13] target/i386: Restrict CpuClass::get_crash_info() to system-mode

2020-05-22 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 7a4a8e3847..dd31c1de5f 100644

[PATCH v4 13/13] stubs: Restrict ui/win32-kbd-hook to system-mode

2020-05-22 Thread Philippe Mathieu-Daudé
In Makefile.objs, the ui/ directory is restricted to system-mode: 43 ifeq ($(CONFIG_SOFTMMU),y) ... 65 common-obj-y += ui/ 66 common-obj-m += ui/ ... 82 endif # CONFIG_SOFTMMU Restrict the ui/ stub added in commit 2df9f5718df to only build it for system-mode emulation. Signed-off-by:

[PATCH v4 12/13] hw/core: Restrict CpuClass::get_crash_info() to system-mode

2020-05-22 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 7 ++- hw/core/cpu.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/hw/core/cpu.h

[PATCH v4 09/13] arch_init: Remove unused 'qapi-commands-misc.h' include

2020-05-22 Thread Philippe Mathieu-Daudé
Commit ffaee83bcb2 moved qmp_query_target but forgot to remove this include. Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- arch_init.c | 1 - 1 file changed, 1 deletion(-) diff

[PATCH v4 08/13] exec: Assert CPU migration is not used on user-only build

2020-05-22 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- exec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 5162f0d12f..6dfd314469 100644 ---

[PATCH v4 11/13] target/s390x: Restrict CpuClass::get_crash_info() to system-mode

2020-05-22 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- target/s390x/cpu.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/target/s390x/cpu.c

[PATCH v4 07/13] target/riscv/cpu: Restrict CPU migration to system-mode

2020-05-22 Thread Philippe Mathieu-Daudé
Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c

[PATCH v4 05/13] util/Makefile: Reduce the user-mode object list

2020-05-22 Thread Philippe Mathieu-Daudé
These objects are not required when configured with --disable-system. Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- util/Makefile.objs | 59 +- 1 file changed, 38

[PATCH v4 02/13] configure: Avoid building TCG when not needed

2020-05-22 Thread Philippe Mathieu-Daudé
Avoid building TCG when building only tools: ./configure --enable-tools --disable-system --disable-user This saves us from running the soft-float tests enabled since commit 76170102508. Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis Reviewed-by: Laurent Vivier Tested-by:

[PATCH v4 06/13] stubs/Makefile: Reduce the user-mode object list

2020-05-22 Thread Philippe Mathieu-Daudé
These stubs are not required when configured with --disable-system. Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- stubs/Makefile.objs | 52 ++--- 1 file changed, 30

[PATCH v4 03/13] tests/Makefile: Only display TCG-related tests when TCG is available

2020-05-22 Thread Philippe Mathieu-Daudé
Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- tests/Makefile.include | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/Makefile.include b/tests/Makefile.include index

[PATCH v4 04/13] tests/Makefile: Restrict some softmmu-only tests

2020-05-22 Thread Philippe Mathieu-Daudé
In the next commit we are going to remove some objects from the util-obj-y variable (objects which are not used by user-mode, when configured with --disable-system). Then some system-mode tests are going to fail, due to the missing objects: $ make check-unit -k LINKtests/test-iov

[PATCH v4 01/13] Makefile: Only build virtiofsd if system-mode is enabled

2020-05-22 Thread Philippe Mathieu-Daudé
Do not build the virtiofsd helper when configured with --disable-system. Reviewed-by: Richard Henderson Acked-by: Dr. David Alan Gilbert Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier Signed-off-by: Philippe Mathieu-Daudé --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v4 00/13] user-mode: Prune build dependencies (part 1)

2020-05-22 Thread Philippe Mathieu-Daudé
This is the first part of a series reducing user-mode dependencies. By stripping out unused code, the build and testing time is reduced (as is space used by objects). Part 1 (generic): - reduce user-mode object list - remove some migration code from user-mode - remove cpu_get_crash_info()

[PATCH 5/5] virtio: enable VIRTIO_F_RING_PACKED for all devices

2020-05-22 Thread Stefan Hajnoczi
The packed virtqueue layout was introduced in VIRTIO 1.1. It is a single ring instead of a split avail/used ring design. There are CPU cache advantages to this layout and it is also suited better to hardware implementation. The vhost-net backend has already supported packed virtqueues for some

[PATCH 3/5] vhost-user-blk: add VIRTIO_F_RING_PACKED feature bit

2020-05-22 Thread Stefan Hajnoczi
Vhost devices have a list of feature bits that the device backend is allowed to control. The VIRTIO_F_RING_PACKED feature is a feature that must be negotiated through all the way to the device backend. Add it so the device backend can declare whether or not it supports the packed ring layout.

[PATCH 4/5] vhost-scsi: add VIRTIO_F_VERSION_1 and VIRTIO_F_RING_PACKED

2020-05-22 Thread Stefan Hajnoczi
Let vhost-scsi and vhost-user-scsi device backends determine whether VIRTIO 1.0 and packed virtqueues are supported. It doesn't make sense to handle these feature bits in QEMU since the device backend needs to support them if we want to use them. Signed-off-by: Stefan Hajnoczi ---

[PATCH 0/5] virtio: enable VIRTIO_F_RING_PACKED for all devices

2020-05-22 Thread Stefan Hajnoczi
The VIRTIO 1.1 packed virtqueue layout improves performance and guest driver support has been available since Linux v5.0. virtio-blk benchmarks show it is beneficial for non-net devices too so I wrote patches to enable it for all devices. It turned out to be trickier than I expected because vhost

[PATCH 1/5] tests/libqos: mask out VIRTIO_F_RING_PACKED for now

2020-05-22 Thread Stefan Hajnoczi
The libqos VIRTIO code does not implement the packed virtqueue layout yet. Mask out the feature bit for now because tests have a habit of enabling all device feature bits and we don't want packed virtqueues to be enabled. Later patches will enable VIRTIO_F_RING_PACKED so prepare libqos now. Cc:

[PATCH 2/5] vhost: involve device backends in feature negotiation

2020-05-22 Thread Stefan Hajnoczi
Many vhost devices in QEMU currently do not involve the device backend in feature negotiation. This seems fine at first glance for device types without their own feature bits (virtio-net has many but other device types have none). This overlooks the fact that QEMU's virtqueue implementation and

Re: [PULL 01/11] ui/win32-kbd-hook: handle AltGr in a hook procedure

2020-05-22 Thread Philippe Mathieu-Daudé
On 5/20/20 10:43 AM, Gerd Hoffmann wrote: > From: Volker Rümelin > > Import win32 keyboard hooking code from project spice-gtk. This > patch removes the extra left control key up/down input events > inserted by Windows for the right alt key up/down input events > with international keyboard

[RFC v2 2/3] cpu-timers, icount: new modules

2020-05-22 Thread Claudio Fontana
refactoring of cpus.c continues with two new modules extracted from it. cpu-timers: responsible for the cpu timers state, and for access to cpu clocks and ticks. icount: counts the TCG instructions executed. As such it is specific to the TCG accelerator. Therefore, it is built only under

[RFC v2 1/3] cpu-throttle: new module, extracted from cpus.c

2020-05-22 Thread Claudio Fontana
move the vcpu throttling functionality into its own module. This functionality is not specific to any accelerator, and it is used currently by migration to slow down guests to try to have migrations converge, and by the cocoa MacOS UI to throttle speed. cpu-throttle contains the controls to

[RFC v2 0/3] QEMU cpus.c refactoring

2020-05-22 Thread Claudio Fontana
Motivation and higher level steps: https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg04628.html v1 -> v2: * 1/3 (cpu-throttle): provide a description in the commit message * 2/3 (cpu-timers, icount): in this v2 separate icount from cpu-timers, as icount is actually TCG-specific. Only

[RFC v2 3/3] cpus: extract out accel-specific code to each accel

2020-05-22 Thread Claudio Fontana
each accelerator registers a new "CpusAccelInterface" on initialization, providing functions for starting a vcpu, kicking a vcpu, and sychronizing state. This way the code in cpus.cc is now all general softmmu code, nothing (or almost nothing) accelerator-specific anymore. Signed-off-by: Claudio

RE: Simplifying the Hexagon frontend

2020-05-22 Thread Taylor Simpson
I made the change discussed below. > #ifdef fGEN_TCG_ > fGEN_TCG_(); > #else > gen_helper_(); > #endif In addition, here's a list of changes since I submitted v2 of the patch series - Use Laurent's gensyscall.sh script to generate linux-user/hexagon/syscall_nr.h - Handle mem_noshuf -

[PATCH v4 11/11] accel/tcg: Add stub for probe_access()

2020-05-22 Thread Philippe Mathieu-Daudé
From: Philippe Mathieu-Daudé The TCG helpers where added in b92e5a22ec3 in softmmu_template.h. probe_write() was added in there in 3b4afc9e75a to be moved out to accel/tcg/cputlb.c in 3b08f0a9254, and was later refactored as probe_access() in c25c283df0f. Since it is a TCG specific helper, add a

Re: [PATCH v4 03/11] MAINTAINERS: Add an entry for the HAX accelerator

2020-05-22 Thread Philippe Mathieu-Daudé
On 5/22/20 6:37 PM, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé > --- > Cc: Sergio Andres Gomez Del Real > Cc: Vincent Palatin > Cc: Yu Ning > Cc: Tao Wu > Cc: haxm-t...@intel.com > Cc: Colin Xu > Cc: Hang Yuan > Cc: David Chou FYI Hang Yuan and David Chou emails

[PATCH v4 08/11] accel/Kconfig: Extract accel selectors into their own config

2020-05-22 Thread Philippe Mathieu-Daudé
Move the accel selectors from the global Kconfig.host to their own Kconfig file. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- Makefile | 1 + Kconfig.host | 7 --- accel/Kconfig | 6 ++ 3 files changed, 7 insertions(+), 7 deletions(-) create mode

[PATCH v4 10/11] Makefile: Allow target-specific optional Kconfig

2020-05-22 Thread Philippe Mathieu-Daudé
Allow use of target-specific Kconfig file. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- v3: Use base-arch() to include TARGET_BASE_ARCH/Kconfig --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index

[PATCH v4 09/11] accel/Kconfig: Add the TCG selector

2020-05-22 Thread Philippe Mathieu-Daudé
Expose the CONFIG_TCG selector to let minikconf.py uses it. When building with --disable-tcg build, this helps to deselect devices that are TCG-dependent. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- Makefile | 1 + accel/Kconfig | 3 +++ 2 files changed, 4

[PATCH v4 03/11] MAINTAINERS: Add an entry for the HAX accelerator

2020-05-22 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- Cc: Sergio Andres Gomez Del Real Cc: Vincent Palatin Cc: Yu Ning Cc: Tao Wu Cc: haxm-t...@intel.com Cc: Colin Xu Cc: Hang Yuan Cc: David Chou Cc: Wenchao Wang --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS

[PATCH v4 05/11] rules.mak: Add base-arch() rule

2020-05-22 Thread Philippe Mathieu-Daudé
Add a rule to return the base architecture for a QEMU target. The current list of TARGET_BASE_ARCH is: $ git grep TARGET_BASE_ARCH configure configure:7785:TARGET_BASE_ARCH="" configure:7795:TARGET_BASE_ARCH=i386 configure:7813:TARGET_BASE_ARCH=arm configure:7846:

[PATCH v4 07/11] Makefile: Write MINIKCONF variables as one entry per line

2020-05-22 Thread Philippe Mathieu-Daudé
Having one entry per line helps reviews/refactors. As we are going to modify the MINIKCONF variables, split them now to ease further review. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- Makefile | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff

[PATCH v4 01/11] MAINTAINERS: Fix KVM path expansion glob

2020-05-22 Thread Philippe Mathieu-Daudé
The KVM files has been moved from target-ARCH to the target/ARCH/ folder in commit fcf5ef2a. Fix the pathname expansion. Fixes: fcf5ef2a ("Move target-* CPU file into a target/ folder") Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH v4 02/11] MAINTAINERS: Add an 'overall' entry for accelerators

2020-05-22 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- Cc: Paolo Bonzini v2: Cover accel/accel.c & accel/Makefile.objs (thuth) --- MAINTAINERS | 11 +++ 1 file changed, 11 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 00c1c1ed8b..f7ee0c77f1 100644 ---

[PATCH v4 04/11] rules.mak: Add startwith() rule

2020-05-22 Thread Philippe Mathieu-Daudé
Add a rule to test if a string starts with a substring. Signed-off-by: Philippe Mathieu-Daudé --- rules.mak | 7 +++ 1 file changed, 7 insertions(+) diff --git a/rules.mak b/rules.mak index 694865b63e..e39bee93d5 100644 --- a/rules.mak +++ b/rules.mak @@ -191,6 +191,13 @@ ne = $(if $(subst

[PATCH v4 00/11] accel: Allow targets to use Kconfig

2020-05-22 Thread Philippe Mathieu-Daudé
Missing review: - patch #4 'rules.mak: Add startwith rule' - patch #5 'rules.mak: Add base-arch rule'. This series include generic patches I took of the KVM/ARM specific series which will follow. - List orphan accelerators in MAINTAINERS - Add accel/Kconfig - Allow targets to use their how

[PATCH v4 06/11] Makefile: Remove dangerous EOL trailing backslash

2020-05-22 Thread Philippe Mathieu-Daudé
One might get caught trying to understand unexpected Makefile behavior. Trailing backslash can help to split very long lines, but are rather dangerous when nothing follow. Preserve other developers debugging time by removing this one. Reviewed-by: Thomas Huth Reviewed-by: Alistair Francis

Re: [PATCH v7 12/12] tests/vm: Add workaround to consume console

2020-05-22 Thread Alex Bennée
Robert Foley writes: I think you need to look at adding: [sendemail] cccmd = scripts/get_maintainer.pl --nogit-fallback to your .git/config to ensure maintainers get pinged when you touch their subsystems. Eduardo and Cleber CC'd > The ConsoleSocket object provides a socket

[PATCH 18/19] target/arm: Fix tsan warning in cpu.c

2020-05-22 Thread Robert Foley
For example: WARNING: ThreadSanitizer: data race (pid=11134) Atomic write of size 4 at 0x7bbce0ac by main thread (mutexes: write M875): #0 __tsan_atomic32_store (qemu-system-aarch64+0x394d84) #1 cpu_reset_interrupt hw/core/cpu.c:107:5 (qemu-system-aarch64+0x842f90) #2

[PATCH v3 3/3] block: generate coroutine-wrapper code

2020-05-22 Thread Vladimir Sementsov-Ogievskiy
We have a very frequent pattern of creating coroutine from function with several arguments: - create structure to pack parameters - create _entry function to call original function taking parameters from struct - do different magic to handle completion: set ret to NOT_DONE or

[PATCH 19/19] docs: Added details on TSan to testing.rst

2020-05-22 Thread Robert Foley
This includes details on how to build and test with TSan both inside a docker and outside. Signed-off-by: Robert Foley --- docs/devel/testing.rst | 72 ++ 1 file changed, 72 insertions(+) diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst index

[PATCH 17/19] util: Added tsan annotate for thread name.

2020-05-22 Thread Robert Foley
This allows us to see the name of the thread in tsan warning reports such as this: Thread T7 'CPU 1/TCG' (tid=24317, running) created by main thread at: Signed-off-by: Robert Foley --- util/qemu-thread-posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/qemu-thread-posix.c

[PATCH v3 2/3] block: declare some coroutine functions in block/coroutines.h

2020-05-22 Thread Vladimir Sementsov-Ogievskiy
We are going to keep coroutine-wrappers code (structure-packing parameters, BDRV_POLL wrapper functions) in a separate auto-generated files. So, we'll need a header with declaration of original _co_ functions, for those which are static now. As well, we'll need declarations for wrapper functions.

[PATCH v3 1/3] block/io: refactor coroutine wrappers

2020-05-22 Thread Vladimir Sementsov-Ogievskiy
Most of coroutine wrappers already follow this notation: We have coroutine_fn bdrv_co_(), which is the core functions, and wrapper, which does polling loope is called bdrv_(). The only outsiders are bdrv_prwv_co and bdrv_common_block_status_above wrappers. Let's refactor the to behave as the

[PATCH 15/19] qht: Fix tsan warnings.

2020-05-22 Thread Robert Foley
For example: WARNING: ThreadSanitizer: data race (pid=23406) Atomic read of size 4 at 0x7b13e3c8 by thread T7: #0 __tsan_atomic32_load (qemu-system-aarch64+0x39a36c) #1 qht_do_lookup util/qht.c:495:17 (qemu-system-aarch64+0xd82f7a) #2 qht_lookup_custom util/qht.c:539:11

[PATCH 05/19] qht: call qemu_spin_destroy for head buckets

2020-05-22 Thread Robert Foley
From: "Emilio G. Cota" Signed-off-by: Robert Foley --- util/qht.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/qht.c b/util/qht.c index aa51be3c52..67e5d5b916 100644 --- a/util/qht.c +++ b/util/qht.c @@ -348,6 +348,7 @@ static inline void qht_chain_destroy(const struct qht_bucket

[PATCH v3 0/3] coroutines: generate wrapper code

2020-05-22 Thread Vladimir Sementsov-Ogievskiy
Hi all! After a long delay (~year) here is a v3. The aim of the series is to reduce code-duplication and writing parameters structure-packing by hand around coroutine function wrappers. It's an alternative to "[PATCH v3] block: Factor out bdrv_run_co()" patch. Benefits: - no code duplication

[PATCH 12/19] configure: added tsan support for blacklist.

2020-05-22 Thread Robert Foley
Initially put several files into blacklist that were causing the most problems, namely bitops.c and bitmap.c. Signed-off-by: Robert Foley --- configure | 3 ++- tests/tsan/blacklist.tsan | 5 + 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644

[PATCH 16/19] util: fixed tsan warnings in thread_pool.c

2020-05-22 Thread Robert Foley
For example: WARNING: ThreadSanitizer: data race (pid=14665) Write of size 4 at 0x7b1c7890 by thread T99: #0 worker_thread util/thread-pool.c:112:20 (qemu-system-aarch64+0xd52108) #1 qemu_thread_start util/qemu-thread-posix.c:519:9 (qemu-system-aarch64+0xd5be30) Previous read of

[PATCH 13/19] accel/tcg: Fixed tsan warnings.

2020-05-22 Thread Robert Foley
For example: WARNING: ThreadSanitizer: data race (pid=35425) Write of size 4 at 0x7bbc00ac by main thread (mutexes: write M875): #0 cpu_reset_interrupt hw/core/cpu.c:107:28 (qemu-system-aarch64+0x843790) #1 arm_cpu_set_irq target/arm/cpu.c (qemu-system-aarch64+0x616265) #2

[PATCH 14/19] util/async: Fixed tsan warnings

2020-05-22 Thread Robert Foley
For example: Atomic write of size 8 at 0x7b4800113c28 by main thread (mutexes: write M30): #0 __tsan_atomic64_exchange (qemu-system-aarch64+0x386f85) #1 aio_bh_poll util/async.c:146:5 (qemu-system-aarch64+0xcd1f61) #2 aio_dispatch util/aio-posix.c:380:5

[PATCH 10/19] include/qemu: Added tsan.h for annotations.

2020-05-22 Thread Robert Foley
These annotations will allow us to give tsan additional hints. For example, we can inform tsan about reads/writes to ignore to silence certain classes of warnings. We can also annotate threads so that the proper thread naming shows up in tsan warning results. Signed-off-by: Robert Foley ---

[PATCH 09/19] tests/docker: Added docker build support for TSan.

2020-05-22 Thread Robert Foley
Added a new docker for ubuntu 20.04. This docker has support for Thread Sanitizer including one patch we need in one of the header files. https://github.com/llvm/llvm-project/commit/a72dc86cd This command will build with tsan enabled: make docker-test-build-ubuntu2004 V=1 TSAN=1 Also added the

[PATCH 07/19] translate-all: call qemu_spin_destroy for PageDesc

2020-05-22 Thread Robert Foley
From: "Emilio G. Cota" The radix tree is append-only, but we can fail to insert a PageDesc if the insertion races with another thread. Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- accel/tcg/translate-all.c | 9 + 1 file changed, 9 insertions(+) diff --git

[PATCH 02/19] cpu: convert queued work to a QSIMPLEQ

2020-05-22 Thread Robert Foley
From: "Emilio G. Cota" Instead of open-coding it. While at it, make sure that all accesses to the list are performed while holding the list's lock. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- cpus-common.c |

[PATCH 06/19] tcg: call qemu_spin_destroy for tb->jmp_lock

2020-05-22 Thread Robert Foley
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley [RF: Minor changes to fix some checkpatch errors] --- accel/tcg/translate-all.c | 10 +- include/tcg/tcg.h | 3 ++- tcg/tcg.c | 19 --- 3 files changed, 27

[PATCH 08/19] thread: add tsan annotations to QemuSpin

2020-05-22 Thread Robert Foley
From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- include/qemu/thread.h | 39 --- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/include/qemu/thread.h b/include/qemu/thread.h index e50a073889..43fc094b96

[PATCH 11/19] accel/tcg: Fixed tsan warnings related to parallel_cpus

2020-05-22 Thread Robert Foley
Fixed several tsan warnings. e.g. WARNING: ThreadSanitizer: data race (pid=35425) Read of size 1 at 0x557cd83aee28 by thread T7: #0 curr_cflags include/exec/exec-all.h:460:13 (qemu-system-aarch64+0x4b7f27) #1 cpu_exec accel/tcg/cpu-exec.c:730:26 (qemu-system-aarch64+0x4b7f27) #2

[PATCH 01/19] configure: add --enable-tsan flag + fiber annotations for coroutine-ucontext

2020-05-22 Thread Robert Foley
From: Lingfeng Yang We tried running QEMU under tsan in 2016, but tsan's lack of support for longjmp-based fibers was a blocker: https://groups.google.com/forum/#!topic/thread-sanitizer/se0YuzfWazw Fortunately, thread sanitizer gained fiber support in early 2019:

[PATCH 04/19] cputlb: destroy CPUTLB with tlb_destroy

2020-05-22 Thread Robert Foley
From: "Emilio G. Cota" I was after adding qemu_spin_destroy calls, but while at it I noticed that we are leaking some memory. Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- accel/tcg/cputlb.c | 15 +++ exec.c | 1 + include/exec/exec-all.h |

[PATCH 03/19] thread: add qemu_spin_destroy

2020-05-22 Thread Robert Foley
From: "Emilio G. Cota" It will be used for TSAN annotations. Signed-off-by: Emilio G. Cota Signed-off-by: Robert Foley --- include/qemu/thread.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/qemu/thread.h b/include/qemu/thread.h index d22848138e..e50a073889 100644 ---

[PATCH 00/19] Add Thread Sanitizer support to QEMU

2020-05-22 Thread Robert Foley
This patch series continues the work done by Emilio Cota and others to add Thread Sanitizer (TSan) support to QEMU. The starting point for this work was Emilio's branch here: https://github.com/cota/qemu/commits/tsan specifically this commit: 0be125fc0afd47218b34d2019abdd19b644f3199 The purpose

  1   2   >