From 0829edee4c13726c9501d447573bb59c39dbcbf3 Mon Sep 17 00:00:00 2001 From: Junming Liu Date: Thu, 20 Feb 2020 10:15:39 +0000 Subject: [PATCH] dm:add an extra lpc bridge when enabling gvt-d Intel Graphics Device(IGD) passthrough on Windows guest has the restriction that it need a lpc bridge device located in 00:1f.0 PCI slot. This patch add a 'gpu' option for 'passthrou' type device, which will create the dedicated "igd-lpc" for IGD passthrough. Tracked-On: #4405 v2 -> v3: * refine the commit message and comments. Signed-off-by: Junming Liu Reviewed-by: Shuo A Liu Reviewed-by: Wu Binbin Acked-by: Wang, Yu1 --- devicemodel/hw/pci/passthrough.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devicemodel/hw/pci/passthrough.c b/devicemodel/hw/pci/passthrough.c index 2efd4e90b..8c69dd28f 100644 --- a/devicemodel/hw/pci/passthrough.c +++ b/devicemodel/hw/pci/passthrough.c @@ -808,7 +808,11 @@ passthru_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) keep_gsi = true; else if (!strncmp(opt, "no_reset", 8)) need_reset = false; - else + else if (!strncmp(opt, "gpu", 3)) { + /* Create the dedicated "igd-lpc" on 00:1f.0 for IGD passthrough */ + if (pci_parse_slot("31,igd-lpc") != 0) + warnx("faild to create igd-lpc"); + } else warnx("Invalid passthru options:%s", opt); }