Re: [Qemu-devel] [PATCH v3] Fix QEMU build on OpenBSD on x86 archs

2014-01-01 Thread Stefan Hajnoczi
On Tue, Dec 10, 2013 at 07:49:08PM -0500, Brad Smith wrote: > This resolves the build issue with building the ROMs on OpenBSD on x86 archs. > As of OpenBSD 5.3 the compiler builds PIE binaries by default and thus the > whole OS/packages and so forth. The ROMs need to have PIE disabled. This > is my

[Qemu-devel] [PATCH target-arm v4 3/3] zynq_slcr: Implement CPU reset

2014-01-01 Thread Peter Crosthwaite
Implement the CPU reset function of the A9_CPU_RST_CTRL register (offset 0x244). Signed-off-by: Peter Crosthwaite --- changed from v3: Author reset Use CPU reset rather than device reset use extract32 rather than << &. Removed halting functionality changed from v2: used device halting API instead

[Qemu-devel] [PATCH target-arm v4 2/3] zynq_slcr: Add links to the CPUs

2014-01-01 Thread Peter Crosthwaite
The SLCR needs to be able to reset the CPUs, so link the CPUs to the SLCR. Signed-off-by: Peter Crosthwaite --- Changed since v3: Revert back to using TYPE_CPU Changed from v2: Soften type of CPU to Device Looped link creator hw/arm/xilinx_zynq.c | 4 hw/misc/zynq_slcr.c | 11 +++

[Qemu-devel] [PATCH target-arm v4 1/3] xilinx_zynq: added SMP support:

2014-01-01 Thread Peter Crosthwaite
Added Linux SMP support for the Xilinx Zynq platform (2x CPUs are supported) Signed-off-by: Peter Crosthwaite --- Changed from v3: Author reset s/zynq_cpus/cpus simplified custom secondary bootloader Rebased Changed from v2: macro defined the maximum number of CPUS Changed from v1: Addressed PMM

[Qemu-devel] [PATCH target-arm v4 0/3] Reset and Halting modifications + Zynq SMP

2014-01-01 Thread Peter Crosthwaite
Hi All, The clock controller module in the Zynq platform has the ability to halt and reset arbitrary devices, including the CPU. We use this feature to implement SMP Linux - the kernel halts CPU1 then rewrites the vector table to the secondary entry point and the resets+unhalts. This series adds

Re: [Qemu-devel] [PATCH] hw/misc/blob-loader: add a generic blob loader

2014-01-01 Thread Li Guang
Peter Crosthwaite wrote: On Thu, Jan 2, 2014 at 3:35 PM, Li Guang wrote: this blob loader will be used to load a specified blob into a specified RAM address. Suggested-by: Peter Crosthwaite Signed-off-by: Li Guang --- it can be used now for allwinner-a10, like: "-device blob-l

Re: [Qemu-devel] [PATCH] hw/misc/blob-loader: add a generic blob loader

2014-01-01 Thread Peter Crosthwaite
On Thu, Jan 2, 2014 at 3:35 PM, Li Guang wrote: > this blob loader will be used to load a specified > blob into a specified RAM address. > Suggested-by: Peter Crosthwaite > Signed-off-by: Li Guang > --- > it can be used now for allwinner-a10, like: > "-device blob-loader,addr=0x4300,file=/

[Qemu-devel] [PATCH] hw/misc/blob-loader: add a generic blob loader

2014-01-01 Thread Li Guang
this blob loader will be used to load a specified blob into a specified RAM address. Signed-off-by: Li Guang --- it can be used now for allwinner-a10, like: "-device blob-loader,addr=0x4300,file=/path/script.bin" reference: http://linux-sunxi.org/Sunxi-tools script file address: http://dl.d

Re: [Qemu-devel] [PATCH 1/1] qtest:Fix the bug about disabling vnc causes "make check" hang

2014-01-01 Thread Stefan Hajnoczi
On Tue, Dec 31, 2013 at 01:19:02AM +0100, Andreas Färber wrote: > Am 30.12.2013 09:46, schrieb Kewei Yu: > > When we disabling vnc from "./configure", the qemu can't use the vnc option. > > So qtest can't use the "vnc -none ", otherwise "make check" will hang. > > > > Signed-off-by: Kewei Yu > >

Re: [Qemu-devel] [PATCH v6 04/22] qapi: extend qdict_flatten() for QLists

2014-01-01 Thread Stefan Hajnoczi
On Fri, Dec 20, 2013 at 06:23:26PM +0100, Max Reitz wrote: > On 20.12.2013 18:19, Max Reitz wrote: > >On 20.12.2013 10:46, Stefan Hajnoczi wrote: > >>>diff --git a/qobject/qdict.c b/qobject/qdict.c > >>>index fca1902..7b6b08a 100644 > >>>--- a/qobject/qdict.c > >>>+++ b/qobject/qdict.c > >>>@@ -477

Re: [Qemu-devel] [PATCH] rbd: switch from pipe to QEMUBH completion notification

2014-01-01 Thread Stefan Hajnoczi
On Thu, Dec 05, 2013 at 04:38:33PM +0100, Stefan Hajnoczi wrote: > rbd callbacks are called from non-QEMU threads. Up until now a pipe was > used to signal completion back to the QEMU iothread. > > The pipe writer code handles EAGAIN using select(2). The select(2) API > is not scalable since fd_

Re: [Qemu-devel] [PATCH V7 4/6] qcow2: cancel the modification on fail in qcow2_snapshot_create()

2014-01-01 Thread Stefan Hajnoczi
On Mon, Dec 23, 2013 at 02:12:56PM +0800, Wenchao Xia wrote: > I have reconsidered the roll back process, there is many case we > should take care, so it is better to summarize a general rule to do such > cancel operations. I suggest: do a series of roll back operations, > when one fail, skip fol

[Qemu-devel] [PATCH qmp v4 6/6] qerror: Remove assert_no_error()

2014-01-01 Thread Peter Crosthwaite
This is no longer needed, and is obsoleted by error_abort. Remove. Signed-off-by: Peter Crosthwaite Reviewed-by: Markus Armbruster --- include/qapi/qmp/qerror.h | 1 - qobject/qerror.c | 8 2 files changed, 9 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi

[Qemu-devel] [PATCH qmp v4 5/6] qemu-option: Remove qemu_opts_create_nofail

2014-01-01 Thread Peter Crosthwaite
This is a boiler-plate _nofail variant of qemu_opts_create. Remove and use error_abort in call sites. null/0 arguments needs to be added for the id and fail_if_exists fields in affected callsites due to argument inconsistency between the normal and no_fail variants. Signed-off-by: Peter Crosthwai

[Qemu-devel] [PATCH qmp v4 4/6] target-i386: Remove assert_no_error usage

2014-01-01 Thread Peter Crosthwaite
Replace an assert_no_error() usage with the error_abort system. Signed-off-by: Peter Crosthwaite Reviewed-by: Markus Armbruster --- target-i386/cpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index bb98f6d..6b7b1a9 100644 --- a

[Qemu-devel] [PATCH qmp v4 3/6] hw: Remove assert_no_error usages

2014-01-01 Thread Peter Crosthwaite
Replace assert_no_error() usages with the error_abort system. &error_abort is passed into API calls to signal to the Error sub-system that any errors are fatal. Removes need for caller assertions. Signed-off-by: Peter Crosthwaite Reviewed-by: Markus Armbruster --- changed since v2: Applied chang

[Qemu-devel] [PATCH qmp v4 2/6] hw/core/qdev: Delete dead code

2014-01-01 Thread Peter Crosthwaite
This is unreachable code, as it's already asserted that no errors have occurred. Delete. Signed-off-by: Peter Crosthwaite Reviewed-by: Markus Armbruster --- hw/core/qdev.c | 5 - 1 file changed, 5 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index e374a93..adbff18 100644 ---

[Qemu-devel] [PATCH qmp v4 1/6] error: Add error_abort

2014-01-01 Thread Peter Crosthwaite
Add a special Error * that can be passed to error handling APIs to signal that any errors are fatal and should abort QEMU. There are two advantages to this: - allows for brevity when wishing to assert success of Error ** accepting APIs. No need for this pattern: Error * local_err = NULL;

[Qemu-devel] [PATCH qmp v4 0/6] Add error_abort and associated cleanups

2014-01-01 Thread Peter Crosthwaite
Following our discussion RE self asserting API calls, here is a spin of my proposal. This series obsoletes the need for _nofail variants for Error ** accepting APIs. Is also greatly reduces the verbosity of calls sites that are currently asserting against errors. Patch 1 is the main event - additi

Re: [Qemu-devel] [PATCH RFC 3/3] tests: add test cases for qapi event support

2014-01-01 Thread Wenchao Xia
+ OrderedDict([('event', 'EVENT_A')]), + OrderedDict([('event', 'EVENT_B'), ('data', OrderedDict())]), Shouldn't the omission of 'data' be the same as 'data':{}? I didn't touch the "{ }" parsing part, maybe an existing parsing style, will check it. Checked the code, it is generated

[Qemu-devel] [PATCH v3 1/1] qtest: Fix the bug about disable vnc causes "make check" fail

2014-01-01 Thread Kewei Yu
When we disable vnc from "./configure", QEMU can't use the vnc option. So qtest can't use the "vnc -none ", otherwise "make check" fails. Signed-off-by: Kewei Yu --- v2: Consolidate VNC macro's #ifdef'ery to one central point (tests/libqtest.c). v3: Fix the spelling and terminology error: "s/di

[Qemu-devel] [PATCH target-arm v2 10/11] char/cadence_uart: Delete redundant rx rst logic

2014-01-01 Thread Peter Crosthwaite
uart_rx_reset() called immediately above already does this. Remove. Signed-off-by: Peter Crosthwaite --- hw/char/cadence_uart.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c index be32126..8a9ef81 100644 --- a/hw/char/cadence_uart.c +++ b/h

[Qemu-devel] [PATCH target-arm v2 11/11] char/cadence_uart: Implement Tx flow control

2014-01-01 Thread Peter Crosthwaite
If the UART back-end blocks, buffer in the Tx FIFO to try again later. This stops the IO-thread busy waiting on char back-ends (which causes all sorts of performance problems). Signed-off-by: Peter Crosthwaite --- hw/char/cadence_uart.c | 31 +-- 1 file changed, 29 i

[Qemu-devel] [PATCH target-arm v2 09/11] char/cadence_uart: Use the TX fifo for transmission

2014-01-01 Thread Peter Crosthwaite
Populate the TxFIFO with the Tx data before sending. Prepares support for proper Tx flow control implementation. Signed-off-by: Peter Crosthwaite --- hw/char/cadence_uart.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/char/cadence_uart.c b/hw/char/cad

[Qemu-devel] [PATCH target-arm v2 07/11] char/cadence_uart: Remove TX timer & add TX FIFO state

2014-01-01 Thread Peter Crosthwaite
This tx timer implementation is flawed. Despite the controller attempting to time the guest visable assertion of the TX-empty status bit (and corresponding interrupt) the controller is still transmitting characters instantaneously. There is also no sense of multiple character delay. The only side

[Qemu-devel] [PATCH target-arm v2 08/11] char/cadence_uart: Fix can_receive logic

2014-01-01 Thread Peter Crosthwaite
The can_receive logic was only taking into account the RxFIFO occupancy. RxFIFO population is only used for the echo and normal modes however. Improve the logic to correctly return the true number of receivable characters based on the current mode: Normal mode: RxFIFO vacancy. Remote loopback: TxF

[Qemu-devel] [PATCH target-arm v2 06/11] char/cadence_uart: Define Missing SR/ISR fields

2014-01-01 Thread Peter Crosthwaite
Some (interrupt) status register bits relating to the TxFIFO path were not defined. Define them. This prepares support for proper Tx data path flow control. Signed-off-by: Peter Crosthwaite --- hw/char/cadence_uart.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/char/cadence_uart.c

[Qemu-devel] [PATCH target-arm v2 05/11] char/cadence_uart: Simplify status generation

2014-01-01 Thread Peter Crosthwaite
The status register bits are always pure functions of other device state. Move the generation of these bits to the update_status() function to simplify. Makes developing much easier as theres now no need to recheck status bits on all the changes to rx/tx fifo state. Signed-off-by: Peter Crosthwait

[Qemu-devel] [PATCH target-arm v2 04/11] char/cadence_uart: s/r_fifo/rx_fifo

2014-01-01 Thread Peter Crosthwaite
Rename this field to match the many other uses of "rx". Xilinx docmentation (UG585) also refers to this as "RxFIFO". Signed-off-by: Peter Crosthwaite --- hw/char/cadence_uart.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_u

[Qemu-devel] [PATCH target-arm v2 03/11] char/cadence_uart: Fix reset.

2014-01-01 Thread Peter Crosthwaite
Don't reset the uart as an init step. Register the reset function as a proper reset fn instead. Signed-off-by: Peter Crosthwaite --- hw/char/cadence_uart.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c index fb9db89..7

[Qemu-devel] [PATCH target-arm v2 02/11] char/cadence_uart: Add missing uart_update_state

2014-01-01 Thread Peter Crosthwaite
This should be rechecked on bus write accesses as such accesses may change the underlying state that generates the interrupt. Particular relevant for when the guest touches the interrupt status or mask. Signed-off-by: Peter Crosthwaite --- hw/char/cadence_uart.c | 1 + 1 file changed, 1 inserti

[Qemu-devel] [PATCH target-arm v2 01/11] char/cadence_uart: Mark struct fields as public/private

2014-01-01 Thread Peter Crosthwaite
As per current QOM conventions. Signed-off-by: Peter Crosthwaite --- changed since v1: Fixed spacing (AF review) hw/char/cadence_uart.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c index f18db53..a7b2f21 100644 --- a/hw/char/cadence_uart.

[Qemu-devel] [PATCH target-arm v2 00/11] Cadence UART cleanups and Tx path fixes

2014-01-01 Thread Peter Crosthwaite
When using QEMU in some terminal environments, char back-ends for serial devices can return EAGAIN for non trivial periods. This coupled with use of qemu_chr_fe_write_all() is a leading cause of: main-loop: WARNING: I/O thread spun for 1000 iterations This series fixes this for cadence_uart by r

Re: [Qemu-devel] [PATCH v2 12/25] target-arm: Update generic cpreg code for AArch64

2014-01-01 Thread Peter Crosthwaite
On Mon, Dec 23, 2013 at 8:49 AM, Peter Maydell wrote: > Update the generic cpreg support code to also handle AArch64: > AArch64-visible registers coexist in the same hash table with > AArch32-visible ones, with a bit in the hash key distinguishing > them. > > Signed-off-by: Peter Maydell > --- >

Re: [Qemu-devel] [RFC/RFT v1 0/8] mb/ppc: Remove include/hw/xilinx.h

2014-01-01 Thread Alexander Graf
On 02.01.2014, at 01:00, Peter Crosthwaite wrote: > Hi Edgar, > > This file is written for a very old qdev style of machine description. > Remove by inlining all usages of its functions (which is consistent with > the modern preference that qdev_initery should be inline and not in > cross-board

[Qemu-devel] [PATCH v2] qdev: add the device to the QOM tree before using it to set a link

2014-01-01 Thread Amos Kong
Test steps: (qemu) device_add e1000,addr=adsf Property 'e1000.addr' doesn't take value 'adsf' (qemu) info qtree Then qemu crashed. Currently we set a link to the new device for qdev parent bus, but the device hasn't been added to QOM tree. When it fails to set properties, object_unparent() c

Re: [Qemu-devel] [PATCH] qdev: unparent device when fails to set properties

2014-01-01 Thread Amos Kong
On Tue, Dec 31, 2013 at 05:06:44PM +0100, Paolo Bonzini wrote: > Il 31/12/2013 09:06, Amos Kong ha scritto: > > When it fails to set properties, qdev's parent is already set > > Do not confuse the QOM parent (which is /machine/peripheral, of which > the new device is a child) with the qdev parent

[Qemu-devel] [RFC/RFT v1 8/8] xilinx: Delete hw/include/xilinx.h

2014-01-01 Thread Peter Crosthwaite
This is now obsolete - remove the header and all its inclusions. Signed-off-by: Peter Crosthwaite --- hw/microblaze/petalogix_ml605_mmu.c | 1 - hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 - hw/ppc/virtex_ml507.c| 2 +- include/hw/xilinx.h | 10

[Qemu-devel] [RFC/RFT v1 6/8] xilinx: Inline usage of xilinx_ethlite_create()

2014-01-01 Thread Peter Crosthwaite
Inline the only usage. Converts this init to at least a semi-recent QOM styling. Signed-off-by: Peter Crosthwaite --- hw/microblaze/petalogix_s3adsp1800_mmu.c | 9 - include/hw/xilinx.h | 19 --- 2 files changed, 8 insertions(+), 20 deletions(-) di

[Qemu-devel] [RFC/RFT v1 7/8] xilinx: Inline usages of xilinx_axi*_init()

2014-01-01 Thread Peter Crosthwaite
Inline the only usage of each of xilinx_axiethernet_init and xilinx_axidma_init. Converts this init to at least a semi-recent QOM styling. Signed-off-by: Peter Crosthwaite --- hw/microblaze/petalogix_ml605_mmu.c | 24 +++- include/hw/xilinx.h | 33 ---

[Qemu-devel] [RFC/RFT v1 5/8] xilinx: Inline usages of xilinx_timer_create()

2014-01-01 Thread Peter Crosthwaite
Inline these usages. Converts these init to at least a semi-recent QOM styling. Signed-off-by: Peter Crosthwaite --- hw/microblaze/petalogix_ml605_mmu.c | 7 ++- hw/microblaze/petalogix_s3adsp1800_mmu.c | 9 - hw/ppc/virtex_ml507.c| 7 ++- include/hw/

[Qemu-devel] [RFC/RFT v1 3/8] microblaze/ml605: Define macros for irq/memory maps

2014-01-01 Thread Peter Crosthwaite
Define (missing) macros for the interrupt and memory maps for the sake of self documentation. Signed-off-by: Peter Crosthwaite --- I haven't converted the xilinx_foo_create usages because they will be deleted in following patches hw/microblaze/petalogix_ml605_mmu.c | 15 --- 1 file

[Qemu-devel] [RFC/RFT v1 4/8] xilinx: Inline usages of xilinx_intc_create()

2014-01-01 Thread Peter Crosthwaite
Inline these usages. Converts these init to at least a semi-recent QOM styling. Signed-off-by: Peter Crosthwaite --- hw/microblaze/petalogix_ml605_mmu.c | 6 +- hw/microblaze/petalogix_s3adsp1800_mmu.c | 7 ++- hw/ppc/virtex_ml507.c| 6 +- include/hw/xili

[Qemu-devel] [RFC/RFT v1 2/8] ppc/virtex_ml507: Define macros for irq/memory maps

2014-01-01 Thread Peter Crosthwaite
Define macros for the interrupt and memory maps for the sake of self documentation. Signed-off-by: Peter Crosthwaite --- I haven't converted the xilinx_foo_create usages because they will be deleted in following patches hw/ppc/virtex_ml507.c | 14 +++--- 1 file changed, 11 insertions(+)

[Qemu-devel] [RFC/RFT v1 1/8] microblaze/s3adsp_1800: Define macros for irq map

2014-01-01 Thread Peter Crosthwaite
Define macros for the interrupt map for the sake of self documentation. Signed-off-by: Peter Crosthwaite --- I haven't converted the xilinx_foo_create usages because they will be deleted in following patches hw/microblaze/petalogix_s3adsp1800_mmu.c | 7 ++- 1 file changed, 6 insertions(+),

[Qemu-devel] [RFC/RFT v1 0/8] mb/ppc: Remove include/hw/xilinx.h

2014-01-01 Thread Peter Crosthwaite
Hi Edgar, This file is written for a very old qdev style of machine description. Remove by inlining all usages of its functions (which is consistent with the modern preference that qdev_initery should be inline and not in cross-board helper functions). To avoid movement of magic numbers, Define m

[Qemu-devel] [PATCH] vmstate: Make VMSTATE_STRUCT_POINTER take type, not ptr-to-type

2014-01-01 Thread Peter Maydell
The VMSTATE_STRUCT_POINTER macros are a bit odd in that they must be passed an argument "FooType *" rather than just taking the FooType. They're only used in one place, so it's easy to tidy this up. This also lets us use the macro to replace the hand-rolled VMSTATE_PTIMER. Signed-off-by: Peter May

Re: [Qemu-devel] [PATCH 2/2] net: Fix lan9118 buffer length handling

2014-01-01 Thread Roy Franz
On Fri, Dec 27, 2013 at 5:25 PM, Peter Crosthwaite wrote: > On Sat, Dec 21, 2013 at 4:26 AM, Roy Franz wrote: >> The 9118 ethernet controller supports transmission of multi-buffer packets >> with arbitrary byte alignment of the start and end bytes. All writes to >> the packet fifo are 32 bits, s

Re: [Qemu-devel] [PULL 10/17] target-m68k: Replace qemu_assert by hw_error

2014-01-01 Thread Peter Maydell
On 1 January 2014 13:56, Stefan Weil wrote: > hw_error is not available for user mode, so this patch fixes Darwin > (which only provides system emulation), but it breaks linking of > m68k-linux-user on Linux hosts. Maybe we need to come up with some better guidelines about when to use the various

Re: [Qemu-devel] [PULL 10/17] target-m68k: Replace qemu_assert by hw_error

2014-01-01 Thread Michael Tokarev
01.01.2014 17:56, Stefan Weil wrote: > I'm sorry that I have to revoke this patch. Ow. Removed from the trivial-patches git tree. /mjt

Re: [Qemu-devel] [PULL 10/17] target-m68k: Replace qemu_assert by hw_error

2014-01-01 Thread Stefan Weil
Am 27.12.2013 23:07, schrieb Michael Tokarev: > From: Stefan Weil > > hw_error is already used for target-arm and target-s390x. > Using it for target-m68k fixes this compiler warning with Darwin because > hw_error is declared with QEMU_NORETURN: > > target-m68k/translate.c:671:13: warning: > vari