Re: [Qemu-devel] [PATCH v3 4/4] Optimize record/replay checkpointing for all clocks it applies to

2018-10-18 Thread Pavel Dovgalyuk
> From: Artem Pisarenko [mailto:artem.k.pisare...@gmail.com] > Removes redundant checkpoints in replay log when there are no expired timers > in timers list, > associated with corresponding clock (i.e. no rr events associated with > current clock value). > This also improves performance in rr

Re: [Qemu-devel] When it's okay to treat OOM as fatal?

2018-10-18 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Markus Armbruster (arm...@redhat.com) wrote: >> "Dr. David Alan Gilbert" writes: >> >> > * Markus Armbruster (arm...@redhat.com) wrote: >> >> "Dr. David Alan Gilbert" writes: >> >> >> >> > * Markus Armbruster (arm...@redhat.com) wrote: >> >> >> We

Re: [Qemu-devel] [PATCH 0/7] vfio: some trivial fixes

2018-10-18 Thread Philippe Mathieu-Daudé
On 19/10/2018 07:20, Li Qiang wrote: > This patch set contains some trivial issue such as > QOMConvetion, typo and resources leak in vfio. > > Li Qiang (7): > vfio-pci: make "vfio-pci-nohotplug" as MACRO > vfio: ap-device: make it more QOMConventional > vfio: drop TYPE_FOO MACRO in

Re: [Qemu-devel] [PATCH v3 0/4] Fix and improve core RTC function and documentation

2018-10-18 Thread Artem Pisarenko
> As a start of future refactoring, would you mind moving all this code to > hw/timer/rtc.c or rtc.c? It was somewaht generic before, but now it's > very tied to -rtc. Yes, sure.

Re: [Qemu-devel] [PATCH 4/7] vfio: paltform: fix a typo

2018-10-18 Thread Philippe Mathieu-Daudé
On 19/10/2018 07:20, Li Qiang wrote: > Signed-off-by: Li Qiang > --- > hw/vfio/platform.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c > index ba03dcd..5992fe7 100644 > --- a/hw/vfio/platform.c > +++ b/hw/vfio/platform.c >

[Qemu-devel] [PATCH 7/7] vfio: platform: destory mutex in error path

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index ba19143..e9d9e80 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -668,7 +668,7 @@ static void

[Qemu-devel] [PATCH 6/7] vfio: platform: free timer in error path

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 6a4fd7b..ba19143 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -518,6 +518,7 @@ static int vfio_populate_device(VFIODevice *vbasedev,

[Qemu-devel] [PATCH 1/7] vfio-pci: make "vfio-pci-nohotplug" as MACRO

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/pci.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 8b73582..1f05b57 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -40,6 +40,8 @@ #define TYPE_VFIO_PCI "vfio-pci" #define PCI_VFIO(obj)

[Qemu-devel] [PATCH 4/7] vfio: paltform: fix a typo

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index ba03dcd..5992fe7 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -72,7 +72,7 @@ static VFIOINTp

[Qemu-devel] [PATCH 3/7] vfio: drop TYPE_FOO MACRO in VMStateDescription

2018-10-18 Thread Li Qiang
As the vmstate structure names aren't related with the QOM type names. Per Peter's mail: -->https://lists.gnu.org/archive/html/qemu-devel/2018-10/msg02175.html Signed-off-by: Li Qiang --- hw/vfio/amd-xgbe.c | 2 +- hw/vfio/ap.c| 2 +- hw/vfio/calxeda-xgmac.c | 2 +-

[Qemu-devel] [PATCH 5/7] vfio: platform: cleanup the notifier in error path

2018-10-18 Thread Li Qiang
Signed-off-by: Li Qiang --- hw/vfio/platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index 5992fe7..6a4fd7b 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -80,6 +80,7 @@ static VFIOINTp *vfio_init_intp(VFIODevice *vbasedev,

[Qemu-devel] [PATCH 2/7] vfio: ap-device: make it more QOMConventional

2018-10-18 Thread Li Qiang
As the documentation says "use TYPE_FOO constants" This also changes the parent of ap-device's MACRO. Signed-off-by: Li Qiang --- hw/s390x/ap-device.c | 2 +- hw/vfio/ap.c | 12 ++-- include/hw/s390x/ap-device.h | 4 ++-- 3 files changed, 9 insertions(+), 9

[Qemu-devel] [PATCH 0/7] vfio: some trivial fixes

2018-10-18 Thread Li Qiang
This patch set contains some trivial issue such as QOMConvetion, typo and resources leak in vfio. Li Qiang (7): vfio-pci: make "vfio-pci-nohotplug" as MACRO vfio: ap-device: make it more QOMConventional vfio: drop TYPE_FOO MACRO in VMStateDescription vfio: paltform: fix a typo vfio:

Re: [Qemu-devel] [PATCH] vl: Print error when using incorrect backend for debugcon

2018-10-18 Thread Philippe Mathieu-Daudé
Cc'ing qemu-trivial@ On 11/10/2018 23:48, Marc-André Lureau wrote: > On Thu, Oct 11, 2018 at 9:13 PM Philippe Mathieu-Daudé > wrote: >> >> When using an incorrect backend for the debugcon, QEMU exits silently >> without any error indication, which is confusing. >> Add a message that the

Re: [Qemu-devel] [PATCH 19/20] target/arm: Promote consecutive memory ops for aa32

2018-10-18 Thread Philippe Mathieu-Daudé
On 11/10/2018 22:52, Richard Henderson wrote: > For a sequence of loads or stores from a single register, > little-endian operations can be promoted to an 8-byte op. > This can reduce the number of operations by a factor of 8. > > Signed-off-by: Richard Henderson Reviewed-by: Philippe

Re: [Qemu-devel] [PATCH v3 0/6] Avocado: more multi-arch tests

2018-10-18 Thread Philippe Mathieu-Daudé
Ping for review before I send v3? v3: - fix patch 4 "Add test_sh4_r2d in BootLinuxConsole" - drop patch 5? "Add test_sh4_r2d in BootLinuxTracing" On Sat, Oct 13, 2018 at 5:15 PM Philippe Mathieu-Daudé wrote: > Another neanderthal approach to add multi-arch acceptance tests using Avocado. > > I

Re: [Qemu-devel] [PATCH v2 2/3] target/arm: Only flush tlb if ASID changes

2018-10-18 Thread Philippe Mathieu-Daudé
On 19/10/2018 03:56, Richard Henderson wrote: > Since QEMU does not implement ASIDs, changes to the ASID must flush the > tlb. However, if the ASID does not change there is no reason to flush. > > In testing a boot of the Ubuntu installer to the first menu, this reduces > the number of flushes

[Qemu-devel] [PULL V2 25/26] e1000: indicate dropped packets in HW counters

2018-10-18 Thread Jason Wang
The e1000 emulation silently discards RX packets if there's insufficient space in the ring buffer. This leads to errors on higher-level protocols in the guest, with no indication about the error cause. This patch increments the "Missed Packets Count" (MPC) and "Receive No Buffers Count" (RNBC) HW

[Qemu-devel] [PULL V2 22/26] rtl8139: fix possible out of bound access

2018-10-18 Thread Jason Wang
In rtl8139_do_receive(), we try to assign size_ to size which converts from size_t to integer. This will cause troubles when size_ is greater INT_MAX, this will lead a negative value in size and it can then pass the check of size < MIN_BUF_SIZE which may lead out of bound access of for both buf

[Qemu-devel] [PULL V2 24/26] net: ignore packet size greater than INT_MAX

2018-10-18 Thread Jason Wang
There should not be a reason for passing a packet size greater than INT_MAX. It's usually a hint of bug somewhere, so ignore packet size greater than INT_MAX in qemu_deliver_packet_iov() CC: qemu-sta...@nongnu.org Reported-by: Daniel Shapira Reviewed-by: Michael S. Tsirkin Signed-off-by: Jason

[Qemu-devel] [PULL V2 23/26] pcnet: fix possible buffer overflow

2018-10-18 Thread Jason Wang
In pcnet_receive(), we try to assign size_ to size which converts from size_t to integer. This will cause troubles when size_ is greater INT_MAX, this will lead a negative value in size and it can then pass the check of size < MIN_BUF_SIZE which may lead out of bound access for both buf and buf1.

[Qemu-devel] [PULL V2 21/26] ne2000: fix possible out of bound access in ne2000_receive

2018-10-18 Thread Jason Wang
In ne2000_receive(), we try to assign size_ to size which converts from size_t to integer. This will cause troubles when size_ is greater INT_MAX, this will lead a negative value in size and it can then pass the check of size < MIN_BUF_SIZE which may lead out of bound access of for both buf and

[Qemu-devel] [PULL V2 19/26] docs: Add COLO status diagram to COLO-FT.txt

2018-10-18 Thread Jason Wang
From: Zhang Chen This diagram make user better understand COLO. Suggested by Markus Armbruster. Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- docs/COLO-FT.txt | 34 ++ 1 file changed, 34 insertions(+) diff --git

[Qemu-devel] [PULL V2 18/26] COLO: quick failover process by kick COLO thread

2018-10-18 Thread Jason Wang
From: zhanghailiang COLO thread may sleep at qemu_sem_wait(>colo_checkpoint_sem), while failover works begin, It's better to wakeup it to quick the process. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- migration/colo.c | 8 1 file

[Qemu-devel] [PULL V2 16/26] filter-rewriter: handle checkpoint and failover event

2018-10-18 Thread Jason Wang
From: Zhang Chen After one round of checkpoint, the states between PVM and SVM become consistent, so it is unnecessary to adjust the sequence of net packets for old connections, besides, while failover happens, filter-rewriter will into failover mode that needn't handle the new TCP connection.

[Qemu-devel] [PULL V2 20/26] clean up callback when del virtqueue

2018-10-18 Thread Jason Wang
From: liujunjie Before, we did not clear callback like handle_output when delete the virtqueue which may result be segmentfault. The scene is as follows: 1. Start a vm with multiqueue vhost-net, 2. then we write VIRTIO_PCI_GUEST_FEATURES in PCI configuration to triger multiqueue disable in this

[Qemu-devel] [PULL V2 12/26] qapi: Add new command to query colo status

2018-10-18 Thread Jason Wang
From: Zhang Chen Libvirt or other high level software can use this command query colo status. You can test this command like that: {'execute':'query-colo-status'} Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- migration/colo.c| 21 +

[Qemu-devel] [PULL V2 15/26] filter: Add handle_event method for NetFilterClass

2018-10-18 Thread Jason Wang
From: Zhang Chen Filter needs to process the event of checkpoint/failover or other event passed by COLO frame. Signed-off-by: zhanghailiang Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: Jason Wang --- include/net/filter.h | 5 + net/filter.c | 17

[Qemu-devel] [PULL V2 17/26] COLO: notify net filters about checkpoint/failover event

2018-10-18 Thread Jason Wang
From: zhanghailiang Notify all net filters about the checkpoint and failover event. Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang --- migration/colo.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/migration/colo.c

[Qemu-devel] [PULL V2 11/26] qapi/migration.json: Rename COLO unknown mode to none mode.

2018-10-18 Thread Jason Wang
From: Zhang Chen Suggested by Markus Armbruster rename COLO unknown mode to none mode. Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Jason Wang --- migration/colo-failover.c | 2 +- migration/colo.c | 2

[Qemu-devel] [PULL V2 26/26] qemu-options: Fix bad "macaddr" property in the documentation

2018-10-18 Thread Jason Wang
From: Thomas Huth When using the "-device" option, the property is called "mac". "macaddr" is only used for the legacy "-net nic" option. Reported-by: Harald Hoyer Reviewed-by: Markus Armbruster Signed-off-by: Thomas Huth Signed-off-by: Jason Wang --- qemu-options.hx | 2 +- 1 file

[Qemu-devel] [PULL V2 13/26] savevm: split the process of different stages for loadvm/savevm

2018-10-18 Thread Jason Wang
From: Zhang Chen There are several stages during loadvm/savevm process. In different stage, migration incoming processes different types of sections. We want to control these stages more accuracy, it will benefit COLO performance, we don't have to save type of QEMU_VM_SECTION_START sections

[Qemu-devel] [PULL V2 10/26] qmp event: Add COLO_EXIT event to notify users while exited COLO

2018-10-18 Thread Jason Wang
From: zhanghailiang If some errors happen during VM's COLO FT stage, it's important to notify the users of this event. Together with 'x-colo-lost-heartbeat', Users can intervene in COLO's failover work immediately. If users don't want to get involved in COLO's failover verdict, it is still

[Qemu-devel] [PULL V2 08/26] ram/COLO: Record the dirty pages that SVM received

2018-10-18 Thread Jason Wang
From: Zhang Chen We record the address of the dirty pages that received, it will help flushing pages that cached into SVM. Here, it is a trick, we record dirty pages by re-using migration dirty bitmap. In the later patch, we will start the dirty log for SVM, just like migration, in this way, we

[Qemu-devel] [PULL V2 06/26] COLO: Remove colo_state migration struct

2018-10-18 Thread Jason Wang
From: Zhang Chen We need to know if migration is going into COLO state for incoming side before start normal migration. Instead by using the VMStateDescription to send colo_state from source side to destination side, we use MIG_CMD_ENABLE_COLO to indicate whether COLO is enabled or not.

[Qemu-devel] [PULL V2 14/26] COLO: flush host dirty ram from cache

2018-10-18 Thread Jason Wang
From: zhanghailiang Don't need to flush all VM's ram from cache, only flush the dirty pages since last checkpoint Signed-off-by: Li Zhijian Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: zhanghailiang Reviewed-by: Dr. David Alan Gilbert Signed-off-by: Jason Wang ---

[Qemu-devel] [PULL V2 03/26] colo-compare: use notifier to notify packets comparing result

2018-10-18 Thread Jason Wang
From: Zhang Chen It's a good idea to use notifier to notify COLO frame of inconsistent packets comparing. Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by: zhanghailiang Signed-off-by: Jason Wang --- net/colo-compare.c | 37 ++---

[Qemu-devel] [PULL V2 07/26] COLO: Load dirty pages into SVM's RAM cache firstly

2018-10-18 Thread Jason Wang
From: Zhang Chen We should not load PVM's state directly into SVM, because there maybe some errors happen when SVM is receving data, which will break SVM. We need to ensure receving all data before load the state into SVM. We use an extra memory to cache these data (PVM's ram). The ram cache in

[Qemu-devel] [PULL V2 09/26] COLO: Flush memory data from ram cache

2018-10-18 Thread Jason Wang
From: Zhang Chen During the time of VM's running, PVM may dirty some pages, we will transfer PVM's dirty pages to SVM and store them into SVM's RAM cache at next checkpoint time. So, the content of SVM's RAM cache will always be same with PVM's memory after checkpoint. Instead of flushing all

[Qemu-devel] [PULL V2 05/26] COLO: Add block replication into colo process

2018-10-18 Thread Jason Wang
From: Zhang Chen Make sure master start block replication after slave's block replication started. Besides, we need to activate VM's blocks before goes into COLO state. Signed-off-by: zhanghailiang Signed-off-by: Li Zhijian Signed-off-by: Zhang Chen Signed-off-by: Zhang Chen Signed-off-by:

[Qemu-devel] [PULL V2 00/26] Net patches

2018-10-18 Thread Jason Wang
The following changes since commit 77f7c747193662edfadeeb3118d63eed0eac51a6: Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2018-10-17' into staging (2018-10-18 13:40:19 +0100) are available in the git repository at: https://github.com/jasowang/qemu.git

[Qemu-devel] [PULL V2 02/26] colo-compare: implement the process of checkpoint

2018-10-18 Thread Jason Wang
From: Zhang Chen While do checkpoint, we need to flush all the unhandled packets, By using the filter notifier mechanism, we can easily to notify every compare object to do this process, which runs inside of compare threads as a coroutine. Signed-off-by: zhanghailiang Signed-off-by: Zhang Chen

[Qemu-devel] [PULL V2 01/26] filter-rewriter: Add TCP state machine and fix memory leak in connection_track_table

2018-10-18 Thread Jason Wang
From: Zhang Chen We add almost full TCP state machine in filter-rewriter, except TCPS_LISTEN and some simplify in VM active close FIN states. The reason for this simplify job is because guest kernel will track the TCP status and wait 2MSL time too, if client resend the FIN packet, guest will

[Qemu-devel] [PULL V2 04/26] COLO: integrate colo compare with colo frame

2018-10-18 Thread Jason Wang
From: Zhang Chen For COLO FT, both the PVM and SVM run at the same time, only sync the state while it needs. So here, let SVM runs while not doing checkpoint, change DEFAULT_MIGRATE_X_CHECKPOINT_DELAY to 200*100. Besides, we forgot to release colo_checkpoint_semd and colo_delay_timer, fix them

Re: [Qemu-devel] [PATCH RFC v5 1/7] Fix segmentation fault when qemu_signal_init fails

2018-10-18 Thread Fei Li
Kindly ping. :) Main discuss whether adding the Error for qemu_thread_create() or not. For details, please see blow: On 10/17/2018 04:17 PM, Fei Li wrote: Sorry for the late reply! Omitted this one.. On 10/12/2018 09:26 PM, Markus Armbruster wrote: Fei Li writes: On 10/12/2018 03:56 PM,

Re: [Qemu-devel] [RFC v4 07/16] hw/arm/virt: Implement kvm_type function for 3.2 machine

2018-10-18 Thread Richard Henderson
On 10/18/18 7:30 AM, Eric Auger wrote: > +#define SZ_1G (1024ULL * 1024 * 1024) already defines GiB. r~

Re: [Qemu-devel] [PATCH v3 3/3] linux-user: Implement special usbfs ioctls.

2018-10-18 Thread Cortland Setlow Tölva
On Thu, Oct 18, 2018 at 11:48 AM Laurent Vivier wrote: > > Le 08/10/2018 à 18:35, Cortland Tölva a écrit : > > Userspace submits a USB Request Buffer to the kernel, optionally > > discards it, and finally reaps the URB. Thunk buffers from target > > to host and back. > > > > Tested by running an

[Qemu-devel] [PATCH v2 0/3] target/arm: Reduce tlb_flush overhead

2018-10-18 Thread Richard Henderson
While installing AArch64 Ubuntu into a new vm, I happened to notice that tlb_flush+memset was consuming 25% of the total runtime. This patch set reduces that overhead to 10%. Full tlb flushes are down to 11k from 1.8M, when pausing the installation at the first menu. Changes since v1: * Rename

[Qemu-devel] [PATCH v2 1/3] target/arm: Remove writefn from TTBR0_EL3

2018-10-18 Thread Richard Henderson
The EL3 version of this register does not include an ASID, and so the tlb_flush performed by vmsa_ttbr_write is not needed. Reviewed-by: Aaron Lindsay Signed-off-by: Richard Henderson --- target/arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[Qemu-devel] [PATCH v2 3/3] target/arm: Flush only the TLBs affected by TTBR*_EL1

2018-10-18 Thread Richard Henderson
Only the EL0 and EL1 TLBs are affected by the EL1 register, so flush only 2 of the 8 TLBs. In testing a boot of the Ubuntu installer to the first menu, this accounts for nearly all of the full tlb flushes: all but 11k of the 1.2M instances without the patch. Signed-off-by: Richard Henderson ---

[Qemu-devel] [PATCH v2 2/3] target/arm: Only flush tlb if ASID changes

2018-10-18 Thread Richard Henderson
Since QEMU does not implement ASIDs, changes to the ASID must flush the tlb. However, if the ASID does not change there is no reason to flush. In testing a boot of the Ubuntu installer to the first menu, this reduces the number of flushes by 30%, or nearly 600k instances. Reviewed-by: Aaron

[Qemu-devel] [RFC v3 53/56] xtensa: acquire the BQL in cpu_has_work

2018-10-18 Thread Emilio G. Cota
Soon we will call cpu_has_work without the BQL. Cc: Max Filippov Signed-off-by: Emilio G. Cota --- target/xtensa/cpu.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index d4ca35e6cc..5cb881f89b 100644 ---

[Qemu-devel] [RFC v3 56/56] cputlb: queue async flush jobs without the BQL

2018-10-18 Thread Emilio G. Cota
This yields sizable scalability improvements, as the below results show. Host: Two Intel E5-2683 v3 14-core CPUs at 2.00 GHz (Haswell) Workload: Ubuntu 18.04 ppc64 compiling the linux kernel with "make -j N", where N is the number of cores in the guest. Speedup vs a single

[Qemu-devel] [RFC v3 27/56] s390x: use cpu_reset_interrupt

2018-10-18 Thread Emilio G. Cota
From: Paolo Bonzini Cc: Cornelia Huck Cc: Richard Henderson Cc: Alexander Graf Cc: David Hildenbrand Cc: qemu-s3...@nongnu.org Reviewed-by: David Hildenbrand Reviewed-by: Richard Henderson Reviewed-by: Cornelia Huck Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota ---

[Qemu-devel] [RFC v3 39/56] s390x: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Cornelia Huck Cc: Christian Borntraeger Cc: Alexander Graf Cc: Richard Henderson Cc: David Hildenbrand Cc: qemu-s3...@nongnu.org Signed-off-by: Emilio G. Cota --- hw/intc/s390_flic.c | 2 +- target/s390x/cpu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [RFC v3 48/56] ppc: acquire the BQL in cpu_has_work

2018-10-18 Thread Emilio G. Cota
Soon we will call cpu_has_work without the BQL. Cc: David Gibson Cc: Alexander Graf Cc: qemu-...@nongnu.org Signed-off-by: Emilio G. Cota --- target/ppc/translate_init.inc.c | 77 +++-- 1 file changed, 73 insertions(+), 4 deletions(-) diff --git

[Qemu-devel] [RFC v3 51/56] riscv: acquire the BQL in cpu_has_work

2018-10-18 Thread Emilio G. Cota
Soon we will call cpu_has_work without the BQL. Cc: Michael Clark Cc: Palmer Dabbelt Cc: Sagar Karandikar Cc: Bastian Koppelmann Signed-off-by: Emilio G. Cota --- target/riscv/cpu.c | 21 - 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/target/riscv/cpu.c

[Qemu-devel] [RFC v3 0/56] per-CPU locks

2018-10-18 Thread Emilio G. Cota
Cc: Aleksandar Markovic Cc: Alexander Graf Cc: Alistair Francis Cc: Andrzej Zaborowski Cc: Anthony Green Cc: Artyom Tarasenko Cc: Aurelien Jarno Cc: Bastian Koppelmann Cc: Christian Borntraeger Cc: Chris Wulff Cc: Cornelia Huck Cc: David Gibson Cc: David Hildenbrand Cc: "Edgar E.

[Qemu-devel] [RFC v3 30/56] i386: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Richard Henderson Cc: Eduardo Habkost Signed-off-by: Emilio G. Cota --- target/i386/cpu.c| 2 +- target/i386/hax-all.c| 16 +-- target/i386/helper.c | 4 +-- target/i386/hvf/hvf.c| 6 ++-- target/i386/hvf/x86hvf.c | 32 ++

[Qemu-devel] [RFC v3 54/56] cpu: protect most CPU state with cpu->lock

2018-10-18 Thread Emilio G. Cota
Instead of taking the BQL every time we exit the exec loop, have a per-CPU lock to serialize accesses the the CPU's state. Differently from the BQL, this lock is uncontended so acquiring it is cheap. Cc: Peter Crosthwaite Cc: Richard Henderson Signed-off-by: Emilio G. Cota ---

[Qemu-devel] [RFC v3 44/56] unicore32: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Guan Xuetao Signed-off-by: Emilio G. Cota --- target/unicore32/cpu.c | 2 +- target/unicore32/softmmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/unicore32/cpu.c b/target/unicore32/cpu.c index 2b49d1ca40..65c5334551 100644 --- a/target/unicore32/cpu.c

[Qemu-devel] [RFC v3 37/56] mips: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Aurelien Jarno Cc: Aleksandar Markovic Cc: James Hogan Signed-off-by: Emilio G. Cota --- target/mips/cpu.c | 6 +++--- target/mips/kvm.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 497706b669..e30aec6851 100644 ---

[Qemu-devel] [RFC v3 47/56] cpu: call .cpu_has_work with the CPU lock held

2018-10-18 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index cd66b8828a..ca7d92c360 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -784,9 +784,16 @@ const char

[Qemu-devel] [RFC v3 55/56] cpu: add async_run_on_cpu_no_bql

2018-10-18 Thread Emilio G. Cota
Some async jobs do not need the BQL. Cc: Peter Crosthwaite Cc: Richard Henderson Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 14 ++ cpus-common.c | 39 ++- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git

[Qemu-devel] [RFC v3 34/56] hppa: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Richard Henderson Signed-off-by: Emilio G. Cota --- target/hppa/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 00bf444620..1ab4e62850 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -60,7 +60,7 @@ static void

[Qemu-devel] [RFC v3 50/56] s390: acquire the BQL in cpu_has_work

2018-10-18 Thread Emilio G. Cota
Soon we will call cpu_has_work without the BQL. Cc: Cornelia Huck Cc: Richard Henderson Cc: Alexander Graf Cc: David Hildenbrand Cc: qemu-s3...@nongnu.org Signed-off-by: Emilio G. Cota --- target/s390x/cpu.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff

[Qemu-devel] [RFC v3 40/56] alpha: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Richard Henderson Signed-off-by: Emilio G. Cota --- target/alpha/cpu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index a953897fcc..4e8965fb6c 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -42,10 +42,10

[Qemu-devel] [RFC v3 33/56] cris: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: "Edgar E. Iglesias" Signed-off-by: Emilio G. Cota --- target/cris/cpu.c| 2 +- target/cris/helper.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/cris/cpu.c b/target/cris/cpu.c index a23aba2688..3cdba581e6 100644 --- a/target/cris/cpu.c +++

[Qemu-devel] [RFC v3 35/56] lm32: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Michael Walle Signed-off-by: Emilio G. Cota --- target/lm32/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/lm32/cpu.c b/target/lm32/cpu.c index b7499cb627..1508bb6199 100644 --- a/target/lm32/cpu.c +++ b/target/lm32/cpu.c @@ -101,7 +101,7 @@ static void

[Qemu-devel] [RFC v3 49/56] mips: acquire the BQL in cpu_has_work

2018-10-18 Thread Emilio G. Cota
Soon we will call cpu_has_work without the BQL. Cc: Aurelien Jarno Cc: Aleksandar Markovic Signed-off-by: Emilio G. Cota --- target/mips/cpu.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index

[Qemu-devel] [RFC v3 41/56] moxie: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Anthony Green Signed-off-by: Emilio G. Cota --- target/moxie/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/moxie/cpu.c b/target/moxie/cpu.c index 8d67eb6727..bad92cfc61 100644 --- a/target/moxie/cpu.c +++ b/target/moxie/cpu.c @@ -33,7 +33,7 @@ static void

[Qemu-devel] [RFC v3 43/56] openrisc: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Stafford Horne Signed-off-by: Emilio G. Cota --- hw/openrisc/cputimer.c | 2 +- target/openrisc/cpu.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c index 850f88761c..739404e4f5 100644 --- a/hw/openrisc/cputimer.c

[Qemu-devel] [RFC v3 29/56] arm: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Peter Maydell Cc: qemu-...@nongnu.org Signed-off-by: Emilio G. Cota --- target/arm/cpu.c| 2 +- target/arm/helper.c | 13 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 9c5cda8eb7..7330c2dae1 100644 ---

[Qemu-devel] [RFC v3 42/56] sparc: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Signed-off-by: Emilio G. Cota --- hw/sparc64/sparc64.c | 19 +-- target/sparc/cpu.c | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/hw/sparc64/sparc64.c b/hw/sparc64/sparc64.c index 372bbd4f5b..640c4b6a30

[Qemu-devel] [RFC v3 45/56] microblaze: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: "Edgar E. Iglesias" Signed-off-by: Emilio G. Cota --- target/microblaze/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 9b546a2c18..206fdd8651 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c

[Qemu-devel] [RFC v3 38/56] nios: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Chris Wulff Cc: Marek Vasut Signed-off-by: Emilio G. Cota --- target/nios2/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index fbfaa2ce26..49a75414d3 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -36,7 +36,7

[Qemu-devel] [RFC v3 36/56] m68k: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Laurent Vivier Signed-off-by: Emilio G. Cota --- target/m68k/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 582e3a73b3..99a7eb4340 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -34,7 +34,7 @@ static void

[Qemu-devel] [RFC v3 31/56] ppc: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: David Gibson Cc: Alexander Graf Cc: qemu-...@nongnu.org Signed-off-by: Emilio G. Cota --- hw/ppc/ppc.c| 2 +- target/ppc/excp_helper.c| 2 +- target/ppc/kvm.c| 6 -- target/ppc/translate_init.inc.c | 14 +++--- 4 files changed, 13

[Qemu-devel] [RFC v3 28/56] openrisc: use cpu_reset_interrupt

2018-10-18 Thread Emilio G. Cota
From: Paolo Bonzini Cc: Stafford Horne Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota --- target/openrisc/sys_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/openrisc/sys_helper.c

[Qemu-devel] [RFC v3 17/56] s390x: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
Cc: Cornelia Huck Cc: Christian Borntraeger Cc: Alexander Graf Cc: David Hildenbrand Cc: qemu-s3...@nongnu.org Signed-off-by: Emilio G. Cota --- hw/intc/s390_flic.c| 2 +- target/s390x/cpu.c | 18 +++--- target/s390x/excp_helper.c | 2 +- target/s390x/kvm.c

[Qemu-devel] [RFC v3 24/56] ppc: use cpu_reset_interrupt

2018-10-18 Thread Emilio G. Cota
From: Paolo Bonzini Cc: David Gibson Cc: Alexander Graf Cc: qemu-...@nongnu.org Acked-by: David Gibson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota --- target/ppc/excp_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[Qemu-devel] [RFC v3 52/56] sparc: acquire the BQL in cpu_has_work

2018-10-18 Thread Emilio G. Cota
Soon we will call cpu_has_work without the BQL. Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Signed-off-by: Emilio G. Cota --- target/sparc/cpu.c | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index

[Qemu-devel] [RFC v3 26/56] i386: use cpu_reset_interrupt

2018-10-18 Thread Emilio G. Cota
From: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini Signed-off-by: Emilio G. Cota --- target/i386/hax-all.c| 4 ++-- target/i386/hvf/x86hvf.c | 8 target/i386/kvm.c| 14 +++---

[Qemu-devel] [RFC v3 22/56] cpu-exec: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
Cc: Peter Crosthwaite Cc: Richard Henderson Signed-off-by: Emilio G. Cota --- accel/tcg/cpu-exec.c | 24 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 870027d435..f37c9b1e94 100644 ---

[Qemu-devel] [RFC v3 32/56] sh4: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Aurelien Jarno Signed-off-by: Emilio G. Cota --- target/sh4/cpu.c| 2 +- target/sh4/helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index b9f393b7c7..58ea212f53 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@

[Qemu-devel] [RFC v3 46/56] accel/tcg: convert to cpu_interrupt_request

2018-10-18 Thread Emilio G. Cota
Cc: Peter Crosthwaite Cc: Richard Henderson Signed-off-by: Emilio G. Cota --- accel/tcg/cpu-exec.c | 14 +++--- accel/tcg/tcg-all.c | 12 +--- accel/tcg/translate-all.c | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/accel/tcg/cpu-exec.c

[Qemu-devel] [RFC v3 23/56] cpu: define cpu_interrupt_request helpers

2018-10-18 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 35 +++ 1 file changed, 35 insertions(+) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 3bf6767cb0..cd66b8828a 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -504,6 +504,41 @@ static

[Qemu-devel] [RFC v3 18/56] sparc: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
Cc: Fabien Chouteau Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Signed-off-by: Emilio G. Cota --- hw/sparc/leon3.c | 2 +- hw/sparc/sun4m.c | 8 hw/sparc64/sparc64.c | 4 ++-- target/sparc/helper.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git

[Qemu-devel] [RFC v3 07/56] target/m68k: rename cpu_halted to cpu_halt

2018-10-18 Thread Emilio G. Cota
To avoid a name clash with the soon-to-be-defined cpu_halted() helper. Cc: Laurent Vivier Signed-off-by: Emilio G. Cota --- target/m68k/translate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index

[Qemu-devel] [RFC v3 12/56] i386: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
Cc: Eduardo Habkost Signed-off-by: Emilio G. Cota --- target/i386/cpu.h | 2 +- target/i386/cpu.c | 2 +- target/i386/hax-all.c | 4 ++-- target/i386/helper.c | 4 ++-- target/i386/hvf/hvf.c | 8 target/i386/hvf/x86hvf.c | 4 ++-- target/i386/kvm.c

[Qemu-devel] [RFC v3 25/56] exec: use cpu_reset_interrupt

2018-10-18 Thread Emilio G. Cota
Cc: Peter Crosthwaite Cc: Richard Henderson Signed-off-by: Emilio G. Cota --- exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec.c b/exec.c index 4fd831ef06..6006902975 100644 --- a/exec.c +++ b/exec.c @@ -776,7 +776,7 @@ static int cpu_common_post_load(void

[Qemu-devel] [RFC v3 14/56] m68k: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
Cc: Laurent Vivier Signed-off-by: Emilio G. Cota --- target/m68k/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 8d09ed91c4..61ba1a6dec 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@

[Qemu-devel] [RFC v3 10/56] ppc: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
In ppce500_spin.c, acquire the lock just once to update both cpu->halted and cpu->stopped. Cc: David Gibson Cc: Alexander Graf Cc: qemu-...@nongnu.org Signed-off-by: Emilio G. Cota --- target/ppc/helper_regs.h| 2 +- hw/ppc/e500.c | 4 ++-- hw/ppc/ppc.c

[Qemu-devel] [RFC v3 20/56] gdbstub: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub.c b/gdbstub.c index c8478de8f5..a5ff50d9e7 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1305,7 +1305,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf)

[Qemu-devel] [RFC v3 15/56] mips: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
Cc: Aurelien Jarno Cc: Aleksandar Markovic Cc: James Hogan Signed-off-by: Emilio G. Cota --- hw/mips/cps.c | 2 +- hw/misc/mips_itu.c | 4 ++-- target/mips/kvm.c | 2 +- target/mips/op_helper.c | 8 target/mips/translate.c | 4 ++-- 5 files changed, 10

[Qemu-devel] [RFC v3 19/56] xtensa: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
Cc: Max Filippov Signed-off-by: Emilio G. Cota --- target/xtensa/cpu.c | 2 +- target/xtensa/helper.c| 2 +- target/xtensa/op_helper.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index a54dbe4260..d4ca35e6cc 100644

[Qemu-devel] [RFC v3 09/56] arm: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
Cc: Andrzej Zaborowski Cc: Peter Maydell Cc: qemu-...@nongnu.org Signed-off-by: Emilio G. Cota --- hw/arm/omap1.c| 4 ++-- hw/arm/pxa2xx_gpio.c | 2 +- hw/arm/pxa2xx_pic.c | 2 +- target/arm/arm-powerctl.c | 4 ++-- target/arm/cpu.c | 2 +-

[Qemu-devel] [RFC v3 04/56] cpu: make qemu_work_cond per-cpu

2018-10-18 Thread Emilio G. Cota
This eliminates the need to use the BQL to queue CPU work. While at it, give the per-cpu field a generic name ("cond") since it will soon be used for more than just queueing CPU work. Cc: Peter Crosthwaite Cc: Richard Henderson Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 6 +++---

[Qemu-devel] [RFC v3 01/56] cpu: convert queued work to a QSIMPLEQ

2018-10-18 Thread 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. Cc: Peter Crosthwaite Cc: Richard Henderson Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 6 +++--- cpus-common.c | 25 - cpus.c

[Qemu-devel] [RFC v3 16/56] riscv: convert to cpu_halted

2018-10-18 Thread Emilio G. Cota
Cc: Michael Clark Cc: Palmer Dabbelt Cc: Sagar Karandikar Cc: Bastian Koppelmann Cc: Alistair Francis Signed-off-by: Emilio G. Cota --- target/riscv/op_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/riscv/op_helper.c b/target/riscv/op_helper.c index

  1   2   3   4   5   >