Re: [Qemu-devel] QEMU to generate host binary

2015-06-26 Thread Peter Crosthwaite
On Fri, Jun 26, 2015 at 12:33 PM, Ayaz Akram wrote: > Hello ! > Is anyone aware of an effort to produce an executable binary for host using > qemu. I mean is it possible that qemu generate a binary for whatever > application it is emulating, which can later be run directly on host? > I'm not sure

Re: [Qemu-devel] [PATCH v3] QOM: object_property_add() performance improvement

2015-06-26 Thread Peter Crosthwaite
Ping! Regards, Peter On Tue, Jun 16, 2015 at 12:50 AM, Pavel Fedin wrote: > The function originally behaves very badly when adding properties with "[*]" > suffix. Normally these are used for numbering IRQ pins. In order to find the > correct starting number the function started from zero and che

Re: [Qemu-devel] [PATCH 1/2] target-arm: Split DISAS_YIELD from DISAS_WFE

2015-06-26 Thread Peter Crosthwaite
On Mon, Jun 15, 2015 at 11:49 AM, Peter Maydell wrote: > Currently we use DISAS_WFE for both WFE and YIELD instructions. > This is functionally correct because at the moment both of them > are implemented as "yield this CPU back to the top level loop so > another CPU has a chance to run". However

Re: [Qemu-devel] [PATCH for-2.3] Revert seccomp tests that allow it to be used on non-x86 architectures

2015-06-26 Thread Paul Moore
On Friday, June 26, 2015 06:03:18 PM Andrew Jones wrote: > On Tue, Jun 16, 2015 at 02:16:03PM +0100, Peter Maydell wrote: > > On 16 June 2015 at 14:12, Andrew Jones wrote: > > > Can we now revert this revert, along with bumping the non-x86 arch > > > atleast-version to v2.2.1 > > > > Probably. I

Re: [Qemu-devel] [Qemu-block] [PATCH] block.c: fix real cdrom detection

2015-06-26 Thread Stefan Hajnoczi
On Fri, Jun 26, 2015 at 4:50 PM, Programmingkid wrote: > > On Jun 26, 2015, at 5:34 AM, Stefan Hajnoczi wrote: > >> On Thu, Jun 25, 2015 at 11:11:24AM -0400, Programmingkid wrote: >>> On Jun 25, 2015, at 9:31 AM, Stefan Hajnoczi wrote: On Tue, Jun 23, 2015 at 02:26:51PM -0400, Programmingkid

Re: [Qemu-devel] [PATCH] blockjob: add block_job_release function

2015-06-26 Thread John Snow
On 06/26/2015 05:37 AM, Ting Wang wrote: > There is job resource leak in function mirror_start_job, > although bdrv_create_dirty_bitmap is unlikely failed. > Add block_job_release for each release when needed. > > Signed-off-by: Ting Wang > --- > block/mirror.c | 2 ++ > blockjob.c

[Qemu-devel] QEMU to generate host binary

2015-06-26 Thread Ayaz Akram
Hello ! Is anyone aware of an effort to produce an executable binary for host using qemu. I mean is it possible that qemu generate a binary for whatever application it is emulating, which can later be run directly on host? Thanks

Re: [Qemu-devel] [PATCH 00/16] ahci: ncq cleanup, part 2

2015-06-26 Thread John Snow
On 06/26/2015 12:11 PM, Stefan Hajnoczi wrote: > On Mon, Jun 22, 2015 at 08:20:59PM -0400, John Snow wrote: >> requires: 1434470575-21625-1-git-send-email-js...@redhat.com >> 1435016308-6150-1-git-send-email-js...@redhat.com [PATCH v2 0/4] >> ahci: misc fixes/tests for 2.4 [PATCH v2 00/16] ahci:

Re: [Qemu-devel] [PATCH v2 2/3] hw/i386/pc: reflect any FDC @ ioport 0x3f0 in the CMOS

2015-06-26 Thread Eduardo Habkost
On Fri, Jun 26, 2015 at 02:50:04PM -0400, John Snow wrote: > On 06/26/2015 08:25 AM, Laszlo Ersek wrote: > > On 06/26/15 11:31, Markus Armbruster wrote: > >> Laszlo Ersek writes: > >> > >>> With the pc-q35-2.4 machine type, if the user creates an ISA FDC manually: > >>> > >>> -device isa-fdc,dri

Re: [Qemu-devel] [PATCH v3 3/5] migration: Dynamic cpu throttling for auto-converge

2015-06-26 Thread Jason J. Herne
On 06/26/2015 01:54 PM, Dr. David Alan Gilbert wrote: * Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: ... diff --git a/migration/migration.c b/migration/migration.c index 05790e9..7708c54 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -25,6 +25,7 @@ #include "qemu/thre

Re: [Qemu-devel] [Qemu-block] [PATCH COLO-Block v6 07/16] Add new block driver interface to connect/disconnect the remote target

2015-06-26 Thread Dr. David Alan Gilbert
* Wen Congyang (we...@cn.fujitsu.com) wrote: > On 06/24/2015 10:07 PM, Dr. David Alan Gilbert wrote: > > * Wen Congyang (ghost...@gmail.com) wrote: > >> At 2015/6/19 18:49, Stefan Hajnoczi Wrote: > >>> On Fri, Jun 19, 2015 at 08:54:56AM +0800, Wen Congyang wrote: > On 06/19/2015 12:06 AM, Stef

Re: [Qemu-devel] [PATCH v3 1/5] cpu: Provide vcpu throttling interface

2015-06-26 Thread Jason J. Herne
On 06/26/2015 02:07 PM, Dr. David Alan Gilbert wrote: * Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: Provide a method to throttle guest cpu execution. CPUState is augmented with timeout controls and throttle start/stop functions. To throttle the guest cpu the caller simply has to call the

Re: [Qemu-devel] [PATCH v2 2/3] hw/i386/pc: reflect any FDC @ ioport 0x3f0 in the CMOS

2015-06-26 Thread John Snow
On 06/26/2015 08:25 AM, Laszlo Ersek wrote: > On 06/26/15 11:31, Markus Armbruster wrote: >> Laszlo Ersek writes: >> >>> With the pc-q35-2.4 machine type, if the user creates an ISA FDC manually: >>> >>> -device isa-fdc,driveA=drive-fdc0-0-0 \ >>> -drive file=...,if=none,id=drive-fdc0-0-0,fo

Re: [Qemu-devel] [PATCH v2] pci : Add pba_offset PCI quirk for Chelsio T5 devices

2015-06-26 Thread Casey Leedom
Looks good to me. Casey From: Alex Williamson [alex.william...@redhat.com] Sent: Friday, June 26, 2015 11:01 AM To: Gabriel Laupre Cc: qemu-devel@nongnu.org; m...@redhat.com; jb-gnumli...@wisemo.com; b...@makefile.in; Casey Leedom; Michael Boksanyi; Ani

Re: [Qemu-devel] [PATCH v3 3/5] migration: Dynamic cpu throttling for auto-converge

2015-06-26 Thread Jason J. Herne
On 06/26/2015 01:54 PM, Dr. David Alan Gilbert wrote: * Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: Remove traditional auto-converge static 30ms throttling code and replace it with a dynamic throttling algorithm. Additionally, be more aggressive when deciding when to start throttling. Pr

Re: [Qemu-devel] [PATCH v3 5/5] migration: Disambiguate MAX_THROTTLE

2015-06-26 Thread Dr. David Alan Gilbert
* Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: > Migration has a define for MAX_THROTTLE. Update comment to clarify that this > is > used for throttling transfer speed. Hopefully this will prevent it from being > confused with a guest cpu throttling entity. > > Signed-off-by: Jason J. Herne

Re: [Qemu-devel] [PATCH 13/16] ahci: add get_cmd_header helper

2015-06-26 Thread John Snow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 06/26/2015 11:51 AM, Stefan Hajnoczi wrote: > On Mon, Jun 22, 2015 at 08:21:12PM -0400, John Snow wrote: >> +static AHCICmdHdr *get_cmd_header(AHCIState *s, uint8_t port, >> uint8_t slot) +{ +if (port > s->ports || slot > >> AHCI_MAX_CMDS) {

Re: [Qemu-devel] [PATCH v3 4/5] qmp/hmp: Add throttle ratio to query-migrate and info migrate

2015-06-26 Thread Dr. David Alan Gilbert
* Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: > Report throttle percentage in info migrate and query-migrate responses when > cpu throttling is active. > > Signed-off-by: Jason J. Herne Reviewed-by: Dr. David Alan Gilbert > --- > hmp.c | 5 + > migration/migration.c

Re: [Qemu-devel] [PATCH 06/16] ahci: record ncq failures

2015-06-26 Thread John Snow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 06/26/2015 11:35 AM, Stefan Hajnoczi wrote: > On Mon, Jun 22, 2015 at 08:21:05PM -0400, John Snow wrote: >> Handle NCQ failures for cases where we want to halt the VM on IO >> errors. >> >> Signed-off-by: John Snow --- hw/ide/ahci.c >> | 17 ++

Re: [Qemu-devel] [PATCH v2] pci : Add pba_offset PCI quirk for Chelsio T5 devices

2015-06-26 Thread Gabriel Laupre
Thank you Alex The test which fails in the msix_init() is pba_offset + pba_size > memory_region_size(pba_bar) because pba_offset will be 0x8000 and memory_region_size(pba_bar) equals 0x2000. If we can catch this error before as you suggested I think it is better. I will integrate the changes th

Re: [Qemu-devel] [PATCH 01/16] ide: add limit to .prepare_buf()

2015-06-26 Thread John Snow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 06/26/2015 10:32 AM, Stefan Hajnoczi wrote: > On Mon, Jun 22, 2015 at 08:21:00PM -0400, John Snow wrote: >> diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 95d228f..f873ab1 >> 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -49,7 +49,7 @@ >>

Re: [Qemu-devel] [PATCH 0/2] Implement YIELD to yield in ARM and Thumb translators

2015-06-26 Thread Peter Crosthwaite
On Fri, Jun 26, 2015 at 7:28 AM, Peter Maydell wrote: > On 26 June 2015 at 15:25, Paolo Bonzini wrote: >> >> >> On 26/06/2015 16:04, Peter Maydell wrote: >>> Ping? >> >> Oh, YIELD was what I was thinking of in the thread about IPIs, not WFE >> (which would require SEV on the other core)... > > Li

Re: [Qemu-devel] [PATCH v3 1/5] cpu: Provide vcpu throttling interface

2015-06-26 Thread Dr. David Alan Gilbert
* Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: > Provide a method to throttle guest cpu execution. CPUState is augmented with > timeout controls and throttle start/stop functions. To throttle the guest cpu > the caller simply has to call the throttle set function and provide a > percentage >

Re: [Qemu-devel] [PATCH v2] pci : Add pba_offset PCI quirk for Chelsio T5 devices

2015-06-26 Thread Alex Williamson
On Thu, 2015-06-25 at 17:30 -0700, Gabriel Laupre wrote: > Fix pba_offset initialization value for Chelsio T5 Virtual Function > device. The T5 hardware has a bug in it where it reports a Pending Interrupt > Bit Array Offset of 0x8000 for its SR-IOV Virtual Functions instead > of the 0x1000 that th

Re: [Qemu-devel] [PATCH v3 3/5] migration: Dynamic cpu throttling for auto-converge

2015-06-26 Thread Dr. David Alan Gilbert
* Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: > Remove traditional auto-converge static 30ms throttling code and replace it > with a dynamic throttling algorithm. > > Additionally, be more aggressive when deciding when to start throttling. > Previously we waited until four unproductive memo

Re: [Qemu-devel] [PATCH 16/16] ahci: fix sdb fis semantics

2015-06-26 Thread John Snow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 06/26/2015 12:11 PM, Stefan Hajnoczi wrote: > On Mon, Jun 22, 2015 at 08:21:15PM -0400, John Snow wrote: >> @@ -682,19 +680,22 @@ static void ahci_write_fis_sdb(AHCIState >> *s, int port, uint32_t finished) >> >> sdb_fis->type = SATA_FIS_TYPE_S

[Qemu-devel] [PATCH v18 4/6] sysbus: add irq_routing_notifier

2015-06-26 Thread Eric Auger
Add a new connect_irq_notifier notifier in the SysBusDeviceClass. This notifier, if populated, is called after sysbus_connect_irq. This mechanism is used to setup VFIO signaling once VFIO platform devices get attached to their platform bus, on a machine init done notifier. Signed-off-by: Eric Aug

Re: [Qemu-devel] [PATCH 14/16] ahci: Do not map cmd_fis to generate response

2015-06-26 Thread John Snow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 06/26/2015 11:59 AM, Stefan Hajnoczi wrote: > On Mon, Jun 22, 2015 at 08:21:13PM -0400, John Snow wrote: >> @@ -744,8 +722,8 @@ static void ahci_write_fis_pio(AHCIDevice >> *ad, uint16_t len) pio_fis[9] = s->hob_lcyl; pio_fis[10] = >> s->hob_hcy

[Qemu-devel] [PATCH v18 6/6] hw/vfio/platform: add irqfd support

2015-06-26 Thread Eric Auger
This patch aims at optimizing IRQ handling using irqfd framework. Instead of handling the eventfds on user-side they are handled on kernel side using - the KVM irqfd framework, - the VFIO driver virqfd framework. the virtual IRQ completion is trapped at interrupt controller This removes the need

[Qemu-devel] [PATCH v18 3/6] intc: arm_gic_kvm: set the qemu_irq/gsi mapping

2015-06-26 Thread Eric Auger
The arm_gic_kvm now calls kvm_irqchip_set_qemuirq_gsi to build the hash table storing qemu_irq/gsi mappings. From that point on irqfd can be setup directly from the qemu_irq using kvm_irqchip_add_irqfd_notifier. Signed-off-by: Eric Auger Tested-by: Vikram Sethi Acked-by: Paolo Bonzini --- v16

[Qemu-devel] [PATCH v18 5/6] kvm: some fixes to kvm_resamplefds_allowed

2015-06-26 Thread Eric Auger
Commit f41389ae3c54b introduced kvm_resamplefds_enabled() and associated kvm_resamplefds_allowed boolean. This patch adds non-KVM version for kvm_resamplefds_enabled and also declares kvm_resamplefds_allowed in kvm-stub as it is done for fellow kvm_irqfds_allowed. Signed-off-by: Eric Auger --- i

[Qemu-devel] [PATCH v18 0/6] KVM platform device passthrough

2015-06-26 Thread Eric Auger
Those remaining patches aim at enabling irqfd usage in the VFIO platform device They can be found at : http://git.linaro.org/people/eric.auger/qemu.git (branch vfio_integ_v18) Tested by Vikram Sethi on a device featuring 2 MMIO regions. Code also exercised successfully by VOSYS for AMBA derivativ

[Qemu-devel] [PATCH v18 2/6] kvm-all.c: add qemu_irq/gsi hash table and utility routines

2015-06-26 Thread Eric Auger
VFIO platform device needs to setup irqfd but it does not know the gsi corresponding to the device qemu_irq. This patch proposes to store a hash table in kvm_state using the qemu_irq as key and the gsi as a value. kvm_irqchip_set_qemuirq_gsi allows to insert such a pair. The interrupt controller i

[Qemu-devel] [PATCH v18 1/6] kvm: rename kvm_irqchip_[add, remove]_irqfd_notifier with gsi suffix

2015-06-26 Thread Eric Auger
Anticipating for the introduction of new add/remove functions taking a qemu_irq parameter, let's rename existing ones with a gsi suffix. Signed-off-by: Eric Auger Tested-by: Vikram Sethi Acked-by: Paolo Bonzini --- v16 -> v17: - added Paolo's A-b v15 -> v16: - added Vikram's T-b - resolve re

Re: [Qemu-devel] [PATCH v3 2/5] migration: Parameters for auto-converge cpu throttling

2015-06-26 Thread Dr. David Alan Gilbert
* Jason J. Herne (jjhe...@linux.vnet.ibm.com) wrote: > Add migration parameters to allow the user to adjust the parameters > that control cpu throttling when auto-converge is in effect. The added > parameters are as follows: > > x-cpu-throttle-initial : Initial percantage of time guest cpus are th

Re: [Qemu-devel] [PATCH 1/2] dataplane: drop copy_in_vring_desc()

2015-06-26 Thread Greg Kurz
On Fri, 26 Jun 2015 18:28:42 +0200 "Michael S. Tsirkin" wrote: > On Fri, Jun 26, 2015 at 02:18:38PM +0200, Greg Kurz wrote: > > On Fri, 26 Jun 2015 12:28:45 +0200 > > Cornelia Huck wrote: > > > > > On Fri, 26 Jun 2015 09:32:21 +0200 > > > Greg Kurz wrote: > > > > > > > During early virtio 1.0

Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 18:08, Peter Maydell wrote: >> > Yeah, ISTR that in some cases you have to wait for other CPUs to >> > invalidate the TLB before proceeding. Maybe it's only when you have a >> > dmb instruction, but it's probably simpler for QEMU to always do it >> > synchronously. > Yeah, the ARM

Re: [Qemu-devel] [PATCH 1/2] target-arm: Split DISAS_YIELD from DISAS_WFE

2015-06-26 Thread Andreas Färber
Am 15.06.2015 um 20:49 schrieb Peter Maydell: > diff --git a/target-arm/op_helper.c b/target-arm/op_helper.c > index 7fa32c4..5f06ca0 100644 > --- a/target-arm/op_helper.c > +++ b/target-arm/op_helper.c > @@ -334,6 +334,18 @@ void HELPER(wfe)(CPUARMState *env) > cpu_loop_exit(cs); > } > > +

Re: [Qemu-devel] [RESEND PATCH v16 6/6] hw/vfio/platform: add irqfd support

2015-06-26 Thread Alex Williamson
On Fri, 2015-06-26 at 18:31 +0200, Eric Auger wrote: > On 06/26/2015 06:26 PM, Paolo Bonzini wrote: > > > > > > On 26/06/2015 18:21, Alex Williamson wrote: > +#ifdef CONFIG_KVM > +if (kvm_irqfds_enabled() && kvm_resamplefds_enabled() && > +vdev->irqfd_allowed) { >

Re: [Qemu-devel] [PATCH 12/16] ahci: ncq migration

2015-06-26 Thread John Snow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 06/26/2015 11:48 AM, Stefan Hajnoczi wrote: > On Mon, Jun 22, 2015 at 08:21:11PM -0400, John Snow wrote: >> @@ -1555,6 +1573,35 @@ static int ahci_state_post_load(void >> *opaque, int version_id) return -1; } >> >> +for (j = 0; j < AHCI

Re: [Qemu-devel] [RFC PATCH V6 14/18] add a callback when tb_invalidate is called.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 18:20, Paolo Bonzini wrote: On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: From: KONRAD Frederic Instead of doing the jump cache invalidation directly in tb_invalidate delay it after the exit so we don't have an other CPU trying to execute the code being invalidated. Sig

Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 18:35, Frederic Konrad wrote: >>> >> Have you tried implementing the solution based on cpu->halted? > You mean based on cpu_has_work? > > Yes it was a little painfull (eg: it required cpu to be halted.. but > maybe it's what you were suggesting?) Yes. :) No problem, we can discus

Re: [Qemu-devel] [RFC PATCH V6 18/18] translate-all: (wip) use tb_flush_safe when we can't alloc more tb.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 18:21, Paolo Bonzini wrote: On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: @@ -1147,7 +1147,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tb = tb_alloc(pc); if (!tb) { /* flush must be done */ -tb_flush(env); +tb_flush_safe(env); S

Re: [Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 18:23, Paolo Bonzini wrote: On 26/06/2015 18:09, Frederic Konrad wrote: +void async_run_safe_work_on_cpu(CPUState *cpu, void (*func)(void *data), +void *data) +{ Do you need a mutex to protect this data structure? I would use one even if not st

[Qemu-devel] Allocate PCI MMIO without BAR requests.

2015-06-26 Thread David kiarie
Hi all, Some efforts to emulate AMD IOMMU have being going over the past few months. In real hardware AMD IOMMU is implemented as a PCI function. When emulating it in Qemu we want to allocate it MMIO space but real AMD IOMMU manage to reserve memory without making a BAR request, probably through

Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 18:31, Paolo Bonzini wrote: On 26/06/2015 18:30, Frederic Konrad wrote: Yes this is not the case as I implemented it. The rest of the TB will be executed before the tlb_flush work really happen. The old version did this, was slow and was a mess (if two VCPUs want to tlb_flush at

Re: [Qemu-devel] [RESEND PATCH v16 6/6] hw/vfio/platform: add irqfd support

2015-06-26 Thread Eric Auger
On 06/26/2015 06:26 PM, Paolo Bonzini wrote: > > > On 26/06/2015 18:21, Alex Williamson wrote: +#ifdef CONFIG_KVM +if (kvm_irqfds_enabled() && kvm_resamplefds_enabled() && +vdev->irqfd_allowed) { +sbc->connect_irq_notifier = vfio_start_irqfd_injection; >> S

Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 18:30, Frederic Konrad wrote: > Yes this is not the case as I implemented it. > > The rest of the TB will be executed before the tlb_flush work really > happen. The old version did this, was slow and was a mess (if two > VCPUs want to tlb_flush at the same time and an other > tlb_

Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 18:08, Peter Maydell wrote: On 26 June 2015 at 17:01, Paolo Bonzini wrote: On 26/06/2015 17:54, Frederic Konrad wrote: So what happen is: An arm instruction want to clear tlb of all VCPUs eg: IS version of TLBIALL. The VCPU which execute the TLBIALL_IS can't flush tlb of other VC

Re: [Qemu-devel] [PATCH 1/2] dataplane: drop copy_in_vring_desc()

2015-06-26 Thread Michael S. Tsirkin
On Fri, Jun 26, 2015 at 02:18:38PM +0200, Greg Kurz wrote: > On Fri, 26 Jun 2015 12:28:45 +0200 > Cornelia Huck wrote: > > > On Fri, 26 Jun 2015 09:32:21 +0200 > > Greg Kurz wrote: > > > > > During early virtio 1.0 devel, there were several proposals about how to > > > deal with the endianness

Re: [Qemu-devel] [RESEND PATCH v16 6/6] hw/vfio/platform: add irqfd support

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 18:21, Alex Williamson wrote: >> > +#ifdef CONFIG_KVM >> > +if (kvm_irqfds_enabled() && kvm_resamplefds_enabled() && >> > +vdev->irqfd_allowed) { >> > +sbc->connect_irq_notifier = vfio_start_irqfd_injection; > Should we be abstracting this to a > sysbus_register_

Re: [Qemu-devel] [PATCH 30/39] contrib: add ivshmem client and server

2015-06-26 Thread Andrew Jones
On Fri, Jun 26, 2015 at 04:49:36PM +0200, Marc-André Lureau wrote: > From: David Marchand > > When using ivshmem devices, notifications between guests can be sent as > interrupts using a ivshmem-server (typical use described in documentation). > The client is provided as a debug tool. > > Signed

Re: [Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 18:09, Frederic Konrad wrote: >>> >>> +void async_run_safe_work_on_cpu(CPUState *cpu, void (*func)(void >>> *data), >>> +void *data) >>> +{ >> Do you need a mutex to protect this data structure? I would use one >> even if not strictly necessary, to

Re: [Qemu-devel] [RFC PATCH V6 18/18] translate-all: (wip) use tb_flush_safe when we can't alloc more tb.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: > @@ -1147,7 +1147,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, > tb = tb_alloc(pc); > if (!tb) { > /* flush must be done */ > -tb_flush(env); > +tb_flush_safe(env); Should you just call cpu_loop_exit()

Re: [Qemu-devel] [RESEND PATCH v16 6/6] hw/vfio/platform: add irqfd support

2015-06-26 Thread Alex Williamson
On Mon, 2015-06-15 at 17:33 +0100, Eric Auger wrote: > This patch aims at optimizing IRQ handling using irqfd framework. > > Instead of handling the eventfds on user-side they are handled on > kernel side using > - the KVM irqfd framework, > - the VFIO driver virqfd framework. > > the virtual IRQ

Re: [Qemu-devel] [RFC PATCH V6 14/18] add a callback when tb_invalidate is called.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: > From: KONRAD Frederic > > Instead of doing the jump cache invalidation directly in tb_invalidate delay > it > after the exit so we don't have an other CPU trying to execute the code being > invalidated. > > Signed-off-by: KONRAD Frederic

Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: > @@ -273,8 +274,9 @@ static TranslationBlock *tb_find_slow(CPUArchState *env, > ptb1 = &tcg_ctx.tb_ctx.tb_phys_hash[h]; > for(;;) { > tb = *ptb1; > -if (!tb) > -goto not_found; > +if (!tb) { > +

Re: [Qemu-devel] [PATCH 39/39] tests: Add ivshmem qtest

2015-06-26 Thread Andreas Färber
Am 26.06.2015 um 18:02 schrieb Marc-André Lureau: > On Fri, Jun 26, 2015 at 5:53 PM, Andreas Färber > wrote: > > Please don't use HTML mails, that breaks quoting as you can see below. > > > I mostly use gmail, afaik it's multipart, never had issues with that. The r

Re: [Qemu-devel] [PATCH 00/16] ahci: ncq cleanup, part 2

2015-06-26 Thread Stefan Hajnoczi
On Mon, Jun 22, 2015 at 08:20:59PM -0400, John Snow wrote: > requires: 1434470575-21625-1-git-send-email-js...@redhat.com > 1435016308-6150-1-git-send-email-js...@redhat.com > [PATCH v2 0/4] ahci: misc fixes/tests for 2.4 > [PATCH v2 00/16] ahci: ncq cleanup, part 1 >

Re: [Qemu-devel] [PATCH 16/16] ahci: fix sdb fis semantics

2015-06-26 Thread Stefan Hajnoczi
On Mon, Jun 22, 2015 at 08:21:15PM -0400, John Snow wrote: > @@ -682,19 +680,22 @@ static void ahci_write_fis_sdb(AHCIState *s, int port, > uint32_t finished) > > sdb_fis->type = SATA_FIS_TYPE_SDB; > /* Interrupt pending & Notification bit */ > -sdb_fis->flags = (ad->hba->control_r

Re: [Qemu-devel] [RFC PATCH V6 07/18] Drop global lock during TCG code execution

2015-06-26 Thread Frederic Konrad
On 26/06/2015 17:42, Jan Kiszka wrote: On 2015-06-26 17:36, Frederic Konrad wrote: On 26/06/2015 16:56, Jan Kiszka wrote: On 2015-06-26 16:47, fred.kon...@greensocs.com wrote: From: Jan Kiszka This finally allows TCG to benefit from the iothread introduction: Drop the global mutex while runn

Re: [Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 17:35, Paolo Bonzini wrote: On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: diff --git a/cpu-exec.c b/cpu-exec.c index de256d6..d6442cd 100644 --- a/cpu-exec.c +++ b/cpu-exec.c Nice solution. However I still have a few questions that need clarification. @@ -382,6 +382,11

Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all.

2015-06-26 Thread Peter Maydell
On 26 June 2015 at 17:01, Paolo Bonzini wrote: > On 26/06/2015 17:54, Frederic Konrad wrote: >> So what happen is: >> An arm instruction want to clear tlb of all VCPUs eg: IS version of >> TLBIALL. >> The VCPU which execute the TLBIALL_IS can't flush tlb of other VCPU. >> It will just ask all VCPU

Re: [Qemu-devel] [PATCH 39/39] tests: Add ivshmem qtest

2015-06-26 Thread Andreas Färber
Am 26.06.2015 um 17:44 schrieb Marc-André Lureau: > On Fri, Jun 26, 2015 at 5:27 PM, Marc-André Lureau > mailto:marcandre.lur...@gmail.com>> wrote: > > Sorry which patch are you refering to? > > > You probably mean about the missing include: I wasn't aware such patch > was already submitted,

Re: [Qemu-devel] [PATCH 39/39] tests: Add ivshmem qtest

2015-06-26 Thread Marc-André Lureau
Hi On Fri, Jun 26, 2015 at 5:53 PM, Andreas Färber wrote: > Please don't use HTML mails, that breaks quoting as you can see below. > > I mostly use gmail, afaik it's multipart, never had issues with that. Am 26.06.2015 um 17:27 schrieb Marc-André Lureau: > > On Fri, Jun 26, 2015 at 5:08 PM, And

Re: [Qemu-devel] [PATCH for-2.3] Revert seccomp tests that allow it to be used on non-x86 architectures

2015-06-26 Thread Andrew Jones
On Tue, Jun 16, 2015 at 02:16:03PM +0100, Peter Maydell wrote: > On 16 June 2015 at 14:12, Andrew Jones wrote: > > Can we now revert this revert, along with bumping the non-x86 arch > > atleast-version to v2.2.1 > > Probably. I suggest you submit a patch and test it on the > relevant architecture

Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 17:54, Frederic Konrad wrote: >> > I think it doesn't requires to be synchronous as each VCPUs only clear > it's own > tlb here: > > void tlb_flush(CPUState *cpu, int flush_global) > { > CPUArchState *env = cpu->env_ptr; > > #if defined(DEBUG_TLB) > printf("tlb_flush:\n");

Re: [Qemu-devel] [PATCH 14/16] ahci: Do not map cmd_fis to generate response

2015-06-26 Thread Stefan Hajnoczi
On Mon, Jun 22, 2015 at 08:21:13PM -0400, John Snow wrote: > @@ -744,8 +722,8 @@ static void ahci_write_fis_pio(AHCIDevice *ad, uint16_t > len) > pio_fis[9] = s->hob_lcyl; > pio_fis[10] = s->hob_hcyl; > pio_fis[11] = 0; > -pio_fis[12] = cmd_fis[12]; > -pio_fis[13] = cmd_fis[

Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 17:15, Paolo Bonzini wrote: On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: +CPU_FOREACH(cpu) { +if (qemu_cpu_is_self(cpu)) { +/* async_run_on_cpu handle this case but this just avoid a malloc + * here. + */ +tlb_fl

Re: [Qemu-devel] [PATCH 39/39] tests: Add ivshmem qtest

2015-06-26 Thread Andreas Färber
Hi, Please don't use HTML mails, that breaks quoting as you can see below. Am 26.06.2015 um 17:27 schrieb Marc-André Lureau: > On Fri, Jun 26, 2015 at 5:08 PM, Andreas Färber > wrote: > > > For the second time within days you're posting a patch for something >

Re: [Qemu-devel] [PATCH 13/16] ahci: add get_cmd_header helper

2015-06-26 Thread Stefan Hajnoczi
On Mon, Jun 22, 2015 at 08:21:12PM -0400, John Snow wrote: > +static AHCICmdHdr *get_cmd_header(AHCIState *s, uint8_t port, uint8_t slot) > +{ > +if (port > s->ports || slot > AHCI_MAX_CMDS) { Should these be >= instead of >? Otherwise 1 element beyond the end of the array can be accessed.

Re: [Qemu-devel] [Qemu-block] [PATCH] block.c: fix real cdrom detection

2015-06-26 Thread Programmingkid
On Jun 26, 2015, at 5:34 AM, Stefan Hajnoczi wrote: > On Thu, Jun 25, 2015 at 11:11:24AM -0400, Programmingkid wrote: >> On Jun 25, 2015, at 9:31 AM, Stefan Hajnoczi wrote: >>> On Tue, Jun 23, 2015 at 02:26:51PM -0400, Programmingkid wrote: On Jun 23, 2015, at 2:06 PM, John Snow wrote: >

Re: [Qemu-devel] [PATCH 12/16] ahci: ncq migration

2015-06-26 Thread Stefan Hajnoczi
On Mon, Jun 22, 2015 at 08:21:11PM -0400, John Snow wrote: > @@ -1555,6 +1573,35 @@ static int ahci_state_post_load(void *opaque, int > version_id) > return -1; > } > > +for (j = 0; j < AHCI_MAX_CMDS; j++) { > +ncq_tfs = &ad->ncq_tfs[j]; > +n

Re: [Qemu-devel] [RFC PATCH V6 03/18] remove unused spinlock.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 17:29, Frederic Konrad wrote: >> The checkpatch.pl parts simply come from Linux. They don't matter for >> QEMU, but we're limiting the changes to the minimum in this script. > > Ok so I can drop this part from the patch? Yes, please! Paolo

Re: [Qemu-devel] [PULL 16/17] hw/pci-bridge: format special OFW unit address for PXB host

2015-06-26 Thread Marcel Apfelbaum
On 06/26/2015 05:28 PM, Laszlo Ersek wrote: On 06/26/15 15:46, Michael S. Tsirkin wrote: From: Laszlo Ersek We have agreed that OpenFirmware device paths in the "bootorder" fw_cfg file should follow the pattern /pci@i0cf8,%x/... for devices that live behind an extra root bus. The extra ro

Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 17:39, Frederic Konrad wrote: >>> >>> @@ -11567,6 +11570,7 @@ void arm_cpu_dump_state(CPUState *cs, FILE >>> *f, fprintf_function cpu_fprintf, >>> void restore_state_to_opc(CPUARMState *env, TranslationBlock *tb, >>> int pc_pos) >>> { >>> +tb_lock(); >>> if (is_a64(e

Re: [Qemu-devel] [PATCH 39/39] tests: Add ivshmem qtest

2015-06-26 Thread Marc-André Lureau
On Fri, Jun 26, 2015 at 5:27 PM, Marc-André Lureau < marcandre.lur...@gmail.com> wrote: > Sorry which patch are you refering to? You probably mean about the missing include: I wasn't aware such patch was already submitted, and I don't think it's a problem if two people identify the same issue an

Re: [Qemu-devel] [PATCH 06/16] ahci: record ncq failures

2015-06-26 Thread Stefan Hajnoczi
On Mon, Jun 22, 2015 at 08:21:05PM -0400, John Snow wrote: > Handle NCQ failures for cases where we want to halt the VM on IO errors. > > Signed-off-by: John Snow > --- > hw/ide/ahci.c | 17 +++-- > hw/ide/ahci.h | 1 + > hw/ide/internal.h | 1 + > 3 files changed, 17 inser

Re: [Qemu-devel] [RFC PATCH V6 07/18] Drop global lock during TCG code execution

2015-06-26 Thread Jan Kiszka
On 2015-06-26 17:36, Frederic Konrad wrote: > On 26/06/2015 16:56, Jan Kiszka wrote: >> On 2015-06-26 16:47, fred.kon...@greensocs.com wrote: >>> From: Jan Kiszka >>> >>> This finally allows TCG to benefit from the iothread introduction: Drop >>> the global mutex while running pure TCG CPU code. R

Re: [Qemu-devel] [RFC PATCH V6 06/18] tcg: remove tcg_halt_cond global variable.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 17:02, Paolo Bonzini wrote: On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: From: KONRAD Frederic This removes tcg_halt_cond global variable. We need one QemuCond per virtual cpu for multithread TCG. Signed-off-by: KONRAD Frederic --- cpus.c | 18 +++--- 1

Re: [Qemu-devel] [RFC PATCH V6 13/18] cpu: introduce async_run_safe_work_on_cpu.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: > diff --git a/cpu-exec.c b/cpu-exec.c > index de256d6..d6442cd 100644 > --- a/cpu-exec.c > +++ b/cpu-exec.c Nice solution. However I still have a few questions that need clarification. > @@ -382,6 +382,11 @@ int cpu_exec(CPUArchState *env) >

Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 16:56, Paolo Bonzini wrote: On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: diff --git a/target-arm/translate.c b/target-arm/translate.c index 971b6db..47345aa 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -11162,6 +11162,8 @@ static inline void gen

Re: [Qemu-devel] [RFC PATCH V6 04/18] add support for spin lock on POSIX systems exclusively

2015-06-26 Thread Frederic Konrad
On 26/06/2015 16:55, Paolo Bonzini wrote: On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: From: Guillaume Delbergue WARNING: spin lock is currently not implemented on WIN32 The Windows KSPIN_LOCK is a kernel data structure. You can implement a simple, portable test-and-test-and-set sp

Re: [Qemu-devel] [RFC PATCH V6 07/18] Drop global lock during TCG code execution

2015-06-26 Thread Frederic Konrad
On 26/06/2015 16:56, Jan Kiszka wrote: On 2015-06-26 16:47, fred.kon...@greensocs.com wrote: From: Jan Kiszka This finally allows TCG to benefit from the iothread introduction: Drop the global mutex while running pure TCG CPU code. Reacquire the lock when entering MMIO or PIO emulation, or whe

[Qemu-devel] [PATCH v17 6/6] hw/vfio/platform: add irqfd support

2015-06-26 Thread Eric Auger
This patch aims at optimizing IRQ handling using irqfd framework. Instead of handling the eventfds on user-side they are handled on kernel side using - the KVM irqfd framework, - the VFIO driver virqfd framework. the virtual IRQ completion is trapped at interrupt controller This removes the need

[Qemu-devel] [PATCH v17 4/6] sysbus: add irq_routing_notifier

2015-06-26 Thread Eric Auger
Add a new connect_irq_notifier notifier in the SysBusDeviceClass. This notifier, if populated, is called after sysbus_connect_irq. This mechanism is used to setup VFIO signaling once VFIO platform devices get attached to their platform bus, on a machine init done notifier. Signed-off-by: Eric Aug

Re: [Qemu-devel] [RFC PATCH V6 15/18] cpu: introduce tlb_flush*_all.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: > +CPU_FOREACH(cpu) { > +if (qemu_cpu_is_self(cpu)) { > +/* async_run_on_cpu handle this case but this just avoid a malloc > + * here. > + */ > +tlb_flush(cpu, flush_global); > +

[Qemu-devel] [PATCH v17 3/6] intc: arm_gic_kvm: set the qemu_irq/gsi mapping

2015-06-26 Thread Eric Auger
The arm_gic_kvm now calls kvm_irqchip_set_qemuirq_gsi to build the hash table storing qemu_irq/gsi mappings. From that point on irqfd can be setup directly from the qemu_irq using kvm_irqchip_add_irqfd_notifier. Signed-off-by: Eric Auger Tested-by: Vikram Sethi Acked-by: Paolo Bonzini --- v16

[Qemu-devel] [PATCH v17 5/6] kvm: some fixes to kvm_resamplefds_allowed

2015-06-26 Thread Eric Auger
Commit f41389ae3c54b introduced kvm_resamplefds_enabled() and associated kvm_resamplefds_allowed boolean. This patch adds non-KVM version for kvm_resamplefds_enabled and also declares kvm_resamplefds_allowed in kvm-stub as it is done for fellow kvm_irqfds_allowed. Signed-off-by: Eric Auger --- i

[Qemu-devel] [PATCH v17 0/6] KVM platform device passthrough

2015-06-26 Thread Eric Auger
Those remaining patches aim at enabling irqfd usage in the VFIO platform device They can be found at : http://git.linaro.org/people/eric.auger/qemu.git (branch vfio_integ_v17) Tested by Vikram Sethi on a device featuring 2 MMIO regions. Code also exercised successfully by VOSYS for AMBA derivativ

Re: [Qemu-devel] [RFC PATCH V6 07/18] Drop global lock during TCG code execution

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:56, Jan Kiszka wrote: >> > +/* >> > + * Some device's reset needs to grab the global_mutex. So just >> > release it >> > + * here. > That's a property newly introduced by the patch, or how does this > happen? In turn, are all reset handlers now fine to be called outs

[Qemu-devel] [PATCH v17 2/6] kvm-all.c: add qemu_irq/gsi hash table and utility routines

2015-06-26 Thread Eric Auger
VFIO platform device needs to setup irqfd but it does not know the gsi corresponding to the device qemu_irq. This patch proposes to store a hash table in kvm_state using the qemu_irq as key and the gsi as a value. kvm_irqchip_set_qemuirq_gsi allows to insert such a pair. The interrupt controller i

[Qemu-devel] [PATCH v17 1/6] kvm: rename kvm_irqchip_[add, remove]_irqfd_notifier with gsi suffix

2015-06-26 Thread Eric Auger
Anticipating for the introduction of new add/remove functions taking a qemu_irq parameter, let's rename existing ones with a gsi suffix. Signed-off-by: Eric Auger Tested-by: Vikram Sethi Acked-by: Paolo Bonzini --- v16 -> v17: - added Paolo's A-b v15 -> v16: - added Vikram's T-b - resolve re

Re: [Qemu-devel] [RFC PATCH V6 03/18] remove unused spinlock.

2015-06-26 Thread Frederic Konrad
On 26/06/2015 16:53, Paolo Bonzini wrote: On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7f0aae9..d1e482a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2664,11 +2664,6 @@ sub process {

Re: [Qemu-devel] [RFC PATCH V6 06/18] tcg: remove tcg_halt_cond global variable.

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: > From: KONRAD Frederic > > This removes tcg_halt_cond global variable. > We need one QemuCond per virtual cpu for multithread TCG. > > Signed-off-by: KONRAD Frederic > --- > cpus.c | 18 +++--- > 1 file changed, 7 insertions(

Re: [Qemu-devel] [PATCH 39/39] tests: Add ivshmem qtest

2015-06-26 Thread Marc-André Lureau
Hi On Fri, Jun 26, 2015 at 5:08 PM, Andreas Färber wrote: > > For the second time within days you're posting a patch for something > that's been on the list already... The commit message above is entirely > Sorry which patch are you refering to? Is it wrong to repost a old patch and adding, wh

Re: [Qemu-devel] [RFC PATCH V6 04/18] add support for spin lock on POSIX systems exclusively

2015-06-26 Thread Paolo Bonzini
On 26/06/2015 16:47, fred.kon...@greensocs.com wrote: > From: Guillaume Delbergue > > WARNING: spin lock is currently not implemented on WIN32 The Windows KSPIN_LOCK is a kernel data structure. You can implement a simple, portable test-and-test-and-set spinlock using atomics, and use it on bo

Re: [Qemu-devel] [PULL 0/7] target-arm queue

2015-06-26 Thread Peter Maydell
On 26 June 2015 at 14:31, Peter Maydell wrote: > target-arm queue: a few new features, but all minor stuff. > > thanks > -- PMM > > > The following changes since commit ccb0c7e122db72d3a5da798c6414d4912bba828f: > > Merge remote-tracking branch 'remotes/lalrae/tag

Re: [Qemu-devel] [PATCH] refresh filename after the node is replaced

2015-06-26 Thread Max Reitz
On 26.06.2015 16:27, Wen Congyang wrote: At 2015/6/26 21:47, Max Reitz Wrote: On 25.06.2015 08:41, Wen Congyang wrote: We can use block job mirror to repair broken quorum files. But the command 'info block' doesn't output correct filename after block job mirror finishes. Which filename? The q

Re: [Qemu-devel] [RFC PATCH V6 07/18] Drop global lock during TCG code execution

2015-06-26 Thread Jan Kiszka
On 2015-06-26 16:47, fred.kon...@greensocs.com wrote: > From: Jan Kiszka > > This finally allows TCG to benefit from the iothread introduction: Drop > the global mutex while running pure TCG CPU code. Reacquire the lock > when entering MMIO or PIO emulation, or when leaving the TCG loop. > > We

  1   2   3   4   >