Re: [PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-03-12 Thread Bernhard Beschow
Am 11. März 2023 22:20:29 UTC schrieb Chuck Zmudzinski : >On 2/9/2023 4:53 PM, Bernhard Beschow wrote: >> Am 1. Februar 2023 08:11:10 UTC schrieb Bernhard Beschow : >> > >> > >> >Am 24. Januar 2023 17:07:30 UTC schrieb Bernhard Beschow >> >: >> >> >> >> >> >>Am 24. Januar 2023 16:11:47 UTC schr

[RFC QEMU PATCH 00/18] Add VirtIO GPU and Passthrough GPU support on Xen

2023-03-12 Thread Huang Rui
Hi all, We are working to introduce VirtIO GPU and Passthrough GPU support on Xen. https://lists.xenproject.org/archives/html/xen-devel/2023-03/msg00714.html Currently, only virgl for VirtIO GPU and Passthrough GPU on PV dom0 can works on Xen. These series introduce more graphic support for Xen

[RFC QEMU PATCH 02/18] virtio-gpu: hostmem

2023-03-12 Thread Huang Rui
From: Gerd Hoffmann Use VIRTIO_GPU_SHM_ID_HOST_VISIBLE as id for virtio-gpu. Signed-off-by: Antonio Caggiano Acked-by: Michael S. Tsirkin --- hw/display/virtio-gpu-pci.c| 14 ++ hw/display/virtio-gpu.c| 1 + hw/display/virtio-vga.c| 33

[RFC QEMU PATCH 01/18] virtio: Add shared memory capability

2023-03-12 Thread Huang Rui
From: "Dr. David Alan Gilbert" Define a new capability type 'VIRTIO_PCI_CAP_SHARED_MEMORY_CFG' to allow defining shared memory regions with sizes and offsets of 2^32 and more. Multiple instances of the capability are allowed and distinguished by a device-specific 'id'. Signed-off-by: Dr. David A

[RFC QEMU PATCH 03/18] virtio-gpu: Handle resource blob commands

2023-03-12 Thread Huang Rui
From: Antonio Caggiano Support BLOB resources creation, mapping and unmapping by calling the new stable virglrenderer 0.10 interface. Only enabled when available and via the blob config. E.g. -device virtio-vga-gl,blob=true Signed-off-by: Antonio Caggiano Signed-off-by: Dmitry Osipenko --- hw

[RFC QEMU PATCH 05/18] virtio-gpu: Unrealize

2023-03-12 Thread Huang Rui
From: Antonio Caggiano Implement an unrealize function for virtio gpu device. Signed-off-by: Antonio Caggiano --- hw/display/virtio-gpu-base.c | 2 +- hw/display/virtio-gpu.c| 11 +++ include/hw/virtio/virtio-gpu.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) di

[RFC QEMU PATCH 04/18] virtio-gpu: CONTEXT_INIT feature

2023-03-12 Thread Huang Rui
From: Antonio Caggiano Create virgl renderer context with flags using context_id when valid. The feature can be enabled via the context_init config option. A warning message will be emitted and the feature will not be used when linking with virglrenderer versions without context_init support. Si

[RFC QEMU PATCH 06/18] virtio-gpu: Resource UUID

2023-03-12 Thread Huang Rui
From: Antonio Caggiano Enable resource UUID feature and implement command resource assign UUID. This is done by introducing a hash table to map resource IDs to their UUIDs. Signed-off-by: Antonio Caggiano --- hw/display/trace-events| 1 + hw/display/virtio-gpu-base.c | 2 ++ hw/dis

[RFC QEMU PATCH 07/18] virtio-gpu: Support Venus capset

2023-03-12 Thread Huang Rui
From: Antonio Caggiano Add support for the Venus capset, which enables Vulkan support through the Venus Vulkan driver for virtio-gpu. Signed-off-by: Antonio Caggiano --- hw/display/virtio-gpu-virgl.c | 21 + include/standard-headers/linux/virtio_gpu.h | 2 ++

[RFC QEMU PATCH 08/18] virtio-gpu: Initialize Venus

2023-03-12 Thread Huang Rui
From: Antonio Caggiano Request Venus when initializing VirGL. Signed-off-by: Antonio Caggiano --- hw/display/virtio-gpu-virgl.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-virgl.c index fe03dc916f..f5ce206b93 100644 --- a/hw/dis

[RFC QEMU PATCH 09/18] meson: Enable virglrenderer unstable APIs

2023-03-12 Thread Huang Rui
From: Antonio Caggiano Also, use alternatives to meson compiler has_function, which does not work properly on my development environment. Signed-off-by: Antonio Caggiano --- meson.build | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index

[RFC QEMU PATCH 18/18] xen: translate irq of host pci device to gsi

2023-03-12 Thread Huang Rui
From: Chen Jiqian Use the new interface in the kernel to map pirq for qemu. Signed-off-by: Chen Jiqian Signed-off-by: Huang Rui --- hw/xen/xen-host-pci-device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xen/xen-host-pci-device.c b/hw/xen/xen-host-pci-device.c in

[RFC QEMU PATCH 17/18] virtio-gpu: Add video hardware accelerate support for virgl

2023-03-12 Thread Huang Rui
From: Honglei Huang Add get_drm_fd callback let the guest OS can get render node to using hw accel codec. Signed-off-by: Honglei Huang Signed-off-by: Huang Rui --- hw/display/virtio-gpu-virgl.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/hw/disp

[RFC QEMU PATCH 13/18] hw/i386/xen/xen-hvm: Introduce xen_ram_block_check function

2023-03-12 Thread Huang Rui
Introduce xen_ram_block_check function to check whether current ramblock is xen ram memory. Signed-off-by: Huang Rui --- hw/i386/xen/xen-hvm.c | 15 +++ include/hw/xen/xen.h | 1 + 2 files changed, 16 insertions(+) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index e

[RFC QEMU PATCH 12/18] softmmu: Fix the size to map cache with xen for host virtual address

2023-03-12 Thread Huang Rui
The xen_map_cache function wants to pass offset and size of this memory block as the input parameters to map the host virtual address. However, block->offset is too large as 0x1 (4G), if we assign the size as block->max_length (0x11000), the mapped host address will be out of block->max

[RFC QEMU PATCH 11/18] virtio-gpu: make blob scanout use dmabuf fd

2023-03-12 Thread Huang Rui
From: Robert Beckett This relies on a virglrenderer change to include the dmabuf fd when returning resource info. Signed-off-by: Robert Beckett --- hw/display/virtio-gpu-virgl.c | 103 - hw/display/virtio-gpu.c| 4 +- include/hw/virtio/virtio-gpu.h |

[RFC QEMU PATCH 15/18] softmmu: Enable qemu ram allocation with fd for Xen

2023-03-12 Thread Huang Rui
Venus is requesting the function on Xen as well, enable this path on Xen hypervisor. Signed-off-by: Huang Rui --- softmmu/physmem.c | 5 - 1 file changed, 5 deletions(-) diff --git a/softmmu/physmem.c b/softmmu/physmem.c index e54561bace..2838dee2f2 100644 --- a/softmmu/physmem.c +++ b/soft

[RFC QEMU PATCH 16/18] virtio-gpu: fix hw-display-virtio-gpu.so undefined symbol virtio_gpu_virgl_resource_unmap

2023-03-12 Thread Huang Rui
From: Honglei Huang Move virtio_gpu_virgl_resource_unmap to virtio-gpu.c cause virtio-gpu.so call this function but this function in virtio-gpu-gl.so before. Add virgl dependency into virtio-gpu-gl.so. Suggested-by: Stefano Stabellini Signed-off-by: Honglei Huang Reviewed-by: Huang Rui Sign

[RFC QEMU PATCH 14/18] softmmu: Add ram block check to map the xen ram memory

2023-03-12 Thread Huang Rui
The xen ram memory should be mapped with addr instead of ramblock offset. So we need to add a check to make sure current ramblock is xen ram memory. Signed-off-by: Huang Rui --- softmmu/physmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/softmmu/physmem.c b/softmmu/phys

[RFC QEMU PATCH 10/18] virtio-gpu: Handle set scanout blob command

2023-03-12 Thread Huang Rui
From: Antonio Caggiano Use mapped data pointer as data for the scanout. Signed-off-by: Antonio Caggiano --- hw/display/virtio-gpu-virgl.c | 3 +++ hw/display/virtio-gpu.c| 11 +++ include/hw/virtio/virtio-gpu.h | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff

[linux-5.4 test] 179567: tolerable trouble: fail/pass/starved - PUSHED

2023-03-12 Thread osstest service owner
flight 179567 linux-5.4 real [real] http://logs.test-lab.xenproject.org/osstest/logs/179567/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-i386-xl-qemut-win7-amd64 19 guest-stop fail like 179082 test-amd64-amd64-xl-qemuu-win7-amd64 19

[RFC PATCH 0/5] Add Xen PVH dom0 support for GPU

2023-03-12 Thread Huang Rui
Hi all, Currently, we are working to add VirtIO GPU and Passthrough GPU support on Xen. We expected to use HVM on domU and PVH on dom0. The x86 PVH dom0 support needs a few modifications on our APU platform. These functions requires multiple software components support including kernel, xen, qemu,

[RFC PATCH 1/5] x86/xen: disable swiotlb for xen pvh

2023-03-12 Thread Huang Rui
Xen PVH is the paravirtualized mode and takes advantage of hardware virtualization support when possible. It will using the hardware IOMMU support instead of xen-swiotlb, so disable swiotlb if current domain is Xen PVH. Signed-off-by: Huang Rui --- arch/x86/kernel/pci-dma.c | 8 +++- 1 file

[PATCH v3 4/6] hw/isa/piix3: Avoid Xen-specific variant of piix3_write_config()

2023-03-12 Thread Bernhard Beschow
Subscribe to pci_bus_fire_intx_routing_notifier() instead which allows for having a common piix3_write_config() for the PIIX3 device models. While at it, move the subscription into machine code to facilitate resolving TYPE_PIIX3_XEN_DEVICE. In a possible future followup, pci_bus_fire_intx_routing

[PATCH v3 2/6] hw/isa/piix3: Reuse piix3_realize() in piix3_xen_realize()

2023-03-12 Thread Bernhard Beschow
This is a preparational patch for the next one to make the following more obvious: First, pci_bus_irqs() is now called twice in case of Xen where the second call overrides the pci_set_irq_fn with the Xen variant. Second, pci_bus_set_route_irq_fn() is now also called in Xen mode. Signed-off-by: B

[RFC PATCH 2/5] xen/grants: update initialization order of xen grant table

2023-03-12 Thread Huang Rui
The xen grant table will be initialied before parsing the PCI resources, so xen_alloc_unpopulated_pages() ends up using a range from the PCI window because Linux hasn't parsed the PCI information yet. So modify the initialization order to make sure the real PCI resources are parsed before. Signed

[PATCH v3 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-03-12 Thread Bernhard Beschow
There is currently a dedicated PIIX3 device model for use under Xen. By reusing existing PCI API during initialization this device model can be eliminated and the plain PIIX3 device model can be used instead. Resolving TYPE_PIIX3_XEN_DEVICE results in less code while also making Xen agnostic towar

[PATCH v3 1/6] include/hw/xen/xen: Rename xen_piix3_set_irq() to xen_intx_set_irq()

2023-03-12 Thread Bernhard Beschow
xen_piix3_set_irq() isn't PIIX specific: PIIX is a single PCI device while xen_piix3_set_irq() maps multiple PCI devices to their respective IRQs, which is board-specific. Rename xen_piix3_set_irq() to communicate this. Also rename XEN_PIIX_NUM_PIRQS to XEN_IOAPIC_NUM_PIRQS since the Xen's IOAPIC

[PATCH v3 3/6] hw/isa/piix3: Wire up Xen PCI IRQ handling outside of PIIX3

2023-03-12 Thread Bernhard Beschow
xen_intx_set_irq() doesn't depend on PIIX3State. In order to resolve TYPE_PIIX3_XEN_DEVICE and in order to make Xen agnostic about the precise south bridge being used, set up Xen's PCI IRQ handling of PIIX3 in the board. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin --- hw/i38

[RFC PATCH 4/5] x86/xen: acpi registers gsi for xen pvh

2023-03-12 Thread Huang Rui
From: Chen Jiqian Add acpi_register_gsi_xen_pvh() to register gsi for PVH mode. In addition to call acpi_register_gsi_ioapic(), it also setup a map between gsi and vector in hypervisor side. So that, when dgpu create an interrupt, hypervisor can correctly find which guest domain to process interr

[RFC PATCH 3/5] drm/amdgpu: set passthrough mode for xen pvh/hvm

2023-03-12 Thread Huang Rui
There is an second stage translation between the guest machine address and host machine address in Xen PVH/HVM. The PCI bar address in the xen guest kernel are not translated at the second stage on Xen PVH/HVM, so it's not the real physical address that hardware would like to know, so we need to se

[PATCH v3 5/6] hw/isa/piix3: Resolve redundant k->config_write assignments

2023-03-12 Thread Bernhard Beschow
The previous patch unified handling of piix3_write_config() accross the PIIX3 device models which allows for assigning k->config_write once in the base class. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin --- hw/isa/piix3.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(

[PATCH v3 6/6] hw/isa/piix3: Resolve redundant TYPE_PIIX3_XEN_DEVICE

2023-03-12 Thread Bernhard Beschow
During the last patches, TYPE_PIIX3_XEN_DEVICE turned into a clone of TYPE_PIIX3_DEVICE. Remove this redundancy. Signed-off-by: Bernhard Beschow Reviewed-by: Michael S. Tsirkin --- include/hw/southbridge/piix.h | 1 - hw/i386/pc_piix.c | 5 ++--- hw/isa/piix3.c| 15

[RFC PATCH 5/5] xen/privcmd: add IOCTL_PRIVCMD_GSI_FROM_IRQ

2023-03-12 Thread Huang Rui
From: Chen Jiqian When hypervisor get an interrupt, it needs interrupt's gsi number instead of irq number. Gsi number is unique in xen, but irq number is only unique in one domain. So, we need to record the relationship between irq and gsi when dom0 initialized pci devices, and provide syscall IO

[linux-linus test] 179570: regressions - trouble: fail/pass/starved

2023-03-12 Thread osstest service owner
flight 179570 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/179570/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-freebsd12-amd64 13 guest-start fail REGR. vs. 178042 test-amd64-amd64-xl

Re: [RFC QEMU PATCH 08/18] virtio-gpu: Initialize Venus

2023-03-12 Thread Dmitry Osipenko
On 3/12/23 12:22, Huang Rui wrote: > From: Antonio Caggiano > > Request Venus when initializing VirGL. > > Signed-off-by: Antonio Caggiano > --- > hw/display/virtio-gpu-virgl.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/hw/display/virtio-gpu-virgl.c b/hw/display/virtio-gpu-v

[xen-unstable test] 179571: tolerable trouble: fail/pass/starved

2023-03-12 Thread osstest service owner
flight 179571 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/179571/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-i386-qemut-rhel6hvm-amd 7 xen-install fail pass in 179546 Tests which did not succeed, but

Re: [PULL 13/27] hw/xen: Add xenstore operations to allow redirection to internal emulation

2023-03-12 Thread Jason Andryuk
On Tue, Mar 7, 2023 at 1:29 PM David Woodhouse wrote: > > From: Paul Durrant > > Signed-off-by: Paul Durrant > Signed-off-by: David Woodhouse > Reviewed-by: Paul Durrant > --- > accel/xen/xen-all.c | 11 +- > hw/char/xen_console.c | 2 +- > hw/i386/kvm/xen_xen

Re: [PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-03-12 Thread Chuck Zmudzinski
On 3/12/23 5:22 AM, Bernhard Beschow wrote: > > > Am 11. März 2023 22:20:29 UTC schrieb Chuck Zmudzinski : >>On 2/9/2023 4:53 PM, Bernhard Beschow wrote: >>> Am 1. Februar 2023 08:11:10 UTC schrieb Bernhard Beschow >>> : >>> > >>> > >>> >Am 24. Januar 2023 17:07:30 UTC schrieb Bernhard Beschow

[qemu-mainline test] 179574: regressions - trouble: fail/pass/starved

2023-03-12 Thread osstest service owner
flight 179574 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/179574/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-libvirt 14 guest-start fail REGR. vs. 179518 test-amd64-amd64-

Re: [PATCH v2 0/6] Resolve TYPE_PIIX3_XEN_DEVICE

2023-03-12 Thread Bernhard Beschow
Am 12. März 2023 21:02:03 UTC schrieb Chuck Zmudzinski : >On 3/12/23 5:22 AM, Bernhard Beschow wrote: >> >> >> Am 11. März 2023 22:20:29 UTC schrieb Chuck Zmudzinski : >>>On 2/9/2023 4:53 PM, Bernhard Beschow wrote: Am 1. Februar 2023 08:11:10 UTC schrieb Bernhard Beschow : > >

[PATCH] xen: fix dm_restrict startup

2023-03-12 Thread Jason Andryuk
QEMU is failing to signal it start when launched by libxl with dm_restrict=1. When xenstore_record_dm_state() is called, the restrictions prevent xs_open() from succeeding. QEMU can't write running to the xenstore, and libxl fails the VM start up. Pass in a open xenstore connection. Let the cal

Re: [RFC QEMU PATCH 08/18] virtio-gpu: Initialize Venus

2023-03-12 Thread Dmitry Osipenko
On 3/12/23 20:51, Dmitry Osipenko wrote: > On 3/12/23 12:22, Huang Rui wrote: >> From: Antonio Caggiano >> >> Request Venus when initializing VirGL. >> >> Signed-off-by: Antonio Caggiano >> --- >> hw/display/virtio-gpu-virgl.c | 4 >> 1 file changed, 4 insertions(+) >> >> diff --git a/hw/di

[linux-linus test] 179583: regressions - trouble: fail/pass/starved

2023-03-12 Thread osstest service owner
flight 179583 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/179583/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-amd64-freebsd12-amd64 17 guest-localmigrate fail REGR. vs. 178042 test-amd64-amd64-xl

[qemu-mainline test] 179588: regressions - trouble: fail/pass/starved

2023-03-12 Thread osstest service owner
flight 179588 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/179588/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-amd64-i386-libvirt 14 guest-start fail REGR. vs. 179518 test-amd64-i386-l