v3:
Hi all,
Thanks for Michael S. Tsirkin's advice. V3 makes below changes:
* Remove changes in file include/standard-headers/linux/virtio_gpu.h
I am not supposed to edit this file and it will be imported after
the patches of linux kernel was merged.
Best regards,
Jiqian Chen.
v2:
link
a new feature flag VIRTIO_GPU_F_FREEZING, so
that guest and host can negotiate whenever freezing is
supported or not.
Signed-off-by: Jiqian Chen
---
hw/display/virtio-gpu-base.c | 3 ++
hw/display/virtio-gpu-gl.c | 9 +-
hw/display/virtio-gpu-virgl.c | 7 +
hw/display/virtio-gpu.c
v3:
Hi all,
Thanks for Gerd Hoffmann's advice. V3 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.
Best regards,
Jiqian Chen.
v2:
Hi all,
Than
ture flag VIRTIO_GPU_F_FREEZE_S3, so that guest and
host can negotiate whenever freeze_S3 is supported or not.
Signed-off-by: Jiqian Chen
---
drivers/gpu/drm/virtio/virtgpu_debugfs.c | 1 +
drivers/gpu/drm/virtio/virtgpu_drv.c | 39
drivers/gpu/drm/virtio/virtgpu_drv.h
it added a new feature flag VIRTIO_GPU_F_FREEZE_S3, so
that guest and host can negotiate whenever freeze_S3 is
supported or not.
Signed-off-by: Jiqian Chen
---
hw/display/virtio-gpu-base.c | 3 ++
hw/display/virtio-gpu-gl.c | 10 ++-
hw/display/virtio-gpu-virgl.c | 7 +
hw/display
l.org/lkml/20230720115805.8206-1-jiqian.c...@amd.com/T/#t
Best regards,
Jiqian Chen.
v3:
link,
https://lore.kernel.org/qemu-devel/20230719074726.1613088-1-jiqian.c...@amd.com/T/#t
Hi all,
Thanks for Michael S. Tsirkin's advice. V3 makes below changes:
* Remove changes in file include/standa
://lore.kernel.org/qemu-devel/20230608025655.1674357-2-jiqian.c...@amd.com/
Best regards,
Jiqian Chen.
Jiqian Chen (1):
virtgpu: init vq during resume and notify qemu guest status
drivers/gpu/drm/virtio/virtgpu_drv.c | 32
drivers/gpu/drm/virtio/virtgpu_drv.h |
to false to notify Qemu that guest exited suspending, and then
Qemu will keep its origin actions. As a result, the display can come
back and everything of guest can come back to the time when guest was
suspended.
Signed-off-by: Jiqian Chen
---
drivers/gpu/drm/virtio/virtgpu_d
destroying
resources and resetting renderer when guest calls into
virtio_gpu_gl_reset. If guest is during resuming, it sets
freezing to false, and then virtio_gpu_gl_reset will keep
its origin actions and has no other impaction.
Signed-off-by: Jiqian Chen
---
hw/display/virtio-gpu-gl.c
hat guest is suspending, it will not destroy resources and will
not reset renderer. If freezing is set to false, Qemu will do its origin
actions, and has no other impaction.
And now, display can come back and applications can continue their
status after guest resumes.
Jiqian Chen (1):
virtgpu: do not
lso needs hot-plug support.
* Add a new feature flag VIRTIO_GPU_F_FREEZING, so that guest and
host can negotiate whenever freezing is supported or not.
Best regards,
Jiqian Chen.
v1:
link:
https://lore.kernel.org/qemu-devel/20230608025655.1674357-1-jiqian.c...@amd.com/
Hi all,
I am work
a new feature flag VIRTIO_GPU_F_FREEZING, so
that guest and host can negotiate whenever freezing is
supported or not.
Signed-off-by: Jiqian Chen
---
hw/display/virtio-gpu-base.c| 3 ++
hw/display/virtio-gpu-gl.c | 9 +++-
hw/display/virtio-gpu-virgl.c
ing is supported or not.
V2 of Qemu patch
https://lore.kernel.org/qemu-devel/20230630070016.841459-1-jiqian.c...@amd.com/T/#t
Best regards,
Jiqian Chen.
v1:
link: https://lore.kernel.org/lkml/20230608063857.1677973-1-jiqian.c...@amd.com/
Hi all,
I am working to implement virtgpu S3 function on
ture flag VIRTIO_GPU_F_FREEZING, so that guest and
host can negotiate whenever freezing is supported or not.
Signed-off-by: Jiqian Chen
---
drivers/gpu/drm/virtio/virtgpu_debugfs.c | 1 +
drivers/gpu/drm/virtio/virtgpu_drv.c | 37
drivers/gpu/drm/virtio/virtgpu_drv.h
m/ and
xen
https://lore.kernel.org/xen-devel/20230312075455.450187-6-ray.hu...@amd.com/)
About the v2 patch of qemu, just change an included head file, other are
similar to the v1 (
qemu
https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.hu...@amd.com/),
just call
xc_physdev_gsi_from
in pcistub_init_device. Because when
using "pci-assignable-add" to assign a passthrough device in
Xen, it will reset passthrough device and the vpci state will
out of date, and then device will fail to restore bar state.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
drivers
Rui
Signed-off-by: Jiqian Chen
---
arch/x86/xen/enlighten_pvh.c | 116 +
drivers/acpi/pci_irq.c | 2 +-
drivers/xen/xen-pciback/pci_stub.c | 8 ++
include/linux/acpi.h | 1 +
include/xen/acpi.h | 1 +
5 files changed,
There is a need for some scenarios to use gsi sysfs.
For example, when xen passthrough a device to dumU, it will
use gsi to map pirq, but currently userspace can't get gsi
number.
So, add gsi sysfs for that and for other potential scenarios.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
can call this hypercall to notify vpci.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c| 35 +++
xen/drivers/vpci/vpci.c | 9 +
xen/include/public/physdev.h | 8
20230312120157.452859-6-ray.hu...@amd.com/ and
xen
https://lore.kernel.org/xen-devel/20230312075455.450187-6-ray.hu...@amd.com/)
About the v2 patch of qemu, just change an included head file, other are
similar to the v1 (
qemu
https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.hu...@amd.
rom gsi sysfs.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
tools/libs/light/libxl_pci.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 96cb4da079..9e75f0c263 100644
--- a/tools/l
stered, but
the gsi of a passthrough device must be configured for it to
be able to be mapped into a hvm domU.
So, add PHYSDEVOP_setup_gsi for PVH dom0, because PVH dom0
will setup gsi during assigning a device to passthrough.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x
ide:
https://lore.kernel.org/xen-devel/20231124104136.3263722-1-jiqian.c...@amd.com/T/#t
Jiqian Chen (1):
xen: Use gsi instead of irq for mapping pirq
hw/xen/xen-host-pci-device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--
2.34.1
gsi sysfs.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
hw/xen/xen-host-pci-device.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/xen/xen-host-pci-device.c b/hw/xen/xen-host-pci-device.c
index 8c6e9a1716..e270ac2631 100644
--- a/hw/xen/xen-host-pci-device.c
++
https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.hu...@amd.com/),
just call
xc_physdev_gsi_from_irq() to get gsi from irq.
Jiqian Chen (3):
xen/pci: Add xen_reset_device_state function
xen/pvh: Setup gsi for passthrough device
PCI/sysfs: Add gsi sysfs for pci_dev
arch/x86
There is a need for some scenarios to use gsi sysfs.
For example, when xen passthrough a device to dumU, it will
use gsi to map pirq, but currently userspace can't get gsi
number.
So, add gsi sysfs for that and for other potential scenarios.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
In PVH dom0, the gsis don't get registered, but the gsi of
a passthrough device must be configured for it to be able to be
mapped into a domU.
When assign a device to passthrough, proactively setup the gsi
of the device during that process.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
in pcistub_init_device. Because when
using "pci-assignable-add" to assign a passthrough device in
Xen, it will reset passthrough device and the vpci state will
out of date, and then device will fail to restore bar state.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
drivers
Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 27 +--
1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 6ad5b4d5f11f..632a68be3cc4 100644
--- a/xen/arch/x86/hvm/hyper
ion.
And change the caller of XEN_DOMCTL_irq_permission to
pass gsi to it instead of pirq.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
tools/libs/light/libxl_pci.c | 6 --
tools/libs/light/libxl_x86.c | 5 -
xen/common/domctl.c | 12 ++--
3 files changed,
l/20230312075455.450187-6-ray.hu...@amd.com/)
About the v2 patch of qemu, just change an included head file, other are
similar to the v1 ( qemu
https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.hu...@amd.com/),
just call
xc_physdev_gsi_from_irq() to get gsi from irq.
Jiqian Chen (5):
can call this hypercall to notify vpci.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c| 34 ++
xen/drivers/vpci/vpci.c | 9 +
xen/include/public/physdev.h | 7
rom gsi sysfs.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
tools/libs/light/libxl_pci.c | 15 +--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index e1341d1e9850..ab51dc099725 100644
--- a/to
purpose.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 632a68be3cc4..e27d3ca15185 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen
use gsi number that
read from gsi sysfs if it exists.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
hw/xen/xen-host-pci-device.c | 7 +++
hw/xen/xen-host-pci-device.h | 1 +
hw/xen/xen_pt.c | 6 +-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/hw/
uccess.
This v2 on qemu side is the same as the v1 ( qemu
https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.hu...@amd.com/),
just call
xc_physdev_gsi_from_irq() to get gsi from irq.
Jiqian Chen (1):
xen: Use gsi instead of irq for mapping pirq
hw/xen/xen-host-pci-device
ng Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 2 ++
xen/arch/x86/physdev.c | 22 ++
2 files changed, 24 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 6ad5b4d5f11f..493998b42ec5 100644
--- a/xen/arch/x
purpose.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 493998b42ec5..46f51ee459f6 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen
rom gsi sysfs.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
tools/libs/light/libxl_pci.c | 25 +++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
in
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
tools/include/xenctrl.h | 5 +
tools/libs/ctrl/xc_domain.c | 15 +++
tools/libs/light/libxl_pci.c | 16 ++--
xen/arch/x86/domctl.c| 31 +++
xen/include/public/domctl.h |
59-6-ray.hu...@amd.com/
and xen
https://lore.kernel.org/xen-devel/20230312075455.450187-6-ray.hu...@amd.com/)
About the v2 patch of qemu, just change an included head file, other are
similar to the v1 ( qemu
https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.hu...@amd.com/),
just c
can call this hypercall to notify vpci.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c| 36
xen/drivers/vpci/vpci.c | 10 ++
xen/include/public/physdev.h | 7
xc_physdev_gsi_from_irq() to get gsi from irq.
v2 on kernel side:
https://lore.kernel.org/lkml/20231124103123.3263471-1-jiqian.c...@amd.com/T/#t
v2 on Xen side:
https://lore.kernel.org/xen-devel/20231124104136.3263722-1-jiqian.c...@amd.com/T/#t
Jiqian Chen (1):
xen/pci: get gsi from irq for passthrough
irq in current code,
that is irq not gsi, so it will fail when mapping.
For above reason, on Xen side, we add a new function to
translate irq to gsi. And at here, we call that function
to get the correct gsi number.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
---
hw/xen/xen-host-pci-devic
can get
that translation when they have a need.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
---
arch/x86/include/asm/apic.h | 7 ++
arch/x86/include/asm/xen/pci.h | 5
arch/x86/kernel/acpi/boot.c | 2 +-
arch/x86/pci/xen.c |
that function in pcistub_init_device. Because when
we use "pci-assignable-add" to assign a passthrough device in
Xen, it will reset passthrough device and the vpci state will
out of date, and then device will fail to restore bar state.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
---
d
.kernel.org/xen-devel/20230312075455.450187-6-ray.hu...@amd.com/)
About the v2 patch of qemu, just change an included head file, other are
similar to the v1 (
qemu
https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.hu...@amd.com/),
just call
xc_physdev_gsi_from_irq() to get gsi from irq.
Ji
n PVH dom0.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
---
drivers/xen/xen-pciback/pci_stub.c | 7 +++
include/linux/irq.h| 1 +
kernel/irq/chip.c | 1 +
kernel/irq/internals.h | 1 -
kernel/irq/irqdesc.c | 2 +-
5 files cha
, dom0 can call this hypercall to notify vpci.
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/passthrough/pci.c | 21 +
xen/drivers/pci/physdev.c | 14 ++
xen/drivers/vpci/vpci.c | 9
currd is PVH dom0 and PVH has no X86_EMU_USE_PIRQ flag, it will
fail at has_pirq check.
So, I think we may need to allow PHYSDEVOP_map_pirq when currd is dom0 (at
present dom0 is PVH).
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
---
xen/arch/x86/hvm/hypercall.c | 2 ++
1 file chan
/lore.kernel.org/xen-devel/20230312120157.452859-6-ray.hu...@amd.com/ and
xen
https://lore.kernel.org/xen-devel/20230312075455.450187-6-ray.hu...@amd.com/)
About the v2 patch of qemu, just change an included head file, other are
similar to the v1 (
qemu
https://lore.kernel.org/xen-devel/202303
ore xc_physdev_map_pirq
Signed-off-by: Jiqian Chen
Signed-off-by: Huang Rui
---
tools/include/xen-sys/Linux/privcmd.h | 7 +++
tools/include/xencall.h | 2 ++
tools/include/xenctrl.h | 2 ++
tools/libs/call/core.c| 5 +
tools/libs/call/libxencall.
Hi All,
This is v6 series to support passthrough on Xen when dom0 is PVH.
v5->v6 changes:
* Due to changes in the implementation of obtaining gsi in the kernel and Xen.
Change to use xc_physdev_gsi_from_irq, instead of gsi sysfs.
Best regards,
Jiqian Chen
v4->v5 changes:
* Add
new function supported by
Xen tools.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
hw/xen/xen-host-pci-device.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/xen/xen-host-pci-device.c b/hw/xen/xen-host-pci-device.c
index 8c6e9a1716a2..5e9aa9679e3e 100644
--- a
In PVH dom0, it uses the linux local interrupt mechanism,
when it allocs irq for a gsi, it is dynamic, and follow
the principle of applying first, distributing first. And
irq number is alloced from small to large, but the applying
gsi number is not, may gsi 38 comes before gsi 28, that
causes the
can call this hypercall to notify vpci.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stewart Hildebrand
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c| 36
xen/drivers/vpci/vpci.c
ng Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 2 ++
xen/arch/x86/physdev.c | 24
2 files changed, 26 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 56fbb69ab201..d49fb8
Best regards,
Jiqian Chen
v5->v6 changes:
* patch#1: Add Reviewed-by Stefano and Stewart. Rebase code and change old
function vpci_remove_device, vpci_add_handlers to vpci_deassign_device,
vpci_assign_device
* patch#2: Add Reviewed-by Stefano
* patch#3: Remove unnecessary "ASSERT(!
off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
tools/include/xenctrl.h | 5
tools/libs/ctrl/xc_domain.c | 15
tools/libs/light/libxl_pci.c | 46
xen/arch/x86/domctl.c| 31
xen/include/public/domct
purpose.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index d49fb8b548a3..98e3c6b176ff 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen
In PVH dom0, the gsis don't get registered, but the gsi of
a passthrough device must be configured for it to be able to be
mapped into a domU.
When assign a device to passthrough, proactively setup the gsi
of the device during that process.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
Hi All,
This is v6 series to support passthrough on Xen when dom0 is PVH.
v5->v6 change:
* patch#3: change to add a new syscall to translate irq to gsi, instead adding
a new gsi sysfs.
Best regards,
Jiqian Chen
v4->v5 changes:
* patch#1: Add Reviewed-by Stefano
* patch#2: Add Re
to gsi for userspace.
For above purpose, record the relationship of gsi and irq
when PVH dom0 do acpi_register_gsi_ioapic for devices and
adds a new syscall into privcmd to let userspace can get
that translation when they have a need.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
in pcistub_init_device. Because when
using "pci-assignable-add" to assign a passthrough device in
Xen, it will reset passthrough device and the vpci state will
out of date, and then device will fail to restore bar state.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-b
for userspace.
For above purpose, record gsi of pcistub devices when init
pcistub and add a new syscall into privcmd to let userspace
can get gsi when they have a need.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
---
drivers/xen/privcmd.c | 28 ++
drivers
we can return that gsi.
Best regards,
Jiqian Chen
v5->v6 change:
* patch#3: change to add a new syscall to translate irq to gsi, instead adding
a new gsi sysfs.
v4->v5 changes:
* patch#1: Add Reviewed-by Stefano
* patch#2: Add Reviewed-by Stefano
* patch#3: No changes
v3->v4 chan
In PVH dom0, the gsis don't get registered, but the gsi of
a passthrough device must be configured for it to be able to be
mapped into a domU.
When assign a device to passthrough, proactively setup the gsi
of the device during that process.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
Hi All,
This is v7 series to support passthrough on Xen when dom0 is PVH.
v6->v7 changes:
* Due to changes in the implementation of obtaining gsi in the kernel and Xen.
Change to use
xc_physdev_gsi_from_dev, that requires passing in sbdf instead of irq.
Best regards,
Jiqian Chen
v5-
ion supported by Xen tools.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
hw/xen/xen-host-pci-device.c | 19 +++
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/hw/xen/xen-host-pci-device.c b/hw/xen/xen-host-pci-device.c
index 8c6e9a1716a2..2fe6a60434ba 100
ng Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 2 ++
xen/arch/x86/physdev.c | 24
2 files changed, 26 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 56fbb69ab201..d49fb8
In PVH dom0, it uses the linux local interrupt mechanism,
when it allocs irq for a gsi, it is dynamic, and follow
the principle of applying first, distributing first. And
irq number is alloced from small to large, but the applying
gsi number is not, may gsi 38 comes before gsi 28, that
causes the
off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
tools/include/xenctrl.h | 5 +++
tools/libs/ctrl/xc_domain.c | 15
tools/libs/light/libxl_pci.c | 72
xen/arch/x86/domctl.c| 31
xen/include/public/domctl.h | 9 +
purpose.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index d49fb8b548a3..98e3c6b176ff 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen
can call this hypercall to notify vpci.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stewart Hildebrand
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c| 36
xen/drivers/vpci/vpci.c
at gets
more intuitive code logic.
Best regards,
Jiqian Chen
v6->v7 changes:
* patch#4: Due to changes in the implementation of obtaining gsi in the kernel.
Change to add a new function
to get gsi from irq, instead of gsi sysfs.
* patch#5: Fix the issue with variable usage,
o get gsi. Then xc_physdev_map_pirq()
will success.
This v2 on qemu side is the same as the v1
(qemu
https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.hu...@amd.com/),
just call
xc_physdev_gsi_from_irq() to get gsi from irq.
Jiqian Chen (1):
xen: Use gsi instead of irq for map
use gsi number that
read from gsi sysfs if it exists.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
RFC: discussions ongoing on the Linux side where/how to expose the gsi
---
hw/xen/xen-host-pci-device.c | 7 +++
hw/xen/xen-host-pci-device.h | 1 +
purpose.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
xen/arch/x86/hvm/hypercall.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 493998b42ec5..7d4e41f66885 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen
nel.org/xen-devel/20230312075455.450187-6-ray.hu...@amd.com/)
About the v2 patch of qemu, just change an included head file, other are
similar to the v1 ( qemu
https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.hu...@amd.com/),
just call
xc_physdev_gsi_from_irq() to get gsi fro
ng Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 2 ++
xen/arch/x86/physdev.c | 24
2 files changed, 26 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 6ad5b4d5f11f..493998
off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
tools/include/xenctrl.h | 5
tools/libs/ctrl/xc_domain.c | 15 +++
tools/libs/light/libxl_pci.c | 52 +---
xen/arch/x86/domctl.c| 31 +
xen/include/public/domctl.h |
rom gsi sysfs.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
RFC: discussions ongoing on the Linux side where/how to expose the gsi
---
tools/libs/light/libxl_pci.c | 16 ++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/to
can call this hypercall to notify vpci.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stewart Hildebrand
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c| 36
xen/drivers/vpci/vpci.c
similar to the v1 ( qemu
https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.hu...@amd.com/),
just call
xc_physdev_gsi_from_irq() to get gsi from irq.
Jiqian Chen (3):
xen/pci: Add xen_reset_device_state function
xen/pvh: Setup gsi for passthrough device
PCI/sysfs: Add
In PVH dom0, the gsis don't get registered, but the gsi of
a passthrough device must be configured for it to be able to be
mapped into a domU.
When assign a device to passthrough, proactively setup the gsi
of the device during that process.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
There is a need for some scenarios to use gsi sysfs.
For example, when xen passthrough a device to dumU, it will
use gsi to map pirq, but currently userspace can't get gsi
number.
So, add gsi sysfs for that and for other potential scenarios.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
in pcistub_init_device. Because when
using "pci-assignable-add" to assign a passthrough device in
Xen, it will reset passthrough device and the vpci state will
out of date, and then device will fail to restore bar state.
Co-developed-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-b
h#2: is the patch#1 of v7. Use CONFIG_XEN_ACPI instead of CONFIG_ACPI to
wrap codes.
* patch#3: is the patch#2 of v7. In function privcmd_ioctl_gsi_from_dev, return
-EINVAL when not confige CONFIG_XEN_ACPI.
use PCI_BUS_NUM PCI_SLOT PCI_FUNC instead of open coding.
Best regards,
Jiq
for userspace.
For above purpose, record gsi of pcistub devices when init
pcistub and add a new syscall into privcmd to let userspace
can get gsi when they have a need.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
RFC: it need review and need to wait for previous patch of this series
in pcistub_init_device. Because when
using "pci-assignable-add" to assign a passthrough device in
Xen, it will reset passthrough device and the vpci state will
out of date, and then device will fail to restore bar state.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-b
In PVH dom0, the gsis don't get registered, but the gsi of
a passthrough device must be configured for it to be able to be
mapped into a domU.
When assign a device to passthrough, proactively setup the gsi
of the device during that process.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
om0 is not PV or dom0
has not PIRQ flag.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
RFC: it needs review and needs to wait for the corresponding third patch on
linux kernel side to be merged.
---
tools/include/xenctrl.h| 5 +++
tools/libs/ctrl/xc_domain.c|
dd gsi_2_irq to transform gsi to irq, instead of
considering gsi == irq.
Add explicit padding to struct xen_domctl_gsi_permission.
Best regards,
Jiqian Chen
v7->v8 changes:
* patch#2: Add the domid check(domid == DOMID_SELF) to prevent self map when
guest doesn't use pirq.
Q flag.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 6 ++
xen/arch/x86/physdev.c | 24
2 files changed, 30 insertions(+)
diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hyper
In PVH dom0, it uses the linux local interrupt mechanism,
when it allocs irq for a gsi, it is dynamic, and follow
the principle of applying first, distributing first. And
irq number is alloced from small to large, but the applying
gsi number is not, may gsi 38 comes before gsi 28, that
causes the
can call this hypercall to notify vpci.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
Reviewed-by: Stewart Hildebrand
Reviewed-by: Stefano Stabellini
---
xen/arch/x86/hvm/hypercall.c | 1 +
xen/drivers/pci/physdev.c| 43
xen/drivers/vpci/vpci.c
purpose.
Signed-off-by: Huang Rui
Signed-off-by: Jiqian Chen
---
The code link that will call this hypercall on linux kernel side is as follows
https://lore.kernel.org/lkml/20240607075109.126277-3-jiqian.c...@amd.com/T/#u
---
xen/arch/x86/hvm/hypercall.c | 1 +
1 file changed, 1 insertion(+)
diff
97 matches
Mail list logo