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 B26D6C55171 for ; Sat, 1 Aug 2026 00:18:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1379718.1624130 (Exim 4.92) (envelope-from ) id 1wpxQF-0000v2-M4; Sat, 01 Aug 2026 00:17:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1379718.1624130; Sat, 01 Aug 2026 00:17:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wpxQF-0000uu-Ho; Sat, 01 Aug 2026 00:17:51 +0000 Received: by outflank-mailman (input) for mailman id 1379718; Sat, 01 Aug 2026 00:17:50 +0000 Received: from mx.expurgate.net ([195.190.135.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wpxQE-0000rs-2x for xen-devel@lists.xenproject.org; Sat, 01 Aug 2026 00:17:50 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wpxQD-00Firx-DI for xen-devel@lists.xenproject.org; Sat, 01 Aug 2026 02:17:49 +0200 Received: from [10.42.69.6] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a6d3ae6-bab6-0a2a0a5309dd-0a2a4506dbea-24 for ; Sat, 01 Aug 2026 02:17:48 +0200 Received: from [98.137.69.83] (helo=sonic314-20.consmr.mail.gq1.yahoo.com) by tlsNG-16d1c6.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a6d3b2b-195a-0a2a45060019-628945539ebc-3 for ; Sat, 01 Aug 2026 02:17:48 +0200 Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.gq1.yahoo.com with HTTP; Sat, 1 Aug 2026 00:17:46 +0000 Received: by hermes--production-bf1-54b5569bdc-h5zdx (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 655a093bcead2c5289eeab02aa189b76; Sat, 01 Aug 2026 00:17:45 +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=1785543466; bh=MtlsR1zLIBzo7DokWP/PBZ1CtP2Neyt/oQv1hSzEZAA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From:Subject:Reply-To; b=l2NAnr2ZeOl00G7zLAfZYUgGGgl3bASj4jRKmAak+9N9/hG24pcUM/LzEn1xl4fJMjpfmcW4O10lvFpATFzfX9CpSfIxtRInzt+3HuBZgIclDqkLODwk2pyWHNVYX8+90vj2YMDizy7uAq4+8YT8E+L2LsbsA4zCApdIWya8uXQV7SXi6LiOzWpYAkul/mTRfIIfjducGFC2IwrAvlqgsviu77t5dtvaEjydWtiMDY/SFD10L5fq9wfzVPmpwSymGDgqyVAVC1NkefvikFb7qmsxJGz7dIwosXSVTfZz2nnjp2n1LIDoYf9SETOVXytPLvpYKgBL8ziU2Ib9lpG//A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1785543466; bh=5ahFWUv8lvDNModk7E2uOFUzvRNOZLW3kzh0fNuw3rd=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=jO+g+4wGJ7JwN/G8/5y3TWUhOu2HKR7nJQIFCXXO393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aYFc87rsElWqoHj1DVD9LIwVMjZgz8p7UUbiCzFmgt.Z.UNAN8Kf89Uy YVwu.jSF6yfBGNtT787dxQ.cQ1JnZQzp3rXVWg9QdV_HctWMub5SaxImA4P7Lu_KuNNoFCMjKMWR 0y1ISuOnqP..R7qlIxm8epK5vevI6tTZAINDhOrYuCGyBB3TX1PlUT_v_a.HbbdT7ET2YQ64xHsO _4XrEdrpRwLGZ1fn75OR6fYIFKA2f7Thgg06Pd1DDCjZ_CWOOrRp8oFWal5HzwFoK4msQUpsf2H7 u3dg03h1mBhoh4QCl5LhvdD6dSDTvZnGj3Q79HX63z28mbEbQTdO2o7WnE7d3uGv928dKV_xq95. UW6ecAcVE8OJPpxL5F46pheb8Y6wWfl3ZXqh5ujcRDNBhu6ZCsf6a2PyfWQf3R799tN1uKX9WNki oO2sif9h.FexmR388UyMb3axdpXNZg1WOlfx9F4KxaIgOlb8n X-Sonic-MF: X-Sonic-ID: 6e72e470-4730-41e5-b846-8856782acdd4 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" , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Teddy Astie , Tomita Moeko Subject: [PATCH v4 3/6] xen/igd: fixup device id before registering rom Date: Fri, 31 Jul 2026 20:17:27 -0400 Message-ID: <20260801001737.16509-4-brchuckz@aol.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260801001737.16509-1-brchuckz@aol.com> References: <20260801001737.16509-1-brchuckz@aol.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-16d1c6/1785543468-F6C7777B-A84B88A1/0/0 X-purgate-type: clean X-purgate-size: 3246 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: 881213f1b9c5 ("xen, gfx passthrough: retrieve VGA BIOS to work") Signed-off-by: Chuck Zmudzinski --- Changes in v4: - Add a Fixes tag 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 b37f9b7..0ae95cc 100644 --- a/hw/xen/xen_pt_graphics.c +++ b/hw/xen/xen_pt_graphics.c @@ -223,6 +223,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