[Qemu-devel] [PULL 06/21] spapr: Simplify unplug path

2017-07-16 Thread David Gibson
spapr_lmb_release() and spapr_core_release() call hotplug_handler_unplug() which after a bunch of indirection calls spapr_memory_unplug() or spapr_core_unplug(). But we already know which is the appropriate thing to call here, so we can just fold it directly into the release function. Once that's

[Qemu-devel] [PULL 00/21] ppc-for-2.10 queue 20170717

2017-07-16 Thread David Gibson
The following changes since commit 4871b51b9241b10f4fd8e04bbb21577886795e25: vmgenid-test: use boot-sector infrastructure (2017-07-14 17:03:03 +0100) are available in the git repository at: git://github.com/dgibson/qemu.git tags/ppc-for-2.10-20170717 for you to fetch changes up to 346ebfc6f

[Qemu-devel] [PULL 17/21] pseries: Enable HPT resizing for 2.10

2017-07-16 Thread David Gibson
We've now implemented a PAPR extensions which allows PAPR guests (i.e. "pseries" machine type) to resize their hash page table during runtime. However, that extension is only enabled if explicitly chosen on the command line. This patch enables it by default for spapr-2.10, but leaves it disabled

[Qemu-devel] [PULL 01/21] spapr: Remove unnecessary instance_size specifications from DRC subtypes

2017-07-16 Thread David Gibson
All the DRC subtypes explicitly list instance_size in TypeInfo (all as sizeof(sPAPRDRConnector). This isn't necessary, since if it's not listed it will be derived from the parent type. Worse, this is dangerous, because if a subtype is changed in future to have a larger structure, then subtypes of

[Qemu-devel] [PULL 07/21] spapr: Abort on delete failure in spapr_drc_release()

2017-07-16 Thread David Gibson
We currently ignore errors from the object_property_del() in spapr_drc_release(). But the only way that could fail is if the property doesn't exist, in which case it's a bug that we're in spapr_drc_release() at all. So change from ignoring to abort()ing on errors. Signed-off-by: David Gibson --

[Qemu-devel] [PULL 20/21] spapr: fix memory leak in spapr_core_pre_plug()

2017-07-16 Thread David Gibson
From: Greg Kurz In case of error, we must ensure the dynamically allocated base_core_type is freed, like it is done everywhere else in this function. This is a regression introduced in QEMU 2.9 by commit 8149e2992f78. Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- hw/ppc/spapr.c |

[Qemu-devel] [PULL 04/21] spapr: Treat devices added before inbound migration as coldplugged

2017-07-16 Thread David Gibson
From: Laurent Vivier When migrating a guest which has already had devices hotplugged, libvirt typically starts the destination qemu with -incoming defer, adds those hotplugged devices with qmp, then initiates the incoming migration. This causes problems for the management of spapr DRC state. Be

Re: [Qemu-devel] [PATCH v2 1/8] qemu-error: introduce error_report_nolf

2017-07-16 Thread Ladi Prosek
On Fri, Jul 14, 2017 at 12:41 PM, Daniel P. Berrange wrote: > On Thu, Jul 13, 2017 at 02:32:06PM +0100, Stefan Hajnoczi wrote: >> On Thu, Jul 13, 2017 at 01:02:30PM +0200, Ladi Prosek wrote: >> > +/* >> > + * Print an error message to current monitor if we have one, else to >> > stderr. >> > + *

Re: [Qemu-devel] [Question] Seabios HANGs when mmio wirte in a nested vmware host wtih virito-scsi controller

2017-07-16 Thread Xiao Guangrong
On 07/17/2017 11:13 AM, Xulei (Stone) wrote: |--virtio_queue_empty Then, kmod falls in infinite loop in handle EPT_MISCONFIG. As far as i know, when kvm enters guest after handling EPT_MISCONFIG, seabios should return from mmio write and wait for virtio backend(q

Re: [Qemu-devel] [PATCH v2 1/8] qemu-error: introduce error_report_nolf

2017-07-16 Thread Ladi Prosek
On Sat, Jul 15, 2017 at 7:50 AM, Markus Armbruster wrote: > Stefan Hajnoczi writes: > >> On Thu, Jul 13, 2017 at 03:48:02PM +0200, Ladi Prosek wrote: >>> On Thu, Jul 13, 2017 at 3:32 PM, Stefan Hajnoczi >>> wrote: >>> > On Thu, Jul 13, 2017 at 01:02:30PM +0200, Ladi Prosek wrote: >>> >> +/* >>>

Re: [Qemu-devel] [PATCH V2 1/4] net/colo-compare.c: Add checkpoint min period to optimize performance

2017-07-16 Thread Zhang Chen
On 07/14/2017 11:22 AM, Jason Wang wrote: On 2017年07月13日 13:52, Zhang Chen wrote: If colo-compare find out the first different packet that means the following packet almost is different. we needn't do a lot of checkpoint in this time, so we set the no-need-checkpoint peroid, default just set

[Qemu-devel] Status and RFC of patchew testings on QEMU

2017-07-16 Thread Fam Zheng
Hi all, Today I've included a fourth type of the automatic patchew replies: FreeBSD. So far we have these tests running by patchew on each patch series: * Docker tests Basically it is make docker-test-quick@centos6 \ docker-test-build@min-glib \ docker-tes

Re: [Qemu-devel] [PATCH] target/ppc: fix CPU hotplug when radix is enabled (TCG)

2017-07-16 Thread Suraj Jitindar Singh
On Fri, 2017-07-14 at 18:13 +0200, Cédric Le Goater wrote: > But when a guest initializes radix mode, it issues a > H_REGISTER_PROC_TBL > to update the LPCR of all CPUs. Hot-plugged CPUs inherit from the > same > setting under KVM but not under TCG. So, Let's check for radix and > update > the defa

Re: [Qemu-devel] New documentation for the LatticeMicro32 target

2017-07-16 Thread Michael Walle
Am 2017-07-09 17:39, schrieb Programmingkid: I just made a documentation page for the LatticeMicro32 target. I need to know its current status, how much of this system is implemented, what software runs on it. If anyone could supply more information that would be appreciated. Pictures of this tar

Re: [Qemu-devel] [PATCH v5 2/3] ACPI: Add APEI GHES Table Generation support

2017-07-16 Thread gengdongjiu
Laszlo, Thanks for the comments. On 2017/7/14 3:41, Laszlo Ersek wrote: snip > > snip > >>> + >>> +error_source_table = (AcpiHardwareErrorSourceTable *)(table_data->data >>> ++ table_data->len - buffer->len); >>> +error_source_table->error_source_count = >>> G

[Qemu-devel] [Bug 1181796] Re: Qemu locks up when incoming serial fills up

2017-07-16 Thread Launchpad Bug Tracker
[Expired for QEMU because there has been no activity for 60 days.] ** Changed in: qemu Status: Incomplete => Expired -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1181796 Title: Qemu locks

Re: [Qemu-devel] [PATCH] qga-win32: remove a redundancy code

2017-07-16 Thread Philippe Mathieu-Daudé
Cc'ing qemu-trivial On 07/15/2017 07:44 PM, Peng Hao wrote: In the first line of run_agent,it has set ga_state = s,don't need set ga_state = s again behind. Signed-off-by: Peng Hao Reviewed-by: Philippe Mathieu-Daudé --- qga/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[Qemu-devel] [PATCH v3] spapr: disable decrementer during reset

2017-07-16 Thread Nikunj A Dadhania
Rebooting a SMP TCG guest is broken for both single/multi threaded TCG. When reset happens, all the CPUs are in halted state. First CPU is brought out of reset and secondary CPUs would be initialized by the guest kernel using a rtas call start-cpu. However, in case of TCG, decrementer interrupts

Re: [Qemu-devel] [Qemu-arm] [PATCH v5 2/6] armv7m: Convert armv7m.memory to DEFINE_PROP_LINK

2017-07-16 Thread Philippe Mathieu-Daudé
On 07/16/2017 11:38 PM, Fam Zheng wrote: Signed-off-by: Fam Zheng Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/armv7m.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 8efc4e8..1c837da 100644 --- a/hw/arm/armv7m.c +++

Re: [Qemu-devel] [Qemu-arm] [PATCH v5 5/6] xilinx_axienet: Convert to DEFINE_PROP_LINK

2017-07-16 Thread Philippe Mathieu-Daudé
On 07/16/2017 11:38 PM, Fam Zheng wrote: Signed-off-by: Fam Zheng Reviewed-by: Philippe Mathieu-Daudé --- hw/net/xilinx_axienet.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 5ffa739..d4c2c89

Re: [Qemu-devel] [PATCH v5 6/6] xilinx_axidma: Convert to DEFINE_PROP_LINK

2017-07-16 Thread Philippe Mathieu-Daudé
On 07/16/2017 11:38 PM, Fam Zheng wrote: Signed-off-by: Fam Zheng Reviewed-by: Philippe Mathieu-Daudé --- hw/dma/xilinx_axidma.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 3987b5f..9b48103 10

Re: [Qemu-devel] [PATCH v5 4/6] xlnx_zynqmp: Convert to DEFINE_PROP_LINK

2017-07-16 Thread Philippe Mathieu-Daudé
On 07/16/2017 11:38 PM, Fam Zheng wrote: Signed-off-by: Fam Zheng Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/xlnx-zynqmp.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 64f52f8..cd8a4aa 100644 --- a/hw/arm

Re: [Qemu-devel] [Qemu-arm] [PATCH v5 1/6] armv7m: Convert bitband.source-mamory to DEFINE_PROP_LINK

2017-07-16 Thread Philippe Mathieu-Daudé
On 07/16/2017 11:38 PM, Fam Zheng wrote: Signed-off-by: Fam Zheng Reviewed-by: Philippe Mathieu-Daudé --- hw/arm/armv7m.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index c8a11f2..8efc4e8 100644 --- a/hw/arm/armv7m.c +++

[Qemu-devel] [PULL 15/15] travis: add no-TCG build

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini It's fairly easy for --disable-tcg to bitrot. Test it in our CI. Signed-off-by: Paolo Bonzini Message-Id: <20170714093016.10897-1-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml

[Qemu-devel] [PULL 10/15] sheepdog: add queue_lock

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini Message-Id: <20170629132749.997-11-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/sheepdog.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PULL 14/15] docker.py: Improve subprocess exit code handling

2017-07-16 Thread Fam Zheng
A few error handlings are missing because we ignore the subprocess exit code, for example "docker build" errors are currently ignored. Introduce _do_check() aside the existing _do() method and use it in a few places. Signed-off-by: Fam Zheng Message-Id: <20170712075528.22770-3-f...@redhat.com> T

[Qemu-devel] [PULL 09/15] qed: protect table cache with CoMutex

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini This makes the driver thread-safe. The CoMutex is dropped temporarily while accessing the data clusters or the backing file. Signed-off-by: Paolo Bonzini Message-Id: <20170629132749.997-10-pbonz...@redhat.com> Reviewed-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off

[Qemu-devel] [PULL 13/15] docker.py: Drop infile parameter

2017-07-16 Thread Fam Zheng
The **kwargs can do this just well. Signed-off-by: Fam Zheng Message-Id: <20170712075528.22770-2-f...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Fam Zheng --- tests/docker/docker.py | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/docker/docke

[Qemu-devel] [PULL 04/15] vpc: make it thread-safe

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini Message-Id: <20170629132749.997-5-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/vpc.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deleti

[Qemu-devel] [PULL 11/15] ssh: support I/O from any AioContext

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini The coroutine may run in a different AioContext, causing the fd handler to busy wait. Fix this by resetting the handler in restart_coroutine, before the coroutine is restarted. Reviewed-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini Message-Id: <2

[Qemu-devel] [PULL 06/15] qed: move tail of qed_aio_write_main to qed_aio_write_{cow, alloc}

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini This part is never called for in-place writes, move it away to avoid the "backwards" coding style typical of callback-based code. Reviewed-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini Message-Id: <20170629132749.997-7-pbonz...@redhat.com> Signed-

[Qemu-devel] [PULL 03/15] vdi: make it thread-safe

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini The VirtualBox driver is using a mutex to order all allocating writes, but it is not protecting accesses to the bitmap because they implicitly happen under the AioContext mutex. Change this to use a CoRwlock explicitly. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi

[Qemu-devel] [PULL 05/15] vvfat: make it thread-safe

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini Message-Id: <20170629132749.997-6-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/vvfat.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff -

[Qemu-devel] [PULL 02/15] coroutine-lock: add qemu_co_rwlock_downgrade and qemu_co_rwlock_upgrade

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini These functions are more efficient in the presence of contention. qemu_co_rwlock_downgrade also guarantees not to block, which may be useful in some algorithms too. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini Me

[Qemu-devel] [PULL 08/15] qed: introduce bdrv_qed_init_state

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini This will be used in the next patch, which will call bdrv_qed_do_open with a CoMutex taken. bdrv_qed_init_state provides a nice place to initialize it. Signed-off-by: Paolo Bonzini Message-Id: <20170629132749.997-9-pbonz...@redhat.com> Reviewed-by: Eric Blake Reviewed-by:

[Qemu-devel] [PULL 12/15] docker: Don't enable networking as a side-effect of DEBUG=1

2017-07-16 Thread Fam Zheng
From: "Daniel P. Berrange" When trying to debug problems with tests it is natural to set DEBUG=1 when starting the docker environment. Unfortunately this has a side-effect of enabling an eth0 network interface in the container, which changes the operating environment of the test suite. IOW tests

[Qemu-devel] [PULL 07/15] block: invoke .bdrv_drain callback in coroutine context and from AioContext

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini This will let the callback take a CoMutex in the next patch. Reviewed-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini Message-Id: <20170629132749.997-8-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/io.c| 42 ++

[Qemu-devel] [PULL 01/15] qcow2: call CoQueue APIs under CoMutex

2017-07-16 Thread Fam Zheng
From: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini Message-Id: <20170629132749.997-2-pbonz...@redhat.com> Signed-off-by: Fam Zheng --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --gi

[Qemu-devel] [PULL 00/15] Block and testing patches

2017-07-16 Thread Fam Zheng
The following changes since commit 4871b51b9241b10f4fd8e04bbb21577886795e25: vmgenid-test: use boot-sector infrastructure (2017-07-14 17:03:03 +0100) are available in the git repository at: git://github.com/famz/qemu.git tags/block-and-testing-pull-request for you to fetch changes up to 978

Re: [Qemu-devel] [PATCH 08/11] qed: introduce bdrv_qed_init_state

2017-07-16 Thread Fam Zheng
On Thu, 06/29 15:27, Paolo Bonzini wrote: > diff --git a/block/qed.c b/block/qed.c > index db390efdbd..8228a50f68 100644 > --- a/block/qed.c > +++ b/block/qed.c > @@ -363,6 +363,15 @@ static void coroutine_fn > bdrv_qed_co_drain(BlockDriverState *bs) > } > } > > +static void bdrv_qed_init_

Re: [Qemu-devel] [PATCH 0/3] migration: export cap/params to qdev props

2017-07-16 Thread Peter Xu
On Fri, Jul 14, 2017 at 12:57:15PM -0300, Eduardo Habkost wrote: > On Fri, Jul 14, 2017 at 12:23:06PM +0800, Peter Xu wrote: > > On Wed, Jul 12, 2017 at 08:02:40PM +0100, Dr. David Alan Gilbert wrote: > > > * Peter Xu (pet...@redhat.com) wrote: > > > > We have the MigrationState as QDev now (which

[Qemu-devel] [Question] Seabios HANGs when mmio wirte in a nested vmware host wtih virito-scsi controller

2017-07-16 Thread Xulei (Stone)
Hello all, Recently, I met a werid question when i run a VM in the following platfrom: Vmware Vsphere 6.0/6.5 |-- centos 7.3 nested VM (with qemu 2.8, kmod 4.4.11, seabios 1.10) |-- VM (with virtio-scsi controller, modern mode) VM MUST hang in seabios when try to mmio write during virt

Re: [Qemu-devel] [PATCH 0/3] migration: export cap/params to qdev props

2017-07-16 Thread Peter Xu
On Fri, Jul 14, 2017 at 05:32:10PM +0100, Dr. David Alan Gilbert wrote: > * Eduardo Habkost (ehabk...@redhat.com) wrote: > > On Fri, Jul 14, 2017 at 01:04:23PM +0800, Peter Xu wrote: > > > On Wed, Jul 12, 2017 at 04:05:58PM -0300, Eduardo Habkost wrote: > > > > On Wed, Jul 12, 2017 at 02:53:40PM +0

Re: [Qemu-devel] [RFC 16/29] vhost+postcopy: Stash RAMBlock and offset

2017-07-16 Thread Peter Xu
On Fri, Jul 14, 2017 at 06:15:54PM +0100, Dr. David Alan Gilbert wrote: > * Peter Xu (pet...@redhat.com) wrote: > > On Wed, Jun 28, 2017 at 08:00:34PM +0100, Dr. David Alan Gilbert (git) > > wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > Stash the RAMBlock and offset for later use looki

[Qemu-devel] [PATCH v5 6/6] xilinx_axidma: Convert to DEFINE_PROP_LINK

2017-07-16 Thread Fam Zheng
Signed-off-by: Fam Zheng --- hw/dma/xilinx_axidma.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index 3987b5f..9b48103 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -562,18 +562,6 @@ st

[Qemu-devel] [PATCH v5 2/6] armv7m: Convert armv7m.memory to DEFINE_PROP_LINK

2017-07-16 Thread Fam Zheng
Signed-off-by: Fam Zheng --- hw/arm/armv7m.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 8efc4e8..1c837da 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -132,12 +132,6 @@ static void armv7m_instance_init(Object *obj)

[Qemu-devel] [PATCH v5 5/6] xilinx_axienet: Convert to DEFINE_PROP_LINK

2017-07-16 Thread Fam Zheng
Signed-off-by: Fam Zheng --- hw/net/xilinx_axienet.c | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c index 5ffa739..d4c2c89 100644 --- a/hw/net/xilinx_axienet.c +++ b/hw/net/xilinx_axienet.c @@ -989,18 +989,6

[Qemu-devel] [PATCH v5 0/6] arm: Make use of DEFINE_PROP_LINK

2017-07-16 Thread Fam Zheng
This is the arm part that was left out from: https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg04006.html Make use of the new DEFINE_PROP_LINK, in favor of open coded the object_property_add_link. The advantage of it is the property now get reflected in the info qtree output, for a bit mor

[Qemu-devel] [PATCH v5 1/6] armv7m: Convert bitband.source-mamory to DEFINE_PROP_LINK

2017-07-16 Thread Fam Zheng
Signed-off-by: Fam Zheng --- hw/arm/armv7m.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index c8a11f2..8efc4e8 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -97,12 +97,6 @@ static void bitband_init(Object *obj) BitBan

[Qemu-devel] [PATCH v5 3/6] gicv3: Convert to DEFINE_PROP_LINK

2017-07-16 Thread Fam Zheng
Signed-off-by: Fam Zheng --- hw/intc/arm_gicv3_its_kvm.c | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c index 1f8991b..39903d5 100644 --- a/hw/intc/arm_gicv3_its_kvm.c +++ b/hw/intc/arm_gicv3_its_k

[Qemu-devel] [PATCH v5 4/6] xlnx_zynqmp: Convert to DEFINE_PROP_LINK

2017-07-16 Thread Fam Zheng
Signed-off-by: Fam Zheng --- hw/arm/xlnx-zynqmp.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c index 64f52f8..cd8a4aa 100644 --- a/hw/arm/xlnx-zynqmp.c +++ b/hw/arm/xlnx-zynqmp.c @@ -140,11 +140,6 @@ static void xlnx_zynqmp

Re: [Qemu-devel] [RFC v2 0/8] VIRTIO-IOMMU device

2017-07-16 Thread Tian, Kevin
> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > Sent: Friday, July 14, 2017 7:26 PM > > On 14/07/17 08:20, Tian, Kevin wrote: > >> From: Jean-Philippe Brucker [mailto:jean-philippe.bruc...@arm.com] > >> Sent: Friday, July 7, 2017 11:15 PM > >> > >> On 07/07/17 07:21, Tian, K

Re: [Qemu-devel] investigating TPM for OVMF-on-QEMU

2017-07-16 Thread Yao, Jiewen
Hi Laszlo This is a good summary. One minor comment is: 1) Tcg2Pei/Dxe are arechitecture driver. We do not expect a platform modify them. 2) Tcg2ConfigPei/Dxe are platform sample driver. A platform may have its own version based upon platform requirement. For example, if a platform supports fTP

Re: [Qemu-devel] [PATCH v3 4/4] intel_iommu: implement mru list for iotlb

2017-07-16 Thread Peter Xu
On Fri, Jul 14, 2017 at 03:28:09PM +0800, Jason Wang wrote: > > > On 2017年07月14日 12:32, Peter Xu wrote: > >On Thu, Jul 13, 2017 at 04:48:42PM +0800, Jason Wang wrote: > >> > >>On 2017年07月12日 16:13, Peter Xu wrote: > >>>It is not wise to disgard all the IOTLB cache when cache size reaches > >>>max

Re: [Qemu-devel] [RFC v2 6/8] virtio-iommu: Implement the translation and commands

2017-07-16 Thread Peter Xu
On Fri, Jul 14, 2017 at 12:25:13PM +0100, Jean-Philippe Brucker wrote: > Hi Peter, > > On 14/07/17 03:17, Peter Xu wrote: > > > > [...] > > > >> static int virtio_iommu_unmap(VirtIOIOMMU *s, > >> @@ -133,10 +227,64 @@ static int virtio_iommu_unmap(VirtIOIOMMU *s, > >> uint64_t virt_addr = l

Re: [Qemu-devel] [RFC v2 6/8] virtio-iommu: Implement the translation and commands

2017-07-16 Thread Peter Xu
On Fri, Jul 14, 2017 at 06:40:34AM +, Bharat Bhushan wrote: > Hi Peter, > > > -Original Message- > > From: Peter Xu [mailto:pet...@redhat.com] > > Sent: Friday, July 14, 2017 7:48 AM > > To: Eric Auger > > Cc: eric.auger@gmail.com; peter.mayd...@linaro.org; > > alex.william...@red

Re: [Qemu-devel] [PATCH] target/ppc: fix CPU hotplug when radix is enabled (TCG)

2017-07-16 Thread David Gibson
On Fri, Jul 14, 2017 at 06:13:58PM +0200, Cédric Le Goater wrote: > But when a guest initializes radix mode, it issues a H_REGISTER_PROC_TBL > to update the LPCR of all CPUs. Hot-plugged CPUs inherit from the same > setting under KVM but not under TCG. So, Let's check for radix and update > the def

Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-16 Thread Aurelien Jarno
On 2017-07-16 11:59, Richard Henderson wrote: > On 07/16/2017 11:43 AM, Aurelien Jarno wrote: > > Indeed, if the same atomic code is used often it might be better to have > > it cached. That said it's only true for TB that are recognized, as IIRC > > TB with the exclusive lock are not cached. > >

Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-16 Thread Richard Henderson
On 07/16/2017 11:43 AM, Aurelien Jarno wrote: Indeed, if the same atomic code is used often it might be better to have it cached. That said it's only true for TB that are recognized, as IIRC TB with the exclusive lock are not cached. At the moment they are not. But in Emilio's multi-threaded t

Re: [Qemu-devel] [PATCH v2 01/27] target/sh4: Use cmpxchg for movco

2017-07-16 Thread Aurelien Jarno
On 2017-07-16 01:22, Aurelien Jarno wrote: > On 2017-07-06 16:20, Richard Henderson wrote: > > As for other targets, cmpxchg isn't quite right for ll/sc, > > suffering from an ABA race, but is sufficient to implement > > portable atomic operations. > > > > Signed-off-by: Richard Henderson > > ---

Re: [Qemu-devel] [PATCH v2 06/27] target/sh4: Handle user-space atomics

2017-07-16 Thread Aurelien Jarno
On 2017-07-16 09:35, Richard Henderson wrote: > On 07/16/2017 05:18 AM, Aurelien Jarno wrote: > > That said for further improvements did you consider decoding the gUSA > > section in a helper. It might avoid having to emulate the atomic > > sequence with 3 TBs in the worst case (the original one, t

[Qemu-devel] [PATCHv3 2/2] pci: add reserved slot check to do_pci_register_device()

2017-07-16 Thread Mark Cave-Ayland
Add a new slot_reserved_mask bitmask to PCIBus indicating whether or not each PCI slot on the bus is reserved. Ensure that it is initialised to zero to maintain the existing behaviour that all slots are available by default, and add the additional check with appropriate error reporting to do_pci_re

[Qemu-devel] [PATCH v2 34/45] tcg: define tcg_init_ctx and make tcg_ctx a pointer

2017-07-16 Thread Emilio G. Cota
Groundwork for supporting multiple TCG contexts. The core of this patch is this change to tcg/tcg.h: > -extern TCGContext tcg_ctx; > +extern TCGContext tcg_init_ctx; > +extern TCGContext *tcg_ctx; Note that for now we set *tcg_ctx to whatever TCGContext is passed to tcg_context_init -- in this c

[Qemu-devel] [PATCH v2 43/45] tcg: introduce regions to split code_gen_buffer

2017-07-16 Thread Emilio G. Cota
This is groundwork for supporting multiple TCG contexts. The naive solution here is to split code_gen_buffer statically among the TCG threads; this however results in poor utilization if translation needs are different across TCG threads. What we do here is to add an extra layer of indirection, a

[Qemu-devel] [PATCH v2 45/45] tcg: enable multiple TCG contexts in softmmu

2017-07-16 Thread Emilio G. Cota
This enables parallel TCG code generation. However, we do not take advantage of it yet since tb_lock is still held during tb_gen_code. In user-mode we use a single TCG context; see the documentation added to tcg_region_init for the rationale. Note that targets do not need any conversion: targets

[Qemu-devel] [PATCH v2 28/45] translate-all: use a binary search tree to track TBs in TBContext

2017-07-16 Thread Emilio G. Cota
This is a prerequisite for supporting multiple TCG contexts, since we will have threads generating code in separate regions of code_gen_buffer. For this we need a new field (.size) in struct tb_tc to keep track of the size of the translated code. This field adds a 4-byte hole to the struct (and th

[Qemu-devel] [PATCHv3 1/2] pci: move check for existing devfn into new pci_bus_devfn_available() helper

2017-07-16 Thread Mark Cave-Ayland
Also touch up the logic in do_pci_register_device() accordingly. Signed-off-by: Mark Cave-Ayland --- hw/pci/pci.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 0c6f74a..efc9c86 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -9

[Qemu-devel] [PATCH v2 40/45] osdep: introduce qemu_mprotect_rwx/none

2017-07-16 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- include/qemu/osdep.h | 2 ++ util/osdep.c | 40 2 files changed, 42 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 3cb36e6..dcecfbc 100644 --- a/include/qemu/osdep.h +++ b/include/qe

[Qemu-devel] [PATCH v2 36/45] tcg: dynamically allocate optimizer globals + fold into TCGContext

2017-07-16 Thread Emilio G. Cota
Groundwork for supporting multiple TCG contexts. Signed-off-by: Emilio G. Cota --- tcg/tcg.h | 12 tcg/optimize.c | 40 +++- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/tcg/tcg.h b/tcg/tcg.h index 569f823..175d4de 100644

[Qemu-devel] [PATCH v2 38/45] tcg: distribute profiling counters across TCGContext's

2017-07-16 Thread Emilio G. Cota
This is groundwork for supporting multiple TCG contexts. To avoid scalability issues when profiling info is enabled, this patch makes the profiling info counters distributed via the following changes: 1) Consolidate profile info into its own struct, TCGProfile, which TCGContext also includes.

[Qemu-devel] [PATCH v2 44/45] translate-all: do not allocate a guard page for code_gen_buffer

2017-07-16 Thread Emilio G. Cota
TCG regions already have a guard page. Signed-off-by: Emilio G. Cota --- accel/tcg/translate-all.c | 47 --- 1 file changed, 12 insertions(+), 35 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c30d400..98aa63e 10

[Qemu-devel] [PATCH v2 15/45] target/arm: check CF_PARALLEL instead of parallel_cpus

2017-07-16 Thread Emilio G. Cota
Thereby decoupling the resulting translated code from the current state of the system. Signed-off-by: Emilio G. Cota --- target/arm/helper-a64.h| 4 target/arm/helper-a64.c| 38 -- target/arm/op_helper.c | 7 --- target/arm/translate-a64

[Qemu-devel] [PATCH v2 27/45] exec-all: extract tb->tc_* into a separate struct tc_tb

2017-07-16 Thread Emilio G. Cota
In preparation for adding tc.size to be able to keep track of TB's using the binary search tree implementation from glib. Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 20 ++-- accel/tcg/cpu-exec.c | 6 +++--- accel/tcg/translate-all.c | 20 ++---

[Qemu-devel] [PATCH v2 42/45] tcg: define TCG_HIGHWATER

2017-07-16 Thread Emilio G. Cota
Will come in handy very soon. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota --- tcg/tcg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 5afb80a..e8aae1f 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -115,6

[Qemu-devel] [PATCH v2 41/45] translate-all: use qemu_protect_rwx/none helpers

2017-07-16 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- accel/tcg/translate-all.c | 49 ++- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index fd3e4a0..913b1c5 100644 --- a/accel/tcg/translate-all.c +++

[Qemu-devel] [PATCH v2 16/45] target/hppa: check CF_PARALLEL instead of parallel_cpus

2017-07-16 Thread Emilio G. Cota
Thereby decoupling the resulting translated code from the current state of the system. Signed-off-by: Emilio G. Cota --- target/hppa/helper.h| 2 ++ target/hppa/op_helper.c | 32 target/hppa/translate.c | 12 ++-- 3 files changed, 40 insertions(+), 6

[Qemu-devel] [PATCHv3 0/2] pci: allow PCI bus slots to be marked as reserved

2017-07-16 Thread Mark Cave-Ayland
For some machines it is impossible to plug devices into a particular PCI bus slot, e.g. for a real Ultra 5 there are 2 PCI bridges attached to the root bus behind which all devices must be plugged. Ignoring this rule will cause problems with interrupt routing since the interrupt numbers are calcula

[Qemu-devel] [PATCH v2 39/45] osdep: move qemu_real_host_page_size/mask to osdep

2017-07-16 Thread Emilio G. Cota
These only depend on the host and therefore belong in the common osdep, not in a target-dependent object. Signed-off-by: Emilio G. Cota --- include/exec/cpu-all.h | 2 -- include/qemu/osdep.h | 8 exec.c | 5 + util/osdep.c | 9 + 4 files changed,

[Qemu-devel] [PATCH v2 17/45] target/i386: check CF_PARALLEL instead of parallel_cpus

2017-07-16 Thread Emilio G. Cota
Thereby decoupling the resulting translated code from the current state of the system. Signed-off-by: Emilio G. Cota --- target/i386/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/translate.c b/target/i386/translate.c index 291c577..c5e4d77 100644

[Qemu-devel] [PATCH v2 12/45] tcg: remove addr argument from lookup_tb_ptr

2017-07-16 Thread Emilio G. Cota
It is unlikely that we will ever want to call this helper passing an argument other than the current PC. So just remove the argument, and use the pc we already get from cpu_get_tb_cpu_state. This change paves the way to having a common "tb_lookup" function. Signed-off-by: Emilio G. Cota --- tcg

[Qemu-devel] [PATCH v2 18/45] target/m68k: check CF_PARALLEL instead of parallel_cpus

2017-07-16 Thread Emilio G. Cota
Thereby decoupling the resulting translated code from the current state of the system. Signed-off-by: Emilio G. Cota --- target/m68k/helper.h| 2 ++ target/m68k/op_helper.c | 32 target/m68k/translate.c | 12 ++-- 3 files changed, 40 insertions(+), 6

[Qemu-devel] [PATCH v2 24/45] exec-all: introduce TB_PAGE_ADDR_FMT

2017-07-16 Thread Emilio G. Cota
And fix the following warning when DEBUG_TB_INVALIDATE is enabled in translate-all.c: CC mipsn32-linux-user/accel/tcg/translate-all.o /data/src/qemu/accel/tcg/translate-all.c: In function ‘tb_alloc_page’: /data/src/qemu/accel/tcg/translate-all.c:1201:16: error: format ‘%lx’ expects argumen

[Qemu-devel] [PATCH v2 19/45] target/s390x: check CF_PARALLEL instead of parallel_cpus

2017-07-16 Thread Emilio G. Cota
Thereby decoupling the resulting translated code from the current state of the system. Signed-off-by: Emilio G. Cota --- target/s390x/helper.h | 3 +++ target/s390x/mem_helper.c | 50 +++ target/s390x/translate.c | 20 +++ 3 files

[Qemu-devel] [PATCH v2 32/45] tcg: take tb_ctx out of TCGContext

2017-07-16 Thread Emilio G. Cota
Groundwork for supporting multiple TCG contexts. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota --- include/exec/tb-context.h | 2 ++ tcg/tcg.h | 2 -- accel/tcg/cpu-exec.c | 2 +- accel/tcg/translate-all.c | 57 +++

[Qemu-devel] [PATCH v2 35/45] gen-icount: fold exitreq_label into TCGContext

2017-07-16 Thread Emilio G. Cota
Groundwork for supporting multiple TCG contexts. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota --- include/exec/gen-icount.h | 7 +++ tcg/tcg.h | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/exec/gen-ic

[Qemu-devel] [PATCH v2 30/45] translate-all: report correct avg host TB size

2017-07-16 Thread Emilio G. Cota
Since commit 6e3b2bfd6 ("tcg: allocate TB structs before the corresponding translated code") we are not fully utilizing code_gen_buffer for translated code, and therefore are incorrectly reporting the amount of translated code as well as the average host TB size. Address this by: - Making the cons

[Qemu-devel] [PATCH v2 33/45] tcg: take .helpers out of TCGContext

2017-07-16 Thread Emilio G. Cota
Groundwork for supporting multiple TCG contexts. The hash table becomes read-only after it is filled in, so we can save space by keeping just a global pointer to it. Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota --- tcg/tcg.h | 2 -- tcg/tcg.c | 10 +++

[Qemu-devel] [PATCH v2 25/45] translate-all: define and use DEBUG_TB_INVALIDATE_GATE

2017-07-16 Thread Emilio G. Cota
This gets rid of an ifdef check while ensuring that the debug code is compiled, which prevents bit rot. Suggested-by: Alex Bennée Signed-off-by: Emilio G. Cota --- accel/tcg/translate-all.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/accel/tcg/translate-all.

[Qemu-devel] [PATCH v2 29/45] exec-all: rename tb_free to tb_remove

2017-07-16 Thread Emilio G. Cota
We don't really free anything in this function anymore; we just remove the TB from the binary search tree. Suggested-by: Alex Bennée Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 2 +- accel/tcg/cpu-exec.c | 2 +- accel/tcg/translate-all.c | 6 +++--- 3 files changed, 5 ins

[Qemu-devel] [PATCH v2 14/45] tcg: define CF_PARALLEL and use it for TB hashing

2017-07-16 Thread Emilio G. Cota
This will enable us to decouple code translation from the value of parallel_cpus at any given time. It will also help us minimize TB flushes when generating code via EXCP_ATOMIC. Note that the declaration of parallel_cpus is brought to exec-all.h to be able to define there the inlines. The inlines

[Qemu-devel] [PATCH v2 09/45] tcg/mips: constify tcg_target_callee_save_regs

2017-07-16 Thread Emilio G. Cota
Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Emilio G. Cota --- tcg/mips/tcg-target.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/mips/tcg-target.inc.c b/tcg/mips/tcg-target.inc.c index 85756b8..56db2

[Qemu-devel] [PATCH v2 26/45] translate-all: define and use DEBUG_TB_CHECK_GATE

2017-07-16 Thread Emilio G. Cota
This prevents bit rot by ensuring the debug code is compiled when building a user-mode target. Unfortunately the helpers are user-mode-only so we cannot fully get rid of the ifdef checks. Add a comment to explain this. Suggested-by: Alex Bennée Signed-off-by: Emilio G. Cota --- accel/tcg/trans

[Qemu-devel] [PATCH v2 05/45] exec-all: fix typos in TranslationBlock's documentation

2017-07-16 Thread Emilio G. Cota
Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 887d7b3..28e3a24 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-a

[Qemu-devel] [PATCH v2 21/45] tcg: check CF_PARALLEL instead of parallel_cpus

2017-07-16 Thread Emilio G. Cota
Thereby decoupling the resulting translated code from the current state of the system. The tb->cflags field is not passed to tcg generation functions. So we add a bit to TCGContext, storing there whether CF_PARALLEL is set before translating every TB. Most architectures have <= 32 registers, whic

[Qemu-devel] [PATCH v2 11/45] exec-all: bring tb->invalid into tb->cflags

2017-07-16 Thread Emilio G. Cota
This gets rid of a hole in struct TranslationBlock. Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 3 +-- accel/tcg/cpu-exec.c | 2 +- accel/tcg/translate-all.c | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec

[Qemu-devel] [PATCH v2 22/45] cpu-exec: lookup/generate TB outside exclusive region during step_atomic

2017-07-16 Thread Emilio G. Cota
Now that all code generation has been converted to check CF_PARALLEL, we can generate !CF_PARALLEL code without having yet set !parallel_cpus -- and therefore without having to be in the exclusive region during cpu_exec_step_atomic. While at it, merge cpu_exec_step into cpu_exec_step_atomic. Sign

[Qemu-devel] [PATCH v2 08/45] tcg/i386: constify tcg_target_callee_save_regs

2017-07-16 Thread Emilio G. Cota
Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Emilio G. Cota --- tcg/i386/tcg-target.inc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 01e3b4e..06df0

[Qemu-devel] [PATCH v2 10/45] translate-all: guarantee that tb_hash only holds valid TBs

2017-07-16 Thread Emilio G. Cota
This gets rid of the need to check the tb->invalid bit during lookups. After this change we do not need atomics to operate on tb->invalid: setting and checking its value is serialised with tb_lock. Signed-off-by: Emilio G. Cota --- accel/tcg/cpu-exec.c | 3 +-- accel/tcg/translate-all.c |

[Qemu-devel] [PATCH v2 31/45] tci: move tci_regs to tcg_qemu_tb_exec's stack

2017-07-16 Thread Emilio G. Cota
Groundwork for supporting multiple TCG contexts. Compile-tested for all targets on an x86_64 host. Suggested-by: Richard Henderson Signed-off-by: Emilio G. Cota --- tcg/tci.c | 552 +++--- 1 file changed, 279 insertions(+), 273 deletions(

[Qemu-devel] [PATCH v2 04/45] tcg: fix corruption of code_time profiling counter upon tb_flush

2017-07-16 Thread Emilio G. Cota
Whenever there is an overflow in code_gen_buffer (e.g. we run out of space in it and have to flush it), the code_time profiling counter ends up with an invalid value (that is, code_time -= profile_getclock(), without later on getting += profile_getclock() due to the goto). Fix it by using the ti v

  1   2   >