[Qemu-devel] [PATCH v10 21/24] replay: document development rules

2019-01-16 Thread Pavel Dovgalyuk
This patch introduces docs/devel/replay.txt which describes the rules that should be followed to make virtual devices usable in record/replay mode. Signed-off-by: Pavel Dovgalyuk -- v9: fixed external virtual clock description (reported by Artem Pisarenko) --- docs/devel/replay.txt | 46

Re: [Qemu-devel] [Qemu-ppc] [PATCH v5 2/3] ppc: Fix duplicated typedefs to be able to compile with Clang in gnu99 mode

2019-01-16 Thread Greg Kurz
On Thu, 17 Jan 2019 08:01:25 +0100 Thomas Huth wrote: > On 2019-01-16 14:29, Cédric Le Goater wrote: > > On 1/16/19 12:47 PM, Thomas Huth wrote: > >> On 2019-01-16 12:43, Cédric Le Goater wrote: > >>> On 1/11/19 9:17 AM, Thomas Huth wrote: > When compiling the ppc code with clang and

[Qemu-devel] [PATCH 3/4] spapr: move the interrupt presenters under machine_data

2019-01-16 Thread Cédric Le Goater
Next step is to remove them from under the PowerPCCPU Signed-off-by: Cédric Le Goater --- include/hw/ppc/spapr_cpu_core.h | 2 ++ hw/intc/spapr_xive.c| 3 ++- hw/intc/xics_spapr.c| 11 ++- hw/ppc/spapr.c | 2 +- hw/ppc/spapr_cpu_core.c

[Qemu-devel] [PATCH v10 15/24] replay: flush rr queue before loading the vmstate

2019-01-16 Thread Pavel Dovgalyuk
Non-empty record/replay queue prevents saving and loading the VM state, because it includes pending bottom halves and block coroutines. But when the new VM state is loaded, we don't have to preserve the consistency of the current state anymore. Therefore this patch just flushes the queue allowing

[Qemu-devel] [PATCH 0/4] ppc: move the interrupt presenters under the CPU machine_data

2019-01-16 Thread Cédric Le Goater
Hello, Currently the interrupt presenters of the sPAPR and PowerNV machines are stored directly under PowerPCCPU which can be problematic as this model is shared by all PPC machines. The following patches move the interrupt presenters under the CPU machine_data pointer which is a private field

[Qemu-devel] [PATCH 4/4] ppc: remove the interrupt presenters from under PowerPCCPU

2019-01-16 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater --- target/ppc/cpu.h | 9 - 1 file changed, 9 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index bde4dff1ba80..2c22292e7f41 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -23,11 +23,6 @@ #include "qemu-common.h" #include

[Qemu-devel] [PATCH v10 12/24] replay: introduce breakpoint at the specified step

2019-01-16 Thread Pavel Dovgalyuk
This patch introduces replay_break, replay_delete_break qmp and hmp commands. These commands allow stopping at the specified instruction. It may be useful for debugging when there are some known events that should be investigated. replay_break command has one argument - number of instructions

[Qemu-devel] [PATCH 1/4] xive: add a get_tctx() method to the XiveRouter

2019-01-16 Thread Cédric Le Goater
It provides a mean to retrieve the XiveTCTX of a CPU. This will become necessary with future changes which move the interrupt presenter object pointers under the PowerPCCPU machine_data. The PowerNV machine has an extra requirement on TIMA accesses that this new method addresses. The machine can

[Qemu-devel] [PATCH v10 17/24] gdbstub: add reverse continue support in replay mode

2019-01-16 Thread Pavel Dovgalyuk
This patch adds support of the reverse continue operation for gdbstub. Reverse continue finds the last breakpoint that would happen in normal execution from the beginning to the current moment. Implementation of the reverse continue replays the execution twice: to find the breakpoints that were

[Qemu-devel] [PATCH v10 09/24] replay: provide an accessor for rr filename

2019-01-16 Thread Pavel Dovgalyuk
This patch adds an accessor function for the name of the record/replay log file. Adding an accessor instead of making variable global, prevents accidental modification of this variable by other modules. Signed-off-by: Pavel Dovgalyuk --- include/sysemu/replay.h |2 ++ replay/replay.c

Re: [Qemu-devel] [PATCH v3 0/4] Introduce attributes for timers subsystem and remove QEMU_CLOCK_VIRTUAL_EXT clock type

2019-01-16 Thread Pavel Dovgalyuk
> From: Artem Pisarenko [mailto:artem.k.pisare...@gmail.com] > ср, 16 янв. 2019 г. в 12:15, Pavel Dovgalyuk : > > > > > From: Artem Pisarenko [mailto:artem.k.pisare...@gmail.com] > > > > It seems, that this approach is not always correct. > > > > Now timerlist_deadline_ns uses all virtual timers

[Qemu-devel] [PATCH v10 19/24] replay: add BH oneshot event for block layer

2019-01-16 Thread Pavel Dovgalyuk
Replay is capable of recording normal BH events, but sometimes there are single use callbacks scheduled with aio_bh_schedule_oneshot function. This patch enables recording and replaying such callbacks. Block layer uses these events for calling the completion function. Replaying these calls makes

[Qemu-devel] [PATCH v10 20/24] replay: init rtc after enabling the replay

2019-01-16 Thread Pavel Dovgalyuk
This patch postpones the call of 'configure_rtc' function. This call uses host clock to configure the rtc, but host clock access should be recorded when using icount record/replay mode. Therefore now rtc is configured after switching record/replay mode on. Signed-off-by: Pavel Dovgalyuk ---

[Qemu-devel] [PATCH v10 07/24] qcow2: introduce icount field for snapshots

2019-01-16 Thread Pavel Dovgalyuk
This patch introduces the icount field for saving within the snapshot. It is required for navigation between the snapshots in record/replay mode. Signed-off-by: Pavel Dovgalyuk Acked-by: Kevin Wolf -- v2: - documented format changes in docs/interop/qcow2.txt (suggested by Eric Blake) v10:

Re: [Qemu-devel] [PATCH] include/fpu/softfloat: Fix compilation with Clang on s390x

2019-01-16 Thread Alex Bennée
Thomas Huth writes: > On 2019-01-16 18:08, Alex Bennée wrote: >> >> Thomas Huth writes: >> >>> On 2019-01-15 21:05, Emilio G. Cota wrote: On Tue, Jan 15, 2019 at 16:01:32 +, Alex Bennée wrote: > Ahh I should have mentioned we already have the technology for this ;-) > >

[Qemu-devel] [PATCH v10 16/24] gdbstub: add reverse step support in replay mode

2019-01-16 Thread Pavel Dovgalyuk
GDB remote protocol supports two reverse debugging commands: reverse step and reverse continue. This patch adds support of the first one to the gdbstub. Reverse step is intended to step one instruction in the backwards direction. This is not possible in regular execution. But replayed execution is

[Qemu-devel] [PATCH v10 06/24] replay: finish record/replay before closing the disks

2019-01-16 Thread Pavel Dovgalyuk
After recent updates block devices cannot be closed on qemu exit. This happens due to the block request polling when replay is not finished. Therefore now we stop execution recording before closing the block devices. Signed-off-by: Pavel Dovgalyuk --- replay/replay.c |2 ++ vl.c

[Qemu-devel] [PATCH v10 18/24] replay: describe reverse debugging in docs/replay.txt

2019-01-16 Thread Pavel Dovgalyuk
This patch updates the documentation and describes usage of the reverse debugging in QEMU+GDB. Signed-off-by: Pavel Dovgalyuk --- docs/replay.txt | 33 + 1 file changed, 33 insertions(+) diff --git a/docs/replay.txt b/docs/replay.txt index 2c2c5f6..8447fdd

[Qemu-devel] [PATCH v10 22/24] util/qemu-timer: refactor deadline calculation for external timers

2019-01-16 Thread Pavel Dovgalyuk
icount-based record/replay uses qemu_clock_deadline_ns_all to measure the period until vCPU may be interrupted. This function takes in account the virtual timers, because they belong to the virtual devices that may generate interrupt request or affect the virtual machine state. However, there are

[Qemu-devel] [PATCH v10 13/24] replay: implement replay-seek command

2019-01-16 Thread Pavel Dovgalyuk
This patch adds hmp/qmp commands replay_seek/replay-seek that proceed the execution to the specified instruction count. The command automatically loads nearest snapshot and replays the execution to find the desired instruction count. Signed-off-by: Pavel Dovgalyuk -- v2: - renamed replay_seek

[Qemu-devel] [PATCH v10 14/24] replay: refine replay-time module

2019-01-16 Thread Pavel Dovgalyuk
This patch removes refactoring artifacts from the replay/replay-time.c Signed-off-by: Pavel Dovgalyuk --- replay/replay-time.c | 36 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/replay/replay-time.c b/replay/replay-time.c index

[Qemu-devel] [PATCH v10 05/24] replay: don't drain/flush bdrv queue while RR is working

2019-01-16 Thread Pavel Dovgalyuk
In record/replay mode bdrv queue is controlled by replay mechanism. It does not allow saving or loading the snapshots when bdrv queue is not empty. Stopping the VM is not blocked by nonempty queue, but flushing the queue is still impossible there, because it may cause deadlocks in replay mode.

[Qemu-devel] [PATCH v10 11/24] replay: introduce info hmp/qmp command

2019-01-16 Thread Pavel Dovgalyuk
This patch introduces 'info replay' monitor command and corresponding qmp request. These commands request the current record/replay mode, replay log file name, and the instruction count (number of recorded/replayed instructions). The instruction count can be used with the replay_seek/replay_break

[Qemu-devel] [PATCH v10 04/24] replay: update docs for record/replay with block devices

2019-01-16 Thread Pavel Dovgalyuk
This patch updates the description of the command lines for using record/replay with attached block devices. Signed-off-by: Pavel Dovgalyuk --- docs/replay.txt | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/replay.txt b/docs/replay.txt index

[Qemu-devel] [PATCH v10 00/24] Fixing record/replay and adding reverse debugging

2019-01-16 Thread Pavel Dovgalyuk
GDB remote protocol supports reverse debugging of the targets. It includes 'reverse step' and 'reverse continue' operations. The first one finds the previous step of the execution, and the second one is intended to stop at the last breakpoint that would happen when the program is executed

[Qemu-devel] [PATCH v10 10/24] qapi: introduce replay.json for record/replay-related stuff

2019-01-16 Thread Pavel Dovgalyuk
This patch adds replay.json file. It will be used for adding record/replay-related data structures and commands. Signed-off-by: Pavel Dovgalyuk -- v10: - minor changes --- MAINTAINERS |1 + Makefile.objs |4 ++-- include/sysemu/replay.h |2 +- qapi/misc.json

[Qemu-devel] [PATCH v10 08/24] migration: introduce icount field for snapshots

2019-01-16 Thread Pavel Dovgalyuk
Saving icount as a parameters of the snapshot allows navigation between them in the execution replay scenario. This information can be used for finding a specific snapshot for proceeding the recorded execution to the specific moment of the time. E.g., 'reverse step' action (introduced in one of

[Qemu-devel] [PATCH v10 03/24] replay: disable default snapshot for record/replay

2019-01-16 Thread Pavel Dovgalyuk
From: Pavel Dovgalyuk This patch disables setting '-snapshot' option on by default in record/replay mode. This is needed for creating vmstates in record and replay modes. Signed-off-by: Pavel Dovgalyuk --- vl.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH v10 02/24] block: implement bdrv_snapshot_goto for blkreplay

2019-01-16 Thread Pavel Dovgalyuk
From: Pavel Dovgalyuk This patch enables making snapshots with blkreplay used in block devices. This function is required to make bdrv_snapshot_goto without calling .bdrv_open which is not implemented. Signed-off-by: Pavel Dovgalyuk --- block/blkreplay.c |8 1 file changed, 8

[Qemu-devel] [PATCH v10 01/24] replay: add missing fix for internal function

2019-01-16 Thread Pavel Dovgalyuk
From: pbonz...@redhat.com This is a fix which was missed by patch 74c0b816adfc6aa1b01b4426fdf385e32e35cbac, which added current_step parameter to the replay_advance_current_step function. Signed-off-by: Pavel Dovgalyuk --- replay/replay-internal.c |2 +- 1 file changed, 1 insertion(+), 1

Re: [Qemu-devel] [Qemu-ppc] [PATCH v5 2/3] ppc: Fix duplicated typedefs to be able to compile with Clang in gnu99 mode

2019-01-16 Thread Thomas Huth
On 2019-01-16 14:29, Cédric Le Goater wrote: > On 1/16/19 12:47 PM, Thomas Huth wrote: >> On 2019-01-16 12:43, Cédric Le Goater wrote: >>> On 1/11/19 9:17 AM, Thomas Huth wrote: When compiling the ppc code with clang and -std=gnu99, there are a couple of warnings/errors like this one:

Re: [Qemu-devel] [PATCH v2] .cirrus.yml: basic compile and test for FreeBSD

2019-01-16 Thread Thomas Huth
On 2019-01-16 20:19, Ed Maste wrote: > From: Ed Maste > > Signed-off-by: Ed Maste > Reviewed-by: Alex Bennée > --- > .cirrus.yml | 16 > MAINTAINERS | 8 > 2 files changed, 24 insertions(+) > create mode 100644 .cirrus.yml > > diff --git a/.cirrus.yml

Re: [Qemu-devel] [PATCH v2 4/7] softfloat: fallback to __int128 maths for s390x and others

2019-01-16 Thread Thomas Huth
On 2019-01-16 21:23, Alex Bennée wrote: > Apparently some versions of clang can't handle inline assembly with > __int128 parameters, especially on s390. Instead of hand-coding the > s390 divide provide a generic fallback for anything that provides > __int128 capable maths. > > Signed-off-by: Alex

Re: [Qemu-devel] [PATCH] include/fpu/softfloat: Fix compilation with Clang on s390x

2019-01-16 Thread Thomas Huth
On 2019-01-16 18:08, Alex Bennée wrote: > > Thomas Huth writes: > >> On 2019-01-15 21:05, Emilio G. Cota wrote: >>> On Tue, Jan 15, 2019 at 16:01:32 +, Alex Bennée wrote: Ahh I should have mentioned we already have the technology for this ;-) If you build the fpu/next tree on

Re: [Qemu-devel] [PATCH v3 20/50] paaudio: properly disconnect streams in fini_*

2019-01-16 Thread Marc-André Lureau
Hi On Thu, Jan 17, 2019 at 3:37 AM Kővágó, Zoltán wrote: > > Currently this needs a workaround due to bug #74624 in pulseaudio. > > Reviewed-by: Marc-André Lureau > Signed-off-by: Kővágó, Zoltán > --- > audio/paaudio.c | 25 +++-- > 1 file changed, 23 insertions(+), 2

Re: [Qemu-devel] [PATCH] include/fpu/softfloat: Fix compilation with Clang on s390x

2019-01-16 Thread Thomas Huth
On 2019-01-16 18:16, Alex Bennée wrote: > > Cornelia Huck writes: > >> On Mon, 14 Jan 2019 13:12:35 +0100 >> Thomas Huth wrote: >> > >>> >>> diff --git a/include/fpu/softfloat-macros.h b/include/fpu/softfloat-macros.h >>> index b1d772e..bd5b641 100644 >>> --- a/include/fpu/softfloat-macros.h

Re: [Qemu-devel] [PATCH] accel: Allow to build QEMU without TCG or KVM support

2019-01-16 Thread Thomas Huth
On 2019-01-16 18:35, Anthony PERARD wrote: > Instead of deny build of QEMU without a default accelerator, simply > report an error when the user haven't passed -accel or -machine accel= > and TCG and KVM isn't builtin. > > ./configure already check that at least one accelerator is available. > >

Re: [Qemu-devel] [PATCH 2/2] vfio-pci: Use vfio_register_event_notifier in vfio_intx_enable_kvm

2019-01-16 Thread Alexey Kardashevskiy
On 12/01/2019 03:58, Eric Auger wrote: > We can also use vfio_register_event_notifier() helper in > vfio_intx_enable_kvm to set the signalling associated to > VFIO_PCI_INTX_IRQ_INDEX. > > Signed-off-by: Eric Auger > --- > hw/vfio/pci.c | 38 +++--- > 1 file

Re: [Qemu-devel] [PATCH 1/2] vfio-pci: Introduce vfio_register_event_notifier helper

2019-01-16 Thread Alexey Kardashevskiy
On 12/01/2019 03:58, Eric Auger wrote: > The code used to attach the eventfd handler for the ERR and > REQ irq indices can be factorized into a helper. In subsequent > patches we will extend this helper to support other irq indices. > > We test the notification is allowed outside of the

Re: [Qemu-devel] [PATCH v3 18/19] nbd/client: Work around 3.0 bug for listing meta contexts

2019-01-16 Thread Eric Blake
On 1/16/19 9:43 AM, Vladimir Sementsov-Ogievskiy wrote: >> @@ -839,9 +842,25 @@ static int nbd_list_meta_contexts(QIOChannel *ioc, >> >> ret = nbd_receive_one_meta_context(ioc, NBD_OPT_LIST_META_CONTEXT, >> , NULL, errp); >> +if (ret

Re: [Qemu-devel] [Qemu-ppc] [PATCH qemu] spapr: Fix fdt warnings

2019-01-16 Thread Alexey Kardashevskiy
On 16/01/2019 23:01, BALATON Zoltan wrote: > On Wed, 16 Jan 2019, Richard Henderson wrote: >> On 1/16/19 3:19 PM, Alexey Kardashevskiy wrote: >>> because TARGET_FMT_lx is defined as "%016"PRIx64. >>> >>> This uses simple "%lx" to suppress the warning. Since it is spapr which >>> is always

[Qemu-devel] [PATCH] ARM: GIC: error out early when creating VGICv2 failed

2019-01-16 Thread Shannon Zhao
Currently if creating a gicv2 VM on the platform without VGICv2 support, it failed in kvm_arm_pmu_set_irq while trying to set the interrupt number for PMU with below error message. KVM_SET_DEVICE_ATTR failed: Invalid argument This error log is a little confused. Also it should error out in

[Qemu-devel] [PATCH qemu 1/3] vfio/spapr: Fix indirect levels calculation

2019-01-16 Thread Alexey Kardashevskiy
The current code assumes that we can address more bits on a PCI bus for DMA than we really can but there is no way knowing the actual limit. This makes a better guess for the number of levels and if the kernel fails to allocate that, this increases the level numbers till succeeded or reached the

[Qemu-devel] [PATCH qemu 0/3] spapr_pci, vfio: NVIDIA V100 + P9 passthrough

2019-01-16 Thread Alexey Kardashevskiy
This is for passing through NVIDIA V100 GPUs on POWER9 systems. This implements a subdriver for NVIDIA V100 GPU with coherent memory and NPU/ATS support available in the POWER9 CPU. 1/3 is not strictly related but since new memory also needs to be mapped to the 64bit DMA window and it is

[Qemu-devel] [PATCH qemu 3/3] spapr: Support NVIDIA V100 GPU with NVLink2

2019-01-16 Thread Alexey Kardashevskiy
NVIDIA V100 GPUs have on-board RAM which is mapped into the host memory space and accessible as normal RAM via an NVLink bus. The VFIO-PCI driver implements special regions for such GPUs and emulates an NVLink bridge. NVLink2-enabled POWER9 CPUs also provide address translation services which

[Qemu-devel] [PATCH qemu 2/3] vfio: Make vfio_get_region_info_cap public

2019-01-16 Thread Alexey Kardashevskiy
This makes vfio_get_region_info_cap() to be used in quirks. Signed-off-by: Alexey Kardashevskiy --- include/hw/vfio/vfio-common.h | 2 ++ hw/vfio/common.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/hw/vfio/vfio-common.h

[Qemu-devel] [PATCH v3] vhost-user-blk: add discard/write zeroes features support

2019-01-16 Thread Changpeng Liu
Linux commit 1f23816b8 "virtio_blk: add discard and write zeroes support" added the support in the Guest kernel, while here also enable the features support with vhost-user-blk driver. Also enable the test example utility with DISCARD and WRITE ZEROES commands. Signed-off-by: Changpeng Liu ---

Re: [Qemu-devel] [PATCH for-4.0 0/5] fix some segmentation faults and migration issues

2019-01-16 Thread fei
> 在 2019年1月16日,23:00,Dr. David Alan Gilbert 写道: > > * Philippe Mathieu-Daudé (phi...@redhat.com) wrote: >>> On 1/16/19 5:50 AM, Fei Li wrote: >>> Hi all, >>> >>> Kindly ping. :) >>> >>> As my v10 of qemu_thread_create partly rely on this patch series, I'd >>> like to know >>> when will

Re: [Qemu-devel] [PATCH v1 2/5] vl.c: add -smp, dies=* command line support

2019-01-16 Thread Like Xu
On 2019/1/17 2:26, Daniel P. Berrangé wrote: On Mon, Jan 14, 2019 at 06:51:34PM -0200, Eduardo Habkost wrote: On Mon, Jan 14, 2019 at 08:24:56PM +0800, Like Xu wrote: This patch updates the check rules on legeacy -smp parse from user command and it's designed to obey the same restrictions as

[Qemu-devel] [PATCH v3 40/50] audio: split ctl_* functions into enable_* and volume_*

2019-01-16 Thread Kővágó, Zoltán
This way we no longer need vararg functions, improving compile time error detection. Also now it's possible to check actually what commands are supported, without needing to manually update ctl_caps. Signed-off-by: Kővágó, Zoltán --- audio/audio_int.h | 15 ++--- audio/audio_template.h |

[Qemu-devel] [PATCH v3 39/50] audio: common rate control code for timer based outputs

2019-01-16 Thread Kővágó, Zoltán
This commit removes the ad-hoc rate-limiting code from noaudio and wavaudio, and replaces them with a (slightly modified) code from spiceaudio. This way multiple write calls (for example when the circular buffer wraps around) do not cause problems. Signed-off-by: Kővágó, Zoltán ---

Re: [Qemu-devel] [PATCH] slirp: Use lduw_be_p in slirp_input

2019-01-16 Thread Richard Henderson
On 1/17/19 10:50 AM, Samuel Thibault wrote: > Hello, > > Richard Henderson, le mer. 26 déc. 2018 14:42:54 +1100, a ecrit: >> The pointer may be unaligned, so we must use our routines for that. >> At the same time, we might as well use the big-endian version >> instead of ntohs. >> >> This fixes

[Qemu-devel] [PATCH v3 27/50] alsaaudio: port to the new audio backend api

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/alsaaudio.c | 306 -- 1 file changed, 81 insertions(+), 225 deletions(-) diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 6ad2a09d16..c23dedd4bf 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@

[Qemu-devel] [PATCH v3 47/50] paaudio: channel-map option

2019-01-16 Thread Kővágó, Zoltán
Add an option to change the channel map used by pulseaudio. If not specified, falls back to an OSS compatible channel map. Signed-off-by: Kővágó, Zoltán --- qapi/audio.json | 5 - audio/paaudio.c | 18 ++ qemu-options.hx | 9 + 3 files changed, 27 insertions(+), 5

[Qemu-devel] [PATCH v3 25/50] audio: use size_t where makes sense

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- Notes: Changes from v2: * Update REPLAY_VERSION * Fix run_in/run_out prototypes in audio_pcm_ops audio/audio.h | 4 +- audio/audio_int.h | 26 +++ audio/audio_template.h | 14 ++-- audio/mixeng.h | 9 ++-

[Qemu-devel] [PATCH v3 24/50] audio: remove read and write pcm_ops

2019-01-16 Thread Kővágó, Zoltán
They just called audio_pcm_sw_read/write anyway, so it makes no sense to have them too. (The noaudio's read is the only exception, but it should work with the generic code too.) Signed-off-by: Kővágó, Zoltán --- audio/audio_int.h | 5 - audio/alsaaudio.c | 12

[Qemu-devel] [PATCH v3 38/50] audio: remove hw->samples, buffer_size_in/out pcm_ops

2019-01-16 Thread Kővágó, Zoltán
This patch removes the samples member from HWVoiceIn and HWVoiceOut. Backends can specify buffer size via the newly added buffer_size_in and buffer_size_out functions in audio_pcm_ops. They are optional, if not defined qemu will fall back to some built-in constant. Signed-off-by: Kővágó, Zoltán

[Qemu-devel] [PATCH v3 45/50] audio: replace shift in audio_pcm_info with bytes_per_frame

2019-01-16 Thread Kővágó, Zoltán
The bit shifting trick worked because the number of bytes per frame was always a power-of-two (since QEMU only supports mono, stereo and 8, 16 and 32 bit samples). But if we want to add support for surround sound, this no longer holds true. Signed-off-by: Kővágó, Zoltán --- audio/audio_int.h

[Qemu-devel] [PATCH v3 44/50] audio: support more than two channels in volume setting

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/audio.h | 10 ++ audio/audio_int.h | 4 ++-- audio/audio.c | 28 audio/paaudio.c| 20 audio/spiceaudio.c | 14 -- 5 files changed, 52 insertions(+), 24 deletions(-) diff

[Qemu-devel] [PATCH v3 37/50] audio: unify input and output mixeng buffer management

2019-01-16 Thread Kővágó, Zoltán
Usage notes: hw->samples became hw->{mix,conv}_buf->size, except before initialization (audio_pcm_hw_alloc_resources_*), hw->samples gives the initial size of the STSampleBuffer. The next commit tries to fix this inconsistency. Signed-off-by: Kővágó, Zoltán --- audio/audio_int.h | 12

[Qemu-devel] [PATCH v3 50/50] usbaudio: change playback counters to 64 bit

2019-01-16 Thread Kővágó, Zoltán
With stereo playback, they need about 375 minutes of continuous audio playback to overflow, which is usually not a problem (as stopping and later resuming playback resets the counters). But with 7.1 audio, they only need about 95 minutes to overflow. After the overflow, the buf->prod %

[Qemu-devel] [PATCH v3 46/50] audio: basic support for multichannel audio

2019-01-16 Thread Kővágó, Zoltán
Which currently only means removing some checks. Old code won't require more than two channels, but new code will need it. Signed-off-by: Kővágó, Zoltán --- audio/alsaaudio.c | 7 --- audio/audio.c | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/audio/alsaaudio.c

Re: [Qemu-devel] [PATCH qemu 0/2] linux-headers: Update to v5.0-rc2

2019-01-16 Thread Alexey Kardashevskiy
On 16/01/2019 22:49, Paolo Bonzini wrote: > On 16/01/19 12:47, Cornelia Huck wrote: >> On Wed, 16 Jan 2019 15:17:10 +1100 >> Alexey Kardashevskiy wrote: >> >>> Here is the update script update and what it did to the v5.0-rc2 kernel. >>> >>> This is based on sha1 >>> a0a8bff Greg Kurz

[Qemu-devel] [PATCH v3 29/50] dsoundaudio: port to the new audio backend api

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/dsound_template.h | 45 +++--- audio/dsoundaudio.c | 329 ++-- 2 files changed, 102 insertions(+), 272 deletions(-) diff --git a/audio/dsound_template.h b/audio/dsound_template.h index 96181efb36..ff5a1f85fd 100644

[Qemu-devel] [PATCH v3 48/50] usb-audio: do not count on avail bytes actually available

2019-01-16 Thread Kővágó, Zoltán
This assumption is no longer true when mixeng is turned off. Signed-off-by: Kővágó, Zoltán --- hw/usb/dev-audio.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 84e737808c..0bfdd52423 100644 ---

[Qemu-devel] [PATCH v3 34/50] spiceaudio: port to the new audio backend api

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/spiceaudio.c | 112 +++-- 1 file changed, 38 insertions(+), 74 deletions(-) diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index 1a777bba17..d1605d3939 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c

[Qemu-devel] [PATCH v3 42/50] audio: make mixeng optional

2019-01-16 Thread Kővágó, Zoltán
Implementation of the previously added mixeng option. Signed-off-by: Kővágó, Zoltán --- audio/audio_template.h | 46 --- audio/audio.c | 70 ++ 2 files changed, 92 insertions(+), 24 deletions(-) diff --git

[Qemu-devel] [PATCH v3 26/50] audio: api for mixeng code free backends

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/audio_int.h | 41 ++-- audio/audio_template.h | 1 + audio/audio.c | 211 - 3 files changed, 245 insertions(+), 8 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index

Re: [Qemu-devel] [PATCH] slirp: Use lduw_be_p in slirp_input

2019-01-16 Thread Samuel Thibault
Hello, Richard Henderson, le mer. 26 déc. 2018 14:42:54 +1100, a ecrit: > The pointer may be unaligned, so we must use our routines for that. > At the same time, we might as well use the big-endian version > instead of ntohs. > > This fixes sparc64 host SIGBUS during pxe boot. I'm not at ease

[Qemu-devel] [PATCH v3 43/50] paaudio: get/put_buffer functions

2019-01-16 Thread Kővágó, Zoltán
This lets us avoid some buffer copying when using mixeng. Signed-off-by: Kővágó, Zoltán --- audio/paaudio.c | 83 + 1 file changed, 83 insertions(+) diff --git a/audio/paaudio.c b/audio/paaudio.c index a45469066b..01c5df278b 100644 ---

[Qemu-devel] [PATCH v3 33/50] sdlaudio: port to the new audio backend api

2019-01-16 Thread Kővágó, Zoltán
SDL2 is still a big mess, but it's probably not worse than the current version. Signed-off-by: Kővágó, Zoltán --- audio/sdlaudio.c | 136 +-- 1 file changed, 50 insertions(+), 86 deletions(-) diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index

[Qemu-devel] [PATCH v3 04/50] audio: -audiodev command line option basic implementation

2019-01-16 Thread Kővágó, Zoltán
Audio drivers now get an Audiodev * as config paramters, instead of the global audio_option structs. There is some code in audio/audio_legacy.c that converts the old environment variables to audiodev options (this way backends do not have to worry about legacy options). It also contains a

[Qemu-devel] [PATCH v3 31/50] ossaudio: port to the new audio backend api

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/ossaudio.c | 288 +-- 1 file changed, 104 insertions(+), 184 deletions(-) diff --git a/audio/ossaudio.c b/audio/ossaudio.c index c6d4086573..774a41fbf9 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@

[Qemu-devel] [PATCH v3 30/50] noaudio: port to the new audio backend api

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/noaudio.c | 39 +++ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/audio/noaudio.c b/audio/noaudio.c index 59e680db6f..647558f54c 100644 --- a/audio/noaudio.c +++ b/audio/noaudio.c @@ -40,10 +40,9 @@

[Qemu-devel] [PATCH v3 36/50] audio: remove remains of the old backend api

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/audio_int.h | 7 --- audio/audio.c | 42 ++ 2 files changed, 6 insertions(+), 43 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index 056c63d45c..1f6ec15e18 100644 --- a/audio/audio_int.h

[Qemu-devel] [PATCH v3 02/50] audio: use qapi AudioFormat instead of audfmt_e

2019-01-16 Thread Kővágó, Zoltán
I had to include an enum for audio sampling formats into qapi, but that meant duplicating the audfmt_e enum. This patch replaces audfmt_e and associated values with the qapi generated AudioFormat enum. This patch is mostly a search-and-replace, except for switches where the qapi generated

[Qemu-devel] [PATCH v3 07/50] dsoundaudio: port to -audiodev config

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/dsound_template.h | 6 ++--- audio/audio_legacy.c| 39 +++ audio/dsoundaudio.c | 59 - 3 files changed, 59 insertions(+), 45 deletions(-) diff --git a/audio/dsound_template.h

[Qemu-devel] [PATCH v3 41/50] audio: add mixeng option (documentation)

2019-01-16 Thread Kővágó, Zoltán
This will allow us to disable mixeng when we use a decent backend. Disabling mixeng have a few advantages: * we no longer convert the audio output from one format to another, when the underlying audio system would just convert it to a third format. We no longer convert, only the underlying

[Qemu-devel] [PATCH v3 32/50] paaudio: port to the new audio backend api

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- configure| 5 - audio/audio_pt_int.h | 22 --- audio/audio_pt_int.c | 174 audio/paaudio.c | 372 ++- audio/Makefile.objs | 1 - 5 files changed, 45 insertions(+), 529

[Qemu-devel] [PATCH v3 14/50] audio: -audiodev command line option: cleanup

2019-01-16 Thread Kővágó, Zoltán
Remove no longer needed code. Signed-off-by: Kővágó, Zoltán --- audio/audio_int.h | 17 audio/audio.c | 201 +- 2 files changed, 4 insertions(+), 214 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index

[Qemu-devel] [PATCH v3 35/50] wavaudio: port to the new audio backend api

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/wavaudio.c | 54 1 file changed, 9 insertions(+), 45 deletions(-) diff --git a/audio/wavaudio.c b/audio/wavaudio.c index a805e5e94b..31db03aadb 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -34,52

[Qemu-devel] [PATCH v3 21/50] audio: remove audio_MIN, audio_MAX

2019-01-16 Thread Kővágó, Zoltán
There's already a MIN and MAX macro in include/qemu/osdep.h, use them instead. Signed-off-by: Kővágó, Zoltán --- audio/audio.h | 17 - audio/alsaaudio.c | 6 +++--- audio/audio.c | 20 ++-- audio/coreaudio.c | 2 +-

[Qemu-devel] [PATCH v3 18/50] audio: audiodev= parameters no longer optional when -audiodev present

2019-01-16 Thread Kővágó, Zoltán
This means you should probably stop using -soundhw (as it doesn't allow you to specify any options) and add the device manually with -device. The exception is pcspk, it's currently not possible to manually add it. To use it with audiodev, use something like this: -audiodev id=foo,... -global

[Qemu-devel] [PATCH v3 28/50] coreaudio: port to the new audio backend api

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/coreaudio.c | 130 -- 1 file changed, 69 insertions(+), 61 deletions(-) diff --git a/audio/coreaudio.c b/audio/coreaudio.c index 646aea06a0..e32c5b62fd 100644 --- a/audio/coreaudio.c +++ b/audio/coreaudio.c @@

[Qemu-devel] [PATCH v3 05/50] alsaaudio: port to -audiodev config

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/alsaaudio.c| 330 ++- audio/audio_legacy.c | 94 +++- 2 files changed, 198 insertions(+), 226 deletions(-) diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 8302f3e882..6b43a06180 100644 ---

[Qemu-devel] [PATCH v3 20/50] paaudio: properly disconnect streams in fini_*

2019-01-16 Thread Kővágó, Zoltán
Currently this needs a workaround due to bug #74624 in pulseaudio. Reviewed-by: Marc-André Lureau Signed-off-by: Kővágó, Zoltán --- audio/paaudio.c | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/audio/paaudio.c b/audio/paaudio.c index

[Qemu-devel] [PATCH v3 23/50] paaudio: fix playback glitches

2019-01-16 Thread Kővágó, Zoltán
Pulseaudio normally assumes that when the server wants it, the client can generate the audio samples and send it right away. Unfortunately this is not the case with QEMU -- it's up to the emulated system when does it generate the samples. Buffering the samples and sending them from a background

[Qemu-devel] [PATCH v3 22/50] audio: do not run each backend in audio_run

2019-01-16 Thread Kővágó, Zoltán
audio_run is called manually by alsa and oss backends when polling. In this case only the requesting backend should be run, not all of them. Signed-off-by: Kővágó, Zoltán --- audio/audio_int.h | 2 +- audio/alsaaudio.c | 7 +-- audio/audio.c | 14 +- audio/ossaudio.c | 12

[Qemu-devel] [PATCH v3 16/50] audio: basic support for multi backend audio

2019-01-16 Thread Kővágó, Zoltán
Audio functions no longer access glob_audio_state, instead they get an AudioState as a parameter. This is required in order to support multiple backends. glob_audio_state is also gone, and replaced with a tailq so we can store more than one states. Signed-off-by: Kővágó, Zoltán ---

[Qemu-devel] [PATCH v3 17/50] audio: add audiodev properties to frontends

2019-01-16 Thread Kővágó, Zoltán
Finally add audiodev= options to audio frontends so users can specify which backend to use when multiple backends exist. Not specifying an audiodev= option currently causes the first audiodev to be used, this is fixed in the next commit. Example usage: -audiodev pa,id=foo -device

[Qemu-devel] [PATCH v3 10/50] paaudio: port to -audiodev config

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/audio_legacy.c | 39 +++ audio/paaudio.c | 90 2 files changed, 79 insertions(+), 50 deletions(-) diff --git a/audio/audio_legacy.c b/audio/audio_legacy.c index 70b46cbcc1..d173ff042e

[Qemu-devel] [PATCH v3 12/50] spiceaudio: port to -audiodev config

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/spiceaudio.c | 5 - 1 file changed, 5 deletions(-) diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c index affc3df17f..4f7873af5a 100644 --- a/audio/spiceaudio.c +++ b/audio/spiceaudio.c @@ -373,10 +373,6 @@ static int line_in_ctl (HWVoiceIn *hw,

[Qemu-devel] [PATCH v3 15/50] audio: reduce glob_audio_state usage

2019-01-16 Thread Kővágó, Zoltán
Remove glob_audio_state from functions, where possible without breaking the API. This means that most static functions in audio.c now take an AudioState pointer instead of implicitly using glob_audio_state. Also included a pointer in SWVoice*, HWVoice* structs, so that functions dealing them can

[Qemu-devel] [PATCH v3 03/50] audio: -audiodev command line option: documentation

2019-01-16 Thread Kővágó, Zoltán
This patch adds documentation of an -audiodev command line option, that deprecates the old QEMU_* environment variables for audio backend configuration. It's syntax is similar to existing options (-netdev, -device, etc): -audiodev driver_name,property=value,... Although now it's possible to

[Qemu-devel] [PATCH v3 13/50] wavaudio: port to -audiodev config

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/audio_legacy.c | 15 audio/wavaudio.c | 58 +++- 2 files changed, 24 insertions(+), 49 deletions(-) diff --git a/audio/audio_legacy.c b/audio/audio_legacy.c index aa6c789096..cf0fc4df90 100644 ---

[Qemu-devel] [PATCH v3 09/50] ossaudio: port to -audiodev config

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/audio_legacy.c | 33 + audio/ossaudio.c | 167 +++ 2 files changed, 90 insertions(+), 110 deletions(-) diff --git a/audio/audio_legacy.c b/audio/audio_legacy.c index 601a68fab6..70b46cbcc1 100644 ---

[Qemu-devel] [PATCH v3 19/50] paaudio: do not move stream when sink/source name is specified

2019-01-16 Thread Kővágó, Zoltán
Unless we disable stream moving, pulseaudio can easily move the stream on connect, effectively ignoring the source/sink specified by the user. Signed-off-by: Kővágó, Zoltán --- audio/paaudio.c | 5 + 1 file changed, 5 insertions(+) diff --git a/audio/paaudio.c b/audio/paaudio.c index

[Qemu-devel] [PATCH v3 11/50] sdlaudio: port to -audiodev config

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/audio_legacy.c | 12 audio/sdlaudio.c | 22 -- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/audio/audio_legacy.c b/audio/audio_legacy.c index d173ff042e..aa6c789096 100644 --- a/audio/audio_legacy.c

[Qemu-devel] [PATCH v3 01/50] qapi: qapi for audio backends

2019-01-16 Thread Kővágó, Zoltán
This patch adds structures into qapi to replace the existing configuration structures used by audio backends currently. This qapi will be the base of the -audiodev command line parameter (that replaces the old environment variables based config). This is not a 1:1 translation of the old options,

[Qemu-devel] [PATCH v3 08/50] noaudio: port to -audiodev config

2019-01-16 Thread Kővágó, Zoltán
Signed-off-by: Kővágó, Zoltán --- audio/noaudio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/audio/noaudio.c b/audio/noaudio.c index 79690af1ea..ccc611fc84 100644 --- a/audio/noaudio.c +++ b/audio/noaudio.c @@ -163,7 +163,6 @@ static struct audio_pcm_ops no_pcm_ops = { static struct

  1   2   3   4   >