[PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine`

2023-07-29 Thread Dinah Baum
Signed-off-by: Dinah Baum --- qapi/machine-target.json | 78 +--- qapi/machine.json| 77 +++ 2 files changed, 78 insertions(+), 77 deletions(-) diff --git a/qapi/machine-target.json b/qapi/machine-target.json index f

Re: [PATCH for-8.2 0/6] vfio/migration: Add P2P support for VFIO migration

2023-07-29 Thread Avihai Horon
On 18/07/2023 18:46, Jason Gunthorpe wrote: On Sun, Jul 16, 2023 at 11:15:35AM +0300, Avihai Horon wrote: Hi all, The first patch in this series adds a small optimization to VFIO migration by moving the STOP_COPY->STOP transition to vfio_save_cleanup(). Testing with a ConnectX-7 VFIO device s

[PATCH v3 0/3] Enable -cpu ,help

2023-07-29 Thread Dinah Baum
This patch adds the ability to query for CPU features. Currently it is limited to the architecture that support feature probing (arm, i386, and s390x). Ex: athlon features: 3dnow= 3dnowext= 3dnowprefetch= ... Suggested-by: Peter Maydell Resolves: https://gitlab.com/qemu-project/qemu/-/i

[PATCH v2 3/5] Refactor i.MX7 processor code

2023-07-29 Thread Jean-Christophe Dubois
Add Addr and size definition for all i.MX7 devices in i.MX7 header file. * Use those newly defined named constants whenever possible. * Standardize the way we init a familly of unimplemented devices - SAI - PWM - CAN * Add/rework few comments Signed-off-by: Jean-Christophe Dubois --- hw/a

[PATCH v2 4/5] Add i.MX7 missing TZ devices and memory regions

2023-07-29 Thread Jean-Christophe Dubois
* Add TZASC as unimplemented device. - Allow bare metal application to access this (unimplemented) device * Add CSU as unimplemented device. - Allow bare metal application to access this (unimplemented) device * Add various memory segments - OCRAM - OCRAM EPDC - OCRAM PXP - OCRAM S -

[PATCH v2 5/5] Add i.MX7 SRC device implementation

2023-07-29 Thread Jean-Christophe Dubois
The SRC device is normaly used to start the secondary CPU. When running Linux directly, Qemu is emulating a PSCI interface that UBOOT is installing at boot time and therefore the fact that the SRC device is unimplemented is hidden as Qemu respond directly to PSCI requets without using the SRC devi

[PATCH v2 2/5] Add i.MX6UL TZ missing devices.

2023-07-29 Thread Jean-Christophe Dubois
* Add TZASC as unimplemented device. - Allow bare metal application to access this (unimplemented) device * Add CSU as unimplemented device. - Allow bare metal application to access this (unimplemented) device Signed-off-by: Jean-Christophe Dubois --- hw/arm/fsl-imx6ul.c | 12 1

[PATCH v2 1/5] Refactor i.MX6UL processor code

2023-07-29 Thread Jean-Christophe Dubois
* Add Addr and size definition for all i.MX6UL devices in i.MX6UL header file. * Use those newly defined named constants whenever possible. * Standardize the way we init a familly of unimplemented devices - SAI - PWM (add missing PWM instances) - CAN * Add/rework few comments Signed-off-by:

Re: [PATCH] target/riscv: Fix page_check_range use in fault-only-first

2023-07-29 Thread Richard Henderson
On 7/28/23 20:16, LIU Zhiwei wrote: Commit bef6f008b98(accel/tcg: Return bool from page_check_range) converts integer return value to bool type. However, it wrongly converted the use of the API in riscv fault-only-first, where page_check_range < = 0, should be converted to !page_check_range. Sig

Re: [PATCH] target/openrisc: Set EPCR to next PC on FPE exceptions

2023-07-29 Thread Stafford Horne
On Sat, Jul 29, 2023 at 10:08:51PM +0100, Stafford Horne wrote: > The architecture specification calls for the EPCR to be set to "Address > of next not executed instruction" when there is a floating point > exception (FPE). This was not being done, so fix it by using the same > method as syscall.

[PATCH] target/openrisc: Set EPCR to next PC on FPE exceptions

2023-07-29 Thread Stafford Horne
The architecture specification calls for the EPCR to be set to "Address of next not executed instruction" when there is a floating point exception (FPE). This was not being done, so fix it by using the same method as syscall. Note, this may need a lot more work if we start seeing floating point o

[PATCH v2 0/5] Complete i.MX6UL and i.MX7 processor for bare metal application.

2023-07-29 Thread Jean-Christophe Dubois
This patch adds a few unimplemented TZ devices (TZASC and CSU) to i.MX6UL and i.MX7 processors to avoid bare metal application to experiment "bus error" when acccessing these devices. It also adds some internal memory segments (OCRAM) to the i.MX7 to allow bare metal application to use them. Last

Re: [PATCH for-8.2 1/2] hw/ppc: use g_free() in spapr_tce_table_post_load()

2023-07-29 Thread Peter Maydell
On Fri, 28 Jul 2023 at 21:15, Daniel Henrique Barboza wrote: > > tcet->mig_table is memcpy'ed from tcet->table, The pointer is just copied, not memcpy'd. > which in turn is created > via spapr_tce_alloc_table(). You could mention that this uses g_new0() for the allocation. > Use g_free() inste

Re: [PATCH for-8.2 2/2] target/ppc: use g_free() in test_opcode_table()

2023-07-29 Thread Peter Maydell
On Fri, 28 Jul 2023 at 21:47, Daniel Henrique Barboza wrote: > > Use g_free(table[i]) instead of free(table[i]) to comply with QEMU low > level memory management guidelines. > > Signed-off-by: Daniel Henrique Barboza > --- > target/ppc/translate.c | 2 +- > 1 file changed, 1 insertion(+), 1 dele

Re: [PATCH for-8.2 0/2] ppc: get rid of free() (gitlab #1798)

2023-07-29 Thread Peter Maydell
On Fri, 28 Jul 2023 at 21:57, Daniel Henrique Barboza wrote: > Here's some trivial changes following Peter's call to arms against > free() and friends in gitlab issue #1798 in an attempt to enforce > our memory management guidelines [1]. To clarify, this isn't a "call to arms". The issue is marke

[PATCH v5 09/12] virtio-sound: handle VIRTIO_SND_R_PCM_PREPARE

2023-07-29 Thread Emmanouil Pitsidianakis
Handles the PCM prepare control request. It initializes a PCM stream when the guests asks for it. Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/virtio-snd.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/hw/virtio/virtio-snd.c b/hw/virtio/virtio-snd.c index 8

Re: [PATCH v5 05/12] virtio-sound: prepare PCM streams

2023-07-29 Thread Manos Pitsidianakis
On Sat, 29 Jul 2023 14:00, Marc-André Lureau wrote: + +s->pcm->streams[stream_id] = stream; Same remark as v4: Shouldn't it close & free the existing stream? Or return an error? Hello, yes you are correct. I missed that comment on the v4 reviews :) Will send a v6 with a fix, I will wa

[PATCH v5 10/12] virtio-sound: handle VIRTIO_SND_PCM_RELEASE

2023-07-29 Thread Emmanouil Pitsidianakis
Handle the PCM release control request, which is necessary for flushing pending sound IO. No IO is handled yet so currently it only replies to the request. Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/trace-events | 1 + hw/virtio/virtio-snd.c | 51 ++

[PATCH v5 05/12] virtio-sound: prepare PCM streams

2023-07-29 Thread Emmanouil Pitsidianakis
After setting PCM parameters, instantiate ("prepare") each stream in virtio_snd_pcm_prepare_impl(). Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/virtio-snd.c | 133 + 1 file changed, 133 insertions(+) diff --git a/hw/virtio/virtio-snd.c b/hw/virti

[PATCH v5 04/12] virtio-sound: set PCM stream parameters

2023-07-29 Thread Emmanouil Pitsidianakis
This commit sets the virtio-snd device's default PCM parameters in virtio_snd_pcm_set_params_impl(). The same function will be used to set parameters from the guest with VIRTIO_SND_R_PCM_SET_PARAMS in a follow-up commit. PCM parameters describe the sound card parameters that the guest's kernel see

[PATCH v5 11/12] virtio-sound: implement audio output (TX)

2023-07-29 Thread Emmanouil Pitsidianakis
Handle output IO messages in the transmit (TX) virtqueue. It allocates a VirtIOSoundPCMBlock for each IO message and copies the data buffer to it. When the IO buffer is written to the host's sound card, the guest will be notified that it has been consumed. The lifetime of an IO message is: 1. Gu

[PATCH v5 12/12] virtio-sound: implement audio capture (RX)

2023-07-29 Thread Emmanouil Pitsidianakis
To perform audio capture we duplicate the TX logic of the previous commit with the following difference: we receive data from the QEMU audio backend and write it in the virt queue IO buffers the guest sends to QEMU. When they are full (i.e. they have `period_bytes` amount of data) or when recording

Re: [PATCH v5 05/12] virtio-sound: prepare PCM streams

2023-07-29 Thread Marc-André Lureau
Hi On Sat, Jul 29, 2023 at 2:39 PM Emmanouil Pitsidianakis wrote: > + > +/* > + * Prepares a VirtIOSound card stream. > + * Returns the response status code. (VIRTIO_SND_S_*). > + * > + * @s: VirtIOSound device > + * @stream_id: stream id > + */ > +static uint32_t virtio_snd_pcm_prepare_impl(Virt

[PATCH v5 03/12] virtio-sound: handle control messages and streams

2023-07-29 Thread Emmanouil Pitsidianakis
Receive guest requests in the control (CTRL) queue of the virtio sound device and reply with a NOT SUPPORTED error to all control commands. The receiving handler is virtio_snd_handle_ctrl(). It stores all control messages in the queue in the device's command queue. Then it calls virtio_snd_process

[PATCH v5 08/12] virtio-sound: handle VIRTIO_SND_PCM_SET_PARAMS

2023-07-29 Thread Emmanouil Pitsidianakis
Handle the set parameters control request. It reconfigures a stream based on a guest's preference if the values are valid and supported. Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/trace-events | 1 + hw/virtio/virtio-snd.c | 26 ++ 2 files changed, 27 insertion

[PATCH v5 06/12] virtio-sound: handle VIRTIO_SND_R_PCM_INFO request

2023-07-29 Thread Emmanouil Pitsidianakis
Respond to the VIRTIO_SND_R_PCM_INFO control request with the parameters of each requested PCM stream. Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/trace-events | 1 + hw/virtio/virtio-snd.c | 78 ++ 2 files changed, 79 insertions(+) diff --git a

[PATCH v5 07/12] virtio-sound: handle VIRTIO_SND_R_PCM_{START,STOP}

2023-07-29 Thread Emmanouil Pitsidianakis
Handle the start and stop control messages for a stream_id. This request does nothing at the moment except for replying to it. Audio playback or capture will be started/stopped here in follow-up commits. Signed-off-by: Emmanouil Pitsidianakis --- hw/virtio/trace-events | 1 + hw/virtio/virtio-s

[PATCH v5 02/12] Add virtio-sound-pci device

2023-07-29 Thread Emmanouil Pitsidianakis
This patch adds a PCI wrapper device for the virtio-sound device. It is necessary to instantiate a virtio-snd device in a guest. All sound logic will be added to the virtio-snd device in the following commits. To add this device with a guest, you'll need a >=5.13 kernel compiled with CONFIG_SND_VI

[PATCH v5 01/12] Add virtio-sound device stub

2023-07-29 Thread Emmanouil Pitsidianakis
Add a new VIRTIO device for the virtio sound device id. Functionality will be added in the following commits. Signed-off-by: Emmanouil Pitsidianakis --- MAINTAINERS| 6 + hw/virtio/Kconfig | 5 + hw/virtio/meson.build | 1 + hw/virtio/trace-events

[PATCH v5 00/12] Add VIRTIO sound card

2023-07-29 Thread Emmanouil Pitsidianakis
This patch series adds an audio device implementing the recent virtio sound spec (1.2) and a corresponding PCI wrapper device. https://github.com/epilys/qemu-virtio-snd/tree/sound-v6 Main differences with v4 patch [^v4] : - Use ERRP_GUARD() to propagate errors. - Use virtio_add_feature() instead

Re: [PATCH] target/s390x: Move trans_exc_code update to do_program_interrupt

2023-07-29 Thread Claudio Fontana
On 7/28/23 21:55, Richard Henderson wrote: > This solves a problem in which the store to LowCore during tlb_fill > triggers a clean-page TB invalidation for page0 during translation, > which results in an assertion failure for locked pages. > > By delaying the store until after the exception has b