From nobody Sun May 19 07:31:52 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=reject dis=none) header.from=aol.com ARC-Seal: i=1; a=rsa-sha256; t=1675821882; cv=none; d=zohomail.com; s=zohoarc; b=NDD4gsJuB2KfHbkXFtfqYVh669Cak07ZvA7hv1dRAEVNzVRupZQBf7CMLq+HP3q+sNStgyWN7n4N4mjvznGaSmS356tNSagLNJweD7sn7WhWbayMmIxt6DZfDDptzuJU91mGN1w+dseRvIN4CJ6Ix6MYDtxZLLMeaFCfkFga+y4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675821882; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NXJ9PRylLClq1paqhxQPO6X19sNqGm+8vVMc3JLv+yo=; b=nURHgd/myfvYsnOgpgyfD7q+yN0yzr/GQb4TjUk7Dutqc3mdfX43ohRDtmIHV+qzt5KTl7vk4LjGInzRODdZeyosptp6Y79POzW73WXeJLa76Dm9Jb2D/UUPhs4znzTcu3DnR+rs3F/8oIhA1jXjJxnSW/xCwMp00Dn1s6I7mw4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675821882366971.2920049267625; Tue, 7 Feb 2023 18:04:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPZoE-000809-CF; Tue, 07 Feb 2023 21:03:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pPZo8-0007yA-1W for qemu-devel@nongnu.org; Tue, 07 Feb 2023 21:03:36 -0500 Received: from sonic315-55.consmr.mail.gq1.yahoo.com ([98.137.65.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPZo5-0002Cg-Gx for qemu-devel@nongnu.org; Tue, 07 Feb 2023 21:03:35 -0500 Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Wed, 8 Feb 2023 02:03:28 +0000 Received: by hermes--production-ne1-746bc6c6c4-j9j2r (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 6c67ca8b47a829739ee46a2e499b4e4c; Wed, 08 Feb 2023 02:03:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1675821808; bh=NXJ9PRylLClq1paqhxQPO6X19sNqGm+8vVMc3JLv+yo=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=K81FqFtOTeBnloDm8unpt8jM7HSXiSqoSjHwDxcqWTgNmGjf1tNMjn4yFltK8b6ETRdF3aYHttqINhgLyYj5WPwO14VxAVOdjrChd1Byw4yqpXq89Qnfjk++D0DXz0pACrx12qOepvsyY/jA79XPfli7K9/OyIqKPQHLDZ7t4zJXUyhJqzDWKSEh8GxyadBC8AWgTcSEzRgphOr4KnawQ5NCDsgiU+OOBSsboODTosmEaMEOVLX7Zgne2COwsTNtdSOHnDQTElT37nxv+Y6YEOTbIZ2RHzD6N3BFoO53ec644VcVi2N63a4YneXyne1kP6Nzaq25thYteDcxHdrqHQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1675821808; bh=kWlPj0khdqgamcY3cVxsxxVYNpSRMoDGw3WTDoMW/XM=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=RExVFcu4TsjeJMcqv6P/tTrkNKS71TbcVS4EHEp8CXq5PoTCnr88GqkJiQVAxAKTr2JTBAhlJrbt/BDZbG4hlkAxoD9pQer2SSDTBl8Zob/BxWevEZS68j1FS1KZpts2Iks/02TVo3q2ePgv63awwSNCDyPde9opyxNXSTn4YLe0+p84Q0JFFrtlmvukrP4tIcAj6Cq1ng8TXPHKqkpnoRzsZ3b4uY6X3/9AS3kycLdXNCooPpUWawqLjcKGk6hDgOP1bwCPYDSZlMXz4MNX3hzBuo9t+95bdIUF/QNBG7R8naQTijFokx2sES1zooblSr0J3uAou8Hby9K8JieFLg== X-YMail-OSG: HdhH2KYVM1mUq4HnKWmrYNjCXKkD8WAM8t491iad3X6T7_EAe0YYzySz2eUIXaD xaTI2LKPoLQEtMVSoddtnOIxIpyvFZI.fbXxClaOxb3HZOuCTKjPxghK1BZ.QaRssSkk8G.Yor_W MdyDDWd57U9_.hIqAXG2HPcR3hBmvnqyi9YGO5q7E3_DQrqSYx0NbATXrZC0EkY2_wNHEUqHyBnx Is4.NX25k0lVY6..iNT939SG7w6biAgEtQW8ckKFWraN8E20E43Lyfeh34KhymL.v08XzW.XKa2d nttcy43MzS6ewwOEKT3HMpJIFBTjIzwnm3N5tmIKPk5iuWb2lYP49tEHFcioFvQuccf238KQSe7x TsRWUrsk_gT93B_XdS9Lp47.a59lDsHbWZSIB7iYKlkT86PJjPZlqxWbSHnxQVYYGkw8dEhvwWzD UBDg.UI8OA.DcHAO8iRgtWE7WNxyNytAAMZEVDXA1TWAx7QAborNhPngTnMW2zyInlNE2m5kFtGE 28rUxlB9JxhHPV5o7NWWaErCyYA6ZQ_.OHiHq6Q6IiDwJcTWwwWJRarCGy5y8VLnav2iP4cqLAkb 7MiRkJxkri.56BPxNyleSZpucB5dsahJ7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FQ_a4fFlfyMDcXwM1Wdi9h9kKPKt1j7W0EFs4vP5YamW1Cs4QJf7chKTDx iaIh17eguneIV3rUEWxP05oP_VX1zZJ8k4ku1BNTwe5yDp1B1Vq_YPilJMCDx.IlKHnjtYWWJSC_ rCYjUn4Bgs433Y_AJxFzF9r6kuOMjdUnhrlIQKzVcFQwu7aUdIKLnrdxFOyHIbT6hmNmHc.lZTm2 u5OsylnaUTidIL2_88mew0pCbV.G1TDkiJ6qFAdwfh2dsN0PGM9MXOb4H9y7RaiBZncWYEq6OF4y SGdREhllhbjr795.WE6gkjPoFzJlXikjxQs8.tgORiTCpmwfLtj5zZ9q.kcAMvvGGIQJt033.qmZ EyhwLQosavtEt_CM2ULZzJ0R_uecKXJd3FYRhQS4uSvMjnBzvpgEO.vDIW_5_s0atxIt8VuVHNzg TT.xUseeyax5yKWXEqKA110m0LxOp0qNtvKOYCdn5pkqUNx939atMDPUgCAjw2OW_XyvLkSd3He. 9SgLZPvwlOboR3app02mNQ3.IUSvVVaqXHwJVH3uQ_acHma4bN0.WvorHyeMrhfvAUxUrpCX65Ih o X-Sonic-MF: From: Chuck Zmudzinski To: qemu-devel@nongnu.org Cc: Stefano Stabellini , Anthony Perard , Paul Durrant , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Igor Mammedov , xen-devel@lists.xenproject.org, qemu-stable@nongnu.org Subject: [PATCH] xen/pt: fix igd passthrough for pc machine with xen accelerator Date: Tue, 7 Feb 2023 21:03:05 -0500 Message-Id: X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable References: Content-Length: 4261 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=98.137.65.31; envelope-from=brchuckz@aim.com; helo=sonic315-55.consmr.mail.gq1.yahoo.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @aol.com) X-ZM-MESSAGEID: 1675821884275100003 Content-Type: text/plain; charset="utf-8" Commit 998250e97661 ("xen, gfx passthrough: register host bridge specific to passthrough") uses the igd-passthrough-i440FX pci host device with the xenfv machine type and igd-passthru=3Don, but using it for the pc machine type, xen accelerator, and igd-passtru=3Don was omitted from that commit. The igd-passthru-i440FX pci host device is also needed for guests configured with the pc machine type, the xen accelerator, and igd-passthru=3Don. Specifically, tests show that not using the igd-specific pci host device with the Intel igd passed through to the guest results in slower startup performance and reduced resolution of the display during startup. This patch fixes this issue. To simplify the logic that is needed to support both the --enable-xen and the --disable-xen configure options, introduce the boolean symbol pc_xen_igd_gfx_pt_enabled() whose value is set appropriately in the sysemu/xen.h header file as the test to determine whether or not to use the igd-passthrough-i440FX pci host device instead of the normal i440FX pci host device. Fixes: 998250e97661 ("xen, gfx passthrough: register host bridge specific t= o passthrough") Signed-off-by: Chuck Zmudzinski Acked-by: Stefano Stabellini --- This patch is intended to replace or complement a recently proposed patch that modifies slot_reserved_mask for the xenfv machine with igd-passthru=3Don in order to fix the problem of Qemu not reserving slot 2 for the Intel IGD for the xenfv machine type. This patch provides a simple way to improve Qemu support for the Intel IGD with the xen accelerator without needing to change how slot_reserved_mask functions. For reference, the latest version of the patch to fix the xenfv machine using slot_reserved_mask is at: https://lore.kernel.org/qemu-devel/b1b4a21fe9a600b1322742dda55a40e9961daa57= .1674346505.git.brchuckz@aol.com/ Reason for introducing the new boolean pc_xen_igd_gfx_pt_enabled(): It is also possible to use xen_igd_gfx_pt_enabled() directly to check if the igd-passthru-i440FX pci host device is needed in this patch, but in that case it would be necessary to implement it in accel/stubs/xen-stub.c like this: bool xen_igd_gfx_pt_enabled(void) { return false; } to cover the case when Qemu is configured with --disable-xen. I thought it was simpler to introduce the same boolean prefixed with pc_ and set it to 0 when --disable-xen is the configure option, and that explains why the proposed patch introduces pc_xen_igd_gfx_pt_enabled() instead of using xen_igd_gfx_pt_enabled() directly. Another reason to use pc_xen_igd_gfx_pt_enabled() is to distinguish it from xen_igd_gfx_pt_enabled() in hw/i386/pc_piix.c, because the use of xen_igd_gfx_pt_enabled() is guarded by CONFIG_XEN but this patch needs to place the boolean in a position that is not guarded by CONFIG_XEN. This approach will simplify any future effort to move the code in pc_piix.c that is not guarded by CONFIG_XEN to a xen-specific file. hw/i386/pc_piix.c | 2 ++ include/sysemu/xen.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index df64dd8dcc..fd5b9ae1eb 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -433,6 +433,8 @@ static void pc_xen_hvm_init(MachineState *machine) compat(machine); \ } \ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ + pc_xen_igd_gfx_pt_enabled() ? \ + TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE : \ TYPE_I440FX_PCI_DEVICE); \ } \ DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn) diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h index 0ca25697e4..99ae41e619 100644 --- a/include/sysemu/xen.h +++ b/include/sysemu/xen.h @@ -23,6 +23,7 @@ extern bool xen_allowed; =20 #define xen_enabled() (xen_allowed) +#define pc_xen_igd_gfx_pt_enabled() xen_igd_gfx_pt_enabled() =20 #ifndef CONFIG_USER_ONLY void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length); @@ -33,6 +34,7 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, #else /* !CONFIG_XEN_IS_POSSIBLE */ =20 #define xen_enabled() 0 +#define pc_xen_igd_gfx_pt_enabled() 0 #ifndef CONFIG_USER_ONLY static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t le= ngth) { --=20 2.39.1