Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BBFC9C43458 for ; Thu, 9 Jul 2026 16:19:11 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1358344.1612531 (Exim 4.92) (envelope-from ) id 1whrSZ-0002FO-Dg; Thu, 09 Jul 2026 16:18:47 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1358344.1612531; Thu, 09 Jul 2026 16:18:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1whrSZ-0002ET-7e; Thu, 09 Jul 2026 16:18:47 +0000 Received: by outflank-mailman (input) for mailman id 1358344; Thu, 09 Jul 2026 16:18:46 +0000 Received: from mx.expurgate.net ([195.190.135.20]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1whrSY-0002Bw-JL for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 16:18:46 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1whrSX-00CbhJ-WC for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:18:46 +0200 Received: from [10.42.69.4] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a4fc9d9-5cb7-0a2a0a5109dd-0a2a4504812a-8 for ; Thu, 09 Jul 2026 18:18:45 +0200 Received: from [98.137.68.147] (helo=sonic302-21.consmr.mail.gq1.yahoo.com) by tlsNG-ebf023.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2) (envelope-from ) id 6a4fc9e4-b1e5-0a2a45040019-6289449386fa-3 for ; Thu, 09 Jul 2026 18:18:45 +0200 Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 16:18:43 +0000 Received: by hermes--production-ne1-7568ccb994-pgg8z (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID e91c25460b5bcef5e32390743f7fb9e1; Thu, 09 Jul 2026 16:18:38 +0000 (UTC) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=a2048 header.d=aol.com header.i="@aol.com" header.h="From:To:Cc:Subject:Date:In-Reply-To:References" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1783613923; bh=NjzxgWYBhBDPccqwhPPakgGCHJbF/Oi59PNz/FTey5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=PHuO18g/I5iYnOfQIVSRLWKyeo2iCMloTvx5+lXG2qV0bULcTAGOI4OmbCop+ztt1cRcMXUkCaw4F92WaYZ6skoYHBqkVBPhSTWQGuoYNGRqBnUA8Y3Jhrin8/38jaY+uctg2GGEfaCo4jGlghMwtD65+QBMIBSGVuQT7YakSj5WEaq408JZ12G+aNU7FNIs81OA//DO2Heockdg0U44MqTN6SzOjse6bo4LmxPUOczjhur8phInLkWOhTawJvGwCZLARMUK5ES57v7nSzxNlp8nZT2ISTdB85pt4MCTvH2mQCsrLcvo46trbPSIoCEIdjm1W7PFXz36wFu6U+Vykg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783613923; bh=Xl5UUP6heRHfJ8Onch0/iWYn1uKw2wGFHWxnlLcOHDy=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=bOMMEcUh9wmtbT18lfuP/P4Oenff5m9OfyHPwnCrye51v2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y1mSCV17pUEUaKcFAX7K0t2FfS4gMGJZwDy8C2q198pQ FIDrb54I77XY262fywuIgRLOjqQEWig7sQn.pUsmuJNM6YNCoY7NDKtQABKcDKxEYhUiTVf8XrSf B55sBeennmKettCkvnCIglv2FM5nsUS3lmA8gNeG4VkNb6_yxwo_cIZNmXP5g9CcienYPljsedaU wp7CXsU.pR3kmHKQoFO_cgNQ4sB05fdI68ipOHGDkP4zI4bw.V7u8lpZzYviE8htqFP9FHZEsH9g qw2BAxn7NKgWtbyXFqgy_tnV7mYjpmHbo4gk6zBUCIzEMEu7GSCLyKWVJk8fhh9HZG5oWtsTtgs4 AUK8SeO_277aLrjCNOa1.c9UfanPyi4GFgsBGH4fRlhy7N8WQeZyj35wsq03qpBqJU3cLqj1PzLF EMKPt8xrOZmytqLq0Liie6UHLMF4XpTGcyTLnI7O3 X-Sonic-MF: X-Sonic-ID: f78416a5-1708-4bda-9a80-a47dc8b7966b From: Chuck Zmudzinski To: qemu-devel@nongnu.org Cc: stable@nongnu.org, xen-devel@lists.xenproject.org, Stefano Stabellini , Anthony PERARD , "Edgar E . Iglesias" Subject: [PATCH v2 3/3] xen/igd: fixup device id before registering rom Date: Thu, 9 Jul 2026 12:18:31 -0400 Message-ID: <20260709161831.17753-4-brchuckz@aol.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260709161831.17753-1-brchuckz@aol.com> References: <20260709161831.17753-1-brchuckz@aol.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-ebf023/1783613925-775A8FE7-A28A73AC/0/0 X-purgate-type: clean X-purgate-size: 3251 With the current implementation, Seabios does not see the fixup of the device id done here and consequently Seabios does not load the VGA bios and the guest screen does not light up until the guest OS graphics driver is loaded. So there is no VGA output from the passed through Intel IGD from either Seabios or the guest bootloader with the current implementation in cases when the device id needs fixing. Fix this by waiting until after doing fixup of the device id before registering the option ROM. With this patch, Seabios sees the fixup done here and loads the VGA bios, and both Seabios and the guest bootloader light up the guest screen in cases when fixup of the device id is needed. Also, remove unused header hw/core/loader.h. Signed-off-by: Chuck Zmudzinski --- Changes in v2: - add a period to the end of the last sentence of the commit message - add stable to Cc list hw/xen/xen_pt_graphics.c | 3 +++ hw/xen/xen_pt_load_rom.c | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/hw/xen/xen_pt_graphics.c b/hw/xen/xen_pt_graphics.c index 2ef941e..aface0b 100644 --- a/hw/xen/xen_pt_graphics.c +++ b/hw/xen/xen_pt_graphics.c @@ -222,6 +222,9 @@ void xen_pt_setup_vga(XenPCIPassthroughState *s, XenHostPCIDevice *dev, } } + pci_register_bar(&s->dev, PCI_ROM_SLOT, 0, &s->dev.rom); + s->dev.has_rom = true; + /* Currently we fixed this address as a primary for legacy BIOS. */ physical_memory_write(0xc0000, bios, bios_size); } diff --git a/hw/xen/xen_pt_load_rom.c b/hw/xen/xen_pt_load_rom.c index 319efca..407b630 100644 --- a/hw/xen/xen_pt_load_rom.c +++ b/hw/xen/xen_pt_load_rom.c @@ -4,14 +4,22 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "hw/core/loader.h" #include "hw/pci/pci.h" #include "xen_pt.h" /* - * Scan the assigned devices for the devices that have an option ROM, and then - * load the corresponding ROM data to RAM. If an error occurs while loading an - * option ROM, we just ignore that option ROM and continue with the next one. + * Normally xen_pt_register_regions will handle loading the option ROM, + * but in some cases, such as for the Intel IGD, the option ROM might + * need to be modified. + * + * For such cases, use this function to get a pointer to the option ROM + * from sysfs. Caller has the responsibility to edit the option ROM as + * needed, call pci_register_bar to register the modified option ROM, + * and set has_rom to true for the PCI device. + * + * This function must be called before xen_pt_register_regions is called + * because if xen_pt_register_regions is called first, it will register + * the option ROM and any attempt to register it again will fail. */ void *pci_assign_dev_load_option_rom(PCIDevice *dev, int *size, unsigned int domain, @@ -76,8 +84,6 @@ void *pci_assign_dev_load_option_rom(PCIDevice *dev, goto close_rom; } - pci_register_bar(dev, PCI_ROM_SLOT, 0, &dev->rom); - dev->has_rom = true; *size = st.st_size; close_rom: /* Write "0" to disable ROM */ -- 2.52.0