[PATCH 3/8] Introduced a new function to disconnect GPIO connections

2023-07-20 Thread xianglai li
It introduces a new function to unwire the vcpu<->exioi interrupts for the vcpu hot-(un)plug cases. Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: "Philippe Mathie

[PATCH 8/8] Turn on CPU hot-(un)plug customization for loongarch

2023-07-20 Thread xianglai li
Turn on CPU hot-(un)plug custom for loongarch in the configuration file Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: "Philippe Mathieu-Daudé" Cc: Yanan Wang Cc

[PATCH 5/8] Adds basic CPU hot-(un)plug support for Loongarch

2023-07-20 Thread xianglai li
1.Add CPU topology related functions 2.Add CPU hot-plug related hook functions 3.Update the in-place CPU creation process at machine initialization Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Hab

[PATCH 1/8] Update ACPI GED framework to support vcpu hot-(un)plug

2023-07-20 Thread xianglai li
ACPI GED shall be used to convey to the guest kernel about any cpu hot-(un)plug events. Therefore, existing ACPI GED framework inside QEMU needs to be enhanced to support CPU hot-(un)plug state and events. Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha

[PATCH 2/8] Update CPUs AML with cpu-(ctrl)dev change

2023-07-20 Thread xianglai li
CPUs Control device(\\_SB.PCI0) register interface for the x86 arch is based on PCI and is IO port based and hence existing cpus AML code assumes _CRS objects would evaluate to a system resource which describes IO Port address. But on LOONGARCH arch CPUs control device(\\_SB.PRES) register interfa

[PATCH 2/6] qapi/block: Tidy up block-latency-histogram-set documentation

2023-07-20 Thread Markus Armbruster
Examples come out like Example set new histograms for all io types with intervals [0, 10), [10, 50), [50, 100), [100, +inf): The sentence "set new histograms ..." starts with a lower case letter. Capitalize it. Same for the other examples. Signed-off-by: Markus Armbruster --

[PATCH 7/8] Update the ACPI table for the Loongarch CPU

2023-07-20 Thread xianglai li
1.Create a new GED device type for Loongarch, mount cpu_madt function to update the ACPI table 2.Update the APIC table for loongarch based on CPU information to support CPU hot-(un)plug Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini

[PATCH 4/8] Introduce the CPU address space destruction function

2023-07-20 Thread xianglai li
Introduce new functions to destroy CPU address space resources for cpu hot-(un)plug. Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcel Apfelbaum Cc: "Philippe Mathieu-Daudé" Cc: Y

[PATCH 0/6] qapi: Tidy up doc comments

2023-07-20 Thread Markus Armbruster
This series only affects generated documentation. Generated code does not change. Would be nice to get it into the release. Markus Armbruster (6): qapi/block-core: Tidy up BlockLatencyHistogramInfo documentation qapi/block: Tidy up block-latency-histogram-set documentation qapi/qdev: Tidy

[PATCH 3/6] qapi/qdev: Tidy up device_add documentation

2023-07-20 Thread Markus Armbruster
The notes section comes out like this: Notes Additional arguments depend on the type. 1. For detailed information about this command, please refer to the ‘docs/qdev-device-use.txt’ file. 2. It’s possible to list device properties by running QEMU with the “-device D

[PATCH 5/6] qapi: Correct "eg." to "e.g." in documentation

2023-07-20 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qapi/char.json | 2 +- qapi/misc.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/char.json b/qapi/char.json index e413ac2b70..52aaff25eb 100644 --- a/qapi/char.json +++ b/qapi/char.json @@ -18,7 +18,7 @@ # @filename: the filen

[PATCH 4/6] qapi/trace: Tidy up trace-event-get-state, -set-state documentation

2023-07-20 Thread Markus Armbruster
trace-event-set-state's explanation of how events are selected is under "Features". Doesn't belong there. Simply delete it, as it feels redundant with documentation of member @name. trace-event-get-state's explanation is under "Returns". Tolerable, but similarly redundant. Delete it, too. Cc:

[PATCH 1/6] qapi/block-core: Tidy up BlockLatencyHistogramInfo documentation

2023-07-20 Thread Markus Armbruster
Documentation for member @bin comes out like list of io request counts corresponding to histogram intervals. len("bins") = len("boundaries") + 1 For the example above, "bins" may be something like [3, 1, 5, 2], and corresponding histogram looks like: Note how the equation and the

[PATCH 0/8] Adds CPU hot-plug support to Loongarch

2023-07-20 Thread xianglai li
Hello everyone, We refer to the implementation of ARM CPU Hot-Plug to add GED-based CPU Hot-Plug support to Loongarch. The first 4 patches are changes to the QEMU common code, including adding GED support for CPU Hot-Plug, updating the ACPI table creation process, and adding qdev_disconnect_gpio_o

[PATCH 6/6] qapi: Reformat recent doc comments to conform to current conventions

2023-07-20 Thread Markus Armbruster
Since commit a937b6aa739 (qapi: Reformat doc comments to conform to current conventions), a number of comments not conforming to the current formatting conventions were added. No problem, just sweep the entire documentation once more. To check the generated documentation does not change, I compar

[PATCH 6/8] Add support of *unrealize* for loongarch cpu

2023-07-20 Thread xianglai li
1.Add the Unrealize function to the Loongarch CPU for cpu hot-(un)plug 2.Add CPU topology-related properties to the Loongarch CPU for cpu hot-(un)plug Cc: Xiaojuan Yang Cc: Song Gao Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Ani Sinha Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo

[PATCH RESEND] accel/kvm: Specify default IPA size for arm64

2023-07-20 Thread Akihiko Odaki
libvirt uses "none" machine type to test KVM availability. Before this change, QEMU used to pass 0 as machine type when calling KVM_CREATE_VM. The kernel documentation says: > On arm64, the physical address size for a VM (IPA Size limit) is > limited to 40bits by default. The limit can be configur

[PATCH v1] xen-platform: do full PCI reset during unplug of IDE devices

2023-07-20 Thread Olaf Hering
The IDE unplug function needs to reset the entire PCI device, to make sure all state is initialized to defaults. This is done by calling pci_device_reset, which resets not only the chip specific registers, but also all PCI state. This fixes "unplug" in a Xen HVM domU with the modular legacy xenlinu

Re: [PATCH v2] net: add initial support for AF_XDP network backend

2023-07-20 Thread Jason Wang
On Thu, Jul 6, 2023 at 4:58 AM Ilya Maximets wrote: > > AF_XDP is a network socket family that allows communication directly > with the network device driver in the kernel, bypassing most or all > of the kernel networking stack. In the essence, the technology is > pretty similar to netmap. But,

Re: [RFC PATCH 6/6] vdpa: remove net cvq migration blocker

2023-07-20 Thread Eugenio Perez Martin
On Mon, Jul 10, 2023 at 9:37 AM Eugenio Perez Martin wrote: > > On Mon, Jul 10, 2023 at 5:54 AM Jason Wang wrote: > > > > On Fri, Jul 7, 2023 at 3:12 AM Eugenio Pérez wrote: > > > > > > Now that we have add migration blockers if the device does not support > > > all the needed features, remove t

Re: [RFC PATCH 6/6] vdpa: remove net cvq migration blocker

2023-07-20 Thread Jason Wang
On Thu, Jul 20, 2023 at 4:18 PM Eugenio Perez Martin wrote: > > On Mon, Jul 10, 2023 at 9:37 AM Eugenio Perez Martin > wrote: > > > > On Mon, Jul 10, 2023 at 5:54 AM Jason Wang wrote: > > > > > > On Fri, Jul 7, 2023 at 3:12 AM Eugenio Pérez wrote: > > > > > > > > Now that we have add migration

Re: [PULL 10/66] tests/qtest: enable tests for virtio-scmi

2023-07-20 Thread Milan Zamazal
Fabiano Rosas writes: > Thomas Huth writes: > >> On 18/07/2023 14.55, Milan Zamazal wrote: >>> Thomas Huth writes: >>> On 11/07/2023 01.02, Michael S. Tsirkin wrote: > From: Milan Zamazal > We don't have a virtio-scmi implementation in QEMU and only support > a > vho

Re: [PULL 10/66] tests/qtest: enable tests for virtio-scmi

2023-07-20 Thread Thomas Huth
On 19/07/2023 21.56, Milan Zamazal wrote: Thomas Huth writes: On 18/07/2023 14.55, Milan Zamazal wrote: Thomas Huth writes: On 11/07/2023 01.02, Michael S. Tsirkin wrote: From: Milan Zamazal We don't have a virtio-scmi implementation in QEMU and only support a vhost-user backend. T

Re: [PULL 1/1] hw/nvme: fix endianness issue for shadow doorbells

2023-07-20 Thread Peter Maydell
On Wed, 19 Jul 2023 at 21:13, Michael Tokarev wrote: > > 19.07.2023 10:36, Klaus Jensen wrote: > pu(req->cmd.dptr.prp2); > > +uint32_t v; > > > if (sq) { > > +v = cpu_to_le32(sq->tail); > > > -pci_dma_write(pci, sq->db_addr, &sq->tail, sizeof(sq->tail)); > > +

Re: [PATCH RESEND] accel/kvm: Specify default IPA size for arm64

2023-07-20 Thread Peter Maydell
On Thu, 20 Jul 2023 at 08:29, Akihiko Odaki wrote: > > libvirt uses "none" machine type to test KVM availability. Before this > change, QEMU used to pass 0 as machine type when calling KVM_CREATE_VM. > > The kernel documentation says: > > On arm64, the physical address size for a VM (IPA Size limi

Re: [PULL 1/1] hw/nvme: fix endianness issue for shadow doorbells

2023-07-20 Thread Klaus Jensen
On Jul 20 09:43, Peter Maydell wrote: > On Wed, 19 Jul 2023 at 21:13, Michael Tokarev wrote: > > > > 19.07.2023 10:36, Klaus Jensen wrote: > > pu(req->cmd.dptr.prp2); > > > +uint32_t v; > > > > > if (sq) { > > > +v = cpu_to_le32(sq->tail); > > > > > -pci_dma_w

Re: [PULL 1/1] hw/nvme: fix endianness issue for shadow doorbells

2023-07-20 Thread Peter Maydell
On Thu, 20 Jul 2023 at 09:49, Klaus Jensen wrote: > > On Jul 20 09:43, Peter Maydell wrote: > > On Wed, 19 Jul 2023 at 21:13, Michael Tokarev wrote: > > > > > > 19.07.2023 10:36, Klaus Jensen wrote: > > > pu(req->cmd.dptr.prp2); > > > > +uint32_t v; > > > > > > > if (sq) { > > > > +

Re: [PATCH v3 0/8] vdpa: Send all CVQ state load commands in parallel

2023-07-20 Thread Lei Yang
According to the Hawkins provided steps, I tested two cases based on applied this series patches and without it. And all tests are based on the real hardware. Case 1, without this series Source: qemu-system-x86_64: vhost_vdpa_net_load() = 23308 us Dest: qemu-system-x86_64: vhost_vdpa_net_load() =

Re: [PULL 1/1] hw/nvme: fix endianness issue for shadow doorbells

2023-07-20 Thread Klaus Jensen
On Jul 20 09:51, Peter Maydell wrote: > On Thu, 20 Jul 2023 at 09:49, Klaus Jensen wrote: > > > > On Jul 20 09:43, Peter Maydell wrote: > > > On Wed, 19 Jul 2023 at 21:13, Michael Tokarev wrote: > > > > > > > > 19.07.2023 10:36, Klaus Jensen wrote: > > > > pu(req->cmd.dptr.prp2); > > > > > +u

Re: [PATCH 0/4] Vhost-vdpa Shadow Virtqueue VLAN support

2023-07-20 Thread Lei Yang
QE tested this series patch with real hardware, it can support setup vlan for the nic, and the vlan id still can be found after finished migrate. In addition, this series patch also help to test another patch, can got the expect result. Tested-by: Lei Yang On Wed, Jul 19, 2023 at 6:54 PM Hawkins

Re: [PULL 10/66] tests/qtest: enable tests for virtio-scmi

2023-07-20 Thread Milan Zamazal
Thomas Huth writes: > On 19/07/2023 21.56, Milan Zamazal wrote: >> Thomas Huth writes: >> > >>> On 18/07/2023 14.55, Milan Zamazal wrote: Thomas Huth writes: >>> > On 11/07/2023 01.02, Michael S. Tsirkin wrote: >> From: Milan Zamazal >> We don't have a virtio-scmi implem

[PATCH] hw/nvme: use stl/ldl pci dma api

2023-07-20 Thread Klaus Jensen
From: Klaus Jensen Use the stl/ldl pci dma api for writing/reading doorbells. This removes the explicit endian conversions. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 42 +- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/hw/nvme/ct

[PATCH] hw/virtio: Add a protection against duplicate vu_scmi_stop calls

2023-07-20 Thread Milan Zamazal
The QEMU CI fails in virtio-scmi test occasionally. As reported by Thomas Huth, this happens most likely when the system is loaded and it fails with the following error: qemu-system-aarch64: ../../devel/qemu/hw/pci/msix.c:659: msix_unset_vector_notifiers: Assertion `dev->msix_vector_use_notif

[PATCH v6 0/6] Hyper-V Dynamic Memory Protocol driver (hv-balloon 🎈️)

2023-07-20 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This is a continuation of the v5 of the patch series located here: https://lore.kernel.org/qemu-devel/cover.1686577753.git.maciej.szmigi...@oracle.com/ Changes from v5: * Incorporate David's rework of the driver on top of his virtio-mem-memslots patches (specifically

[PATCH v6 1/6] memory-device: Support empty memory devices

2023-07-20 Thread Maciej S. Szmigiero
From: David Hildenbrand Let's support empty memory devices -- memory devices that don't have a memory device region in the current configuration. hv-balloon with an optional memdev is the primary use case. Signed-off-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/mem/memory-d

[PATCH v6 4/6] qapi: Add HvBalloonDeviceInfo sub-type to MemoryDeviceInfo

2023-07-20 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Used by the hv-balloon driver to report its provided memory state information. Co-developed-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/core/machine-hmp-cmds.c | 15 +++ qapi/machine.json | 39 +++

[PATCH v6 6/6] Add a Hyper-V Dynamic Memory Protocol driver (hv-balloon)

2023-07-20 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This driver is like virtio-balloon on steroids: it allows both changing the guest memory allocation via ballooning and inserting pieces of extra RAM into it on demand from a provided memory backend. One of advantages of these over ACPI-based PC DIMM hotplug is that su

[PATCH v6 2/6] memory-device: Drop size alignment check

2023-07-20 Thread Maciej S. Szmigiero
From: David Hildenbrand There is no strong requirement that the size has to be multiples of the requested alignment, let's drop it. This is a preparation for hv-baloon. Signed-off-by: David Hildenbrand Signed-off-by: Maciej S. Szmigiero --- hw/mem/memory-device.c | 6 -- 1 file changed, 6

[PATCH v6 3/6] Add Hyper-V Dynamic Memory Protocol definitions

2023-07-20 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" This commit adds Hyper-V Dynamic Memory Protocol definitions, taken from hv_balloon Linux kernel driver, adapted to the QEMU coding style and definitions. Signed-off-by: Maciej S. Szmigiero --- include/hw/hyperv/dynmem-proto.h | 423 +++

[PATCH v6 5/6] qapi: Add HV_BALLOON_STATUS_REPORT event

2023-07-20 Thread Maciej S. Szmigiero
From: "Maciej S. Szmigiero" Used by the hv-balloon driver for (optional) guest memory status reports. Signed-off-by: Maciej S. Szmigiero --- qapi/machine.json | 25 + 1 file changed, 25 insertions(+) diff --git a/qapi/machine.json b/qapi/machine.json index 5ede977cf2bc

Re: [PATCH v3 0/8] vdpa: Send all CVQ state load commands in parallel

2023-07-20 Thread Hawkins Jiawei
在 2023/7/20 16:53, Lei Yang 写道: > According to the Hawkins provided steps, I tested two cases based on > applied this series patches and without it. And all tests are based on > the real hardware. > Case 1, without this series > Source: qemu-system-x86_64: vhost_vdpa_net_load() = 23308 us > Dest:

Re: [PATCH for-8.1] virtio-iommu: Standardize granule extraction and formatting

2023-07-20 Thread Jean-Philippe Brucker
On Tue, Jul 18, 2023 at 08:21:36PM +0200, Eric Auger wrote: > At several locations we compute the granule from the config > page_size_mask using ctz() and then format it in traces using > BIT(). As the page_size_mask is 64b we should use ctz64 and > BIT_ULL() for formatting. We failed to be consist

Re: [PATCH] hw/virtio: Add a protection against duplicate vu_scmi_stop calls

2023-07-20 Thread Thomas Huth
On 20/07/2023 12.10, Milan Zamazal wrote: The QEMU CI fails in virtio-scmi test occasionally. As reported by Thomas Huth, this happens most likely when the system is loaded and it fails with the following error: qemu-system-aarch64: ../../devel/qemu/hw/pci/msix.c:659: msix_unset_vector_no

Re: [PATCH] hw/nvme: use stl/ldl pci dma api

2023-07-20 Thread Thomas Huth
On 20/07/2023 11.42, Klaus Jensen wrote: From: Klaus Jensen Use the stl/ldl pci dma api for writing/reading doorbells. This removes the explicit endian conversions. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 42 +- 1 file changed, 13 insertions

Re: [Virtio-fs] [PATCH v2 1/4] vhost-user.rst: Migrating back-end-internal state

2023-07-20 Thread Hanna Czenczek
On 18.07.23 18:12, Stefan Hajnoczi wrote: On Wed, Jul 12, 2023 at 01:16:59PM +0200, Hanna Czenczek wrote: @@ -1471,6 +1511,53 @@ Front-end message types before. The back-end must again begin processing rings that are not stopped, and it may resume background operations. +``VHOST_USER

Re: [PATCH v2 3/4] vhost: Add high-level state save/load functions

2023-07-20 Thread Hanna Czenczek
On 18.07.23 20:42, Stefan Hajnoczi wrote: On Wed, Jul 12, 2023 at 01:17:01PM +0200, Hanna Czenczek wrote: vhost_save_backend_state() and vhost_load_backend_state() can be used by vhost front-ends to easily save and load the back-end's state to/from the migration stream. Because we do not know t

Re: [PATCH v2 1/4] vhost-user.rst: Migrating back-end-internal state

2023-07-20 Thread Stefan Hajnoczi
On Wed, 19 Jul 2023 at 12:35, Hanna Czenczek wrote: > > On 18.07.23 17:57, Stefan Hajnoczi wrote: > > On Wed, Jul 12, 2023 at 01:16:59PM +0200, Hanna Czenczek wrote: > >> For vhost-user devices, qemu can migrate the virtio state, but not the > >> back-end's internal state. To do so, we need to be

Re: [PATCH 0/5] target/arm: Fixes for RME

2023-07-20 Thread Peter Maydell
On Wed, 19 Jul 2023 at 16:56, Jean-Philippe Brucker wrote: > > With these patches I'm able to boot a Realm guest under > "-cpu max,x-rme=on". They are based on Peter's series which fixes > handling of NSTable: > https://lore.kernel.org/qemu-devel/20230714154648.327466-1-peter.mayd...@linaro.org/

[QEMU PATCH v4 1/1] virtgpu: do not destroy resources when guest suspend

2023-07-20 Thread Jiqian Chen
After suspending and resuming guest VM, you will get a black screen, and the display can't come back. This is because when guest did suspending, it called into qemu to call virtio_gpu_gl_reset. In function virtio_gpu_gl_reset, it destroyed resources and reset renderer, which were used for display.

Re: [Virtio-fs] [PATCH v2 2/4] vhost-user: Interface for migration state transfer

2023-07-20 Thread Hao Xu
On 7/12/23 19:17, Hanna Czenczek wrote: Add the interface for transferring the back-end's state during migration as defined previously in vhost-user.rst. Signed-off-by: Hanna Czenczek --- include/hw/virtio/vhost-backend.h | 24 + include/hw/virtio/vhost.h | 79 +++

[QEMU PATCH v4 0/1] S3 support

2023-07-20 Thread Jiqian Chen
v4: Hi all, Thanks for Gerd Hoffmann's advice. V4 makes below changes: * Use enum for freeze mode, so this can be extended with more modes in the future. * Rename functions and paratemers with "_S3" postfix. And no functional changes. latest version on kernel side: https://lore.kernel.org/lkml/

Re: [PATCH for-8.1] accel/tcg: Take mmap_lock in load_atomic16_or_exit

2023-07-20 Thread Peter Maydell
On Mon, 17 Jul 2023 at 19:25, Richard Henderson wrote: > > On 7/17/23 11:12, Peter Maydell wrote: > > On Sun, 16 Jul 2023 at 18:03, Richard Henderson > > wrote: > >> > >> For user-only, the probe for page writability may race with another > >> thread's mprotect. Take the mmap_lock around the ope

Re: [RFC PATCH 10/17] misc/i2c_mctp_cxl: Initial device emulation

2023-07-20 Thread Jonathan Cameron via
On Wed, 19 Jul 2023 14:49:07 -0400 Gregory Price wrote: > On Wed, Jul 19, 2023 at 09:19:47AM +0100, Jonathan Cameron wrote: > > On Tue, 18 Jul 2023 17:30:57 -0400 > > Gregory Price wrote: > > > > > On Mon, Jul 17, 2023 at 06:16:39PM +0100, Jonathan Cameron wrote: > > > > @@ -397,8 +401,9 @@

Re: [PATCH] hw/virtio: Add a protection against duplicate vu_scmi_stop calls

2023-07-20 Thread Fabiano Rosas
Milan Zamazal writes: > The QEMU CI fails in virtio-scmi test occasionally. As reported by > Thomas Huth, this happens most likely when the system is loaded and it > fails with the following error: > > qemu-system-aarch64: ../../devel/qemu/hw/pci/msix.c:659: > msix_unset_vector_notifiers: As

Re: [PATCH 0/5] target/arm: Fixes for RME

2023-07-20 Thread Jean-Philippe Brucker
On Thu, Jul 20, 2023 at 01:05:58PM +0100, Peter Maydell wrote: > On Wed, 19 Jul 2023 at 16:56, Jean-Philippe Brucker > wrote: > > > > With these patches I'm able to boot a Realm guest under > > "-cpu max,x-rme=on". They are based on Peter's series which fixes > > handling of NSTable: > > https://l

[PATCH v4 00/12] Add VIRTIO sound card

2023-07-20 Thread Emmanouil Pitsidianakis
This patch series adds an audio device implementing the recent virtio sound spec (1.2) and a corresponding PCI wrapper device. Main differences with v3 patch [^v3] : - Addressed review style comments. - Split patches for easier review. [^v3]: https://lore.kernel.org/qemu-devel/cover.1689692765.

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

2023-07-20 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 v4 02/12] Add virtio-sound-pci device

2023-07-20 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 v4 06/12] virtio-sound: handle VIRTIO_SND_R_PCM_INFO request

2023-07-20 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 v4 12/12] virtio-sound: implement audio capture (RX)

2023-07-20 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

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

2023-07-20 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 v4 05/12] virtio-sound: prepare PCM streams

2023-07-20 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 v4 04/12] virtio-sound: set PCM stream parameters

2023-07-20 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 v4 08/12] virtio-sound: handle VIRTIO_SND_PCM_SET_PARAMS

2023-07-20 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 v4 11/12] virtio-sound: implement audio output (TX)

2023-07-20 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 v4 03/12] virtio-sound: handle control messages and streams

2023-07-20 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 v4 10/12] virtio-sound: handle VIRTIO_SND_PCM_RELEASE

2023-07-20 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 v4 09/12] virtio-sound: handle VIRTIO_SND_R_PCM_PREPARE

2023-07-20 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 e

[PATCH 1/4] python/machine: move socket setup out of _base_args property

2023-07-20 Thread John Snow
This property isn't meant to do much else besides return a list of strings, so move this setup back out into _pre_launch(). Signed-off-by: John Snow --- python/qemu/machine/machine.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/qemu/machine/machine.py b/python

[PATCH 2/4] python/console_socket: accept existing FD in initializer

2023-07-20 Thread John Snow
Useful if we want to use ConsoleSocket() for a socket created by socketpair(). Signed-off-by: John Snow --- python/qemu/machine/console_socket.py | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/python/qemu/machine/console_socket.py b/python/qemu/machine/console_s

[PATCH 0/4] python/machine: use socketpair() for console socket

2023-07-20 Thread John Snow
Like we did for the QMP socket, use socketpair() for the console socket so that hopefully there isn't a race condition during early boot where data might get dropped on the floor. "lightly tested"; passes local tests and gitlab CI. Doesn't seem to make anything worse. John Snow (4): python/mach

[PATCH 4/4] python/machine: remove unused console socket configuration arguments

2023-07-20 Thread John Snow
By using a socketpair for the console, we don't need the sock_dir argument for the base class anymore, remove it. The qtest subclass still uses the argument for the qtest socket for now. Signed-off-by: John Snow --- python/qemu/machine/machine.py | 18 -- python/qemu

[PATCH 3/4] python/machine: use socketpair() for console connections

2023-07-20 Thread John Snow
Create a socketpair for the console output. This should help eliminate race conditions around console text early in the boot process that might otherwise have been dropped on the floor before being able to connect to QEMU under "server,nowait". Signed-off-by: John Snow --- python/qemu/machine/ma

Re: [PULL 03/18] numa: Validate cluster and NUMA node boundary if required

2023-07-20 Thread Peter Maydell
On Mon, 26 Jun 2023 at 12:15, Paolo Bonzini wrote: > > From: Gavin Shan > > For some architectures like ARM64, multiple CPUs in one cluster can be > associated with different NUMA nodes, which is irregular configuration > because we shouldn't have this in baremetal environment. The irregular > co

[PATCH] tests/decode: Suppress "error: " string for expected-failure tests

2023-07-20 Thread Peter Maydell
The "expected failure" tests for decodetree result in the error messages from decodetree ending up in logs and in V=1 output: >>> MALLOC_PERTURB_=226 >>> /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/x86/pyvenv/bin/python3 >>> /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/scripts/decodetree.py

[PATCH 0/2] target/riscv: add missing riscv,isa strings

2023-07-20 Thread Daniel Henrique Barboza
Hi, Found these 2 instances while working in more 8.2 material. I believe both are safe for freeze but I won't lose my sleep if we decide to postpone it. Daniel Henrique Barboza (2): target/riscv/cpu.c: add zmmul isa string target/riscv/cpu.c: add smepmp isa string target/riscv/cpu.c | 2 +

[PATCH 1/2] target/riscv/cpu.c: add zmmul isa string

2023-07-20 Thread Daniel Henrique Barboza
zmmul was promoted from experimental to ratified in commit 6d00ffad4e95. Add a riscv,isa string for it. Fixes: 6d00ffad4e95 ("target/riscv: move zmmul out of the experimental properties") Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 1 + 1 file changed, 1 insertion(+) diff -

[PATCH 2/2] target/riscv/cpu.c: add smepmp isa string

2023-07-20 Thread Daniel Henrique Barboza
The cpu->cfg.epmp extension is still experimental, but it already has a 'smepmp' riscv,isa string. Add it. Signed-off-by: Daniel Henrique Barboza --- target/riscv/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index d64ac07558..8c9acadd3b 100644

Re: [Virtio-fs] [PATCH v2 2/4] vhost-user: Interface for migration state transfer

2023-07-20 Thread Hanna Czenczek
On 20.07.23 14:13, Hao Xu wrote: On 7/12/23 19:17, Hanna Czenczek wrote: Add the interface for transferring the back-end's state during migration as defined previously in vhost-user.rst. Signed-off-by: Hanna Czenczek ---   include/hw/virtio/vhost-backend.h |  24 +   include/hw/virtio/vhos

Re: [PATCH v2] net: add initial support for AF_XDP network backend

2023-07-20 Thread Ilya Maximets
On 7/20/23 09:37, Jason Wang wrote: > On Thu, Jul 6, 2023 at 4:58 AM Ilya Maximets wrote: >> >> AF_XDP is a network socket family that allows communication directly >> with the network device driver in the kernel, bypassing most or all >> of the kernel networking stack. In the essence, the techno

Re: [PATCH 1/2] i386: Add support for SUCCOR feature

2023-07-20 Thread Joao Martins
On 12/07/2023 20:11, John Allen wrote: > On Fri, Jul 07, 2023 at 04:25:22PM +0200, Paolo Bonzini wrote: >> On 7/6/23 21:40, John Allen wrote: >>> case 0x8007: >>> *eax = 0; >>> -*ebx = 0; >>> +*ebx = env->features[FEAT_8000_0007_EBX] | >>> CPUID_8000_0007_EBX_SU

[PATCH for-8.1 0/6] x86: acpi pci fixes

2023-07-20 Thread Igor Mammedov
Working on PXB acpi-index support takes unexpectedly long so pushing out self sufficient fixes from my PXB queue that do not have dependency on other patches. patch 2/6 is regression fix for making acpi-index work with Windows guests patch 5/6 is ACPI spec compliance fix tested with rhel9, WS2012

Re: [PATCH] tests/decode: Suppress "error: " string for expected-failure tests

2023-07-20 Thread Philippe Mathieu-Daudé
On 20/7/23 15:15, Peter Maydell wrote: The "expected failure" tests for decodetree result in the error messages from decodetree ending up in logs and in V=1 output: MALLOC_PERTURB_=226 /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/x86/pyvenv/bin/python3 /mnt/nvmedisk/linaro/qemu-from-lapto

[PATCH for-8.1 2/6] x86: acpi: workaround Windows not handling name references in Package properly

2023-07-20 Thread Igor Mammedov
it seems that Windows is unable to handle variable references making it choke up when accessing ASUN during _DSM call when device is hotplugged (it lists package elements as DataAlias but despite that later on it misbehaves) with following error shown up in AMLI debugger (WS2012r2): Store(Shift

Re: [PATCH] hw/nvme: use stl/ldl pci dma api

2023-07-20 Thread Philippe Mathieu-Daudé
On 20/7/23 11:42, Klaus Jensen wrote: From: Klaus Jensen Use the stl/ldl pci dma api for writing/reading doorbells. This removes the explicit endian conversions. Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 42 +- 1 file changed, 13 insertions(+)

[PATCH for-8.1 4/6] tests: acpi: whitelist expected blobs

2023-07-20 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 37 + 1 file changed, 37 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..8911b10650 100644 --- a/tests/qtest/

Re: [PATCH 2/6] qapi/block: Tidy up block-latency-histogram-set documentation

2023-07-20 Thread Philippe Mathieu-Daudé
On 20/7/23 09:16, Markus Armbruster wrote: Examples come out like Example set new histograms for all io types with intervals [0, 10), [10, 50), [50, 100), [100, +inf): The sentence "set new histograms ..." starts with a lower case letter. Capitalize it. Same for the other

[PATCH for-8.1 5/6] acpi: x86: remove _ADR on host bridges

2023-07-20 Thread Igor Mammedov
ACPI spec (since 2.0a) says " A device object must contain either an _HID object or an _ADR object, but can contain both. " _ADR is used when device is attached to an ennumerable bus, however hostbridge is not and uses dedicated _HID for discovery, drop _ADR field. It doesn't seem that having _AD

[PATCH for-8.1 3/6] tests: acpi: x86: update expected blobs

2023-07-20 Thread Igor Mammedov
Following change is expected on each PCI slot with enabled ACPI PCI hotplug -BSEL, -ASUN +Zero, +Zero } +Local0 [Zero] = BSEL /* \_SB_.PCI0.B

[PATCH for-8.1 1/6] tests: acpi: x86: whitelist expected blobs

2023-07-20 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..1983fa596b 100644 --- a/tests/qtest/bios-ta

[PATCH for-8.1 6/6] tests: acpi: update expected blobs

2023-07-20 Thread Igor Mammedov
Expected change is that _ADR object is removed from hostbridge descriptor in DSDT for PC and Q35 machines. Signed-off-by: Igor Mammedov --- tests/qtest/bios-tables-test-allowed-diff.h | 37 -- tests/data/acpi/pc/DSDT | Bin 6836 -> 6830 bytes tests/data/a

Re: [PATCH 5/6] qapi: Correct "eg." to "e.g." in documentation

2023-07-20 Thread Philippe Mathieu-Daudé
Hi Markus, On 20/7/23 09:16, Markus Armbruster wrote: Signed-off-by: Markus Armbruster --- qapi/char.json | 2 +- qapi/misc.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qapi/char.json b/qapi/char.json index e413ac2b70..52aaff25eb 100644 --- a/qapi/char.json ++

Re: [PATCH 3/6] qapi/qdev: Tidy up device_add documentation

2023-07-20 Thread Philippe Mathieu-Daudé
On 20/7/23 09:16, Markus Armbruster wrote: The notes section comes out like this: Notes Additional arguments depend on the type. 1. For detailed information about this command, please refer to the ‘docs/qdev-device-use.txt’ file. 2. It’s possible to list device pro

Re: [PATCH 0/4] python/machine: use socketpair() for console socket

2023-07-20 Thread Peter Maydell
On Thu, 20 Jul 2023 at 14:04, John Snow wrote: > > Like we did for the QMP socket, use socketpair() for the console socket > so that hopefully there isn't a race condition during early boot where > data might get dropped on the floor. > > "lightly tested"; passes local tests and gitlab CI. Doesn't

Re: [PATCH 1/4] python/machine: move socket setup out of _base_args property

2023-07-20 Thread Daniel P . Berrangé
On Thu, Jul 20, 2023 at 09:04:45AM -0400, John Snow wrote: > This property isn't meant to do much else besides return a list of > strings, so move this setup back out into _pre_launch(). > > Signed-off-by: John Snow > --- > python/qemu/machine/machine.py | 5 ++--- > 1 file changed, 2 insertions

[PATCH] block: Be more verbose in create fallback

2023-07-20 Thread Hanna Czenczek
For image creation code, we have central fallback code for protocols that do not support creating new images (like NBD or iscsi). So for them, you can only specify existing paths/exports that are overwritten to make clean new images. In such a case, if the given path cannot be opened (assuming a

Re: [PATCH 2/4] python/console_socket: accept existing FD in initializer

2023-07-20 Thread Daniel P . Berrangé
On Thu, Jul 20, 2023 at 09:04:46AM -0400, John Snow wrote: > Useful if we want to use ConsoleSocket() for a socket created by > socketpair(). > > Signed-off-by: John Snow > --- > python/qemu/machine/console_socket.py | 11 +++ > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff -

Re: [PATCH 3/4] python/machine: use socketpair() for console connections

2023-07-20 Thread Daniel P . Berrangé
On Thu, Jul 20, 2023 at 09:04:47AM -0400, John Snow wrote: > Create a socketpair for the console output. This should help eliminate > race conditions around console text early in the boot process that might > otherwise have been dropped on the floor before being able to connect to > QEMU under "ser

Re: [PATCH 4/4] python/machine: remove unused console socket configuration arguments

2023-07-20 Thread Daniel P . Berrangé
On Thu, Jul 20, 2023 at 09:04:48AM -0400, John Snow wrote: > By using a socketpair for the console, we don't need the sock_dir > argument for the base class anymore, remove it. > > The qtest subclass still uses the argument for the qtest socket for now. > > Signed-off-by: John Snow > --- > pyth

[PATCH v2 3/4] target/i386: Add CET states to vmstate

2023-07-20 Thread Yang Weijiang
Add CET states in vmstate if the feature is enabled. Signed-off-by: Yang Weijiang --- target/i386/machine.c | 28 1 file changed, 28 insertions(+) diff --git a/target/i386/machine.c b/target/i386/machine.c index c7ac8084b2..6d42f6dc7e 100644 --- a/target/i386/machin

  1   2   3   >