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 1D5C5C43458 for ; Thu, 9 Jul 2026 18:35:53 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1358457.1612580 (Exim 4.92) (envelope-from ) id 1whtat-0004Ea-Ff; Thu, 09 Jul 2026 18:35:31 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1358457.1612580; Thu, 09 Jul 2026 18:35:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1whtat-0004ET-C1; Thu, 09 Jul 2026 18:35:31 +0000 Received: by outflank-mailman (input) for mailman id 1358457; Thu, 09 Jul 2026 18:35:30 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1whtas-0003o1-DT for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 18:35:30 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1whtar-004bSK-Py for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 20:35:29 +0200 Received: from [10.42.69.11] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a4fe9ee-5cb7-0a2a0a5109dd-0a2a450b9898-2 for ; Thu, 09 Jul 2026 20:35:26 +0200 Received: from [98.137.68.31] (helo=sonic308-55.consmr.mail.gq1.yahoo.com) by tlsNG-42698a.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.2) (envelope-from ) id 6a4fe9ed-b7da-0a2a450b0019-6289441fa20e-3 for ; Thu, 09 Jul 2026 20:35:26 +0200 Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 18:35:24 +0000 Received: by hermes--production-ne1-7568ccb994-fjmzg (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 910e3b4d72a347495c18993f77062a0e; Thu, 09 Jul 2026 18:35:23 +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=1783622124; bh=RWUWN1Khjj7dJNM0rQ3yGglWM1wDL1ijwxyNMLI6jYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=DqdgcDySsWQn3/hfhqx93w0tMHWTVlJYPc2ZhAOCQPfAMMIoP/uPvJ9TcMh1o2KSDl7zg5KTfN55CvOhskA0l1W7IEcOAJz5DV8P/EGSHkq2w1qAw5OJe5Lw3ZUgvhx1UbJh8oqXFLgz4NYWQvLpgeC6RKS6by8Ub6whBxQkXmc0SBrGsPJ9ep6IhsexQAtYmAhPCKuoWfc2CzvnBZNTCPBgRvyLRz/Kb+hFGsLLRg8F5Ex8oFeEnUTEllKyNFPdQthsMajmBPO4Tb/WF3IUx3X3qdBen7YVYEkZWMOHGWX779Uu5F8EdZ/X2SBmjFVQNO4Y5EEhOg1lyyB1MxZtgA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783622124; bh=5qCBF6nm0C28qlJPoFBbn0E8KwxNV8yc5GrA4lxP5jX=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=oj6CFCXljEo5MSL5LpWL2Ce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VwsrMsrWbPxH QNFX9mH8jDSHo3R9r_8h.sojbcDL3Ie65MuLmu8hjYJSiiEazCesmFIfiTJUd7pdyUDPximjDfiF _f9ngMsZteF5jSMLbQty6vLEslG6DUdfVWKEaVyCupJlvmfm5UukyA80KQY.WGLlD8kgzLuLegfE 168HR46NsLD9x1.77_lOsXCAfKVJ3mdsv1SczGmXCNY2ifGbdmWfbAi_T7hHlzNHr77MbDYHjfHZ L1grRi8jhzl2zXyR4IeqPZyKijn4CjFOROUrCpef7ViO_3JmL9lx6FMUAUR8QEwd7D9e3B5m2a7o .pW26Q7WsiOkkWapCYMG5T0BsmP7OUX9ANCe_ZIL2BHPds2vUIE_MoAcWyU6nnE1FEpEf1OYDU5a o9b.ExeN.sS.grra_SWofdrAOZ0RDwZhan8NnNxgjnzDj0O54EFviAybg13DWxekJiYZQO9KLEsM VD7x1wllEcTAM1t7euqv6mh7p.cRSc1m8MkKZz.mY X-Sonic-MF: X-Sonic-ID: 5789bcb1-0729-48f7-807f-e36832099043 From: Chuck Zmudzinski To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, xen-devel@lists.xenproject.org, Stefano Stabellini , Anthony PERARD , "Edgar E . Iglesias" Subject: [PATCH v3 3/3] xen/igd: fixup device id before registering rom Date: Thu, 9 Jul 2026 14:35:16 -0400 Message-ID: <20260709183517.25866-4-brchuckz@aol.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260709183517.25866-1-brchuckz@aol.com> References: <20260709183517.25866-1-brchuckz@aol.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-42698a/1783622126-4B36C9ED-BD7F74DB/0/0 X-purgate-type: clean X-purgate-size: 3305 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 Changes in v3: - fix Cc address for qemu-stable 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