Skip to content

Commit

Permalink
Add Intel GVT-g support (xengt device)
Browse files Browse the repository at this point in the history
  • Loading branch information
jevank committed Feb 16, 2022
1 parent 1c88f84 commit 8e26317
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
91 changes: 91 additions & 0 deletions qemu/patches/qemu-stub-xengt-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
From 01818d9d2af100d56e2701690bbac4a87576f0e9 Mon Sep 17 00:00:00 2001
From: Ivan Kardykov <kardykov@tabit.pro>
Date: Sun, 2 Jan 2022 23:36:21 +0300
Subject: [PATCH] Add stubdom xengt support

---
hw/pci/pci.c | 4 ++++
include/sysemu/sysemu.h | 2 +-
qemu-options.hx | 7 ++++++-
softmmu/vl.c | 5 +++++
4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 23d2ae2ab..40838559a 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1062,6 +1062,10 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev,
if (devfn < 0) {
for(devfn = bus->devfn_min ; devfn < ARRAY_SIZE(bus->devices);
devfn += PCI_FUNC_MAX) {
+ /* If vGT/XenGT is in use, reserve 00:02.* for the IGD */
+ if (vga_interface_type == VGA_VGT && devfn == 0x10)
+ continue;
+
if (pci_bus_devfn_available(bus, devfn) &&
!pci_bus_devfn_reserved(bus, devfn)) {
goto found;
diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 8fae66717..a6d228927 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -28,7 +28,7 @@ extern int autostart;

typedef enum {
VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL,
- VGA_TCX, VGA_CG3, VGA_DEVICE, VGA_VIRTIO,
+ VGA_TCX, VGA_CG3, VGA_DEVICE, VGA_VIRTIO, VGA_VGT,
VGA_TYPE_MAX,
} VGAInterfaceType;

diff --git a/qemu-options.hx b/qemu-options.hx
index 83aa59a92..07d2696e4 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2131,7 +2131,7 @@ SRST
ERST

DEF("vga", HAS_ARG, QEMU_OPTION_vga,
- "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|none]\n"
+ "-vga [std|cirrus|vmware|qxl|xenfb|tcx|cg3|virtio|xengt|none]\n"
" select video card type\n", QEMU_ARCH_ALL)
SRST
``-vga type``
@@ -2175,6 +2175,11 @@ SRST
``virtio``
Virtio VGA card.

+ ``xengt``
+ Intel IGD card based on mediated pass-through technique. A single
+ IGD card can be used to accelerate multiple VMs, which each run
+ native graphics driver inside.
+
``none``
Disable VGA card.
ERST
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 5ca11e746..116095d5d 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -906,6 +906,10 @@ static const VGAInterfaceInfo vga_interfaces[VGA_TYPE_MAX] = {
.opt_name = "xenfb",
.name = "Xen paravirtualized framebuffer",
},
+ [VGA_VGT] = {
+ .opt_name = "xengt",
+ .name = "Intel GVT-g",
+ },
};

static bool vga_interface_available(VGAInterfaceType t)
@@ -960,6 +964,7 @@ static void select_vgahw(const MachineClass *machine_class, const char *p)
exit(1);
}
vga_interface_type = t;
+ printf("%s vga is %s\n", __func__, ti->opt_name);
break;
}
}
--
2.31.1

1 change: 1 addition & 0 deletions qemu/patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
0018-pc-bios-ignore-prebuilt-binaries.patch
seabios-python3.patch
vgasrc-ignore-.node.gnu.property-binutils-2.36-suppo.patch
qemu-stub-xengt-support.patch
2 changes: 2 additions & 0 deletions rpm_spec/xen-hvm-stubdom-linux.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ URL: https://www.qubes-os.org/

Requires: xen-libs >= 2001:4.14.3-5

Provides: xen-hvm-stubdom-gvt

BuildRequires: quilt

# QEMU
Expand Down

0 comments on commit 8e26317

Please sign in to comment.