[Qemu-devel] [PATCH 8/9] x86: avoid AREG0 in segmentation helpers

2012-06-21 Thread Blue Swirl
Add an explicit CPUX86State parameter instead of relying on AREG0. Rename remains of op_helper.c to seg_helper.c. Signed-off-by: Blue Swirl --- target-i386/Makefile.objs |1 - target-i386/helper.h | 38 target-i386/seg_helper.c | 217 +--

[Qemu-devel] [PATCH 07/17] x86: improve SSE table type safety

2012-06-21 Thread Blue Swirl
SSE function tables could easily be corrupted because of use of void pointers. Introduce function pointer types and helper variables in order to improve type safety. Split sse_op_table3 according to types used. Signed-off-by: Blue Swirl --- target-i386/translate.c | 134 ++

[Qemu-devel] [PATCH 0/2] Sandboxing Qemu guests with Libseccomp

2012-06-21 Thread Eduardo Otubo
Hello all, This is the third effort to sandbox Qemu guests using Libseccomp[0]. The patches that follows are pretty simple and straightforward. I added the correct options and checks to the configure script and the basic calls to libseccomp in the main loop at vl.c. Details of each one are in the

[Qemu-devel] [PATCH 2/2] Creating qemu-seccomp.[ch] and adding call to vl.c

2012-06-21 Thread Eduardo Otubo
I added a syscall struct using priority levels as described in the libseccomp man page. The priority numbers are based to the frequency they appear in a sample strace from a regular qemu guest run under libvirt. Libseccomp generates linear BPF code to filter system calls, those rules are read one

[Qemu-devel] [PATCH 1/2] Adding support for libseccomp in configure and Makefile

2012-06-21 Thread Eduardo Otubo
Adding basic options to the configure script to use libseccomp or not. The default is set to 'no'. If the flag --enable-libseccomp is used, the script will check for its existence using pkg-config. v2: * As I removed all the code related to seccomp from vl.c, I created qemu-seccomp.[ch]. * Al

[Qemu-devel] [PATCH 9/9] x86: switch to AREG0 free mode

2012-06-21 Thread Blue Swirl
Add an explicit CPUX86State parameter instead of relying on AREG0. Remove temporary wrappers and switch to AREG0 free mode. Signed-off-by: Blue Swirl --- configure |2 +- cpu-all.h | 22 ++ target-i386/Makefile.objs |2 - target-i386/cpu.h |

[Qemu-devel] [PATCH 09/17] x86: split condition code and shift templates

2012-06-21 Thread Blue Swirl
Move shift templates from helper_template.h to shift_helper_template.h and the condition code helpers to cc_helper_template.h. Signed-off-by: Blue Swirl --- target-i386/cc_helper_template.h| 277 +++ target-i386/helper_template.h | 353

[Qemu-devel] [PATCH 16/17] x86: split off memory access helpers

2012-06-21 Thread Blue Swirl
Move memory access helpers to mem_helper.c. Signed-off-by: Blue Swirl --- target-i386/Makefile.objs |3 +- target-i386/mem_helper.c | 161 + target-i386/op_helper.c | 138 +-- 3 files changed, 165 insertions

[Qemu-devel] [PATCH 10/17] x86: prepare eflags helpers for general use

2012-06-21 Thread Blue Swirl
Adjust function names and add an explicit CPUX86State parameter instead of relying on AREG0. Signed-off-by: Blue Swirl --- target-i386/op_helper.c | 68 +- 1 files changed, 37 insertions(+), 31 deletions(-) diff --git a/target-i386/op_helper.c b/tar

[Qemu-devel] [PATCH 04/17] x86: avoid an extern declaration

2012-06-21 Thread Blue Swirl
After the previous patch, we can use the proper declaration in a common header file. Signed-off-by: Blue Swirl --- target-i386/excp_helper.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/target-i386/excp_helper.c b/target-i386/excp_helper.c index 72bd46d..aaa5ca2 1

[Qemu-devel] [PATCH 08/17] x86: fix coding style in helper_template.h

2012-06-21 Thread Blue Swirl
Fix coding style in helper_template.h before next commit. Signed-off-by: Blue Swirl --- target-i386/helper_template.h | 25 ++--- 1 files changed, 22 insertions(+), 3 deletions(-) diff --git a/target-i386/helper_template.h b/target-i386/helper_template.h index afc41fb..8b2

[Qemu-devel] [PATCH 11/17] x86: split off condition code helpers

2012-06-21 Thread Blue Swirl
Move condition code helpers to cc_helper.c. Move the shared inline functions lshift(), cpu_load_eflags() and cpu_cc_compute_all() to cpu.h. Signed-off-by: Blue Swirl --- target-i386/Makefile.objs |3 +- target-i386/cc_helper.c | 387 +++ target-i38

[Qemu-devel] [PATCH 3/9] x86: avoid AREG0 for integer helpers

2012-06-21 Thread Blue Swirl
Add an explicit CPUX86State parameter instead of relying on AREG0. Signed-off-by: Blue Swirl --- target-i386/Makefile.objs |1 - target-i386/helper.h| 50 +- target-i386/int_helper.c| 36 +- target-i386/shift_h

[Qemu-devel] [PULL] qemu-ga patches for guest-fstrim command

2012-06-21 Thread Michael Roth
The following changes since commit 47ecbdf07ed2c37bdfd2d77137d01bb319ce13da: libcacard: build fixes (2012-06-21 20:04:24 +) are available in the git repository at: git://github.com/mdroth/qemu.git qga-pull-6-21-12 Paolo Bonzini (2): qemu-ga: make names more generic for mount list f

[Qemu-devel] [PATCH 1/2] qemu-ga: make names more generic for mount list functions

2012-06-21 Thread Michael Roth
From: Paolo Bonzini We will use these functions and types for more than FSFREEZE, so rename them. Signed-off-by: Paolo Bonzini Reviewed-by: Luiz Capitulino Reviewed-by: Michal Privoznik Signed-off-by: Michael Roth --- qga/commands-posix.c | 36 ++-- 1 files

[Qemu-devel] [PATCH 2/2] qemu-ga: add guest-fstrim command

2012-06-21 Thread Michael Roth
From: Paolo Bonzini FITRIM is a mounted filesystem feature to discard (or "trim") blocks which are not in use by the filesystem. This is useful for solid-state drives (SSDs) and thinly-provisioned storage. Provide access to the feature from the host so that filesystems can be trimmed periodicall

[Qemu-devel] KVM Forum and oVirt Workshop Europe 2012 Save the Date

2012-06-21 Thread KVM Forum 2012 Program Committee
KVM is an industry leading open source hypervisor that provides an ideal platform for datacenter virtualization, virtual desktop infrastructure, and cloud computing. Once again, it's time to bring together the community of developers and users that define the KVM ecosystem for our annual technical

[Qemu-devel] [Bug 1015978] [NEW] USB serial port regression after qemu-kvm_1.0+dfsg-8

2012-06-21 Thread Attila Lendvai
Public bug reported: Host is debian testing, on x64. Guest is a windoze xp. I'm flashing a mobile Point of Sale (POS) terminal using its proprietary windoze program that communicates on serial ports. The POS device has a USB port which is acting as a serial port (CDC to USB UART). Up to and inc

Re: [Qemu-devel] qemu -numa option and non-contiguous CPU ranges

2012-06-21 Thread Andre Przywara
On 06/21/2012 07:51 PM, Eduardo Habkost wrote: Hi, I just noticed libvirt tries to use the -numa option in a way that qemu never understood: if a node is configured to have a non-contiguous set of CPUs, it tries to generate a command-line option that looks like: "-numa node,nodeid=...,cpus=0,2,

Re: [Qemu-devel] [PATCH] msi/msix: added API to set MSI message address and data

2012-06-21 Thread Alexey Kardashevskiy
On 21/06/12 21:49, Jan Kiszka wrote: > On 2012-06-21 13:39, Alexey Kardashevskiy wrote: >> Added (msi|msix)_set_message() functions. >> >> Currently msi_notify()/msix_notify() write to these vectors to >> signal the guest about an interrupt so the correct values have to >> written there by the gues

Re: [Qemu-devel] [PATCH 1/3] Fix aml_name_string() to recognize block name modifiers.

2012-06-21 Thread Kevin O'Connor
On Wed, Jun 20, 2012 at 04:08:41PM +0300, Gleb Natapov wrote: > On Tue, May 22, 2012 at 09:23:03PM -0400, Kevin O'Connor wrote: > > On Sun, May 20, 2012 at 12:03:38PM +0300, Gleb Natapov wrote: > > > > > > Signed-off-by: Gleb Natapov > > > > The patch series looks okay to me. Let me know when t

[Qemu-devel] [PATCH] msi/msix: added API to set MSI message address and data

2012-06-21 Thread Alexey Kardashevskiy
Added (msi|msix)_set_message() function for whoever might want to use them. Currently msi_notify()/msix_notify() write to these vectors to signal the guest about an interrupt so the correct values have to written there by the guest or QEMU. For example, POWER guest never initializes MSI/MSIX vect

Re: [Qemu-devel] [PATCH 01/13] Better support for dma_addr_t variables

2012-06-21 Thread Benjamin Herrenschmidt
On Wed, 2012-06-20 at 16:14 -0500, Anthony Liguori wrote: > diff --git a/hw/qdev-dma.h b/hw/qdev-dma.h > > new file mode 100644 > > index 000..f0ff558 > > --- /dev/null > > +++ b/hw/qdev-dma.h > > @@ -0,0 +1,12 @@ > > +/* > > + * Support for dma_addr_t typed properties > > + * > > + * Copyrig

Re: [Qemu-devel] [PATCH 02/13] Implement cpu_physical_memory_set()

2012-06-21 Thread Benjamin Herrenschmidt
On Wed, 2012-06-20 at 16:15 -0500, Anthony Liguori wrote: > On 06/19/2012 01:39 AM, Benjamin Herrenschmidt wrote: > > From: David Gibson > > > > This patch adds cpu_physical_memory_set() function. This is equivalent to > > calling cpu_physical_memory_write() with a buffer filled with a character,

Re: [Qemu-devel] [PATCH 1/3] iommu: remove extra 'typedef struct DMAContext'

2012-06-21 Thread Benjamin Herrenschmidt
On Wed, 2012-06-20 at 16:11 -0400, Jason Baron wrote: > There are several instances of 'typedef struct DMAContext DMAContext'. Remove > them > all except for the one in qemu-common.h. Actually, the other way around :-) I'm removing the one in qemu-common.h in favor of the one in dma.h (at Anthony

Re: [Qemu-devel] [PATCH 03/13] iommu: Add universal DMA helper functions

2012-06-21 Thread Benjamin Herrenschmidt
On Wed, 2012-06-20 at 16:16 -0500, Anthony Liguori wrote: > > diff --git a/qemu-common.h b/qemu-common.h > > index 8f87e41..80026af 100644 > > --- a/qemu-common.h > > +++ b/qemu-common.h > > @@ -264,6 +264,7 @@ typedef struct EventNotifier EventNotifier; > > typedef struct VirtIODevice VirtIODevi

Re: [Qemu-devel] hw/Makefile.objs question

2012-06-21 Thread Alexey Kardashevskiy
On 22/06/12 00:04, Andreas Färber wrote: > Am 21.06.2012 15:10, schrieb Alexey Kardashevskiy: >> On 21/06/12 22:19, Andreas Färber wrote: >>> Am 21.06.2012 13:21, schrieb Alexey Kardashevskiy: On 21/06/12 20:36, Andreas Färber wrote: > Am 21.06.2012 05:22, schrieb Alexey Kardashevskiy: >>>

Re: [Qemu-devel] [PATCH 04/13] usb-ohci: Use universal DMA helper functions

2012-06-21 Thread Benjamin Herrenschmidt
On Thu, 2012-06-21 at 07:55 -0500, Anthony Liguori wrote: > As long as we scrub the buffers, returning an unhandled error seems okay to > me. > > I've long thought we should have some sort of generic way to throw an error > and > effectively pause a single device. I'm not sure how it would wo

Re: [Qemu-devel] [PATCH 2/2] kvm: use per-cpu lock to free vcpu thread out of the big lock

2012-06-21 Thread Wei-Ren Chen
Hi Liu, On Thu, Jun 21, 2012 at 11:06:58PM +0800, Liu Ping Fan wrote: > In order to break the big lock, using per-cpu_lock in kvm_cpu_exec() > to protect the race from other cpu's access to env->apic_state & related > field in env. Can this also be applied on tcg_cpu_exec(), too? Regards, chen

Re: [Qemu-devel] [PATCH 6/7] Exit loop if we have been there too long

2012-06-21 Thread Wei-Ren Chen
> >> +if ((i & 63) == 0) { > >> +uint64_t t1 = (qemu_get_clock_ns(rt_clock) - bwidth) / > >> 100; > >> +if (t1 > 50) { /* 50ms, half buffered_file limit */ > > can't we use a constant ? > > 50 is a constant already, no? Or what do you mean. I guess Orit mea

Re: [Qemu-devel] [PATCH v5 00/16] QEMU OpenRISC support

2012-06-21 Thread Wei-Ren Chen
On Thu, Jun 21, 2012 at 06:28:30PM +0100, Peter Maydell wrote: > On 21 June 2012 18:24, Blue Swirl wrote: > > On Wed, Jun 20, 2012 at 7:10 AM, Jia Liu wrote: > >> ERROR: need consistent spacing around '*' (ctx:WxV) > >> #99: FILE: target-openrisc/int_helper.c:53: > >> +target_ulong HELPER(mul32)(

Re: [Qemu-devel] [PATCH 09/13] iommu: Add facility to cancel in-use dma memory maps

2012-06-21 Thread Benjamin Herrenschmidt
On Wed, 2012-06-20 at 16:25 -0500, Anthony Liguori wrote: > > +static void dma_aio_cancel(BlockDriverAIOCB *acb) > > +{ > > +DMAAIOCB *dbs = container_of(acb, DMAAIOCB, common); > > + > > +trace_dma_aio_cancel(dbs); > > + > > +if (dbs->acb) { > > +BlockDriverAIOCB *acb = dbs->a

[Qemu-devel] [PATCH 00/11] iommu series

2012-06-21 Thread Benjamin Herrenschmidt
Here's the latest drop as discussed on the list. 2 patches are gone, the _set variant is folded in the DMA helpers and I ditched all the broken cancellation bits.

[Qemu-devel] [PATCH 01/11] Better support for dma_addr_t variables

2012-06-21 Thread Benjamin Herrenschmidt
From: David Gibson A while back, we introduced the dma_addr_t type, which is supposed to be used for bus visible memory addresses. At present, this is an alias for target_phys_addr_t, but this will change when we eventually add support for guest visible IOMMUs. There are some instances of targe

[Qemu-devel] [PATCH 04/11] iommu: Make sglists and dma_bdrv helpers use new universal DMA helpers

2012-06-21 Thread Benjamin Herrenschmidt
From: David Gibson dma-helpers.c contains a number of helper functions for doing scatter/gather DMA, and various block device related DMA. Currently, these directly access guest memory using cpu_physical_memory_*(), assuming no IOMMU translation. This patch updates this code to use the new univ

[Qemu-devel] [PATCH 03/11] usb-ohci: Use universal DMA helper functions

2012-06-21 Thread Benjamin Herrenschmidt
From: David Gibson The OHCI device emulation can provide both PCI and SysBus OHCI implementations. Because of this, it was not previously converted to use the PCI DMA helper functions. This patch converts it to use the new universal DMA helper functions. In the PCI case, it obtains its DMAConte

[Qemu-devel] [PATCH 11/11] Add a memory barrier to DMA functions

2012-06-21 Thread Benjamin Herrenschmidt
The emulated devices can run simultaneously with the guest, so we need to be careful with ordering of load and stores done by them to the guest system memory, which need to be observed in the right order by the guest operating system. This adds a barrier call to the basic DMA read/write ops which

[Qemu-devel] [PATCH 10/11] pseries: Implement IOMMU and DMA for PAPR PCI devices

2012-06-21 Thread Benjamin Herrenschmidt
From: David Gibson Currently the pseries machine emulation does not support DMA for emulated PCI devices, because the PAPR spec always requires a (guest visible, paravirtualized) IOMMU which was not implemented. Now that we have infrastructure for IOMMU emulation, we can correct this and allow P

[Qemu-devel] [PATCH 09/11] iommu: Allow PCI to use IOMMU infrastructure

2012-06-21 Thread Benjamin Herrenschmidt
From: David Gibson This patch adds some hooks to let PCI devices and busses use the new IOMMU infrastructure. When IOMMU support is enabled, each PCI device now contains a DMAContext * which is used by the pci_dma_*() wrapper functions. By default, the contexts are initialized to NULL, assuming

[Qemu-devel] [PATCH 06/11] usb: Convert usb_packet_{map, unmap} to universal DMA helpers

2012-06-21 Thread Benjamin Herrenschmidt
From: David Gibson The USB UHCI and EHCI drivers were converted some time ago to use the pci_dma_*() helper functions. However, this conversion was not complete because in some places both these drivers do DMA via the usb_packet_map() function in usb-libhw.c. That function directly used cpu_phy

[Qemu-devel] [PATCH 05/11] ide/ahci: Use universal DMA helper functions

2012-06-21 Thread Benjamin Herrenschmidt
From: David Gibson The AHCI device can provide both PCI and SysBus AHCI device emulations. For this reason, it wasn't previously converted to use the pci_dma_*() helper functions. Now that we have universal DMA helper functions, this converts AHCI to use them. The DMAContext is obtained from p

[Qemu-devel] [PATCH 08/11] pseries: Convert sPAPR TCEs to use generic IOMMU infrastructure

2012-06-21 Thread Benjamin Herrenschmidt
From: David Gibson The pseries platform already contains an IOMMU implementation, since it is essential for the platform's paravirtualized VIO devices. This IOMMU support is currently built into the implementation of the VIO "bus" and the various VIO devices. This patch converts this code to ma

[Qemu-devel] [PATCH 07/11] iommu: Introduce IOMMU emulation infrastructure

2012-06-21 Thread Benjamin Herrenschmidt
From: David Gibson This patch adds the basic infrastructure necessary to emulate an IOMMU visible to the guest. The DMAContext structure is extended with information and a callback describing the translation, and the various DMA functions used by devices will now perform IOMMU translation using

[Qemu-devel] [PATCH 02/11] iommu: Add universal DMA helper functions

2012-06-21 Thread Benjamin Herrenschmidt
From: David Gibson Not that long ago, every device implementation using DMA directly accessed guest memory using cpu_physical_memory_*(). This meant that adding support for a guest visible IOMMU would require changing every one of these devices to go through IOMMU translation. Shortly before qe

[Qemu-devel] [RFC] block: Removed coroutine ownership assumption

2012-06-21 Thread Peter A. G. Crosthwaite
The block layer assumes that it is the only user of coroutines - The qemu_in_coroutine() is used to determine if a function is in one of the block layers coroutines, which is flawed. I.E. If a client (e.g. a device or a machine model) of the block layer uses couroutine itself, the block layer will

<    1   2