From nobody Fri Apr 4 03:43:02 2025 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=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1741717192; cv=none; d=zohomail.com; s=zohoarc; b=ScBHV1KgV6QOxvggh185XkB25kKqLb4PXjA8Jsnp+BQ4fn11KuRrtTzLxSaDXzi5s1r5Sqgh0EQ3vqxDngQt03n9lajzxs2FrDiHFX1Nu2bsxKm9pQYfRotM+rD2WFUJrrX68qbgUKLVPpDshZ6cVuX1LClbZTV/UtF5Na8JMmg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741717192; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7Mvk7qi+1MfRSVciOay3HBXxKeJIBtr9pVETo1LgVJ8=; b=Mb4WDDO/X1ymMd73jwIXKwTDXlopO8xUh/B5kdp7SERzL1iysOG3CMwXk88Y3jdP/7OvfsPEV6/EyNBx2cWh3GCvOKjHN6LupOlPWxnrXp7fZrTt/+o/r39o9VWLuBIlcIP2xqx6phk/tobk7Z0KA+/N9oKtWTV9RRKYvam7/cg= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741717192246243.97624844560403; Tue, 11 Mar 2025 11:19:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ts486-0007mG-6t; Tue, 11 Mar 2025 14:15:02 -0400 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 1ts47V-00079R-Am for qemu-devel@nongnu.org; Tue, 11 Mar 2025 14:14:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ts47L-0006iU-Tc for qemu-devel@nongnu.org; Tue, 11 Mar 2025 14:14:25 -0400 Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-155-TI-gP8SfMSmlAlX-XV8lww-1; Tue, 11 Mar 2025 14:13:57 -0400 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 443FF1800259; Tue, 11 Mar 2025 18:13:56 +0000 (UTC) Received: from corto.redhat.com (unknown [10.44.32.116]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 6844318001E9; Tue, 11 Mar 2025 18:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741716840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Mvk7qi+1MfRSVciOay3HBXxKeJIBtr9pVETo1LgVJ8=; b=DrRN1fPrfjJyM1QpElfJMrGF9bazj4LCE6+2ZkROhsIIGQctWupfvrgCJro1VoKJIrDmG/ LpijYJ0bMrCri7g4181uXAZ6fskEK7AfbYBUQnaAxv1uvsrIEYyb9dIJ0hEWP5JkxkfccW XoiH147IVv/KVJYZk7JfYiRU6HSjnXc= X-MC-Unique: TI-gP8SfMSmlAlX-XV8lww-1 X-Mimecast-MFC-AGG-ID: TI-gP8SfMSmlAlX-XV8lww_1741716836 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , Tomita Moeko , =?UTF-8?q?Corvin=20K=C3=B6hne?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Subject: [PULL 09/21] vfio/igd: Introduce x-igd-lpc option for LPC bridge ID quirk Date: Tue, 11 Mar 2025 19:13:16 +0100 Message-ID: <20250311181328.1200431-10-clg@redhat.com> In-Reply-To: <20250311181328.1200431-1-clg@redhat.com> References: <20250311181328.1200431-1-clg@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 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=170.10.129.124; envelope-from=clg@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham 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 @redhat.com) X-ZM-MESSAGEID: 1741717194141019000 From: Tomita Moeko The LPC bridge/Host bridge IDs quirk is also not dependent on legacy mode. Recent Windows driver no longer depends on these IDs, as well as Linux i915 driver, while UEFI GOP seems still needs them. Make it an option to allow users enabling and disabling it as needed. Signed-off-by: Tomita Moeko Reviewed-by: Alex Williamson Tested-by: Alex Williamson Reviewed-by: Corvin K=C3=B6hne Link: https://lore.kernel.org/qemu-devel/20250306180131.32970-10-tomitamoek= o@gmail.com [ clg: - Fixed spelling in vfio_probe_igd_config_quirk() ] Signed-off-by: C=C3=A9dric Le Goater --- hw/vfio/pci.h | 3 +++ hw/vfio/igd.c | 14 ++++++++------ hw/vfio/pci.c | 2 ++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h index 816bdbf844dc17e7cbac9a6f42daf9a448ab9cc0..d94ecaba689c4681687c0a6796f= fbcda522ae179 100644 --- a/hw/vfio/pci.h +++ b/hw/vfio/pci.h @@ -154,6 +154,9 @@ struct VFIOPCIDevice { #define VFIO_FEATURE_ENABLE_IGD_OPREGION_BIT 2 #define VFIO_FEATURE_ENABLE_IGD_OPREGION \ (1 << VFIO_FEATURE_ENABLE_IGD_OPREGION_BIT) +#define VFIO_FEATURE_ENABLE_IGD_LPC_BIT 3 +#define VFIO_FEATURE_ENABLE_IGD_LPC \ + (1 << VFIO_FEATURE_ENABLE_IGD_LPC_BIT) OnOffAuto display; uint32_t display_xres; uint32_t display_yres; diff --git a/hw/vfio/igd.c b/hw/vfio/igd.c index 12e07517b4a09ef87791acc09f6a6120abf17ae5..8a88dbab13ede764d0610a04313= 2a3acfe208134 100644 --- a/hw/vfio/igd.c +++ b/hw/vfio/igd.c @@ -560,13 +560,9 @@ bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, = Error **errp) goto error; } =20 - /* Enable OpRegion quirk */ + /* Enable OpRegion and LPC bridge quirk */ vdev->features |=3D VFIO_FEATURE_ENABLE_IGD_OPREGION; - - /* Setup LPC bridge / Host bridge PCI IDs */ - if (!vfio_pci_igd_setup_lpc_bridge(vdev, &err)) { - goto error; - } + vdev->features |=3D VFIO_FEATURE_ENABLE_IGD_LPC; } else if (vdev->igd_legacy_mode =3D=3D ON_OFF_AUTO_ON) { error_setg(&err, "Machine is not i440fx or assigned BDF is not 00:02.0"); @@ -579,6 +575,12 @@ bool vfio_probe_igd_config_quirk(VFIOPCIDevice *vdev, = Error **errp) goto error; } =20 + /* Setup LPC bridge / Host bridge PCI IDs */ + if ((vdev->features & VFIO_FEATURE_ENABLE_IGD_LPC) && + !vfio_pci_igd_setup_lpc_bridge(vdev, errp)) { + goto error; + } + /* * Allow user to override dsm size using x-igd-gms option, in multiple= s of * 32MiB. This option should only be used when the desired size cannot= be diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index e2897bdcd58d092d64689b5921a34c133139b56d..3cb7806f2f219174ffb7d28595e= 9430b41ee40ae 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3360,6 +3360,8 @@ static const Property vfio_pci_dev_properties[] =3D { VFIO_FEATURE_ENABLE_REQ_BIT, true), DEFINE_PROP_BIT("x-igd-opregion", VFIOPCIDevice, features, VFIO_FEATURE_ENABLE_IGD_OPREGION_BIT, false), + DEFINE_PROP_BIT("x-igd-lpc", VFIOPCIDevice, features, + VFIO_FEATURE_ENABLE_IGD_LPC_BIT, false), DEFINE_PROP_ON_OFF_AUTO("x-igd-legacy-mode", VFIOPCIDevice, igd_legacy_mode, ON_OFF_AUTO_AUTO), DEFINE_PROP_ON_OFF_AUTO("enable-migration", VFIOPCIDevice, --=20 2.48.1