forked from HW42/qubes-vmm-xen-stubdom-linux
-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Intel GVT-g support (xengt device)
- Loading branch information
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters