)]}'
{"doc/source/contributor/pci-sim/developer-guide.rst":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"5a00142de58a303c183d7895c7e05cd1b671da7f","unresolved":false,"context_lines":[{"line_number":416,"context_line":""},{"line_number":417,"context_line":".. code-block:: make"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"   obj-m +\u003d fake_pci_sriov.o"},{"line_number":420,"context_line":"   fake_pci_sriov-y :\u003d \\"},{"line_number":421,"context_line":"       fake_pci_sriov_core.o \\"},{"line_number":422,"context_line":"       fake_pci_sriov_cfg.o \\"}],"source_content_type":"text/x-rst","patch_set":1,"id":"568e4f52_572c2767","line":419,"updated":"2026-07-13 14:55:26.000000000","message":"The Makefile code example in the developer guide does not include fake_pci_sriov_mdev.o, which was added to the actual Makefile in this patch.\n\n**Severity**: SUGGESTION | **Confidence**: 0.9\n\n**Benefit**: A contributor reading the developer guide sees an incomplete Makefile example that does not match the actual file, causing confusion about the module\u0027s source file composition.\n\n**Recommendation**:\nAdd fake_pci_sriov_mdev.o to the fake_pci_sriov-y assignment in the code example to match the actual Makefile.","commit_id":"ddde7c49e26a9bd059fcb0ec3b933ebf75c2146b"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"5a00142de58a303c183d7895c7e05cd1b671da7f","unresolved":false,"context_lines":[{"line_number":640,"context_line":"-----------------"},{"line_number":641,"context_line":""},{"line_number":642,"context_line":"The init path is ordered so that dependencies exist before devices appear:"},{"line_number":643,"context_line":""},{"line_number":644,"context_line":"#. Validate module parameters such as ``num_pfs``."},{"line_number":645,"context_line":"#. Register the fake IOMMU platform device."},{"line_number":646,"context_line":"#. Add the IOMMU sysfs object and register ``fake_iommu_ops``."}],"source_content_type":"text/x-rst","patch_set":1,"id":"0a41f78e_bf0957fa","line":643,"updated":"2026-07-13 14:55:26.000000000","message":"The Module load order and Module unload order sections in the developer guide do not mention the mdev parent registration and unregistration steps that were added to the init and exit code in this patch.\n\n**Severity**: SUGGESTION | **Confidence**: 0.9\n\n**Benefit**: A contributor extending the module init path would not know about the mdev registration step and could add new init steps in the wrong position relative to mdev parent registration, breaking the mdev lifecycle.\n\n**Recommendation**:\nAdd a step after pci_host_probe in the load order for conditional mdev driver and parent registration when enable_mdev\u003d1. Add a step before host bridge removal in the unload order for mdev parent and driver unregistration.","commit_id":"ddde7c49e26a9bd059fcb0ec3b933ebf75c2146b"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"049fe5aafad3575fbf740adf8e8146c2869731bc","unresolved":false,"context_lines":[{"line_number":933,"context_line":"host bridges are torn down, following the reverse-init-order"},{"line_number":934,"context_line":"convention used throughout the module."},{"line_number":935,"context_line":""},{"line_number":936,"context_line":"The mdev support is independent of SR-IOV VF creation.  Both"},{"line_number":937,"context_line":"can be active simultaneously on the same PF: VFs exercise the"},{"line_number":938,"context_line":"SR-IOV and VFIO passthrough path, while mdev types exercise"},{"line_number":939,"context_line":"the mediated device path that Cyborg\u0027s ``GenericMdevDriver``"}],"source_content_type":"text/x-rst","patch_set":9,"id":"13d9fe5e_542d6278","line":936,"updated":"2026-07-23 10:26:22.000000000","message":"The developer guide states that mdev support and SR-IOV VF creation can be active simultaneously on the same PF. This directly contradicts the code: the pf_mode parameter assigns exactly one mode per PF, and fake_pci_sriov_configure() returns -ENODEV for mdev-mode PFs.\n\n**Severity**: WARNING | **Confidence**: 0.9\n\n**Impact**: A contributor reading the guide may incorrectly assume that SR-IOV VFs and mdev types can coexist on the same PF, leading to confusion during testing or future development. The statement also contradicts other parts of the same document.\n\n**Suggestion**:\nRewrite to clarify that SR-IOV and mdev modes are mutually exclusive per PF but can coexist on different PFs in the same module load. For example: \u0027The mdev support is independent of SR-IOV VF creation at the module level. Both paths can be active in the same module load by assigning different PFs to each mode. However, a single PF operates in either sriov or mdev mode, not both.\u0027","commit_id":"1f650cd6f2985db24298159eafe0748ed021a9e9"}],"pci-sim/fake_pci_sriov_core.c":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"dcdcf2840e7a39bb1f090bb61aecde674c54479a","unresolved":false,"context_lines":[{"line_number":15,"context_line":"bool enable_mdev;"},{"line_number":16,"context_line":"module_param(enable_mdev, bool, 0444);"},{"line_number":17,"context_line":"MODULE_PARM_DESC(enable_mdev,"},{"line_number":18,"context_line":"\t\t \"Register each PF as an mdev parent (requires CONFIG_VFIO_MDEV)\");"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"unsigned int mdev_instances \u003d 8;"},{"line_number":21,"context_line":"module_param(mdev_instances, uint, 0444);"}],"source_content_type":"text/x-csrc","patch_set":5,"id":"f0ddd22b_b5654d18","line":18,"updated":"2026-07-20 11:46:01.000000000","message":"The enable_mdev module parameter description, the #else error message in fake_pci_sriov_init, and the smoke test script comments all reference CONFIG_VFIO_MDEV, which was removed from the Linux kernel in v6.0 when the mdev framework was merged into VFIO core. The actual compile-time gate (PCI_SIM...\n\n**Severity**: SUGGESTION | **Confidence**: 0.8\n\n**Benefit**: Users or CI engineers reading the parameter description will search for CONFIG_VFIO_MDEV in their kernel config and not find it, causing confusion about whether mdev support is properly enabled. The error message in the #else branch similarly references a non-existent option.\n\n**Recommendation**:\nReplace \u0027CONFIG_VFIO_MDEV\u0027 with \u0027CONFIG_VFIO\u0027 in the MODULE_PARM_DESC string, the pr_err in the #else branch of fake_pci_sriov_init, and the smoke test script header comments to match the actual compile-time gate in fake_pci_sriov_compat.h.","commit_id":"f41811da1781a9d0e8ea0a082b25ae090960a78b"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"8e2d1ca17d6461de492f4f1c9482427b378be622","unresolved":false,"context_lines":[{"line_number":15,"context_line":"bool enable_mdev;"},{"line_number":16,"context_line":"module_param(enable_mdev, bool, 0444);"},{"line_number":17,"context_line":"MODULE_PARM_DESC(enable_mdev,"},{"line_number":18,"context_line":"\t\t \"Register each PF as an mdev parent (requires CONFIG_VFIO_MDEV)\");"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"unsigned int mdev_instances \u003d 8;"},{"line_number":21,"context_line":"module_param(mdev_instances, uint, 0444);"}],"source_content_type":"text/x-csrc","patch_set":6,"id":"247d0591_11217e92","line":18,"updated":"2026-07-20 14:31:17.000000000","message":"The MODULE_PARM_DESC for enable_mdev says \u0027requires CONFIG_VFIO_MDEV\u0027 and the #else error message says \u0027CONFIG_VFIO_MDEV is not available\u0027, but the actual compile-time gate (PCI_SIM_HAS_MDEV in fake_pci_sriov_compat.h) uses IS_ENABLED(CONFIG_VFIO), not CONFIG_VFIO_MDEV. CONFIG_VFIO_MDEV was effec...\n\n**Severity**: SUGGESTION | **Confidence**: 0.8\n\n**Benefit**: A user or developer who sees the error \u0027CONFIG_VFIO_MDEV is not available\u0027 will look for that specific kernel option and may not find it, since on 5.16+ kernels the mdev framework is part of CONFIG_VFIO. This wastes debugging time and could lead to incorrect conclusions about why enable_mdev is f...\n\n**Recommendation**:\nUpdate both the MODULE_PARM_DESC and the pr_err message to reference CONFIG_VFIO instead of CONFIG_VFIO_MDEV. For example: \u0027Register each PF as an mdev parent (requires CONFIG_VFIO)\u0027 and \u0027enable_mdev\u003d1 but CONFIG_VFIO is not available\u0027.","commit_id":"0dd49f4654e165be7a6d6ec775288c0a0fd42aee"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"193c458e66f8448f0387342d1d8a2d0f85a3c163","unresolved":false,"context_lines":[{"line_number":15,"context_line":"bool enable_mdev;"},{"line_number":16,"context_line":"module_param(enable_mdev, bool, 0444);"},{"line_number":17,"context_line":"MODULE_PARM_DESC(enable_mdev,"},{"line_number":18,"context_line":"\t\t \"Register each PF as an mdev parent (requires CONFIG_VFIO_MDEV)\");"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"unsigned int mdev_instances \u003d 8;"},{"line_number":21,"context_line":"module_param(mdev_instances, uint, 0444);"}],"source_content_type":"text/x-csrc","patch_set":7,"id":"7b6cab87_dcace710","line":18,"updated":"2026-07-22 13:21:37.000000000","message":"The MODULE_PARM_DESC for enable_mdev says \u0027requires CONFIG_VFIO_MDEV\u0027 and the runtime error message says \u0027CONFIG_VFIO_MDEV is not available\u0027, but the actual compile-time gate in fake_pci_sriov_compat.h checks IS_ENABLED(CONFIG_VFIO). CONFIG_VFIO_MDEV was the old separate Kconfig symbol; in modern...\n\n**Severity**: SUGGESTION | **Confidence**: 0.9\n\n**Benefit**: A developer or user who sees the parameter description or error message may waste time looking for CONFIG_VFIO_MDEV in their kernel config, when the actual gate is CONFIG_VFIO. On modern kernels CONFIG_VFIO_MDEV no longer exists as a separate option, making the message actively misleading.\n\n**Recommendation**:\nUpdate the MODULE_PARM_DESC text and the pr_err message to reference CONFIG_VFIO instead of CONFIG_VFIO_MDEV, matching the actual compile-time gate in fake_pci_sriov_compat.h.","commit_id":"2e2886de48b9ff7e770e3f05774ce6d08a0364ee"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"fa8834ef09b24b012bd8f943ed4ffd738adcc21b","unresolved":false,"context_lines":[{"line_number":15,"context_line":"bool enable_mdev;"},{"line_number":16,"context_line":"module_param(enable_mdev, bool, 0444);"},{"line_number":17,"context_line":"MODULE_PARM_DESC(enable_mdev,"},{"line_number":18,"context_line":"\t\t \"Register each PF as an mdev parent (requires CONFIG_VFIO_MDEV)\");"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"unsigned int mdev_instances \u003d 8;"},{"line_number":21,"context_line":"module_param(mdev_instances, uint, 0444);"}],"source_content_type":"text/x-csrc","patch_set":8,"id":"8f37068a_6c3e63ff","line":18,"updated":"2026-07-22 16:25:01.000000000","message":"The MODULE_PARM_DESC for enable_mdev and the runtime error message both reference CONFIG_VFIO_MDEV, but the actual compile-time gate in fake_pci_sriov_compat.h checks IS_ENABLED(CONFIG_VFIO). CONFIG_VFIO_MDEV was merged into VFIO core in modern kernels and no longer exists as a separate Kconfig o...\n\n**Severity**: WARNING | **Confidence**: 0.9\n\n**Impact**: A user who reads the parameter description and tries to enable CONFIG_VFIO_MDEV on a modern kernel will be confused because that option no longer exists. The actual requirement is CONFIG_VFIO, which is already transitively satisfied by VFIO_PCI_CORE in Kconfig.\n\n**Suggestion**:\nUpdate both the MODULE_PARM_DESC at line 18 and the pr_err at line 410 to reference CONFIG_VFIO instead of CONFIG_VFIO_MDEV, matching the actual compile-time gate in fake_pci_sriov_compat.h.","commit_id":"6bdbcea246ba14c18c22c9051adcf76e4b5daad8"},{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"049fe5aafad3575fbf740adf8e8146c2869731bc","unresolved":false,"context_lines":[{"line_number":460,"context_line":"\t\t\t}"},{"line_number":461,"context_line":"\t\t}"},{"line_number":462,"context_line":"#else"},{"line_number":463,"context_line":"\t\tpr_err(\"fake_pci: pf_mode\u003dmdev but CONFIG_VFIO_MDEV is not available\\n\");"},{"line_number":464,"context_line":"\t\terr \u003d -ENODEV;"},{"line_number":465,"context_line":"\t\tgoto err_hosts;"},{"line_number":466,"context_line":"#endif"}],"source_content_type":"text/x-csrc","patch_set":9,"id":"ffa415e7_5997be8c","line":463,"updated":"2026-07-23 10:26:22.000000000","message":"The error message printed when pf_mode\u003dmdev is requested but the mdev framework is unavailable says \u0027CONFIG_VFIO_MDEV is not available\u0027. However, the actual compile-time gate in fake_pci_sriov_compat.h checks IS_ENABLED(CONFIG_VFIO), not CONFIG_VFIO_MDEV.\n\n**Severity**: SUGGESTION | **Confidence**: 0.9\n\n**Benefit**: A developer who sees this error and tries to enable CONFIG_VFIO_MDEV will find no such option in modern kernels (the mdev framework was merged into VFIO core). They should be told to enable CONFIG_VFIO instead.\n\n**Recommendation**:\nChange the error message to: \u0027fake_pci: pf_mode\u003dmdev but CONFIG_VFIO is not available\u0027 to match the actual compile-time gate.","commit_id":"1f650cd6f2985db24298159eafe0748ed021a9e9"}],"pci-sim/fake_pci_sriov_mdev.c":[{"author":{"_account_id":28006,"name":"teim-ci","display_name":"teim-ci","email":"ci@seanmooney.info","username":"ci-sean-mooney","status":"this is a third-party ci account run by sean-k-mooney on irc\nhosted at zuul.teim.app"},"tag":"autogenerated:zuul:automatic-ci","change_message_id":"5a00142de58a303c183d7895c7e05cd1b671da7f","unresolved":false,"context_lines":[{"line_number":405,"context_line":"\tmp \u003d container_of(type-\u003eparent, struct pci_sim_mdev_parent, parent);"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"\tvfio_unregister_group_dev(\u0026state-\u003evdev);"},{"line_number":408,"context_line":"\tvfio_put_device(\u0026state-\u003evdev);"},{"line_number":409,"context_line":"\tatomic_inc(\u0026mp-\u003eavail[state-\u003etype_idx]);"},{"line_number":410,"context_line":"\tdev_info(\u0026mdev-\u003edev, \"mdev instance removed (type %d)\\n\","},{"line_number":411,"context_line":"\t\t state-\u003etype_idx);"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"da6c5b62_5e4422f7","line":408,"updated":"2026-07-13 14:55:26.000000000","message":"In pci_sim_mdev_remove, vfio_put_device drops the initial reference acquired by vfio_alloc_device. When the refcount reaches zero, the VFIO core calls release_dev and then frees the containing pci_sim_mdev_state struct. The code then accesses state-\u003etype_idx for atomic_inc and dev_info, which is...\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: Accessing freed memory causes undefined behavior including potential kernel crashes or data corruption. In practice the type_idx value may remain readable from freed slab memory, masking the bug, but this is not guaranteed across kernel versions or configurations.\n\n**Priority**: Before merge\n**Why This Matters**: Accessing freed memory causes undefined behavior including potential kernel crashes or data corruption. In practice the type_idx value may remain readable from freed slab memory, masking the bug, but this is not guaranteed across kernel versions or configurations.\n\n**Recommendation**:\nSave type_idx to a local variable before calling vfio_put_device. For example: int type_idx \u003d state-\u003etype_idx; vfio_unregister_group_dev(\u0026state-\u003evdev); vfio_put_device(\u0026state-\u003evdev); atomic_inc(\u0026mp-\u003eavail[type_idx]); dev_info(\u0026mdev-\u003edev, \"mdev instance removed (type %d)\\n\", type_idx);","commit_id":"ddde7c49e26a9bd059fcb0ec3b933ebf75c2146b"}]}
