[Qemu-devel] [PATCH 2/2] vmmouse: change qdev pointer property to qom link

2018-02-03 Thread Zihan Yang
The ps2_mouse property of vmmouse is still pointer type which is defined by DEFINE_PROP_PTR. But qdev pointer property should be avoided. Convert it into QOM link relationship Signed-off-by: Zihan Yang --- hw/i386/pc.c | 2 +- hw/i386/vmmouse.c | 19 --- 2 files changed, 13

[Qemu-devel] [PATCH 1/2] hw/input/pckdb: put TYPE_I8042 into a single header file

2018-02-03 Thread Zihan Yang
This allows the macro to be used elsewhere, for example, when adding link property to vmmouse object. Signed-off-by: Zihan Yang --- hw/input/pckbd.c | 2 +- hw/input/pckbd.h | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 hw/input/pckbd.h diff --git a/hw/input/pc

[Qemu-devel] [PATCH 0/2] vmmouse: convert qdev pointer property to QOM link relationship

2018-02-03 Thread Zihan Yang
The ps2_mouse property of vmmouse is still pointer type which is defined by DEFINE_PROP_PTR. But qdev pointer property should be avoided according to qdev-properties.h. Convert it to QOM link relationship. It involves two patches because it requires the TYPE_I8042 macro which is defined in anothe

[Qemu-devel] Linux Guest Memory Performance

2018-02-03 Thread geoff--- via Qemu-devel
Hi All, I am having some very strange issues with Qemu and memory copy performance. It seems that when performing buffer -> buffer copies of 8MB or lower the performance is horrid. Test program: #include #include #include #include #include static inline uint64_t nanotime() { struct t

[Qemu-devel] [PATCH 1/2] hw/hppa: Use qemu_log_mask instead of fprintf to stderr

2018-02-03 Thread Richard Henderson
Reported-by: Thomas Huth Signed-off-by: Richard Henderson --- hw/hppa/machine.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index afd3867313..19033e268d 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -19,6

[Qemu-devel] [PATCH 2/2] tests: Enable boot-serial-test for hppa

2018-02-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tests/boot-serial-test.c | 1 + tests/Makefile.include | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c index 418c5b92dc..ea87a80be7 100644 --- a/tests/boot-serial-test.c +++ b/tests/boot-serial-test.

Re: [Qemu-devel] [PATCH] rtc: placing RTC memory region outside BQL

2018-02-03 Thread Gonglei (Arei)
> -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Thursday, February 01, 2018 10:24 PM > To: Gonglei (Arei); qemu-devel@nongnu.org > Cc: Huangweidong (C) > Subject: Re: [PATCH] rtc: placing RTC memory region outside BQL > > On 01/02/2018 08:47, Gonglei wrote:

[Qemu-devel] [PATCH 23/24] fpu: Implement muladd with soft-fp.h

2018-02-03 Thread Richard Henderson
Add routines for float16 and float128. Signed-off-by: Richard Henderson --- fpu/soft-fp-specialize.h | 123 fpu/softfloat-specialize.h | 228 -- include/fpu/softfloat.h| 3 + fpu/floatxx.inc.c | 68 +++ fpu/softfloat.c| 473 -

[Qemu-devel] [PATCH 24/24] fpu: Implement round_to_int with soft-fp.h

2018-02-03 Thread Richard Henderson
Add float16 support. Remove float64_trunc_to_int as unused rather than recreating it within the new framework. Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 2 +- fpu/floatxx.inc.c | 75 fpu/softfloat.c | 311 ---

[Qemu-devel] [PATCH 15/24] fpu: Implement add/sub/mul/div with soft-fp.h

2018-02-03 Thread Richard Henderson
Port the implementation of these 4 routines to the code imported from glibc. This allows the trivial addition of float16 support. Signed-off-by: Richard Henderson --- Makefile.target |4 + fpu/sfp-machine.h| 222 ++ fpu/soft-fp-specialize.h | 131 ++ include/f

[Qemu-devel] [PATCH 13/24] fpu/soft-fp: Add arithmetic macros to half.h

2018-02-03 Thread Richard Henderson
These were omitted from upstream glibc for some reason. Signed-off-by: Richard Henderson --- fpu/half.h | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/fpu/half.h b/fpu/half.h index 75a3168a75..d9e1cd5e01 100644 --- a/fpu/half.h +++ b/fpu/half.h @@ -159,7 +159,

[Qemu-devel] [PATCH 22/24] fpu: Implement float_to_float with soft-fp.h

2018-02-03 Thread Richard Henderson
Signed-off-by: Richard Henderson --- Makefile.target| 1 + fpu/softfloat-specialize.h | 40 include/fpu/softfloat.h| 8 +- fpu/floatconv.c| 154 ++ fpu/softfloat.c| 489 - 5 files changed, 15

[Qemu-devel] [PATCH 20/24] fpu: Implement sqrt with soft-fp.h

2018-02-03 Thread Richard Henderson
Add float16 support. Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 1 + fpu/floatxx.inc.c | 16 + fpu/softfloat.c | 179 3 files changed, 17 insertions(+), 179 deletions(-) diff --git a/include/fpu/softfloat.

[Qemu-devel] [PATCH 11/24] fpu/soft-fp: Adjust soft-fp types

2018-02-03 Thread Richard Henderson
Glibc uses host compiler floating-point types for packing. We need to use softfloat.h types. Signed-off-by: Richard Henderson --- fpu/double.h | 6 ++ fpu/half.h | 4 +--- fpu/quad.h | 6 ++ fpu/single.h | 4 +--- 4 files changed, 6 insertions(+), 14 deletions(-) diff --git a/fpu/do

[Qemu-devel] [PATCH 21/24] fpu: Implement scalbn with soft-fp.h

2018-02-03 Thread Richard Henderson
Add float16 support. Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 1 + fpu/floatxx.inc.c | 28 + fpu/softfloat.c | 109 3 files changed, 29 insertions(+), 109 deletions(-) diff --git a/include/fpu/so

[Qemu-devel] [PATCH 14/24] fpu/soft-fp: Adjust _FP_CMP_CHECK_NAN

2018-02-03 Thread Richard Henderson
The fourth argument to _FP_CMP is a 4-state integer operand that controls the operation wrt raising exceptions. However, the usage that we need within QEMU produces a -Werror=int-in-bool-context: error: ?: using integer constants in boolean context, \ the expression will always evaluate to ‘t

[Qemu-devel] [PATCH 08/24] include/fpu/softfloat: add some float16 constants

2018-02-03 Thread Richard Henderson
From: Alex Bennée This defines the same set of common constants for float 16 as defined for 32 and 64 bit floats. These are often used by target helper functions. I've also removed constants that are not used by anybody. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-b

[Qemu-devel] [PATCH 18/24] fpu: Implement compares with soft-fp.h

2018-02-03 Thread Richard Henderson
Add float16 comparisons. Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 10 + fpu/floatxx.inc.c | 67 +++ fpu/softfloat.c | 1051 ++- 3 files changed, 109 insertions(+), 1019 deletions(-) diff --git a/include/fpu/soft

[Qemu-devel] [PATCH 17/24] fpu: Implement int/uint_to_float with soft-fp.h

2018-02-03 Thread Richard Henderson
Add conversions to float16. For consistency, add float128 conversions from int16_t/uint16_t. Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 50 +-- fpu/floatxx.inc.c | 55 fpu/softfloat.c | 227

[Qemu-devel] [PATCH 16/24] fpu: Implement float_to_int/uint with soft-fp.h

2018-02-03 Thread Richard Henderson
Add float16 conversions. For consistency, add missing float128 conversions to uint32_t. Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 20 +- fpu/floatxx.inc.c | 45 ++ fpu/softfloat.c | 1088 --- 3 files changed, 64

[Qemu-devel] [PATCH 19/24] fpu: Implement min/max with soft-fp.h

2018-02-03 Thread Richard Henderson
Add routines for float16 and float128. Signed-off-by: Richard Henderson --- include/fpu/softfloat.h | 12 ++ fpu/floatxx.inc.c | 89 fpu/softfloat.c | 107 3 files changed, 101 insertion

[Qemu-devel] [PATCH 06/24] include/fpu/softfloat: implement float16_chs helper

2018-02-03 Thread Richard Henderson
From: Alex Bennée Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell --- include/fpu/softfloat.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 1d34f2c3eb..f75aa59100 100644 --- a/include/f

[Qemu-devel] [PATCH 12/24] fpu/soft-fp: Add ties_away and to_odd rounding modes

2018-02-03 Thread Richard Henderson
These rounding modes are used by ARM and PowerPC respectively. Signed-off-by: Richard Henderson --- fpu/op-common.h | 20 fpu/soft-fp.h | 25 + 2 files changed, 45 insertions(+) diff --git a/fpu/op-common.h b/fpu/op-common.h index 4526afd1b6..c5f33

[Qemu-devel] [PATCH 03/24] fpu/softfloat-types: new header to prevent excessive re-builds

2018-02-03 Thread Richard Henderson
From: Alex Bennée The main culprit here is bswap.h which pulled in softfloat.h so it could use the types in its CPU_Float* and ldfl/stfql functions. As bswap.h is very widely included this added a compile dependency every time we touch softfloat.h. Move the typedefs for each float type into their

[Qemu-devel] [PATCH 09/24] fpu/softfloat: improve comments on ARM NaN propagation

2018-02-03 Thread Richard Henderson
From: Alex Bennée Mention the pseudo-code fragment from which this is based. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- fpu/softfloat-specialize.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.

[Qemu-devel] [PATCH 07/24] include/fpu/softfloat: implement float16_set_sign helper

2018-02-03 Thread Richard Henderson
From: Alex Bennée Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/fpu/softfloat.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index f75aa59100..

[Qemu-devel] [PATCH 04/24] target/*/cpu.h: remove softfloat.h

2018-02-03 Thread Richard Henderson
From: Alex Bennée As cpu.h is another typically widely included file which doesn't need full access to the softfloat API we can remove the includes from here as well. Where they do need types it's typically for float_status and the rounding modes so we move that to softfloat-types.h as well. As

[Qemu-devel] [PATCH 00/24] re-factor and add fp16 using glibc soft-fp

2018-02-03 Thread Richard Henderson
As discussed on list, the structure and inline function solution that Alex and I have been writing from scratch introduces a sizeable performance regression. Alex and I have done some work earlier in the week that improved things some, but not enough. Which leaves us with a bit of a problem. The

[Qemu-devel] [PATCH 02/24] include/fpu/softfloat: remove USE_SOFTFLOAT_STRUCT_TYPES

2018-02-03 Thread Richard Henderson
From: Alex Bennée It's not actively built and when enabled things fail to compile. I'm not sure the type-checking is really helping here. Seeing as we "own" our softfloat now lets remove the cruft. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- include/fpu/softfloat.h | 27

[Qemu-devel] [PATCH 05/24] include/fpu/softfloat: implement float16_abs helper

2018-02-03 Thread Richard Henderson
From: Alex Bennée This will be required when expanding the MINMAX() macro for 16 bit/half-precision operations. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell --- include/fpu/softfloat.h | 7 +++ 1 file changed, 7

[Qemu-devel] [PATCH 01/24] fpu/softfloat: implement float16_squash_input_denormal

2018-02-03 Thread Richard Henderson
From: Alex Bennée This will be required when expanding the MINMAX() macro for 16 bit/half-precision operations. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell --- include/fpu/softfloat.h | 1 + fpu/softfloat.c | 15 +++ 2 files chang

Re: [Qemu-devel] [PATCH v1 21/21] RISC-V Build Infrastructure

2018-02-03 Thread Michael Clark
On Fri, Jan 5, 2018 at 7:22 PM, Michael Clark wrote: > > On Fri, 5 Jan 2018 at 5:55 AM, Antony Pavlov > wrote: > >> On Wed, 3 Jan 2018 13:44:25 +1300 >> Michael Clark wrote: >> >> > This adds RISC-V into the build system enabling the following targets: >> > >> > - riscv32-softmmu >> > - riscv6

Re: [Qemu-devel] [PATCH 4/7] target/arm: Make v7M exception entry stack push check MPU

2018-02-03 Thread Richard Henderson
On 02/03/2018 01:30 PM, Peter Maydell wrote: > On 3 February 2018 at 21:21, Richard Henderson > wrote: >> On 01/30/2018 07:02 AM, Peter Maydell wrote: >>> +if (get_phys_addr(env, addr, MMU_DATA_STORE, mmu_idx, &physaddr, >>> + &attrs, &prot, &page_size, &fi, NULL)) { >> >>

Re: [Qemu-devel] [Qemu-arm] [PATCH 4/7] target/arm: Make v7M exception entry stack push check MPU

2018-02-03 Thread Peter Maydell
On 30 January 2018 at 15:02, Peter Maydell wrote: > -static void v7m_push(CPUARMState *env, uint32_t val) > +static bool v7m_stack_write(ARMCPU *cpu, uint32_t addr, uint32_t value, > +ARMMMUIdx mmu_idx, bool ignfault) > { > -CPUState *cs = CPU(arm_env_get_cpu(env))

Re: [Qemu-devel] [PATCH 7/7] target/arm: Handle exceptions during exception stack pop

2018-02-03 Thread Richard Henderson
On 01/30/2018 07:02 AM, Peter Maydell wrote: > Handle possible MPU faults, SAU faults or bus errors when > popping register state off the stack during exception return. > > Signed-off-by: Peter Maydell > --- > target/arm/helper.c | 115 > ++-- > 1

Re: [Qemu-devel] [PATCH 4/7] target/arm: Make v7M exception entry stack push check MPU

2018-02-03 Thread Peter Maydell
On 3 February 2018 at 21:21, Richard Henderson wrote: > On 01/30/2018 07:02 AM, Peter Maydell wrote: >> +if (get_phys_addr(env, addr, MMU_DATA_STORE, mmu_idx, &physaddr, >> + &attrs, &prot, &page_size, &fi, NULL)) { > > Given that you know you're going to call this at leas

Re: [Qemu-devel] [PATCH 6/7] target/arm: Make exception vector loads honour the SAU

2018-02-03 Thread Richard Henderson
On 01/30/2018 07:02 AM, Peter Maydell wrote: > Make the load of the exception vector from the vector table honour > the SAU and any bus error on the load (possibly provoking a derived > exception), rather than simply aborting if the load fails. > > Signed-off-by: Peter Maydell > --- > target/arm

Re: [Qemu-devel] [PATCH 5/7] target/arm: Make v7m_push_callee_stack() honour MPU

2018-02-03 Thread Richard Henderson
On 01/30/2018 07:02 AM, Peter Maydell wrote: > Make v7m_push_callee_stack() honour the MPU by using the > new v7m_stack_write() function. We return a flag to indicate > whether the pushes failed, which we can then use in > v7m_exception_taken() to cause us to handle the derived > exception correctl

Re: [Qemu-devel] [PATCH 4/7] target/arm: Make v7M exception entry stack push check MPU

2018-02-03 Thread Richard Henderson
On 01/30/2018 07:02 AM, Peter Maydell wrote: > +if (get_phys_addr(env, addr, MMU_DATA_STORE, mmu_idx, &physaddr, > + &attrs, &prot, &page_size, &fi, NULL)) { Given that you know you're going to call this at least 8 times in a row, probably with all operations on the same p

Re: [Qemu-devel] [PATCH 3/7] target/arm: Add ignore_stackfaults argument to v7m_exception_taken()

2018-02-03 Thread Richard Henderson
On 01/30/2018 07:02 AM, Peter Maydell wrote: > In the v8M architecture, if the process of taking an exception > results in a further exception this is called a derived exception > (for example, an MPU exception when writing the exception frame to > memory). If the derived exception happens while pu

Re: [Qemu-devel] [PATCH 2/7] target/arm: Split "get pending exception info" from "acknowledge it"

2018-02-03 Thread Richard Henderson
On 01/30/2018 07:02 AM, Peter Maydell wrote: > Currently armv7m_nvic_acknowledge_irq() does three things: > * make the current highest priority pending interrupt active > * return a bool indicating whether that interrupt is targeting >Secure or NonSecure state > * implicitly tell the caller

Re: [Qemu-devel] [PATCH 1/7] target/arm: Add armv7m_nvic_set_pending_derived()

2018-02-03 Thread Richard Henderson
On 01/30/2018 07:02 AM, Peter Maydell wrote: > In order to support derived exceptions (exceptions generated in > the course of trying to take an exception), we need to be able > to handle prioritizing whether to take the original exception > or the derived exception. > > We do this by introducing

Re: [Qemu-devel] [PATCH 5/5] curl: convert to CoQueue

2018-02-03 Thread Richard Henderson
On 02/03/2018 07:39 AM, Paolo Bonzini wrote: > Now that CoQueues can use a QemuMutex for thread-safety, there is no > need for curl to roll its own coroutine queue. Coroutines can be > placed directly on the queue instead of using a list of CURLAIOCBs. > > Reviewed-by: Stefan Hajnoczi > Signed-o

Re: [Qemu-devel] [PATCH 4/5] coroutine-lock: make qemu_co_enter_next thread-safe

2018-02-03 Thread Richard Henderson
On 02/03/2018 07:39 AM, Paolo Bonzini wrote: > qemu_co_queue_next does not need to release and re-acquire the mutex, > because the queued coroutine does not run immediately. However, this > does not hold for qemu_co_enter_next. Now that qemu_co_queue_wait > can synchronize (via QemuLockable) with

Re: [Qemu-devel] [PATCH 3/5] coroutine-lock: convert CoQueue to use QemuLockable

2018-02-03 Thread Richard Henderson
On 02/03/2018 07:39 AM, Paolo Bonzini wrote: > There are cases in which a queued coroutine must be restarted from > non-coroutine context (with qemu_co_enter_next). In this cases, > qemu_co_enter_next also needs to be thread-safe, but it cannot use > a CoMutex and so cannot qemu_co_queue_wait. Us

Re: [Qemu-devel] [PATCH 1/5] test-coroutine: add simple CoMutex test

2018-02-03 Thread Richard Henderson
On 02/03/2018 07:39 AM, Paolo Bonzini wrote: > In preparation for adding a similar test using QemuLockable, add a very > simple testcase that has two interleaved calls to lock and unlock. > > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Paolo Bonzini > --- > tests/test-coroutine.c | 50 >

Re: [Qemu-devel] [PATCH 2/5] lockable: add QemuLockable

2018-02-03 Thread Richard Henderson
On 02/03/2018 07:39 AM, Paolo Bonzini wrote: > +/* This function gives an error if an invalid, non-NULL pointer type is > passed > + * to QEMU_MAKE_LOCKABLE. For optimized builds, we can rely on dead-code > elimination > + * from the compiler, and give the errors already at link time. > + */ > +

Re: [Qemu-devel] [PATCH v8 13/14] tcg: Replace fprintf(stderr, "*\n" with error_report()

2018-02-03 Thread Thomas Huth
On 03.02.2018 09:43, Markus Armbruster wrote: > From: Alistair Francis > > Replace a large number of the fprintf(stderr, "*\n" calls with > error_report(). The functions were renamed with these commands and then > compiler issues where manually fixed. > > find ./* -type f -exec sed -i \ > 'N

Re: [Qemu-devel] [PATCH v8 14/14] target: Use qemu_log() instead of fprintf(stderr, ...)

2018-02-03 Thread Thomas Huth
On 03.02.2018 09:43, Markus Armbruster wrote: > From: Alistair Francis > > Convert fprintf(stderr, ...) to use qemu_log(). Double prints in > target/ppc/translate.c were manually remove. A fprintf() in > target/sh4/translate.c was kept as it's inside a #if 0. The #if 0 and > fflush() was removed

Re: [Qemu-devel] [PATCH v7 03/15] hw/dma: Replace fprintf(stderr, "*\n" with error_report()

2018-02-03 Thread Thomas Huth
On 02.02.2018 19:37, Markus Armbruster wrote: > From: Alistair Francis > > Replace a large number of the fprintf(stderr, "*\n" calls with > error_report(). The functions were renamed with these commands and then > compiler issues where manually fixed. [...] > Some lines where then manually tweake

Re: [Qemu-devel] [PATCH v7 10/15] hw/sd: Replace fprintf(stderr, "*\n" with error_report()

2018-02-03 Thread Thomas Huth
On 02.02.2018 19:37, Markus Armbruster wrote: > From: Alistair Francis > > Replace a large number of the fprintf(stderr, "*\n" calls with > error_report(). The functions were renamed with these commands and then > compiler issues where manually fixed. > > find ./* -type f -exec sed -i \ > 'N

Re: [Qemu-devel] [RfC PATCH v2 0/5] vfio: add display support

2018-02-03 Thread Kirti Wankhede
On 2/1/2018 1:54 PM, Gerd Hoffmann wrote: > Hi, > >>> plese test and review, >> >> may never come to fruition. As for testing, region support was >> included for NVIDIA, dmabuf for Intel... is this testing request mainly >> for the Kirti and others at NVIDIA? Thanks, > > Yes. v1 was tested

Re: [Qemu-devel] How to make memory mapped controller receive data?

2018-02-03 Thread KONRAD Frederic
Hi, There are no CAN bus support in QEMU yet but there is some work going on about CAN from Pavel (added in CC): https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg00104.html He knows better than me what it does but basically the device will be able to be contacted by other CAN devices on

[Qemu-devel] [PATCH v6] ui/cocoa.m: Add ability for user to specify mouse ungrab key

2018-02-03 Thread John Arbuckle
Currently the ungrab keys for the Cocoa and GTK interface are Control-Alt-g. This combination may not be very fun for the user to have to enter, so we now enable the user to specify their own key(s) as the ungrab key(s). The list of keys that can be used is found in the file qapi/ui.json under QKey

Re: [Qemu-devel] [PATCH v2 3/6] qapi: add block-dirty-bitmap-enable/disable

2018-02-03 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > qapi/block-core.json | 42 ++ > blockdev.c | 42 ++ > 2 files changed, 84 insertions(+) > > diff --git a/qapi/bloc

Re: [Qemu-devel] [PATCH v2 5/6] qapi: add block-dirty-bitmap-merge

2018-02-03 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > qapi/block-core.json | 38 ++ > include/block/dirty-bitmap.h | 2 ++ > block/dirty-bitmap.c | 18 ++ > blockdev.c | 3

Re: [Qemu-devel] [PATCH v2 8/8] qapi: query-blockstat: add driver specific file-posix stats

2018-02-03 Thread Markus Armbruster
Eric Blake writes: > On 01/19/2018 06:50 AM, Anton Nefedov wrote: >> A block driver can provide a callback to report driver-specific >> statistics. >> >> file-posix driver now reports discard statistics >> >> Signed-off-by: Anton Nefedov >> Reviewed-by: Vladimir Sementsov-Ogievskiy >> --- > >

Re: [Qemu-devel] [PATCH V4 10/16] qmp event: Add COLO_EXIT event to notify users while exited COLO

2018-02-03 Thread Markus Armbruster
Zhang Chen writes: > From: zhanghailiang > > If some errors happen during VM's COLO FT stage, it's important to > notify the users of this event. Together with 'x-colo-lost-heartbeat', > Users can intervene in COLO's failover work immediately. > If users don't want to get involved in COLO's fail

[Qemu-devel] [PATCH 3/5] coroutine-lock: convert CoQueue to use QemuLockable

2018-02-03 Thread Paolo Bonzini
There are cases in which a queued coroutine must be restarted from non-coroutine context (with qemu_co_enter_next). In this cases, qemu_co_enter_next also needs to be thread-safe, but it cannot use a CoMutex and so cannot qemu_co_queue_wait. Use QemuLockable so that the CoQueue can interchangeabl

[Qemu-devel] [PATCH v5 0/5] coroutine-lock: polymorphic CoQueue

2018-02-03 Thread Paolo Bonzini
There are cases in which a queued coroutine must be restarted from non-coroutine context (with qemu_co_enter_next). In this cases, qemu_co_enter_next also needs to be thread-safe, but it cannot use a CoMutex and so cannot qemu_co_queue_wait. This happens in curl (which right now is rolling its ow

[Qemu-devel] [PATCH 4/5] coroutine-lock: make qemu_co_enter_next thread-safe

2018-02-03 Thread Paolo Bonzini
qemu_co_queue_next does not need to release and re-acquire the mutex, because the queued coroutine does not run immediately. However, this does not hold for qemu_co_enter_next. Now that qemu_co_queue_wait can synchronize (via QemuLockable) with code that is not running in coroutine context, it's

[Qemu-devel] [PATCH 5/5] curl: convert to CoQueue

2018-02-03 Thread Paolo Bonzini
Now that CoQueues can use a QemuMutex for thread-safety, there is no need for curl to roll its own coroutine queue. Coroutines can be placed directly on the queue instead of using a list of CURLAIOCBs. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- block/curl.c | 20

[Qemu-devel] [PATCH 2/5] lockable: add QemuLockable

2018-02-03 Thread Paolo Bonzini
QemuLockable is a polymorphic lock type that takes an object and knows which function to use for locking and unlocking. The implementation could use C11 _Generic, but since the support is not very widespread I am instead using __builtin_choose_expr and __builtin_types_compatible_p, which are alrea

[Qemu-devel] [PATCH 1/5] test-coroutine: add simple CoMutex test

2018-02-03 Thread Paolo Bonzini
In preparation for adding a similar test using QemuLockable, add a very simple testcase that has two interleaved calls to lock and unlock. Reviewed-by: Stefan Hajnoczi Signed-off-by: Paolo Bonzini --- tests/test-coroutine.c | 50 -- 1 file changed

[Qemu-devel] [PULL 1/4] tpm: Split off tpm_crb_reset function

2018-02-03 Thread Stefan Berger
Split off the tpm_crb_reset function part from tpm_crb_realize that we need to run every time the machine resets. Also register our reset function with the system since TYPE_DEVICE seems to not get a reset otherwise. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_cr

[Qemu-devel] [PULL 0/4] Merge tpm 2018/02/03

2018-02-03 Thread Stefan Berger
The following patches do some cleanups and fix the resetting of the TPM CRB device and add my tpm-next git tree reference to MAINTAINERS. The following changes since commit e486b528229ed4ed5dfdac790c8152bfb2a265c9: Merge remote-tracking branch 'remotes/elmarco/tags/dump-pull-request' into stag

[Qemu-devel] [PULL 4/4] tpm: tis: move one-line function into caller

2018-02-03 Thread Stefan Berger
Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_tis.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index 08f41d2..f81168a 100644 --- a/hw/tpm/tpm_tis.c +++ b/hw/tpm/tpm_tis.c @@ -946,11 +946,6 @@ static c

[Qemu-devel] [PULL 3/4] MAINTAINERS: add pointer to tpm-next repository

2018-02-03 Thread Stefan Berger
Signed-off-by: Stefan Berger Reviewed-by: Eric Blake Reviewed-by: Marc-André Lureau --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index f8deaf6..d352d16 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1593,6 +1593,7 @@ F: include/hw/acpi/tpm.h F:

[Qemu-devel] [PULL 2/4] tpm: wrap stX_be_p in tpm_cmd_set_XYZ functions

2018-02-03 Thread Stefan Berger
Wrap the calls to stl_be_p and stw_be_p in tpm_cmd_set_XYZ functions that are similar to existing getters. Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau --- hw/tpm/tpm_util.c | 6 +++--- hw/tpm/tpm_util.h | 15 +++ 2 files changed, 18 insertions(+), 3 deletions(-) di

Re: [Qemu-devel] [PATCH 1/2] Add save-snapshot, load-snapshot and delete-snapshot to QAPI

2018-02-03 Thread Markus Armbruster
Coming to this thread rather late, sorry. Eric Blake writes: > On 01/10/2018 10:19 AM, Richard Palethorpe wrote: >> Hello Eric & Peter, >> >> Eric Blake writes: >> >>> On 01/07/2018 06:23 AM, Richard Palethorpe wrote: Add QAPI wrapper functions for the existing snapshot functionality. The

Re: [Qemu-devel] [PATCH 3/4] MAINTAINERS: add pointer to tpm-next repository

2018-02-03 Thread Marc-Andre Lureau
On Fri, Feb 2, 2018 at 3:44 PM, Stefan Berger wrote: > Signed-off-by: Stefan Berger Reviewed-by: Marc-André Lureau > --- > MAINTAINERS | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/MAINTAINERS b/MAINTAINERS > index f8deaf6..d352d16 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS >

Re: [Qemu-devel] [PATCH 1/4] tpm: Split off tpm_crb_reset function

2018-02-03 Thread Marc-Andre Lureau
On Fri, Feb 2, 2018 at 3:44 PM, Stefan Berger wrote: > Split off the tpm_crb_reset function part from tpm_crb_realize > that we need to run every time the machine resets. > > Also register our reset function with the system since TYPE_DEVICE > seems to not get a reset otherwise. > > Signed-off-by:

Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code

2018-02-03 Thread Markus Armbruster
Conflicts with commit a3b0dc7582 "qapi: add nbd-server-remove". I pushed the exact version I posted to my public repository: http://repo.or.cz/qemu/armbru.git/shortlog/refs/heads/qapi-monolith

Re: [Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 to separate device

2018-02-03 Thread Mark Cave-Ayland
On 03/02/18 11:11, no-re...@patchew.org wrote: Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20180203103727.26457-1-mark.cave-ayl...@ilande.co.uk Subject: [Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 t

Re: [Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 to separate device

2018-02-03 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20180203103727.26457-1-mark.cave-ayl...@ilande.co.uk Subject: [Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 to separate device === TEST SCRIPT BEGIN === #!/b

Re: [Qemu-devel] [PATCH] hw/timer/mt48t59: Fix bit-rotten NVRAM_PRINTF format strings

2018-02-03 Thread Mark Cave-Ayland
On 02/02/18 08:15, Thomas Huth wrote: When compiling with NVRAM_PRINTF enabled, gcc currently bails out with: CC hw/timer/m48t59.o CC hw/timer/m48t59-isa.o hw/timer/m48t59.c: In function ‘NVRAM_writeb’: hw/timer/m48t59.c:460:5: error: format ‘%x’ expects argument of type ‘unsign

Re: [Qemu-devel] [PATCH 2/3] tests/boot-serial: Add tests for PowerPC Mac machines

2018-02-03 Thread Mark Cave-Ayland
On 01/02/18 10:09, Thomas Huth wrote: OpenBIOS prints out the CPU type on these machine types, so we can use this string to test whether the CPU detection is working correctly. Signed-off-by: Thomas Huth --- tests/boot-serial-test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test

Re: [Qemu-devel] [PATCH 1/3] tests/boot-serial: Enable the boot-serial test on SPARC machines, too

2018-02-03 Thread Mark Cave-Ayland
On 01/02/18 10:09, Thomas Huth wrote: OpenBIOS prints out the name of the detected CPU here, so looking for this string is a nice test to verify that the CPU detection is still working correctly. Signed-off-by: Thomas Huth --- tests/Makefile.include | 2 ++ tests/boot-serial-test.c | 4 +++

[Qemu-devel] [PATCH 10/10] cuda: convert to use the shared mos6522 device

2018-02-03 Thread Mark Cave-Ayland
Add the relevant hooks as required for the MacOS timer calibration and delayed SR interrupt. Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/cuda.c | 606 ++- hw/ppc/mac.h | 87 2 files changed, 204 insertions(+), 489 deletions(

[Qemu-devel] [PATCH 08/10] cuda: factor out timebase-derived counter value and load time

2018-02-03 Thread Mark Cave-Ayland
Commit b981289c49 "PPC: Cuda: Use cuda timer to expose tbfreq to guest" altered the timer calculations from those based upon the hardware CUDA clock frequency to those based upon the CPU timebase frequency. In fact we can isolate the differences to 2 simple changes: one to the counter read value a

[Qemu-devel] [PATCH 04/10] cuda: introduce CUDAState parameter to get_counter()

2018-02-03 Thread Mark Cave-Ayland
This will be required shortly and also happens to match nicely with the corresponding signature for set_counter(). Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/cuda.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c i

[Qemu-devel] [PATCH 05/10] cuda: rename frequency property to tb_frequency

2018-02-03 Thread Mark Cave-Ayland
This allows us to more easily differentiate between the timebase frequency used to calibrate the MacOS timers and the actual frequency of the hardware clock as indicated by CUDA_TIMER_FREQ. Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/cuda.c | 10 +- hw/misc/macio/macio.c | 2 +-

[Qemu-devel] [PATCH 09/10] misc: introduce new mos6522 VIA device and enable it for ppc builds

2018-02-03 Thread Mark Cave-Ayland
The MOS6522 VIA forms the bridge part of several Mac devices, including the Mac via-cuda and via-pmu devices. Introduce a standard mos6522 device that can be shared amongst multiple implementations. This is effectively taking the 6522 parts out of cuda.c and turning them into a separate device whi

[Qemu-devel] [PATCH 06/10] cuda: minor cosmetic tidy-ups to get_next_irq_time()

2018-02-03 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/cuda.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index a200320e7d..3336ed46b2 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -184,36 +

[Qemu-devel] [PATCH 02/10] cuda: don't allow writes to port output pins

2018-02-03 Thread Mark Cave-Ayland
Use the direction registers as a mask to ensure that only input pins are updated upon write. Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/cuda.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index 23b7e0f5b0..7214e7adcb 1

[Qemu-devel] [PATCH 07/10] cuda: set timer 1 frequency property to CUDA_TIMER_FREQ

2018-02-03 Thread Mark Cave-Ayland
Now that we have successfully decoupled the timebase frequency and the hardware timer frequency, set the timer 1 frequency property to CUDA_TIMER_FREQ and alter get_next_irq_time() to use it rather than the hard-coded constant. In addition to this we must now switch the tb_diff calculation over to

[Qemu-devel] [PATCH 03/10] cuda: don't call cuda_update() when writing to ACR register

2018-02-03 Thread Mark Cave-Ayland
The wire protocol for reading data to/from the VIA is triggered by changing inputs on port B rather than changing the timer configuration via the ACR. Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/cuda.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/

[Qemu-devel] [PATCH 01/10] cuda: do not use old_mmio accesses

2018-02-03 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland --- hw/misc/macio/cuda.c | 40 1 file changed, 8 insertions(+), 32 deletions(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index 008d8bd4d5..23b7e0f5b0 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cud

[Qemu-devel] [PATCH 00/10] cuda: various fixes, and move 6522 to separate device

2018-02-03 Thread Mark Cave-Ayland
The Mac CUDA device (also known as via-cuda) consists of two parts: a 6522 VIA acting as an interface chip and the CUDA device itself. Currently there are at least 2 other upcoming Mac devices that include their own 6522 VIA implementations: Ben's via-pmu device and Laurent's mac_via device with t

Re: [Qemu-devel] [PATCH RFC 00/21] Modularize generated QAPI code

2018-02-03 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Fri, Feb 02, 2018 at 02:03:15PM +0100, Markus Armbruster wrote: >> Our qapi-schema.json is composed of modules connected by include >> directives, but the generated code is monolithic all the same: one >> qapi-types.h with all the types, one qapi-visit.h with all t

Re: [Qemu-devel] [PATCH RFC 09/21] qapi: Don't absolutize include file name in error messages

2018-02-03 Thread Markus Armbruster
Eric Blake writes: > On 02/02/2018 07:03 AM, Markus Armbruster wrote: >> Error messages print absolute filenames of included files even gave a > > s/even gave/even when given/ I meant to write "even if the user gave". Is that okay? >> relative one on the command line: >> >> PYTHONPATH=sc

Re: [Qemu-devel] [PATCH RFC 08/21] qapi: Touch generated files only when they change

2018-02-03 Thread Markus Armbruster
Eric Blake writes: > On 02/02/2018 07:03 AM, Markus Armbruster wrote: >> A massive number of objects depends on QAPI-generated headers. In my >> "build everything" tree, it's roughly 4500 out of 4800. This is >> particularly annoying when only some of the generated files change, >> say for a do

Re: [Qemu-devel] [PATCH RFC 06/21] qapi-gen: New common driver for code and doc generators

2018-02-03 Thread Markus Armbruster
Eric Blake writes: > On 02/02/2018 07:03 AM, Markus Armbruster wrote: >> Whenever qapi-schema.json changes, we run six programs eleven times to >> update eleven files. This is silly. Replace the six programs by a >> single program that spits out all eleven files. > > Yay, about time! > > One pr

[Qemu-devel] [PATCH v8 08/14] hw/pci*: Replace fprintf(stderr, "*\n" with error_report()

2018-02-03 Thread Markus Armbruster
From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\))

[Qemu-devel] [PATCH v8 14/14] target: Use qemu_log() instead of fprintf(stderr, ...)

2018-02-03 Thread Markus Armbruster
From: Alistair Francis Convert fprintf(stderr, ...) to use qemu_log(). Double prints in target/ppc/translate.c were manually remove. A fprintf() in target/sh4/translate.c was kept as it's inside a #if 0. The #if 0 and fflush() was removed around the unimplemented log in target/sh4/translate.c as

Re: [Qemu-devel] [PATCH RFC 02/21] qapi: Generate up-to-date copyright notice

2018-02-03 Thread Markus Armbruster
Eric Blake writes: > On 02/02/2018 07:03 AM, Markus Armbruster wrote: >> Each generator carries a copyright notice for the generator itself, >> and another one for the files it generates. Only the former have been >> updated along the way, the latter have not, and are all out of date. >> >> Fix

Re: [Qemu-devel] [PATCH RFC 03/21] qapi: New classes QAPIGenC, QAPIGenH, QAPIGenDoc

2018-02-03 Thread Markus Armbruster
Eric Blake writes: > On 02/02/2018 07:03 AM, Markus Armbruster wrote: >> These classes encapsulate accumulating and writing output. >> >> Convert C code generation to QAPIGenC and QAPIGenH. The conversion is >> rather shallow: most of the output accumulation is not converted. >> Left for later.

[Qemu-devel] [PATCH v8 02/14] hw/arm: Replace fprintf(stderr, "*\n" with error_report()

2018-02-03 Thread Markus Armbruster
From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\))

[Qemu-devel] [PATCH v8 11/14] hw/sparc*: Replace fprintf(stderr, "*\n" with error_report()

2018-02-03 Thread Markus Armbruster
From: Alistair Francis Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\))

Re: [Qemu-devel] [PATCH RFC 01/21] qapi: Streamline boilerplate comment generation

2018-02-03 Thread Markus Armbruster
Eric Blake writes: > On 02/02/2018 07:03 AM, Markus Armbruster wrote: >> Every generator has separate boilerplate for .h and .c, and their >> differences are boring. All of them repeat the license note. >> >> Reduce the repetition as follows. Move common text like the license >> note to common

  1   2   >