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 E96A9C44506 for ; Thu, 9 Jul 2026 05:09:43 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1357504.1611904 (Exim 4.92) (envelope-from ) id 1whh0n-0007uA-KX; Thu, 09 Jul 2026 05:09:25 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1357504.1611904; Thu, 09 Jul 2026 05:09:25 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1whh0n-0007sh-GX; Thu, 09 Jul 2026 05:09:25 +0000 Received: by outflank-mailman (input) for mailman id 1357504; Thu, 09 Jul 2026 05:09:24 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1whh0m-0007mL-6I for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 05:09:24 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1whh0l-00AI4q-74 for xen-devel@lists.xenproject.org; Thu, 09 Jul 2026 07:09:23 +0200 Received: from [10.42.69.7] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a4f2cff-bab6-0a2a0a5309dd-0a2a45079eaa-8 for ; Thu, 09 Jul 2026 07:09:23 +0200 Received: from [98.137.69.84] (helo=sonic314-21.consmr.mail.gq1.yahoo.com) by tlsNG-ef75cf.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a4f2d01-9c8e-0a2a45070019-62894554a526-3 for ; Thu, 09 Jul 2026 07:09:22 +0200 Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.gq1.yahoo.com with HTTP; Thu, 9 Jul 2026 05:09:20 +0000 Received: by hermes--production-ne1-7568ccb994-mqdhs (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID da73cafa7d25cff72b3b6899257e7b9a; Thu, 09 Jul 2026 05:09:16 +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=1783573760; bh=UmUmWH59zwDkMLLGuuGvz0xwapBoT1O8sVu7oXOskMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=hGHrGkCZrQZCC7XLtuCMvJIdut61Pe/EmUDh0iLkCd/+jW65mcTW6JH0XjzA6jvabpZsVqk641YUUGNH39EU5YeFPCeapQB3t4JdY1Rct3CaNTqamO+JBrgBTNPbByTSaEnjnMgMObZZOa7xm2LDa3dN9QZikCwv8Kk7ACNiMQK9E4eO+DDeIh7+bH95LQ7C2splnR5CJp0YpkJNZ83ZoGhLS/cluKUChART3xYV63nJlVkoUkwGYWbX3q0duIpLgePeqZgdU57ZFJn19PHolewmNVHjTI+QdCnib38GOXoEEnS1MCf1lVpKyrNz+p2leiMb+TUPQF/HXHMdhJI1Qw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1783573760; bh=9xClvDzp3a1vB5OzI9ZBLOxM/ZtVUMYTi9D1WxSqNGH=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=s2wHTm8b6Q9HGZDmxBeolGQ2/STF0XVsaH9gI2V5oPJJ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_PzLRMykYuCYCAsYVCTemyxGIxutTHZUrYEmTSI4c3y_iTgJuPal4B81oDqwgqa 0Dksj.wVwUiNCQ4_lJ0mzeiObB0sm6IHIVpeI5JiWuEgZRr244fsinTP79cfAZftm0lzy3MqscEv jaVuTHPjX.c3jGEy5KsbPZQkkWj74g0.YrHFBEXDrY.HzSRhniqMpHpiyd_xQRq0Z3A7vt1QQe.H klVQGSK91OCdctFkP.athI26.gnWQWufh6Qy5GyfRXp0709_J8EZxKspyE10UL.UW.U5Aa4v1Cpc flIU0FlQVEU0Yut56zAl4E_WtMWG0mcmFYesn5oj9HM7_G2e27nxGw3JU4LTF.cVbAqpczSIdmm4 1BWb7IfOOAUkQQorbZYYglwJS96nkZ._2ff3sWiB.hvxRftpxR2YpyZSDO0jzvh7hzDwX2byEShg 5hhJ6zOmRP4t_x1s2jlkXQ8Fs5lCVL0LcAw-- X-Sonic-MF: X-Sonic-ID: 95c2e078-b625-436e-bd84-c2e244a36491 From: Chuck Zmudzinski To: qemu-devel@nongnu.org Cc: xen-devel@lists.xenproject.org, Stefano Stabellini , Anthony PERARD , "Edgar E . Iglesias" Subject: [PATCH 3/3] xen/igd: fixup device id before registering rom Date: Thu, 9 Jul 2026 01:09:10 -0400 Message-ID: <20260709050910.8217-4-brchuckz@aol.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260709050910.8217-1-brchuckz@aol.com> References: <20260709050910.8217-1-brchuckz@aol.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-ef75cf/1783573763-7E93A25E-0E9C0C70/0/0 X-purgate-type: clean X-purgate-size: 3201 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 Fixes: 881213f ("xen, gfx passthrough: retrieve VGA BIOS to work") Signed-off-by: Chuck Zmudzinski --- 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 54f0d54..9e9ab55 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