From nobody Fri Apr 4 03:29:52 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=1739813775; cv=none; d=zohomail.com; s=zohoarc; b=akbuHHYkFb9K6v3U4zYL8oGoXqePaaIqkEpXF/6Ugk5PiP/Fei388/aFXGgQLHlSeKVUUdyXqGVluBfkrA6ZpVYCXNlYQlL/hwtYe/i8NlSVSPraSMOGDfFunRGiJ1wq0GIkxRiXvx8JPOyhkAaPnDQsNjyzqO2bwKM2jJGpXPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739813775; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=K8BxtlK81ZNB9rUny3j/nBp+Y7FWYfYeQxJcPYtU2DE=; b=hZc7FB1kkDEhqd7ER85idZBVvAnZMvIksOUxSt+uC9Ynm5y/fQRi7Qib1bspy9u3nVlzVqKlKqKtTwHU6TRSfo66l15MT9vuaOdmaMvgNWIbqb6gL4fe7WzcMek8x0127WbwqN249cJhXA7x5ZAKPsjdFRtHy9wXLuqkTa0RWow= 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 1739813775869259.9780496658909; Mon, 17 Feb 2025 09:36:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tk51f-0000Fp-0P; Mon, 17 Feb 2025 12:35:23 -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 1tk51Z-0000EF-FL for qemu-devel@nongnu.org; Mon, 17 Feb 2025 12:35:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tk51W-0001Iq-65 for qemu-devel@nongnu.org; Mon, 17 Feb 2025 12:35:17 -0500 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-678-sQ201f0PNruBcE4VTIa6BA-1; Mon, 17 Feb 2025 12:35:05 -0500 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 3C730180087A; Mon, 17 Feb 2025 17:35:03 +0000 (UTC) Received: from corto.redhat.com (unknown [10.45.224.52]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 484711955BCB; Mon, 17 Feb 2025 17:34:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739813712; 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; bh=K8BxtlK81ZNB9rUny3j/nBp+Y7FWYfYeQxJcPYtU2DE=; b=BEGmA6j4hhYiq0YUQW9R5zbKWyAqOdY1yj4ufQty3Udh8hC4DHQdX8vKTOEMe18lNW6pEi kd6Zjunsz78DUv/5FvYEyGWz5Wmr9kNgcFJKIqKzgvnuyg/sUokLm/xfrUwfVNw1OPXaR6 gmdLiJfmPiYT5WbGK8UHaoFrv2qio+c= X-MC-Unique: sQ201f0PNruBcE4VTIa6BA-1 X-Mimecast-MFC-AGG-ID: sQ201f0PNruBcE4VTIa6BA_1739813704 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-devel@nongnu.org Cc: Alex Williamson , tomitamoeko@gmail.com, corvin.koehne@gmail.com, Kirti Wankhede , Joao Martins , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Tony Krowiak , Eric Farman , Eric Auger Subject: [PATCH v4] vfio: Add property documentation Date: Mon, 17 Feb 2025 18:34:55 +0100 Message-ID: <20250217173455.449983-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.0 on 10.30.177.12 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.133.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_H2=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: 1739813778387019000 Investigate the git history to uncover when and why the VFIO properties were introduced and update the models. This is mostly targeting vfio-pci device, since vfio-platform, vfio-ap and vfio-ccw devices are simpler. Sort the properties based on the QEMU version in which they were introduced. Cc: Tony Krowiak Cc: Eric Farman Cc: Eric Auger Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Alex Williamson Reviewed-by: Anthony Krowiak Reviewed-by: Eric Auger Reviewed-by: Eric Farman # vfio-ccw Reviewed-by: Kirti Wankhede --- Should we introduce documentation for properties like the kernel has in Documentation/ABI/*/sysfs-* ? Changes in v4: - Latest improvements from Alex=20 Changes in v3: - Re-organized the vfio-pci properties based on the QEMU version in which they were introduced - Added property labels - Improved description as suggested by Alex, Tomita and Corvin Changes in v2: - Fixed version numbers - Fixed #ifdef in vfio/ccw.c - Addressed vfio-pci-nohotplug - Organize the vfio-pci properties in topics hw/vfio/ap.c | 9 ++++ hw/vfio/ccw.c | 15 ++++++ hw/vfio/pci.c | 125 +++++++++++++++++++++++++++++++++++++++++++++ hw/vfio/platform.c | 24 +++++++++ 4 files changed, 173 insertions(+) diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c index 30b08ad375d5ecae886c5000fbaa364799fe76d0..c7ab4ff57ada0ed0e5a76f52b5a= 05c86ca4fe0b4 100644 --- a/hw/vfio/ap.c +++ b/hw/vfio/ap.c @@ -257,6 +257,15 @@ static void vfio_ap_class_init(ObjectClass *klass, voi= d *data) dc->hotpluggable =3D true; device_class_set_legacy_reset(dc, vfio_ap_reset); dc->bus_type =3D TYPE_AP_BUS; + + object_class_property_set_description(klass, /* 3.1 */ + "sysfsdev", + "Host sysfs path of assigned dev= ice"); +#ifdef CONFIG_IOMMUFD + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device= "); +#endif } =20 static const TypeInfo vfio_ap_info =3D { diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c index 6bb8882d3f2b965eb47cc9e65d7e74bbdb5e7685..e5e0d9e3e7ed124f242b3eda345= bc973e418a64c 100644 --- a/hw/vfio/ccw.c +++ b/hw/vfio/ccw.c @@ -709,6 +709,21 @@ static void vfio_ccw_class_init(ObjectClass *klass, vo= id *data) cdc->handle_halt =3D vfio_ccw_handle_halt; cdc->handle_clear =3D vfio_ccw_handle_clear; cdc->handle_store =3D vfio_ccw_handle_store; + + object_class_property_set_description(klass, /* 2.10 */ + "sysfsdev", + "Host sysfs path of assigned dev= ice"); + object_class_property_set_description(klass, /* 3.0 */ + "force-orb-pfch", + "Force unlimited prefetch"); +#ifdef CONFIG_IOMMUFD + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device= "); +#endif + object_class_property_set_description(klass, /* 9.2 */ + "loadparm", + "Define which devices that can b= e used for booting"); } =20 static const TypeInfo vfio_ccw_info =3D { diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 89d900e9cf0ce364f7c813d81b0317bb3b3e80ca..4f92b50b133060c9199079a0ab6= 20793ecdac0ee 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3433,6 +3433,122 @@ static void vfio_pci_dev_class_init(ObjectClass *kl= ass, void *data) pdc->exit =3D vfio_exitfn; pdc->config_read =3D vfio_pci_read_config; pdc->config_write =3D vfio_pci_write_config; + + object_class_property_set_description(klass, /* 1.3 */ + "host", + "Host PCI address [domain:] of assigned device"); + object_class_property_set_description(klass, /* 1.3 */ + "x-intx-mmap-timeout-ms", + "When EOI is not provided by KVM= /QEMU, wait time " + "(milliseconds) to re-enable dev= ice direct access " + "after INTx (DEBUG)"); + object_class_property_set_description(klass, /* 1.5 */ + "x-vga", + "Expose VGA address spaces for d= evice"); + object_class_property_set_description(klass, /* 2.3 */ + "x-req", + "Disable device request notifica= tion support (DEBUG)"); + object_class_property_set_description(klass, /* 2.4 and 2.5 */ + "x-no-mmap", + "Disable MMAP for device. Allows= to trace MMIO " + "accesses (DEBUG)"); + object_class_property_set_description(klass, /* 2.5 */ + "x-no-kvm-intx", + "Disable direct VFIO->KVM INTx i= njection. Allows to " + "trace INTx interrupts (DEBUG)"); + object_class_property_set_description(klass, /* 2.5 */ + "x-no-kvm-msi", + "Disable direct VFIO->KVM MSI in= jection. Allows to " + "trace MSI interrupts (DEBUG)"); + object_class_property_set_description(klass, /* 2.5 */ + "x-no-kvm-msix", + "Disable direct VFIO->KVM MSIx i= njection. Allows to " + "trace MSIx interrupts (DEBUG)"); + object_class_property_set_description(klass, /* 2.5 */ + "x-pci-vendor-id", + "Override PCI Vendor ID with pro= vided value (DEBUG)"); + object_class_property_set_description(klass, /* 2.5 */ + "x-pci-device-id", + "Override PCI device ID with pro= vided value (DEBUG)"); + object_class_property_set_description(klass, /* 2.5 */ + "x-pci-sub-vendor-id", + "Override PCI Subsystem Vendor I= D with provided value " + "(DEBUG)"); + object_class_property_set_description(klass, /* 2.5 */ + "x-pci-sub-device-id", + "Override PCI Subsystem Device I= D with provided value " + "(DEBUG)"); + object_class_property_set_description(klass, /* 2.6 */ + "sysfsdev", + "Host sysfs path of assigned dev= ice"); + object_class_property_set_description(klass, /* 2.7 */ + "x-igd-opregion", + "Expose host IGD OpRegion to gue= st"); + object_class_property_set_description(klass, /* 2.7 (See c4c45e943e51)= */ + "x-igd-gms", + "Override IGD data stolen memory= size (32MiB units)"); + object_class_property_set_description(klass, /* 2.11 */ + "x-nv-gpudirect-clique", + "Add NVIDIA GPUDirect capability= indicating P2P DMA " + "clique for device [0-15]"); + object_class_property_set_description(klass, /* 2.12 */ + "x-no-geforce-quirks", + "Disable GeForce quirks (for NVI= DIA Quadro/GRID/Tesla). " + "Improves performance"); + object_class_property_set_description(klass, /* 2.12 */ + "display", + "Enable display support for devi= ce, ex. vGPU"); + object_class_property_set_description(klass, /* 2.12 */ + "x-msix-relocation", + "Specify MSI-X MMIO relocation t= o the end of specified " + "existing BAR or new BAR to avoi= d virtualization overhead " + "due to adjacent device register= s"); + object_class_property_set_description(klass, /* 3.0 */ + "x-no-kvm-ioeventfd", + "Disable registration of ioevent= fds with KVM (DEBUG)"); + object_class_property_set_description(klass, /* 3.0 */ + "x-no-vfio-ioeventfd", + "Disable linking of KVM ioeventf= ds to VFIO ioeventfds " + "(DEBUG)"); + object_class_property_set_description(klass, /* 3.1 */ + "x-balloon-allowed", + "Override allowing ballooning wi= th device (DEBUG, DANGER)"); + object_class_property_set_description(klass, /* 3.2 */ + "xres", + "Set X display resolution the vG= PU should use"); + object_class_property_set_description(klass, /* 3.2 */ + "yres", + "Set Y display resolution the vG= PU should use"); + object_class_property_set_description(klass, /* 5.2 */ + "x-pre-copy-dirty-page-tracking", + "Disable dirty pages tracking du= ring iterative phase " + "(DEBUG)"); + object_class_property_set_description(klass, /* 5.2, 8.0 non-experimet= al */ + "enable-migration", + "Enale device migration. Also re= quires a host VFIO PCI " + "variant or mdev driver with mig= ration support enabled"); + object_class_property_set_description(klass, /* 8.1 */ + "vf-token", + "Specify UUID VF token. Required= for VF when PF is owned " + "by another VFIO driver"); +#ifdef CONFIG_IOMMUFD + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device= "); +#endif + object_class_property_set_description(klass, /* 9.1 */ + "x-device-dirty-page-tracking", + "Disable device dirty page track= ing and use " + "container-based dirty page trac= king (DEBUG)"); + object_class_property_set_description(klass, /* 9.1 */ + "migration-events", + "Emit VFIO migration QAPI event = when a VFIO device " + "changes its migration state. Fo= r management applications"); + object_class_property_set_description(klass, /* 9.1 */ + "skip-vsc-check", + "Skip config space check for Ven= dor Specific Capability. " + "Setting to false will enforce s= trict checking of VSC content " + "(DEBUG)"); } =20 static const TypeInfo vfio_pci_dev_info =3D { @@ -3461,6 +3577,15 @@ static void vfio_pci_nohotplug_dev_class_init(Object= Class *klass, void *data) =20 device_class_set_props(dc, vfio_pci_dev_nohotplug_properties); dc->hotpluggable =3D false; + + object_class_property_set_description(klass, /* 3.1 */ + "ramfb", + "Enable ramfb to provide pre-boo= t graphics for devices " + "enabling display option"); + object_class_property_set_description(klass, /* 8.2 */ + "x-ramfb-migrate", + "Override default migration supp= ort for ramfb support " + "(DEBUG)"); } =20 static const TypeInfo vfio_pci_nohotplug_dev_info =3D { diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c index f491f4dc9543c2ea3a7af4e51ee82fbc7ee6e4bb..d9faaa73959ad36aa3a835b8796= 4ab940928bd9f 100644 --- a/hw/vfio/platform.c +++ b/hw/vfio/platform.c @@ -672,6 +672,30 @@ static void vfio_platform_class_init(ObjectClass *klas= s, void *data) dc->desc =3D "VFIO-based platform device assignment"; sbc->connect_irq_notifier =3D vfio_start_irqfd_injection; set_bit(DEVICE_CATEGORY_MISC, dc->categories); + + object_class_property_set_description(klass, /* 2.4 */ + "host", + "Host device name of assigned de= vice"); + object_class_property_set_description(klass, /* 2.4 and 2.5 */ + "x-no-mmap", + "Disable MMAP for device. Allows= to trace MMIO " + "accesses (DEBUG)"); + object_class_property_set_description(klass, /* 2.4 */ + "mmap-timeout-ms", + "When EOI is not provided by KVM= /QEMU, wait time " + "(milliseconds) to re-enable dev= ice direct access " + "after level interrupt (DEBUG)"); + object_class_property_set_description(klass, /* 2.4 */ + "x-irqfd", + "Allow disabling irqfd support (= DEBUG)"); + object_class_property_set_description(klass, /* 2.6 */ + "sysfsdev", + "Host sysfs path of assigned dev= ice"); +#ifdef CONFIG_IOMMUFD + object_class_property_set_description(klass, /* 9.0 */ + "iommufd", + "Set host IOMMUFD backend device= "); +#endif } =20 static const TypeInfo vfio_platform_dev_info =3D { --=20 2.48.1