Re: [Qemu-devel] [PATCH 46/55] block: Drop BlockDriverState member removable

2011-07-26 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH 45/55] block: Clean up remaining users of "removable"

2011-07-26 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH v3] Add support for fd: protocol

2011-07-26 Thread Christoph Hellwig
I have to say I really hate it. We've been working hard on getting rid of special cases in the qemu block layer, and this sprinkles them all over. I'd recommend to fix your security model instead.

Re: [Qemu-devel] [RFC PATCH 0/4] Fix subsection ambiguity in the migration format

2011-07-26 Thread Anthony Liguori
On 07/26/2011 07:51 AM, Stefan Hajnoczi wrote: On Tue, Jul 26, 2011 at 10:48 AM, Stefan Hajnoczi wrote: On Mon, Jul 25, 2011 at 06:23:17PM -0500, Anthony Liguori wrote: However, doing so imposes extra work on management tools - they need to understand and drive negotiation. If QEMU adds a new

Re: [Qemu-devel] [RFC][PATCH 0/21] QEMU Object Model

2011-07-26 Thread Paolo Bonzini
On 07/25/2011 03:44 AM, Anthony Liguori wrote: Hi, This series is the rough beginnings of the QEMU Object Model. This is basically qdev generalized on steroids. This series includes the core infrastructure, a strawman Device type, and the beginnings of the conversion of CharDriverState. This

[Qemu-devel] [PATCH v2 21/23] pci: add MemoryRegion based BAR management API

2011-07-26 Thread Avi Kivity
Allow registering a BAR using a MemoryRegion. Once all users are converted, pci_register_bar() and pci_register_bar_simple() will be removed. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- hw/pci.c | 47 +++ hw/pci.h |3 +++ 2 files

[Qemu-devel] [PATCH v3] Add support for fd: protocol

2011-07-26 Thread Corey Bryant
sVirt provides SELinux MAC isolation for Qemu guest processes and their corresponding resources (image files). sVirt provides this support by labeling guests and resources with security labels that are stored in file system extended attributes. Some file systems, such as NFS, do not support the ext

Re: [Qemu-devel] [RFC PATCH 0/4] Fix subsection ambiguity in the migration format

2011-07-26 Thread Stefan Hajnoczi
On Tue, Jul 26, 2011 at 10:48 AM, Stefan Hajnoczi wrote: > On Mon, Jul 25, 2011 at 06:23:17PM -0500, Anthony Liguori wrote: >> On 07/25/2011 04:10 PM, Paolo Bonzini wrote: >> >On Thu, Jun 30, 2011 at 17:46, Paolo Bonzini  wrote: >> >>With the current migration format, VMS_STRUCTs with subsections

[Qemu-devel] [PATCH v2 01/23] Add memory API documentation

2011-07-26 Thread Avi Kivity
Signed-off-by: Avi Kivity --- docs/memory.txt | 172 +++ 1 files changed, 172 insertions(+), 0 deletions(-) create mode 100644 docs/memory.txt diff --git a/docs/memory.txt b/docs/memory.txt new file mode 100644 index 000..4460c06 --- /dev

Re: [Qemu-devel] [PATCH] m68k: Add uc5282 machine

2011-07-26 Thread Alexander Graf
Hi Joel, On 20.07.2011, at 19:10, Joel Sherrill wrote: > From: Till Straumann > > Add m68k machine support for Arcturus Networks > Inc. uC5282 board. Also include > > a fix for the FEC ethernet controller. > > Signed-off-by: Joel Sherrill Could you please split this into several patches an

[Qemu-devel] [PATCH v2 06/23] memory: abstract address space operations

2011-07-26 Thread Avi Kivity
Prepare for multiple address space support by abstracting away the details of registering a memory range with qemu's flat representation into an AddressSpace object. Note operations which are memory specific are not abstracted, since they will never be called on I/O address spaces anyway. Reviewe

[Qemu-devel] [PATCH v2 05/23] Internal interfaces for memory API

2011-07-26 Thread Avi Kivity
get_system_memory() provides the root of the memory hierarchy. This interface is intended to be private between memory.c and exec.c. If this file is included elsewhere, it should be regarded as a bug (or TODO item). However, it will be temporarily needed for the conversion to hierarchical memory

[Qemu-devel] [PATCH v2 16/23] ioport: register ranges by byte aligned addresses always

2011-07-26 Thread Avi Kivity
The I/O port space is byte addressable, even for word and long accesses. An example is the VMware svga card, which has long ports on offsets 0, 1, and 2. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- ioport.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --gi

[Qemu-devel] [PATCH v2 12/23] memory: add ioeventfd support

2011-07-26 Thread Avi Kivity
As with the rest of the memory API, the caller associates an eventfd with an address, and the memory API takes care of registering or unregistering when the address is made visible or invisible to the guest. Signed-off-by: Avi Kivity --- memory.c | 224 ++

[Qemu-devel] [PATCH 10/10] block: Use bdrv_co_* instead of synchronous versions in coroutines

2011-07-26 Thread Kevin Wolf
If we're already in a coroutine, there is no reason to use the synchronous version of block layer functions when a coroutine one exists. This makes bdrv_read/write/flush use bdrv_co_* when used inside a coroutine. Signed-off-by: Kevin Wolf --- block.c | 43 +

[Qemu-devel] [PATCH v2 07/23] memory: rename MemoryRegion::has_ram_addr to ::terminates

2011-07-26 Thread Avi Kivity
I/O regions will not have ram_addrs, so this is a better name. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- memory.c | 18 +- memory.h |2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/memory.c b/memory.c index bae7765..9e1a838 100644 --

[Qemu-devel] [PATCH 05/10] qcow2: Use coroutines

2011-07-26 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block/qcow2-cluster.c | 26 +++--- block/qcow2.c | 240 ++--- block/qcow2.h |5 +- 3 files changed, 102 insertions(+), 169 deletions(-) diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c inde

Re: [Qemu-devel] [RFC PATCH 0/4] Fix subsection ambiguity in the migration format

2011-07-26 Thread Anthony Liguori
On 07/26/2011 07:07 AM, Juan Quintela wrote: Anthony Liguori wrote: == What we need == We need to decompose migration into three different problems: 1) serializing device state 2) transforming the device model in order to satisfy forwards and backwards compatibility 3) encoding the serialized

[Qemu-devel] [PATCH v2 20/23] pci: pass address space to pci bus when created

2011-07-26 Thread Avi Kivity
This is now done sloppily, via get_system_memory(). Eventually callers will be converted to stop using that. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- hw/apb_pci.c |2 ++ hw/bonito.c|4 +++- hw/grackle_pci.c |5 +++-- hw/gt64xxx.c |4 +++-

Re: [Qemu-devel] [PATCH 42/55] block: Clean up bdrv_flush_all()

2011-07-26 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH 40/55] block: Leave tracking media change to device models

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:24:14PM +0200, Markus Armbruster wrote: > hw/fdc.c is the only one that cares. > > Signed-off-by: Markus Armbruster Looks good, Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH 39/55] block/raw: Fix to forward method bdrv_media_changed()

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:24:13PM +0200, Markus Armbruster wrote: > Block driver "raw" forwards most methods to the underlying block > driver. However, it doesn't implement method bdrv_media_changed(). > Makes bdrv_media_changed() always return -ENOTSUP. > > I believe -fda /dev/fd0 gives you raw

Re: [Qemu-devel] [PATCH 35/55] scsi-disk: Avoid physical/virtual tray state mismatch

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:24:09PM +0200, Markus Armbruster wrote: > When scsi-cd is backed by a physical drive, we want the physical tray > match the virtual one. To that end, we call bdrv_eject() on guest's > load/eject, and bdrv_lock_medium() on guest's prevent/allow removal. > But we don't set

Re: [Qemu-devel] [PATCH 34/55] scsi-disk: Fix START_STOP to fail when it can't eject

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:24:08PM +0200, Markus Armbruster wrote: > Don't fail when tray is already open. > > Signed-off-by: Markus Armbruster Looks good, Reviewed-by: Christoph Hellwig

[Qemu-devel] [PATCH v2 17/23] pc: grab system_memory

2011-07-26 Thread Avi Kivity
While eventually this should come from the machine initialization function, take a short cut to avoid converting all machines now. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- hw/pc.c |3 ++- hw/pc.h |4 +++- hw/pc_piix.c |8 +++- 3 files changed, 12 inse

Re: [Qemu-devel] [PATCH 33/55] ide/atapi: Avoid physical/virtual tray state mismatch

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:24:07PM +0200, Markus Armbruster wrote: > When ide-cd is backed by a physical drive, we want the physical tray > match the virtual one. To that end, we call bdrv_eject() on guest's > load/eject, and bdrv_lock_medium() on guest's prevent/allow removal. > But we don't set

Re: [Qemu-devel] [PATCH 32/55] ide/atapi: Don't fail eject when tray is already open

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:24:06PM +0200, Markus Armbruster wrote: > MMC-5 6.40.2.6 specifies that START STOP UNIT succeeds when the drive > already has the requested state. cmd_start_stop_unit() fails when > asked to eject while the tray is open and locked. Fix that. > > Signed-off-by: Markus A

Re: [Qemu-devel] [PATCH 31/55] ide: Provide IDEDeviceInfo method exit()

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:24:05PM +0200, Markus Armbruster wrote: > > Signed-off-by: Markus Armbruster Looks good, Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH 27/55] scsi-disk: Switch from BlockDriverState's locked to own tray_locked

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:24:01PM +0200, Markus Armbruster wrote: > > Signed-off-by: Markus Armbruster Looks good, although I would have merged it into the previous one. Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH 26/55] scsi-disk: Track tray locked state

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:24:00PM +0200, Markus Armbruster wrote: > We already track it in BlockDriverState. Just like tray open/close > state, we should track it in the device models instead, because it's > device state. > > Signed-off-by: Markus Armbruster Looks good, Reviewed-by: Christoph

Re: [Qemu-devel] [PATCH 25/55] ide/atapi: Switch from BlockDriverState's locked to own tray_locked

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:59PM +0200, Markus Armbruster wrote: > > Signed-off-by: Markus Armbruster > --- > hw/ide/atapi.c |3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) Looks good, Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH 24/55] ide/atapi: Track tray locked state

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:58PM +0200, Markus Armbruster wrote: > We already track it in BlockDriverState. Just like tray open/close > state, we should track it in the device models instead, because it's > device state. > > Signed-off-by: Markus Armbruster Looks good, Reviewed-by: Christoph

Re: [Qemu-devel] [PATCH 22/55] block: Drop tray status tracking, no longer used

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:56PM +0200, Markus Armbruster wrote: > Commit 4be9762a is now completely redone. > > Signed-off-by: Markus Armbruster Looks good, Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH 21/55] block: Revert entanglement of bdrv_is_inserted() with tray status

2011-07-26 Thread Christoph Hellwig
> @@ -1066,20 +1066,21 @@ static const struct { > [ 0x03 ] = { cmd_request_sense, ALLOW_UA }, > [ 0x12 ] = { cmd_inquiry, ALLOW_UA }, > [ 0x1a ] = { cmd_mode_sense, /* (6) */ 0 }, > -[ 0x1b ] = { cmd_start_stop_unit, 0

Re: [Qemu-devel] [RFC PATCH 0/4] Fix subsection ambiguity in the migration format

2011-07-26 Thread Juan Quintela
Anthony Liguori wrote: > On 07/25/2011 04:10 PM, Paolo Bonzini wrote: > == Today == > > Today we only support generating the latest serialization of > devices. To increase the probability of the latest version working on > older versions of QEMU, we strategically omit fields that we know can > sa

[Qemu-devel] [PATCH v2 18/23] pc: convert pc_memory_init() to memory API

2011-07-26 Thread Avi Kivity
Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- hw/pc.c | 59 --- hw/pc.h |1 + 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index 369566a..1c9d89a 100644 --- a/hw/pc.c +++ b/hw/pc.c @@

[Qemu-devel] [PATCH v2 22/23] sysbus: add MemoryRegion based memory management API

2011-07-26 Thread Avi Kivity
Allow registering sysbus device memory using a MemoryRegion. Once all users are converted, sysbus_init_mmio() and sysbus_init_mmio_cb() will be removed. Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- hw/sysbus.c | 27 --- hw/sysbus.h |3 +++ 2 files ch

Re: [Qemu-devel] [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Avi Kivity
On 07/26/2011 02:51 PM, Paolo Bonzini wrote: On 07/26/2011 01:38 PM, Avi Kivity wrote: if (j != i) { +memmove(&view->ranges[i], &view->ranges[j], +(view->nr - j) * sizeof(view->ranges[j])); +view->nr -= j - i; +} } Seems to work both ways? Sure, but y

[Qemu-devel] [PATCH v2 08/23] memory: late initialization of ram_addr

2011-07-26 Thread Avi Kivity
For non-RAM memory regions, we cannot tell whether this is an I/O region or an MMIO region. Since the qemu backing registration is different for the two, we have to defer initialization until we know which address space we are in. These shenanigans will be removed once the backing registration is

Re: [Qemu-devel] [PATCH 20/55] scsi-disk: Track tray open/close state

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:54PM +0200, Markus Armbruster wrote: > We already track it in BlockDriverState since commit 4be9762a. As > discussed in that commit's message, we should track it in the device > device models instead, because it's device state. Looks good, Reviewed-by: Christoph Hel

Re: [Qemu-devel] [PATCH 19/55] scsi-disk: Factor out scsi_disk_emulate_start_stop()

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:53PM +0200, Markus Armbruster wrote: > > Signed-off-by: Markus Armbruster Looks good, Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH 18/55] scsi-disk: Reject CD-specific SCSI commands to disks

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:52PM +0200, Markus Armbruster wrote: > Use a table to declare which drive kinds accept each command. > > Limit READ_CAPACITY, READ_TOC, GET_CONFIGURATION to SCSI_CD, as per > SPC-4. READ CAPACITY is defined in SBC, and absolutely required for proper operation with di

[Qemu-devel] [PATCH v2 10/23] memory: add backward compatibility for old portio registration

2011-07-26 Thread Avi Kivity
Reviewed-by: Anthony Liguori Signed-off-by: Avi Kivity --- memory.c | 32 memory.h | 17 + 2 files changed, 49 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index df0ed0e..5f2c9ef 100644 --- a/memory.c +++ b/memory.c @@ -218,

[Qemu-devel] [PATCH 03/10] block: Add bdrv_co_readv/writev emulation

2011-07-26 Thread Kevin Wolf
In order to be able to call bdrv_co_readv/writev for drivers that don't implement the functions natively, add an emulation that uses the AIO functions to implement them. Signed-off-by: Kevin Wolf --- block.c | 84 - trace-events |

Re: [Qemu-devel] [PATCH 17/55] ide/atapi: Switch from BlockDriverState's tray_open to own

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:51PM +0200, Markus Armbruster wrote: > > Signed-off-by: Markus Armbruster Looks good, although I would have folded this patch into the previous one. Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH 16/55] ide/atapi: Track tray open/close state

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:50PM +0200, Markus Armbruster wrote: > We already track it in BlockDriverState since commit 4be9762a. As > discussed in that commit's message, we should track it in the device > device models instead, because it's device state. Looks good, Reviewed-by: Christoph Hel

Re: [Qemu-devel] [PATCH 0/3] Add PL111, implement PL110 BGR mode

2011-07-26 Thread Francis Moreau
On Tue, Jul 26, 2011 at 12:12 PM, Peter Maydell wrote: > On 22 July 2011 16:59, Peter Maydell wrote: >> This patch series improves the emulation of the PL11x CLCD >> controllers used by the various ARM dev boards. > >> versatilepb has a PL110 but it also has an external mux controlled >> by a sys

Re: [Qemu-devel] [PATCH 15/55] ide/atapi: Clean up misleading name in cmd_start_stop_unit()

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:49PM +0200, Markus Armbruster wrote: > "eject" is misleading; it means "eject" when start is clear, but > "load" when start is set. Rename to loej, because that's how MMC-5 > calls it, in section 6.40. Just as clear as the bdrv_eject name :) Looks fine anyway, Revi

Re: [Qemu-devel] [PATCH 14/55] ide: Reject ATA commands specific to drive kinds

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:48PM +0200, Markus Armbruster wrote: > ACS-2 Table B.2 explicitly prohibits ATAPI devices from implementing > WIN_RECAL, WIN_READ_EXT, WIN_READDMA_EXT, WIN_READ_NATIVE_MAX, > WIN_MULTREAD_EXT, WIN_WRITE, WIN_WRITE_ONCE, WIN_WRITE_EXT, > WIN_WRITEDMA_EXT, WIN_MULTWRITE_

Re: [Qemu-devel] [PATCH 13/55] ide: Use a table to declare which drive kinds accept each command

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:47PM +0200, Markus Armbruster wrote: > No functional change. > > It would be nice to have handler functions in the table, like commit > e1a064f9 did for ATAPI. Left for another day. Looks good, Reviewed-by: Christoph Hellwig

Re: [Qemu-devel] [PATCH 12/55] ide: Fix ATA command READ to set ATAPI signature for CD-ROM

2011-07-26 Thread Christoph Hellwig
On Wed, Jul 20, 2011 at 06:23:46PM +0200, Markus Armbruster wrote: > Must set the ATAPI device signature, see ACS-2 7.36.6 Outputs for > PACKET feature set devices. Odd but true, even if it's 7.38.2 in my local copy of the ACS spec. It defintively should be documented in a comment next to the cod

[Qemu-devel] [PATCH v2 02/23] Hierarchical memory region API

2011-07-26 Thread Avi Kivity
The memory API separates the attributes of a memory region (its size, how reads or writes are handled, dirty logging, and coalescing) from where it is mapped and whether it is enabled. This allows a device to configure a memory region once, then hand it off to its parent bus to map it according to

[Qemu-devel] [PATCH v2 14/23] memory: transaction API

2011-07-26 Thread Avi Kivity
Allow changes to the memory hierarchy to be accumulated and made visible all at once. This reduces computational effort, especially when an accelerator (e.g. kvm) is involved. Useful when a single register update causes multiple changes to an address space. Signed-off-by: Avi Kivity --- memory

Re: [Qemu-devel] [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Paolo Bonzini
On 07/26/2011 01:38 PM, Avi Kivity wrote: if (j != i) { +memmove(&view->ranges[i], &view->ranges[j], +(view->nr - j) * sizeof(view->ranges[j])); +view->nr -= j - i; +} } Seems to work both ways? Sure, but you're pointlessly memmove-ing memory over itse

[Qemu-devel] [PATCH 01/10] block: Add bdrv_co_readv/writev

2011-07-26 Thread Kevin Wolf
Add new block driver callbacks bdrv_co_readv/writev, which work on a QEMUIOVector like bdrv_aio_*, but don't need a callback. The function may only be called inside a coroutine, so a block driver implementing this interface can yield instead of blocking during I/O. Signed-off-by: Kevin Wolf ---

[Qemu-devel] [PATCH 07/10] async: Remove AsyncContext

2011-07-26 Thread Kevin Wolf
The purpose of AsyncContexts was to protect qcow and qcow2 against reentrancy during an emulated bdrv_read/write (which includes a qemu_aio_wait() call and can run AIO callbacks of different requests if it weren't for AsyncContexts). Now both qcow and qcow2 are protected by CoMutexes and AsyncCont

[Qemu-devel] [PATCH 08/10] coroutines: Use one global bottom half for CoQueue

2011-07-26 Thread Kevin Wolf
Now that AsyncContexts don't exist any more, we can use one global bottom half for restarting coroutines instead of allocating a new one every time (before removing AsyncContexts, the problem with having a global BH was that it had to belong to a single AsyncContexts and wouldn't be executed in a d

[Qemu-devel] [PATCH 02/10] block: Emulate AIO functions with bdrv_co_readv/writev

2011-07-26 Thread Kevin Wolf
Use the bdrv_co_readv/writev callbacks to implement bdrv_aio_readv/writev and bdrv_read/write if a driver provides the coroutine version instead of the synchronous or AIO version. Signed-off-by: Kevin Wolf --- block.c | 98 ++- 1 file

[Qemu-devel] [PATCH 00/10] block: Coroutine support

2011-07-26 Thread Kevin Wolf
Depends on Stefan's latest coroutine patches. This series makes qcow and qcow2 take advantage of the new coroutine infrastructure. Both formats used synchronous operations for accessing their metadata and blocked the guest CPU during that time. With coroutines, the I/O will happen asynchronously in

[Qemu-devel] [PATCH v2 15/23] exec.c: initialize memory map

2011-07-26 Thread Avi Kivity
Allocate the root memory region and initialize it. Signed-off-by: Avi Kivity --- exec.c | 19 +++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/exec.c b/exec.c index 2160ded..d51502f 100644 --- a/exec.c +++ b/exec.c @@ -33,6 +33,8 @@ #include "kvm.h" #includ

Re: [Qemu-devel] [PATCH 14/23] memory: transaction API

2011-07-26 Thread Avi Kivity
On 07/26/2011 01:48 PM, Avi Kivity wrote: On 07/25/2011 10:16 PM, Anthony Liguori wrote: On 07/25/2011 09:02 AM, Avi Kivity wrote: Allow changes to the memory hierarchy to be accumulated and made visible all at once. This reduces computational effort, especially when an accelerator (e.g. kvm)

Re: [Qemu-devel] [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Avi Kivity
On 07/26/2011 02:36 PM, Paolo Bonzini wrote: On 07/26/2011 01:26 PM, Avi Kivity wrote: +while (i < view->nr) { +j = i + 1; +while (j < view->nr + && can_merge(&view->ranges[j-1], &view->ranges[j])) { +view->ranges[i].addr.size += view->ranges[j].addr.size; +

Re: [Qemu-devel] [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Paolo Bonzini
On 07/26/2011 01:26 PM, Avi Kivity wrote: +while (i < view->nr) { +j = i + 1; +while (j < view->nr + && can_merge(&view->ranges[j-1], &view->ranges[j])) { +view->ranges[i].addr.size += view->ranges[j].addr.size; +++j; +} ++

[Qemu-devel] [Bug 816370] [NEW] compile error in QEMU 0.15.0-rc0

2011-07-26 Thread rowa
Public bug reported: I've tryed to compile QEMU 0.15.0-rc0 on Ubuntu 10.10 „Maverick Meerkat“ but I get an error (For further details please see http://qemu- buch.de/d/Installation#Quellen_kompilieren ). ./configure --prefix=/usr --enable-spice --audio-card-list=ac97,es1370,sb16,adlib,gus,cs423

Re: [Qemu-devel] [PATCH 00/23] Memory API, batch 1

2011-07-26 Thread Avi Kivity
On 07/25/2011 11:23 PM, Anthony Liguori wrote: Very nice series. Despite my lack of exciting over ioeventfd and coalescing, if you fix the few minor comments, this should be a no brainer to merge. Thanks; v2 posted. Note that this patchset has a logical dependency on my "[PATCH] CODING_STY

[Qemu-devel] [PATCH v2 04/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Avi Kivity
Simple implementations of memory routers, for example the Cirrus VGA memory banks or the 440FX PAM registers can generate adjacent memory regions which are contiguous. Detect these and merge them; this saves kvm memory slots and shortens lookup times. Signed-off-by: Avi Kivity --- memory.c |

Re: [Qemu-devel] [RFC PATCH 2/2] separate thread for VM migration

2011-07-26 Thread Paolo Bonzini
On 07/22/2011 09:58 PM, Umesh Deshapnde wrote: -qemu_mod_timer(s->timer, qemu_get_clock_ms(rt_clock) + 100); +qemu_mod_timer(s->timer, qemu_get_clock_ms(migration_clock) + 100); if (s->freeze_output) return; @@ -246,8 +246,10 @@ static void buffered_rate_tick(void *opaque

Re: [Qemu-devel] KVM call agenda for July 26

2011-07-26 Thread Stefan Hajnoczi
On Tue, Jul 26, 2011 at 12:30 AM, Juan Quintela wrote: > Please send in any agenda items you are interested in covering. 0.15.0 release candidate testing * http://wiki.qemu.org/Planning/0.15/Testing * Please test hosts, targets, subsystems, or features you care about! * May just include runnin

Re: [Qemu-devel] [PATCH 21/23] pci: add MemoryRegion based BAR management API

2011-07-26 Thread Avi Kivity
On 07/25/2011 11:20 PM, Anthony Liguori wrote: On 07/25/2011 09:03 AM, Avi Kivity wrote: Allow registering a BAR using a MemoryRegion. Once all users are converted, pci_register_bar() and pci_register_bar_simple() will be removed. Signed-off-by: Avi Kivity diff --git a/hw/pci.h b/hw/pci.h

Re: [Qemu-devel] [PATCH 19/23] pc: move global memory map out of pc_init1() and into its callers

2011-07-26 Thread Avi Kivity
On 07/25/2011 11:02 PM, Anthony Liguori wrote: On 07/25/2011 09:03 AM, Avi Kivity wrote: Signed-off-by: Avi Kivity What's the rationale here? Removing globals and making dependencies explicit. -- error compiling committee.c: too many arguments to function

Re: [Qemu-devel] [PATCH 16/23] ioport: register ranges by byte aligned addresses always

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:20 PM, Anthony Liguori wrote: On 07/25/2011 09:02 AM, Avi Kivity wrote: The I/O port space is byte addressable, even for word and long accesses. An example is the VMware svga card, which has long ports on offsets 0, 1, and 2. Signed-off-by: Avi Kivity I've always thought thi

Re: [Qemu-devel] [PATCH 15/23] exec.c: initialize memory map

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:17 PM, Anthony Liguori wrote: +static void memory_map_init(void) +{ +system_memory = qemu_malloc(sizeof(*system_memory)); +memory_region_init(system_memory, "system", UINT64_MAX); Would be nice to #define MEM_REG_SIZE_ALL UINT64_MAX Without reading the docs, it seems

Re: [Qemu-devel] [PATCH 14/23] memory: transaction API

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:16 PM, Anthony Liguori wrote: On 07/25/2011 09:02 AM, Avi Kivity wrote: Allow changes to the memory hierarchy to be accumulated and made visible all at once. This reduces computational effort, especially when an accelerator (e.g. kvm) is involved. Useful when a single register

Re: [Qemu-devel] [PATCH 13/23] memory: document the memory API

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:15 PM, Anthony Liguori wrote: +Region names + + +Regions are assigned names by the constructor. For most regions these are +only used for debugging purposes, but RAM regions also use the name to identify +live migration sections. This means that RAM region names n

Re: [Qemu-devel] [PATCH 12/23] memory: separate building the final memory map into two steps

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:12 PM, Anthony Liguori wrote: On 07/25/2011 09:02 AM, Avi Kivity wrote: Instead of adding and deleting regions in one pass, do a delete pass followed by an add pass. This fixes the following case: from: 0x-0x0fff ram (a1) 0x1000-0x1fff mmio (a2) 0x2000-0x2fff ram

Re: [Qemu-devel] idea: non-ethernet paravirtual network device

2011-07-26 Thread Hannes Reinecke
On 07/26/2011 08:04 AM, Stefan Hajnoczi wrote: On Mon, Jul 25, 2011 at 4:53 PM, Sassan Panahinejad wrote: Here's a thought, could we improve network performance by creating a paravirtual network device which doesn't emulate ethernet? It shouldn't be too hard to just whack IP packets pretty much

Re: [Qemu-devel] External COW format for raw images

2011-07-26 Thread Stefan Hajnoczi
On Wed, Jul 20, 2011 at 4:57 PM, Marcelo Tosatti wrote: > On Wed, Jul 20, 2011 at 09:35:05AM +0100, Stefan Hajnoczi wrote: >> 2011/7/19 Anthony Liguori : >> > On 07/19/2011 04:25 AM, Robert Wang wrote: >> >> As you known, raw image is very popular,but the raw image format does >> >> NOT support Co

Re: [Qemu-devel] [PATCH 0/3] Add PL111, implement PL110 BGR mode

2011-07-26 Thread Peter Maydell
On 22 July 2011 16:59, Peter Maydell wrote: > This patch series improves the emulation of the PL11x CLCD > controllers used by the various ARM dev boards. > versatilepb has a PL110 but it also has an external mux controlled > by a system register which allows the OS to select whether the > 16 bit

Re: [Qemu-devel] [PATCH 11/23] memory: add ioeventfd support

2011-07-26 Thread Avi Kivity
On 07/25/2011 10:08 PM, Anthony Liguori wrote: +static void as_memory_ioeventfd_add(AddressSpace *as, MemoryRegionIoeventfd *fd) +{ +int r; + +if (!fd->match_data || fd->addr.size != 4) { +abort(); +} + +r = kvm_set_ioeventfd_mmio_long(fd->fd, fd->addr.start, fd->data,

Re: [Qemu-devel] [PATCH 06/23] memory: rename MemoryRegion::has_ram_addr to ::terminates

2011-07-26 Thread Avi Kivity
On 07/25/2011 09:56 PM, Anthony Liguori wrote: On 07/25/2011 09:02 AM, Avi Kivity wrote: I/O regions will not have ram_addrs, so this is a better name. Signed-off-by: Avi Kivity Reviewed-by: Anthony Liguori Although it seems squashable. Yeah, I'm loath to squash across a conflicting commi

[Qemu-devel] [PATCH 6/7] balloon: Fix header comment; add Copyright

2011-07-26 Thread Amit Shah
Signed-off-by: Amit Shah --- balloon.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/balloon.c b/balloon.c index 8be3812..a938475 100644 --- a/balloon.c +++ b/balloon.c @@ -1,7 +1,9 @@ /* - * QEMU System Emulator + * Generic Balloon handlers and management * *

Re: [Qemu-devel] [PATCH 03/23] memory: merge adjacent segments of a single memory region

2011-07-26 Thread Avi Kivity
On 07/25/2011 09:48 PM, Anthony Liguori wrote: +/* Attempt to simplify a view by merging ajacent ranges */ +static void flatview_simplify(FlatView *view) +{ +unsigned i; +FlatRange *r1, *r2; + +for (i = 0; i + 1< view->nr; ++i) { +r1 =&view->ranges[i]; +r2 =&view->ran

Re: [Qemu-devel] [PATCH v7 2/4] coroutine: implement coroutines using gthread

2011-07-26 Thread Stefan Hajnoczi
On Mon, Jul 25, 2011 at 9:38 PM, Anthony Liguori wrote: > On 07/25/2011 03:04 PM, Stefan Hajnoczi wrote: >> >> From: "Aneesh Kumar K.V" >> >> On platforms that don't support makecontext(3) use gthread based >> coroutine implementation. >> >> Darwin has makecontext(3) but getcontext(3) is stubbed o

Re: [Qemu-devel] [RFC PATCH 0/4] Fix subsection ambiguity in the migration format

2011-07-26 Thread Stefan Hajnoczi
On Mon, Jul 25, 2011 at 06:23:17PM -0500, Anthony Liguori wrote: > On 07/25/2011 04:10 PM, Paolo Bonzini wrote: > >On Thu, Jun 30, 2011 at 17:46, Paolo Bonzini wrote: > >>With the current migration format, VMS_STRUCTs with subsections > >>are ambiguous. The protocol cannot tell whether a 0x5 byte

[Qemu-devel] [PATCH v8 2/5] coroutine: introduce coroutines API

2011-07-26 Thread Stefan Hajnoczi
Asynchronous code is becoming very complex. At the same time synchronous code is growing because it is convenient to write. Sometimes duplicate code paths are even added, one synchronous and the other asynchronous. This patch introduces coroutines which allow code that looks synchronous but is as

Re: [Qemu-devel] [RFC PATCH 0/4] Fix subsection ambiguity in the migration format

2011-07-26 Thread Daniel P. Berrange
On Mon, Jul 25, 2011 at 06:23:17PM -0500, Anthony Liguori wrote: > We also need a way to future proof ourselves. > > == What we can do == > > 1) Add migration capabilities to future proof ourselves. I think > the simplest way this would work is to have a > 'query-migration-capabilities' command

[Qemu-devel] [PATCH 5/7] balloon: Separate out stat and balloon handling

2011-07-26 Thread Amit Shah
Passing on '0' as ballooning target to indicate retrieval of stats is bad API. It also makes 'balloon 0' in the monitor cause a segfault. Have two different functions handle the different functionality instead. Detailed explanation from Markus's review: 1. do_info_balloon() is an info_async() me

[Qemu-devel] mips-linux-user and POSIX IPC

2011-07-26 Thread Holger Freyther
Hi All, I have no idea about the MIPS ABI (or which one I am actually using). I try to run Qt/Embedded using the linux-user target and have some issues with the code. For semctl qemu enters through the do_ipc method, it appears to be that the 'variable' ptr is really a ptr (to the stack) and need

Re: [Qemu-devel] [PATCH 01/23] Hierarchical memory region API

2011-07-26 Thread Avi Kivity
On 07/25/2011 09:41 PM, Anthony Liguori wrote: +/* Initialize a memory region + * + * The region typically acts as a container for other memory regions. + */ I'm also writing a fair bit of documentation right now. We should use a common format and declare that the doc format in CODING_STYLE.

[Qemu-devel] [PATCH] configure: add --disable-zlib-test

2011-07-26 Thread Alon Levy
This is required for building libcacard which doesn't itself require zlib without bringing in this requirement to the build environment. Signed-off-by: Alon Levy --- I'd like this to go into 0.15.0 too, it makes building libcacard possible without zlib-devel being installed. --- configure | 23

[Qemu-devel] [PATCH v8 4/5] coroutine: add test-coroutine automated tests

2011-07-26 Thread Stefan Hajnoczi
To run automated tests for coroutines: make test-coroutine ./test-coroutine On success the program terminates with exit status 0. On failure an error message is written to stderr and the program exits with exit status 1. Signed-off-by: Stefan Hajnoczi --- .gitignore |1 + Makefi

Re: [Qemu-devel] [PATCH v8 0/5] Coroutines for better asynchronous programming

2011-07-26 Thread Stefan Hajnoczi
On Tue, Jul 26, 2011 at 10:21 AM, Stefan Hajnoczi wrote: > QEMU is event-driven and suffers when blocking operations are performed > because > VM execution may be stopped until the operation completes.  Therefore many > operations that could block are performed asynchronously and a callback is >

[Qemu-devel] [PATCH v8 3/5] coroutine: add ucontext and win32 implementations

2011-07-26 Thread Stefan Hajnoczi
From: Kevin Wolf This coroutines implementation is based on the gtk-vnc implementation written by Anthony Liguori but it has been significantly rewritten by Kevin Wolf to use setjmp()/longjmp() instead of the more expensive swapcontext() and by Paolo Bonzini for Windows Fibers support. Darwin

[Qemu-devel] [PATCH v8 5/5] coroutine: add test-coroutine --benchmark-lifecycle

2011-07-26 Thread Stefan Hajnoczi
Add a microbenchmark for coroutine create, enter, and return (aka lifecycle). This is a useful benchmark because users are expected to create many coroutines, one per I/O request for example, and we therefore need to provide good performance in that scenario. To run: make test-coroutine ./te

[Qemu-devel] [PATCH v8 0/5] Coroutines for better asynchronous programming

2011-07-26 Thread Stefan Hajnoczi
QEMU is event-driven and suffers when blocking operations are performed because VM execution may be stopped until the operation completes. Therefore many operations that could block are performed asynchronously and a callback is invoked when the operation has completed. This allows QEMU to contin

[Qemu-devel] [PATCH v8 1/5] coroutine: add gthread dependency

2011-07-26 Thread Stefan Hajnoczi
Commit 1fc7bd4a86a2bfeafcec29445871eb97469a2699 removed the gthread and gio dependency since qemu-ga did not require it. Coroutines require gthread, so add it back in. Signed-off-by: Stefan Hajnoczi --- configure |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf

[Qemu-devel] [PATCH 4/7] virtio-balloon: Separate status handling into separate function

2011-07-26 Thread Amit Shah
Separate out the code to retrieve balloon info from the code that sets balloon values. This will be used to separate the two callbacks from balloon.c and help cope with 'balloon 0' on the monitor. Currently, 'balloon 0' causes a segfault in monitor_resume(). Signed-off-by: Amit Shah Reviewed-by

[Qemu-devel] [PATCH 3/7] balloon: Simplify code flow

2011-07-26 Thread Amit Shah
Replace: if (foo) { ... } else { return 0; } by if (!foo) { return 0; } ... Signed-off-by: Amit Shah Reviewed-by: Markus Armbruster --- balloon.c | 16 +++- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/balloon.c b/balloon.c index 86f629e

[Qemu-devel] [PATCH 7/7] virtio-balloon: Fix header comment; add Copyright

2011-07-26 Thread Amit Shah
Signed-off-by: Amit Shah --- hw/virtio-balloon.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c index 40b43b0..2ba7e95 100644 --- a/hw/virtio-balloon.c +++ b/hw/virtio-balloon.c @@ -1,7 +1,9 @@ /* - * Virtio Block Device + *

[Qemu-devel] [PATCH 2/7] balloon: Add braces around if statements

2011-07-26 Thread Amit Shah
Signed-off-by: Amit Shah Reviewed-by: Markus Armbruster --- balloon.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/balloon.c b/balloon.c index f9bcf07..86f629e 100644 --- a/balloon.c +++ b/balloon.c @@ -65,9 +65,10 @@ static void print_balloon_stat(const char *k

<    1   2   3   >