[PATCH v6 5/6] net/colo-compare.c: Check that colo-compare is active

2020-05-22 Thread Lukas Straub
If the colo-compare object is removed before failover and a checkpoint happens, qemu crashes because it tries to lock the destroyed event_mtx in colo_notify_compares_event. Fix this by checking if everything is initialized by introducing a new variable colo_compare_active which is protected by a n

Re: [RFC][PATCH v2 2/3] docs/specs: Add specification of ivshmem device revision 2

2020-05-22 Thread Jan Kiszka
On 21.05.20 20:18, Michael S. Tsirkin wrote: > On Thu, May 21, 2020 at 05:53:31PM +0100, Alex Bennée wrote: >> >> Jan Kiszka writes: >> >>> From: Jan Kiszka >>> >>> This imports the ivshmem v2 specification draft from Jailhouse where the >>> implementation is about to be merged now. The final hom

Re: [PATCH v4 0/6] hyperv: VMBus implementation

2020-05-22 Thread Paolo Bonzini
On 22/05/20 04:53, Jon Doron wrote: >>> >>> >> >> Queued, thanks.  I'll take a look at the EOM handling threads next. >> >> Paolo >> > > Hi Paolo, there is no need to look at the EOM, we have scraped it as you > can see in v4 :) I mean in order to un-scrape it. :) Paolo

Re: [PATCH v1 0/1] target/microblaze: Add GDB XML files

2020-05-22 Thread Edgar E. Iglesias
On Thu, May 21, 2020 at 09:02:14PM -0700, Joe Komlodi wrote: > Hi all, > > This adds GDB XML files for Microblaze CPUs. > For Microblaze, it's split up into core and stack protect XML files. Hi Joe, Can you please add a license header to microblaze-core.xml? I think you wrote this on your own bu

Re: [PATCH v3 3/9] target/riscv: Add the lowRISC Ibex CPU

2020-05-22 Thread LIU Zhiwei
On 2020/5/20 5:31, Alistair Francis wrote: Ibex is a small and efficient, 32-bit, in-order RISC-V core with a 2-stage pipeline that implements the RV32IMC instruction set architecture. For more details on lowRISC see here: https://github.com/lowRISC/ibex Signed-off-by: Alistair Francis Revi

RE: [PATCH v6 5/6] net/colo-compare.c: Check that colo-compare is active

2020-05-22 Thread Zhang, Chen
> -Original Message- > From: Lukas Straub > Sent: Friday, May 22, 2020 2:48 PM > To: qemu-devel > Cc: Zhang, Chen ; Li Zhijian > ; Jason Wang ; Marc- > André Lureau > Subject: [PATCH v6 5/6] net/colo-compare.c: Check that colo-compare is > active > > If the colo-compare object is rem

[PATCH V2 3/7] net/colo-compare.c: Fix deadlock in compare_chr_send

2020-05-22 Thread Zhang Chen
From: Lukas Straub The chr_out chardev is connected to a filter-redirector running in the main loop. qemu_chr_fe_write_all might block here in compare_chr_send if the (socket-)buffer is full. If another filter-redirector in the main loop want's to send data to chr_pri_in it might also block if th

[PATCH V2 2/7] chardev/char.c: Use qemu_co_sleep_ns if in coroutine

2020-05-22 Thread Zhang Chen
From: Lukas Straub This will be needed in the next patch so compare_chr_send can be converted to a coroutine. Signed-off-by: Lukas Straub Reviewed-by: Marc-André Lureau Reviewed-by: Zhang Chen Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Zhang Chen --- chardev/char.c | 7 ++- 1 f

[PATCH V2 0/7] Latest COLO tree queued patches

2020-05-22 Thread Zhang Chen
From: Zhang Chen Hi Jason, this series include latest COLO related patches. I have finish basic test and review. If no other comments, please check and merge this series. Derek Su (1): colo-compare: Fix memory leak in packet_enqueue() Lukas Straub (6): net/colo-compare.c: Create event_bh wi

[PATCH V2 6/7] net/colo-compare.c: Correct ordering in complete and finalize

2020-05-22 Thread Zhang Chen
From: Lukas Straub In colo_compare_complete, insert CompareState into net_compares only after everything has been initialized. In colo_compare_finalize, remove CompareState from net_compares before anything is deinitialized. Signed-off-by: Lukas Straub Reviewed-by: Zhang Chen Signed-off-by: Zh

[PATCH V2 1/7] net/colo-compare.c: Create event_bh with the right AioContext

2020-05-22 Thread Zhang Chen
From: Lukas Straub qemu_bh_new will set the bh to be executed in the main loop. This causes crashes as colo_compare_handle_event assumes that it has exclusive access the queues, which are also concurrently accessed in the iothread. Create the bh with the AioContext of the iothread to fulfill the

[PATCH V2 4/7] net/colo-compare.c: Only hexdump packets if tracing is enabled

2020-05-22 Thread Zhang Chen
From: Lukas Straub Else the log will be flooded if there is a lot of network traffic. Signed-off-by: Lukas Straub Reviewed-by: Zhang Chen Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Zhang Chen --- net/colo-compare.c | 10 ++ 1 file changed,

[PATCH V2 5/7] net/colo-compare.c: Check that colo-compare is active

2020-05-22 Thread Zhang Chen
From: Lukas Straub If the colo-compare object is removed before failover and a checkpoint happens, qemu crashes because it tries to lock the destroyed event_mtx in colo_notify_compares_event. Fix this by checking if everything is initialized by introducing a new variable colo_compare_active whic

[PATCH V2 7/7] colo-compare: Fix memory leak in packet_enqueue()

2020-05-22 Thread Zhang Chen
From: Derek Su The patch is to fix the "pkt" memory leak in packet_enqueue(). The allocated "pkt" needs to be freed if the colo compare primary or secondary queue is too big. Replace the error_report of full queue with a trace event. Signed-off-by: Derek Su Reviewed-by: Zhang Chen Signed-off-

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

2020-05-22 Thread Claudio Fontana
On 5/22/20 8:07 AM, Thomas Huth wrote: >> From: "Claudio Fontana" >> Sent: Thursday, May 21, 2020 8:54:05 PM >> >> this is a first step in the refactoring of cpus.c. > > Could you maybe extend the commit message in the next version a little bit? > ... say something about *what* you are moving to

Re: [PATCH] hw/arm/virt: Fix PL061 node name and properties

2020-05-22 Thread Geert Uytterhoeven
Hi Peter, On Thu, May 21, 2020 at 6:59 PM Peter Maydell wrote: > On Tue, 19 May 2020 at 09:49, Geert Uytterhoeven > wrote: > > Make the created node comply with the PL061 Device Tree bindings: > > - Use generic node name "gpio" instead of "pl061", > > - Add missing "#interrupt-cells" and "in

Re: [PATCH v4 5/6] i386: Hyper-V VMBus ACPI DSDT entry

2020-05-22 Thread Igor Mammedow
On Thu, 21 May 2020 18:02:07 +0200 Paolo Bonzini wrote: > On 13/05/20 17:34, Igor Mammedov wrote: > > I'd rather avoid using random IRQ numbers (considering we are > > dealing with black-box here). So if it's really necessary to have > > IRQ described here, I'd suggest to implement them in device

Re: [PATCH v1 5/8] cpus-common: ensure auto-assigned cpu_indexes don't clash

2020-05-22 Thread Igor Mammedow
On Thu, 21 May 2020 18:10:40 +0100 Alex Bennée wrote: > Igor Mammedov writes: > > > On Thu, 14 May 2020 17:27:53 +0100 > > Alex Bennée wrote: > > > >> a > >> Alex Bennée writes: > >> > >> > Basing the cpu_index on the number of currently allocated vCPUs > >> > fails when vCPUs aren't rem

Re: [PATCH v5] char-socket: initialize reconnect timer only when the timer doesn't start

2020-05-22 Thread Marc-André Lureau
On Fri, May 22, 2020 at 4:56 AM Li Feng wrote: > > When the disconnect event is triggered in the connecting stage, > the tcp_chr_disconnect_locked may be called twice. > > The first call: > #0 qemu_chr_socket_restart_timer (chr=0x5582ee90) at > chardev/char-socket.c:120 > #1 0x5

Re: [PATCH] hw/arm/virt: Fix PL061 node name and properties

2020-05-22 Thread Peter Maydell
On Fri, 22 May 2020 at 09:29, Geert Uytterhoeven wrote: > > Hi Peter, > > On Thu, May 21, 2020 at 6:59 PM Peter Maydell > wrote: > > On Tue, 19 May 2020 at 09:49, Geert Uytterhoeven > > wrote: > > > Make the created node comply with the PL061 Device Tree bindings: > > > - Use generic node nam

Re: [PATCH v1 7/8] tests/tcg: add new threadcount test

2020-05-22 Thread Philippe Mathieu-Daudé
On 5/13/20 7:31 PM, Alex Bennée wrote: Based on the original testcase by Nikolay Igotti. Message-ID: Cc: Nikolay Igotti [Nikolay can we have your signed of by to add the testcase?] Signed-off-by: Alex Bennée --- tests/tcg/multiarch/threadcount.c | 62 + tests/

Re: [PATCH v1 6/8] linux-user: properly "unrealize" vCPU object

2020-05-22 Thread Philippe Mathieu-Daudé
+Paolo On 5/13/20 7:31 PM, Alex Bennée wrote: We shouldn't be messing around with the CPU list in linux-user save for the very special case of do_fork(). When threads end we need to properly follow QOM object lifetime handling and allow the eventual cpu_common_unrealizefn to both remove the CPU

Re: [PATCH] hw/arm/virt: Fix PL061 node name and properties

2020-05-22 Thread Philippe Mathieu-Daudé
On 5/22/20 11:30 AM, Peter Maydell wrote: On Fri, 22 May 2020 at 09:29, Geert Uytterhoeven wrote: On Thu, May 21, 2020 at 6:59 PM Peter Maydell wrote: On Tue, 19 May 2020 at 09:49, Geert Uytterhoeven wrote: Make the created node comply with the PL061 Device Tree bindings: - Use generic n

Re: [PATCH 0/3] virtio: add vhost-user-vsock device

2020-05-22 Thread Stefano Garzarella
On Thu, May 21, 2020 at 03:35:59PM +0100, Stefan Hajnoczi wrote: > On Fri, May 15, 2020 at 05:21:07PM +0200, Stefano Garzarella wrote: > > This series add vhost-user-vsock base device and its PCI version > > (vhost-user-vsock-pci). > > The vhost-user-vsock device can be used to implement the virtio

RE: [PATCH 2/4] hw/riscv: spike: Allow creating multiple sockets

2020-05-22 Thread Anup Patel
> -Original Message- > From: Palmer Dabbelt > Sent: 22 May 2020 01:46 > To: Anup Patel > Cc: Peter Maydell ; Alistair Francis > ; sag...@eecs.berkeley.edu; Atish Patra > ; a...@brainfault.org; qemu-ri...@nongnu.org; > qemu-devel@nongnu.org; Anup Patel > Subject: Re: [PATCH 2/4] hw/risc

Re: [PATCH v1 04/10] linux-user: completely re-write init_guest_space

2020-05-22 Thread Alex Bennée
Richard Henderson writes: > On 5/21/20 1:21 AM, Alex Bennée wrote: >> >> Thomas Huth writes: >> >>> On 13/05/2020 19.51, Alex Bennée wrote: First we ensure all guest space initialisation logic comes through probe_guest_base once we understand the nature of the binary we are lo

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

2020-05-22 Thread Alex Bennée
Claudio Fontana writes: > On 5/22/20 8:07 AM, Thomas Huth wrote: >>> From: "Claudio Fontana" >>> Sent: Thursday, May 21, 2020 8:54:05 PM >>> >>> this is a first step in the refactoring of cpus.c. >> >> Could you maybe extend the commit message in the next version a little bit? >> ... say som

Re: [PATCH v1 04/10] linux-user: completely re-write init_guest_space

2020-05-22 Thread Peter Maydell
On Fri, 22 May 2020 at 11:24, Alex Bennée wrote: > Examples: > > /tmp/qemu-test/src/fpu/softfloat.c:3365:13: error: bitwise negation of a > boolean expression; did you mean logical negation? [-Werror,-Wbool-operation] > absZ &= ~ ( ( ( roundBits ^ 0x40 ) == 0 ) & roundNearestEven ); >

AW: AW: [PATCH 1/1] tricore: added AURIX TC277 D-Step TriBoard

2020-05-22 Thread Konopik, Andreas (EFS-GH2)
Hello Philippe, sorry to keep you waiting. > -Ursprüngliche Nachricht- > Von: Philippe Mathieu-Daudé Im Auftrag > von Philippe Mathieu-Daudé > Gesendet: Dienstag, 12. Mai 2020 10:40 > An: Konopik, Andreas (EFS-GH2) ; qemu- > de...@nongnu.org > Cc: kbast...@mail.uni-paderborn.de; Brenken,

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

2020-05-22 Thread Claudio Fontana
On 5/22/20 12:26 PM, Alex Bennée wrote: > > Claudio Fontana writes: > >> On 5/22/20 8:07 AM, Thomas Huth wrote: From: "Claudio Fontana" Sent: Thursday, May 21, 2020 8:54:05 PM this is a first step in the refactoring of cpus.c. >>> >>> Could you maybe extend the commit messag

Re: [PULL v2 00/29] target-arm queue

2020-05-22 Thread Peter Maydell
On Thu, 21 May 2020 at 22:06, Peter Maydell wrote: > > v2: added Property array terminator (which caused crashes on > various non-x86 host architectures). > > The following changes since commit ae3aa5da96f4ccf0c2a28851449d92db9fcfad71: > > Merge remote-tracking branch > 'remotes/berrange/tags/s

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

2020-05-22 Thread Alex Bennée
Claudio Fontana writes: > On 5/22/20 12:26 PM, Alex Bennée wrote: >> >> Claudio Fontana writes: >> >>> On 5/22/20 8:07 AM, Thomas Huth wrote: > From: "Claudio Fontana" > Sent: Thursday, May 21, 2020 8:54:05 PM > > this is a first step in the refactoring of cpus.c.

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

2020-05-22 Thread Claudio Fontana
On 5/22/20 1:18 PM, Alex Bennée wrote: > > Claudio Fontana writes: > >> On 5/22/20 12:26 PM, Alex Bennée wrote: >>> >>> Claudio Fontana writes: >>> On 5/22/20 8:07 AM, Thomas Huth wrote: >> From: "Claudio Fontana" >> Sent: Thursday, May 21, 2020 8:54:05 PM >> >> this is a

Re: [PATCH] replay: fix replay shutdown for console mode

2020-05-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/159012995470.27967.18129611453659045726.stgit@pasha-ThinkPad-X280/ 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. =

[PATCH 1/2] hw/ssi/imx_spi: changed while statement to prevent underflow

2020-05-22 Thread Eden Mikitas
The while statement in question only checked if tx_burst is not 0. tx_burst is a signed int, which is assigned the value put by the guest driver in ECSPI_CONREG. The burst length can be anywhere between 1 and 4096, and since tx_burst is always decremented by 8 it could possibly underflow, causing a

[PATCH 0/2] hw/ssi/imx_spi: 2 Fixes to flush txfifo function in imx_spi

2020-05-22 Thread Eden Mikitas
This patch series contains 2 fixes to the imx_spi_flush_txfifo function. The first fix prevents a case in which calling imx_spi_flush_txfifo while the controller is configured (by the guest driver) to use a burst length that isn't a multiple of 8 will cause an infinite loop. The second fix ma

[PATCH 2/2] hw/ssi/imx_spi: Removed unnecessary cast of rx data received from slave

2020-05-22 Thread Eden Mikitas
When inserting the value retrieved (rx) from the spi slave, rx is pushed to rx_fifo after being cast to uint8_t. rx_fifo is a fifo32, and the rx register the driver uses is also 32 bit. This zeroes the 24 most significant bits of rx. This proved problematic with devices that expect to use the whole

[PATCH v2 0/3] virtio: add vhost-user-vsock device

2020-05-22 Thread Stefano Garzarella
v2: - removed live migration code in the vhost-user-vsock base device since vhost-user-vsock application built with Cloud Hypervisor crates doesn't support VHOST_USER_PROTOCOL_F_LOG_SHMFD, so I'm not able to test this code [Stefan] v1: https://lists.gnu.org/archive/html/qemu-devel/20

[PATCH v2 3/3] virtio: add vhost-user-vsock-pci device

2020-05-22 Thread Stefano Garzarella
Add the PCI version of vhost-user-vsock Launch QEMU like this: qemu -chardev socket,path=/tmp/vm.vsock,id=chr0 \ -device vhost-user-vsock-pci,chardev=chr0 Signed-off-by: Stefano Garzarella --- hw/virtio/vhost-user-vsock-pci.c | 84 hw/virtio/Makefile.o

[PATCH v2 2/3] virtio: add vhost-user-vsock base device

2020-05-22 Thread Stefano Garzarella
This patch introduces a vhost-user device for vsock, using the vhost-vsock-common parent class. The vhost-user-vsock device can be used to implement the virtio-vsock device emulation in user-space. Signed-off-by: Stefano Garzarella --- v1 -> v2: - removed live migration code since vhost-user-v

[PATCH v2 1/3] vhost-vsock: add vhost-vsock-common abstraction

2020-05-22 Thread Stefano Garzarella
This patch prepares the introduction of vhost-user-vsock, moving the common code usable for both vhost-vsock and vhost-user-vsock devices, in the new vhost-vsock-common parent class. While moving the code, fixed checkpatch warnings about block comments. Signed-off-by: Stefano Garzarella --- inc

Re: [PATCH v2 3/3] xen/9pfs: increase max ring order to 9

2020-05-22 Thread Christian Schoenebeck
On Donnerstag, 21. Mai 2020 21:26:27 CEST Stefano Stabellini wrote: > From: Stefano Stabellini > > The max order allowed by the protocol is 9. Increase the max order > supported by QEMU to 9 to increase performance. > > Signed-off-by: Stefano Stabellini > --- > Changes in v2: > - patch added >

Re: [PATCH v2 1/3] Revert "9p: init_in_iov_from_pdu can truncate the size"

2020-05-22 Thread Christian Schoenebeck
On Donnerstag, 21. Mai 2020 21:26:25 CEST Stefano Stabellini wrote: > From: Stefano Stabellini > > This reverts commit 16724a173049ac29c7b5ade741da93a0f46edff7. > It causes https://bugs.launchpad.net/bugs/1877688. > > Signed-off-by: Stefano Stabellini > --- Actually already reviewed by me; no

Re: [PATCH v7 03/12] tests/vm: pass args through to BaseVM's __init__

2020-05-22 Thread Robert Foley
On Wed, 20 May 2020 at 17:49, Alex Bennée wrote: > > > Robert Foley writes: > > A brief rationale wouldn't go amiss in the commit message. e.g. "We will > shortly need to pass more parameters to the class so lets just pass args > rather than growing the parameter list." Good point. I will add th

Re: [PATCH v4 3/6] migration/block-dirty-bitmap: fix bitmaps pre-blockdev migration during mirror job

2020-05-22 Thread Eric Blake
On 5/21/20 5:06 PM, Vladimir Sementsov-Ogievskiy wrote: Important thing for bitmap migration is to select destination block node to obtain the migrated bitmap. Prepatch, on source we use bdrv_get_device_or_node_name() to identify the node, and on target we do bdrv_lookup_bs. bdrv_get_device_or_n

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

2020-05-22 Thread Paul Goyette
Seems ok now. On Fri, 22 May 2020, Thomas Huth wrote: > Can you still reproduce this issue with the latest version of QEMU > (currently 5.0)? > > ** Changed in: qemu > Status: New => Incomplete > > -- > You received this bug notification because you are subscribed to the bug > report. > ht

Re: [PATCH] replay: notify the main loop when there are no instructions

2020-05-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/159013007895.28110.2020104406699709721.stgit@pasha-ThinkPad-X280/ 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. ==

Re: [Bug 1693667] Re: -cpu haswell / broadwell have no MONITOR in features1

2020-05-22 Thread Paul Goyette
This bug seems not to be a problem, and may reflect an issue with NetBSD. Even though the decode of the features1 register does not include MONITOR/MWAIT, that capability is separately reported on a separate line, further down (apologies in advance for any confusing line-wrap): # cpuctl identify

Re: [RFC 2/3] cpu-timers: new module extracted from cpus.c

2020-05-22 Thread Claudio Fontana
here the obvious next step would be to split icount as its own module, and make it tcg-only. The issue I am facing with that is that qtest is actually requiring this, as it is "using" icount for its qtest_clock_warp functionality. Does somebody have a good idea here that might save some time?

Fwd: simple qemu command not working

2020-05-22 Thread haris iqbal
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 Date: Wed, May 20, 2020 at 5:10 PM Subject: simple qemu command not working T

Re: [PATCH v7 04/12] tests/vm: Add configuration to basevm.py

2020-05-22 Thread Alex Bennée
Robert Foley writes: > Added use of a configuration to tests/vm/basevm.py. > The configuration provides parameters used to configure a VM. > This allows for providing alternate configurations to the VM being > created/launched. cpu, machine, memory, and NUMA configuration are all > examples of

[PATCH] linux-user: provide fallback pgd_find_hole for bare chroots

2020-05-22 Thread Alex Bennée
When running QEMU out of a chroot environment we may not have access to /proc/self/maps. As there is no other "official" way to introspect our memory map we need to fall back to the original technique of repeatedly trying to mmap an address range until we find one that works. Fortunately it's not

Re: [PATCH v7 05/12] tests/vm: Added configuration file support

2020-05-22 Thread Alex Bennée
Robert Foley writes: > Changes to tests/vm/basevm.py to allow accepting a configuration file > as a parameter. Allows for specifying VM options such as > cpu, machine, memory, and arbitrary qemu arguments for specifying options > such as NUMA configuration. > Also added an example conf_example_

Re: [PULL 0/1] qemu-openbios queue 20200521

2020-05-22 Thread Peter Maydell
On Thu, 21 May 2020 at 21:07, Mark Cave-Ayland wrote: > > The following changes since commit ae3aa5da96f4ccf0c2a28851449d92db9fcfad71: > > Merge remote-tracking branch > 'remotes/berrange/tags/socket-next-pull-request' into staging (2020-05-21 > 16:47:28 +0100) > > are available in the Git rep

Re: [PATCH v7 06/12] tests/vm: Pass --debug through for vm-boot-ssh.

2020-05-22 Thread Alex Bennée
Robert Foley writes: > This helps debug issues that occur during the boot sequence. > > Signed-off-by: Robert Foley > Reviewed-by: Peter Puhov Reviewed-by: Alex Bennée > --- > tests/vm/Makefile.include | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tests/vm/Makefile.include b/te

Re: [PATCH 10/10] target/arm: Convert Neon one-register-and-immediate insns to decodetree

2020-05-22 Thread Peter Maydell
On Sat, 16 May 2020 at 03:51, Richard Henderson wrote: > I wonder if it's worth repeating VORR/VBIC so many times. > You can just as well do the (cmode & 1) && cmode < 12 check in the trans_ > function. OK; at that point we might as well just have a single Vimm_1r pattern and distinguish VORR/VB

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

2020-05-22 Thread Alex Bennée
Robert Foley writes: > Added a new special variable QEMU_LOCAL=1, which > will indicate to take the QEMU binary from the current > build. > > Signed-off-by: Robert Foley > Reviewed-by: Peter Puhov > --- > tests/vm/Makefile.include | 4 > tests/vm/basevm.py| 25 +

Re: [PATCH v2 5/5] hw/arm/virt: Let the virtio-iommu bypass MSIs

2020-05-22 Thread Jean-Philippe Brucker
On Fri, May 08, 2020 at 07:30:57PM +0200, Eric Auger wrote: > At the moment the virtio-iommu translates MSI transactions. > This behavior is inherited from ARM SMMU. The virt machine > code knows where the guest MSI doorbells are so we can easily > declare those regions as VIRTIO_IOMMU_RESV_MEM_T_M

[PATCH v2 2/9] target/arm: Convert Neon VSHR 2-reg-shift insns to decodetree

2020-05-22 Thread Peter Maydell
Convert the VSHR 2-reg-shift insns to decodetree. Note that unlike the legacy decoder, we present the right shift amount to the trans_ function as a positive integer. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/neon-dp.decode | 25 targ

[PATCH v2 3/9] target/arm: Convert Neon VSRA, VSRI, VRSHR, VRSRA 2-reg-shift insns to decodetree

2020-05-22 Thread Peter Maydell
Convert the VSRA, VSRI, VRSHR, VRSRA 2-reg-shift insns to decodetree. (These are the last instructions in the group that are vectorized; the rest all require looping over each element.) Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/neon-dp.decode | 35

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

2020-05-22 Thread Peter Maydell
This patchset converts the Neon insns in the 2-register-and-shift-amount and 1-register-and-modified-immediate groups to decodetree. Changes since v1: * old patch 1 is now in master * patch 1, 2, 3, 4: create and use separate formats for each size of shift * patch 5, 6, 7: use new @2reg_shrn_[d

[PATCH v2 1/9] target/arm: Convert Neon VSHL and VSLI 2-reg-shift insn to decodetree

2020-05-22 Thread Peter Maydell
Convert the VSHL and VSLI insns from the Neon 2-registers-and-a-shift group to decodetree. Signed-off-by: Peter Maydell --- target/arm/neon-dp.decode | 25 ++ target/arm/translate-neon.inc.c | 38 + target/arm/translate.c | 18 ++

[PATCH v2 4/9] target/arm: Convert VQSHLU, VQSHL 2-reg-shift insns to decodetree

2020-05-22 Thread Peter Maydell
Convert the VQSHLU and QVSHL 2-reg-shift insns to decodetree. These are the last of the simple shift-by-immediate insns. Signed-off-by: Peter Maydell --- target/arm/neon-dp.decode | 15 + target/arm/translate-neon.inc.c | 108 +++ target/arm/translate.c

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

2020-05-22 Thread Peter Maydell
Convert the Neon narrowing shifts where op==8 to decodetree: * VSHRN * VRSHRN * VQSHRUN * VQRSHRUN Signed-off-by: Peter Maydell --- target/arm/neon-dp.decode | 27 + target/arm/translate-neon.inc.c | 168 target/arm/translate.c | 1 + 3

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

2020-05-22 Thread Peter Maydell
Convert the remaining Neon narrowing shifts to decodetree: * VQSHRN * VQRSHRN Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/neon-dp.decode | 20 ++ target/arm/translate-neon.inc.c | 15 + target/arm/translate.c | 110 +---

[PATCH v2 8/9] target/arm: Convert VCVT fixed-point ops to decodetree

2020-05-22 Thread Peter Maydell
Convert the VCVT fixed-point conversion operations in the Neon 2-regs-and-shift group to decodetree. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/neon-dp.decode | 11 + target/arm/translate-neon.inc.c | 49 + target/arm/translate.c

[PATCH v2 7/9] target/arm: Convert Neon VSHLL, VMOVL to decodetree

2020-05-22 Thread Peter Maydell
Convert the VSHLL and VMOVL insns from the 2-reg-shift group to decodetree. Since the loop always has two passes, we unroll it to avoid the awkward reassignment of one TCGv to another. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/neon-dp.decode | 16 +++

[PATCH v2 9/9] target/arm: Convert Neon one-register-and-immediate insns to decodetree

2020-05-22 Thread Peter Maydell
Convert the insns in the one-register-and-immediate group to decodetree. In the new decode, our asimd_imm_const() function returns a 64-bit value rather than a 32-bit one, which means we don't need to treat cmode=14 op=1 as a special case in the decoder (it is the only encoding where the two halve

Re: [PATCH v3 11/11] hw/semihosting: Make the feature depend of TCG, and allow to disable it

2020-05-22 Thread Philippe Mathieu-Daudé
On 5/22/20 6:26 AM, Richard Henderson wrote: > On 5/21/20 12:59 PM, Philippe Mathieu-Daudé wrote: >> +++ b/hw/semihosting/Kconfig >> @@ -1,3 +1,5 @@ >> >> +# default is 'n' >> config SEMIHOSTING >> - bool >> +bool >> +depends on TCG >> diff --git a/target/arm/Kconfig b/target/arm/K

Re: [PATCH v3 11/11] hw/semihosting: Make the feature depend of TCG, and allow to disable it

2020-05-22 Thread Philippe Mathieu-Daudé
On 5/21/20 9:59 PM, Philippe Mathieu-Daudé wrote: > The semihosting feature is only meaningful when using TCG. > > Do not enable it by default, and let the few targets requiring > it to manually select it. > The targets restricted to TCG that previously selected it > (see commit 16932bb761e52c2 'i

Re: [PATCH v3 08/17] block/io: support int64_t bytes in bdrv_aligned_preadv()

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 v3 09/11] rules.mak: Add base-arch() rule

2020-05-22 Thread Philippe Mathieu-Daudé
On 5/22/20 6:24 AM, Richard Henderson wrote: > On 5/21/20 12:59 PM, Philippe Mathieu-Daudé wrote: >> +$(if $(findstring risc,$1),risc,\ > > Eh? riscv{32,64} vs openrisc. Nice catch, because with this patch openrisc builds with a riscv config-devices.h =) > >> +$(if $(fi

Re: [PATCH 1/4] coroutine: support SafeStack in ucontext backend

2020-05-22 Thread Daniele Buono
Hi Stefan, thank you so much for reviewing this. See my answers below: On 5/21/2020 5:44 AM, Stefan Hajnoczi wrote: On Wed, Apr 29, 2020 at 03:44:17PM -0400, Daniele Buono wrote: diff --git a/include/qemu/coroutine_int.h b/include/qemu/coroutine_int.h index bd6b0468e1..2ffd75ddbe 100644 --- a/i

Re: [PATCH v4 0/6] fix migration with bitmaps and mirror

2020-05-22 Thread Eric Blake
On 5/21/20 5:06 PM, Vladimir Sementsov-Ogievskiy wrote: v4: (Max's patch marking filters as filters already in master) 03: careful select child of filter, avoid crash 04: add Eric's r-b 05-06: tweak error message, keep Andrey's r-b, add Eric's r-b Vladimir Sementsov-Ogievskiy (6): migration/b

Re: [PATCH 3/4] configure: add flag to enable SafeStack

2020-05-22 Thread Daniele Buono
Hi Stefan, I would feel more confident by adding another check in configure to make sure that the user didn't enable SafeStack manually through other means, like manually setting the option through extra_cflags. What do you think? On 5/21/2020 5:52 AM, Stefan Hajnoczi wrote: On Wed, Apr 29, 202

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

2020-05-22 Thread Alex Bennée
Robert Foley writes: > ubuntu.aarch64 provides a script to create an Ubuntu 18.04 VM. > Another new file is also added aarch64vm.py, which is a module with > common methods used by aarch64 VMs, such as how to create the > flash images. > > Signed-off-by: Robert Foley > Reviewed-by: Peter Puhov

Re: [PATCH 4/4] check-block: Enable iotests with SafeStack

2020-05-22 Thread Daniele Buono
On 5/21/2020 5:59 AM, Stefan Hajnoczi wrote: On Wed, Apr 29, 2020 at 03:44:20PM -0400, Daniele Buono wrote: SafeStack is a stack protection technique implemented in llvm. It is enabled with a -fsanitize flag. iotests are currently disabled when any -fsanitize option is used. Since SafeStack is

Re: [PATCH 1/2] hw/ssi/imx_spi: changed while statement to prevent underflow

2020-05-22 Thread Alistair Francis
On Fri, May 22, 2020 at 4:51 AM Eden Mikitas wrote: > > The while statement in question only checked if tx_burst is not 0. > tx_burst is a signed int, which is assigned the value put by the > guest driver in ECSPI_CONREG. The burst length can be anywhere > between 1 and 4096, and since tx_burst is

Re: [PATCH 2/2] hw/ssi/imx_spi: Removed unnecessary cast of rx data received from slave

2020-05-22 Thread Alistair Francis
On Fri, May 22, 2020 at 4:52 AM Eden Mikitas wrote: > > When inserting the value retrieved (rx) from the spi slave, rx is pushed to > rx_fifo after being cast to uint8_t. rx_fifo is a fifo32, and the rx > register the driver uses is also 32 bit. This zeroes the 24 most > significant bits of rx. Th

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

2020-05-22 Thread Alex Bennée
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 > +++ b/tests/vm/centos.aarch64 > @@ -0,0 +1,227 @@ > +#!/usr/bin/env p

Re: [PATCH v4 0/6] fix migration with bitmaps and mirror

2020-05-22 Thread Vladimir Sementsov-Ogievskiy
22.05.2020 18:24, Eric Blake wrote: On 5/21/20 5:06 PM, Vladimir Sementsov-Ogievskiy wrote: v4: (Max's patch marking filters as filters already in master) 03: careful select child of filter, avoid crash 04: add Eric's r-b 05-06: tweak error message, keep Andrey's r-b, add Eric's r-b Vladimir Se

[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 o

[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 --- a/inclu

[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 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: https://reviews.llvm.org/D54

[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 tcg_

[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 insertio

[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 100

[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 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 a/accel/tcg

[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 TS

[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 --- inc

[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 (qemu-system-aarch64+0xcd8abb)

[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 s

[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 qemu_se

[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 tests/tsan/bla

[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 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 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 (qemu-sys

[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 othe

  1   2   >