)]}'
{"/COMMIT_MSG":[{"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":"91ad9cbf12a54e23b2965ecf58c3060e80ec70d6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     77bb8f79 (Add per-PF vf_personality sysfs interface)"},{"line_number":2,"context_line":"Author:     jgilaber \u003cjgilaber@redhat.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2026-07-10 14:25:57 +0200"},{"line_number":4,"context_line":"Commit:     jgilaber \u003cjgilaber@redhat.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"b10b8b9c_1ab74697","line":1,"updated":"2026-08-31 13:49:48.000000000","message":"The commit message states: \u0027The store holds host-\u003elock across the transition, which is safe because mdev registration locks do not overlap with pci-sim internal locks.\u0027 The implemented vf_personality_store does mutex_unlock(\u0026host-\u003elock) at line 577 before calling pci_sim_mdev_unregister_parent/register_parent, and assigns host-\u003epersonality outside the lock. The permanent change history therefore records a locking design the code does not implement.\n\n**Severity**: WARNING | **Confidence**: 0.9\n\n**Impact**: Future maintainers and reviewers auditing locking from the history will assume the transition is serialized and may build or review on that assumption; the mismatch also obscures the real race described in CF-001.\n\n**Suggestion**:\nEither hold host-\u003elock across the transition as the message describes, or amend the message to state that the lock is dropped before mdev parent (un)registration and explain why that window is safe.","commit_id":"bdeed0f32da589fc26529eaa4188667a6ad3b4d1"},{"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":"1b412d1c0901533b8e46770ae0f9bbfa82cb00e6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     7b252a2e (Add per-PF vf_personality sysfs interface)"},{"line_number":2,"context_line":"Author:     jgilaber \u003cjgilaber@redhat.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2026-07-10 14:25:57 +0200"},{"line_number":4,"context_line":"Commit:     jgilaber \u003cjgilaber@redhat.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"75243886_2adbdb94","line":1,"updated":"2026-08-31 16:20:38.000000000","message":"The commit message states: \u0027The store holds host-\u003elock across the transition, which is safe because mdev registration locks do not overlap with pci-sim internal locks.\u0027 The implementation does the opposite: vf_personality_store explicitly calls mutex_unlock(\u0026host-\u003elock) at fake_pci_sriov_cfg.c:577 before it unregisters/registers the mdev parent and before it updates host-\u003epersonality. The permanent change history documents a locking guarantee the code does not provide.\n\n**Severity**: WARNING | **Confidence**: 0.95\n\n**Impact**: Reviewers and future maintainers rely on the commit message for the locking contract of vf_personality_store. A reader who trusts it will assume the personality/mdev-parent transition is serialized and will not audit concurrent vf_personality writes, hiding the race in CF-001 and making later refactors of host-\u003elock unsafe.\n\n**Suggestion**:\nFix the locking to match the message (preferred, see CF-001), or if the unlocked transition is intentional, reword the commit message before merge to state that mdev parent registration runs after host-\u003elock is released and explain what serializes the transition.","commit_id":"d3a5cc160c4ec417ee901fba3ef8be0e45c12407"},{"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":"a885534bd793f2fbc8aee58ddf1cb4f852139f1c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     f2ef0994 (Add per-PF vf_personality sysfs interface)"},{"line_number":2,"context_line":"Author:     jgilaber \u003cjgilaber@redhat.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2026-07-10 14:25:57 +0200"},{"line_number":4,"context_line":"Commit:     jgilaber \u003cjgilaber@redhat.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"86707282_347cb331","line":1,"updated":"2026-09-01 11:03:56.000000000","message":"The commit message states: \u0027The store holds host-\u003elock across the transition, which is safe because mdev registration locks do not overlap with pci-sim internal locks.\u0027 The implementation does the opposite: mutex_unlock(\u0026host-\u003elock) precedes the mdev parent unregister/register calls and the personality assignment, so the entire transition runs unlocked.\n\n**Severity**: WARNING | **Confidence**: 0.9\n\n**Impact**: The permanent change history documents a locking guarantee the code does not provide, misleading future maintainers who rely on it when reasoning about the sriov_configure/vf_personality_store concurrency contract; it also masks the related code defect.\n\n**Suggestion**:\nPreferably fix the code to actually hold host-\u003elock across the transition (matching the message and resolving the related finding); otherwise correct the message wording before merge so it accurately describes the implemented locking.","commit_id":"d27b90ab45d8cdf1159514702ff002225091526f"},{"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":"a22e3f2019eb183a5d062eda6ef2055d5ed3057b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     badca235 (Add per-PF vf_personality sysfs interface)"},{"line_number":2,"context_line":"Author:     jgilaber \u003cjgilaber@redhat.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2026-07-10 14:25:57 +0200"},{"line_number":4,"context_line":"Commit:     jgilaber \u003cjgilaber@redhat.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"8eff4d2b_fc46f592","line":1,"updated":"2026-09-18 15:35:33.000000000","message":"The commit message states \u0027The store holds host-\u003elock across the transition, which is safe because mdev registration locks do not overlap with pci-sim internal locks.\u0027 The implementation actually releases host-\u003elock before the parent unregister/register calls and writes host-\u003epersonality after unlocking, so the permanent change history describes a locking design the code does not implement.\n\n**Severity**: WARNING | **Confidence**: 0.95\n\n**Impact**: A maintainer relying on the message would assume the personality transition is serialized under host-\u003elock, for example when reasoning about sriov_configure interactions, and could miss the race in CF-001 or introduce regressions around the lock contract.\n\n**Suggestion**:\nPreferably hold host-\u003elock across the transition so the code matches the stated design, then the message is accurate; otherwise correct the commit message text before merge so the permanent history matches the implemented behavior.","commit_id":"1ac7a00d538a92d20e6819fc6de848df8c7075d1"}],"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"},{"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":"55dfaa872b48fd04fd644682fc4bf3dd8dd71906","unresolved":false,"context_lines":[{"line_number":913,"context_line":""},{"line_number":914,"context_line":"Mdev mode is activated per PF through the ``vf_personality`` sysfs"},{"line_number":915,"context_line":"attribute rather than a module parameter.  All PFs start with the"},{"line_number":916,"context_line":"``uart`` personality and can be switched to ``mdev`` at runtime"},{"line_number":917,"context_line":"while no VFs are active."},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"Example — single mdev PF:"}],"source_content_type":"text/x-rst","patch_set":11,"id":"ef301ad9_84789bd8","line":916,"updated":"2026-07-29 17:16:05.000000000","message":"The newly added \u0027Mdev parameters\u0027 section says \u0027All PFs start with the uart personality\u0027, but the code initializes host-\u003epersonality to PCI_SIM_VF_PERS_UNSET. overview.rst and README.rst both correctly document the initial personality as \u0027unset\u0027.\n\n**Severity**: SUGGESTION | **Confidence**: 0.9\n\n**Benefit**: A developer following the guide would incorrectly assume PFs are already in uart mode and might not set the personality explicitly, leading to confusion when sriov_numvfs writes are rejected with -ENODEV.\n\n**Recommendation**:\nChange \u0027All PFs start with the uart personality\u0027 to \u0027All PFs start with the unset personality\u0027 to match the code and the other documentation files.","commit_id":"99e98ec51ce37ab584af723058ce69180e5c52a1"},{"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":"4ad183281b3c4182d15970135bcd3297acb1d158","unresolved":false,"context_lines":[{"line_number":913,"context_line":""},{"line_number":914,"context_line":"Mdev mode is activated per PF through the ``vf_personality`` sysfs"},{"line_number":915,"context_line":"attribute rather than a module parameter.  All PFs start with the"},{"line_number":916,"context_line":"``uart`` personality and can be switched to ``mdev`` at runtime"},{"line_number":917,"context_line":"while no VFs are active."},{"line_number":918,"context_line":""},{"line_number":919,"context_line":"Example — single mdev PF:"}],"source_content_type":"text/x-rst","patch_set":12,"id":"cdc46524_a4f605ba","line":916,"updated":"2026-07-29 18:11:49.000000000","message":"The newly added \u0027Mdev parameters\u0027 section states \u0027All PFs start with the uart personality\u0027, but the actual initial personality is \u0027unset\u0027 (PCI_SIM_VF_PERS_UNSET). Users must explicitly assign a personality before the PF can be used.\n\n**Severity**: WARNING | **Confidence**: 0.9\n\n**Impact**: Contributors following the mdev setup instructions may believe PFs are immediately ready for VF creation without first setting a personality, leading to confusion when sriov_numvfs writes fail with -ENODEV.\n\n**Suggestion**:\nChange \u0027uart\u0027 to \u0027unset\u0027 on line 916-917: \u0027All PFs start with the ``unset`` personality and can be switched to ``mdev`` or ``uart`` at runtime while no VFs are active.\u0027","commit_id":"d5bb2f29796c95b9cda190da7adad4e4398e99ff"},{"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":"bfbead72cc183def28dbb7c27a31a54da303fadc","unresolved":false,"context_lines":[{"line_number":826,"context_line":""},{"line_number":827,"context_line":"Keep ownership local"},{"line_number":828,"context_line":"--------------------"},{"line_number":829,"context_line":""},{"line_number":830,"context_line":"Each source file owns one major subsystem. Keep new code near the subsystem"},{"line_number":831,"context_line":"that owns the state:"},{"line_number":832,"context_line":""}],"source_content_type":"text/x-rst","patch_set":16,"id":"2e7f5f3d_c70d0e7a","line":829,"updated":"2026-08-04 17:50:49.000000000","message":"The maintenance section \u0027Keep ownership local\u0027 lists file-to-subsystem ownership for all source files but does not include the new fake_pci_sriov_mdev.c file added by this patch.\n\n**Severity**: SUGGESTION | **Confidence**: 0.8\n\n**Benefit**: A maintainer following the ownership guide may not know where mdev-related changes should go. Minor maintenance friction.\n\n**Recommendation**:\nAdd an entry such as: \u0027* mdev support in ``fake_pci_sriov_mdev.c``,\u0027 to the bullet list in the \u0027Keep ownership local\u0027 section.","commit_id":"c8cc02186bb248cdcfbd13e712c0369a1d5c8f99"}],"doc/source/contributor/pci-sim/overview.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":"d39825163864e362f3650696be3928fc325ba61a","unresolved":false,"context_lines":[{"line_number":17,"context_line":"Currently supported personalities are ``uart`` (default), and ``mdev``;"},{"line_number":18,"context_line":"additional types (e.g. NVMe) may be added in the future."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"When a PF\u0027s is configured with an ``mdev`` personality,"},{"line_number":21,"context_line":"it registers as an mdev parent and exposes two mdev types"},{"line_number":22,"context_line":"(``sim_accel_small`` and ``sim_accel_large``), which allows Cyborg\u0027s"},{"line_number":23,"context_line":"``GenericMdevDriver`` to be tested without real mdev-capable hardware."}],"source_content_type":"text/x-rst","patch_set":10,"id":"6f9c1030_4fdb27fc","line":20,"updated":"2026-07-29 12:09:48.000000000","message":"The overview documentation contains a grammatical error: \u0027When a PF\u0027s is configured with an mdev personality\u0027 should read \u0027When a PF is configured with an mdev personality\u0027. The erroneous apostrophe-s creates a possessive form where none is needed.\n\n**Severity**: SUGGESTION | **Confidence**: 0.9\n\n**Benefit**: Minor readability issue in user-facing documentation. Does not affect functionality but looks unprofessional in published docs.\n\n**Recommendation**:\nChange \u0027When a PF\u0027s is configured\u0027 to \u0027When a PF is configured\u0027.","commit_id":"f0324e550f4fd080585dac6453870853fbcdf449"}],"pci-sim/README.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":"91ad9cbf12a54e23b2965ecf58c3060e80ec70d6","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    cat /sys/bus/pci/devices/\u003cPF\u003e/vf_personality        # -\u003e unset"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    # List available personalities"},{"line_number":37,"context_line":"    cat /sys/bus/pci/devices/\u003cPF\u003e/vf_personality_available  # -\u003e [unset] uart"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    # Assign the uart personality (required before enabling VFs)"},{"line_number":40,"context_line":"    echo uart \u003e /sys/bus/pci/devices/\u003cPF\u003e/vf_personality"}],"source_content_type":"text/x-rst","patch_set":17,"id":"2a4bab0b_ee4be686","line":37,"updated":"2026-08-31 13:49:48.000000000","message":"The README section updated by this patch to say supported personalities are \u0027uart\u0027 and \u0027mdev\u0027 still shows sample output \u0027cat .../vf_personality_available  # -\u003e [unset] uart\u0027. Because the patch adds PCI_SIM_VF_PERS_MDEV to pci_sim_personality_names, the actual output is \u0027[unset] uart mdev\u0027.\n\n**Severity**: SUGGESTION | **Confidence**: 0.85\n\n**Impact**: The example output no longer matches module behavior, misleading developers who verify the sysfs interface against the docs.\n\n**Recommendation**:\nUpdate the example comment to \u0027# -\u003e [unset] uart mdev\u0027.","commit_id":"bdeed0f32da589fc26529eaa4188667a6ad3b4d1"},{"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":"91ad9cbf12a54e23b2965ecf58c3060e80ec70d6","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"- ``sim_accel_small`` — \"PCI-SIM Small Accelerator\" (default 8 instances)"},{"line_number":59,"context_line":"- ``sim_accel_large`` — \"PCI-SIM Large Accelerator\" (default 2 instances)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"The type directory names are auto-prefixed by the kernel with the PF driver"},{"line_number":62,"context_line":"name, so they appear as ``fake_pci_sriov_pf-sim_accel_small`` and"},{"line_number":63,"context_line":"``fake_pci_sriov_pf-sim_accel_large`` under ``mdev_supported_types/``."}],"source_content_type":"text/x-rst","patch_set":17,"id":"3e2ff23a_9a7be4c9","line":60,"updated":"2026-08-31 13:49:48.000000000","message":"README.rst and the contributor docs state the type directories appear as \u0027fake_pci_sriov_pf-sim_accel_small\u0027 / \u0027fake_pci_sriov_pf-sim_accel_large\u0027 and that \u0027the type directory names are auto-prefixed by the kernel with the PF driver name\u0027. Under the mdev_register_parent() API this module targets (stable since 5.16, per the comment in fake_pci_sriov_compat.h), each mdev_supported_types/ directory is named exactly by mdev_type.sysfs_name with no driver-name prefix, so the real directories are \u0027sim_accel_small\u0027 and \u0027sim_accel_large\u0027. Notably the new smoke scripts glob \u0027*sim_accel_small\u0027, which matches the actual names but not the documented ones.\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: Anyone following the docs, or writing Cyborg GenericMdevDriver discovery assertions against the documented names, will look for directories that do not exist and conclude parent registration failed.\n\n**Suggestion**:\nCorrect README.rst:60-63, developer-guide.rst:937-939 and 956-958, and testing.rst:73-75 to state the type directories are named sim_accel_small and sim_accel_large, and drop the \u0027auto-prefixed by the PF driver name\u0027 sentence.","commit_id":"bdeed0f32da589fc26529eaa4188667a6ad3b4d1"},{"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":"a22e3f2019eb183a5d062eda6ef2055d5ed3057b","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"- ``sim_accel_small`` — \"PCI-SIM Small Accelerator\" (default 8 instances)"},{"line_number":59,"context_line":"- ``sim_accel_large`` — \"PCI-SIM Large Accelerator\" (default 2 instances)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"The type directory names are auto-prefixed by the kernel with the PF driver"},{"line_number":62,"context_line":"name, so they appear as ``fake_pci_sriov_pf-sim_accel_small`` and"},{"line_number":63,"context_line":"``fake_pci_sriov_pf-sim_accel_large`` under ``mdev_supported_types/``."}],"source_content_type":"text/x-rst","patch_set":20,"id":"10813849_312e614a","line":60,"updated":"2026-09-18 15:35:33.000000000","message":"README.rst, developer-guide.rst, and testing.rst all present the exposed mdev type directory names as \u0027fake_pci_sriov_pf-sim_accel_small\u0027 / \u0027-sim_accel_large\u0027, and README claims the kernel \u0027auto-prefix[es]\u0027 the names \u0027with the PF driver name\u0027. mdev core names each type kobject \u0027%s-%s\u0027 using dev_name(parent-\u003edev), which here is the fake PF\u0027s PCI address (e.g. 0000:01:00.0), not the PF driver name, so the actual directories are like \u00270000:01:00.0-sim_accel_small\u0027.\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: Operators and tooling following the documentation will look for mdev type directories that never exist and misdiagnose the setup; the documentation also teaches an incorrect kernel naming rule.\n\n**Suggestion**:\nCorrect the three documentation locations to show the actual \u0027\u003cparent PCI address\u003e-\u003ctype\u003e\u0027 directory names (e.g. 0000:01:00.0-sim_accel_small) and drop the \u0027prefixed with the PF driver name\u0027 explanation, or verify against a live sysfs tree and align the docs with the observed names.","commit_id":"1ac7a00d538a92d20e6819fc6de848df8c7075d1"}],"pci-sim/fake_pci_sriov.h":[{"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":"55dfaa872b48fd04fd644682fc4bf3dd8dd71906","unresolved":false,"context_lines":[{"line_number":81,"context_line":"enum pci_sim_vf_personality {"},{"line_number":82,"context_line":"\tPCI_SIM_VF_PERS_UNSET \u003d 0,"},{"line_number":83,"context_line":"\tPCI_SIM_VF_PERS_UART,"},{"line_number":84,"context_line":"\tPCI_SIM_VF_PERS_MDEV,"},{"line_number":85,"context_line":"\tPCI_SIM_VF_PERS_COUNT,"},{"line_number":86,"context_line":"};"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-csrc","patch_set":11,"id":"40cb01cc_44603858","line":84,"updated":"2026-07-29 17:16:05.000000000","message":"The enum pci_sim_vf_personality was extended with PCI_SIM_VF_PERS_MDEV (PCI_SIM_VF_PERS_COUNT went from 2 to 3), but pci_sim_personality_names in fake_pci_sriov_cfg.c was not updated. Index 2 is implicitly NULL. vf_personality_store calls sysfs_streq(buf, NULL) when searching for \u0027mdev\u0027, causing...\n\n**Severity**: CRITICAL | **Confidence**: 0.9\n\n**Risk**: Writing \u0027echo mdev \u003e .../vf_personality\u0027 either crashes the kernel (NULL deref in sysfs_streq) or returns -EINVAL. Reading vf_personality_available shows \u0027(null)\u0027 for the mdev slot. All three smoke test scripts fail because they depend on setting the mdev personality.\n\n**Priority**: Immediate\n**Why This Matters**: Writing \u0027echo mdev \u003e .../vf_personality\u0027 either crashes the kernel (NULL deref in sysfs_streq) or returns -EINVAL. Reading vf_personality_available shows \u0027(null)\u0027 for the mdev slot. All three smoke test scripts fail because they depend on setting the mdev personality.\n\n**Recommendation**:\nAdd [PCI_SIM_VF_PERS_MDEV] \u003d \"mdev\" to the pci_sim_personality_names array in fake_pci_sriov_cfg.c, matching the pattern used for the other two entries.","commit_id":"99e98ec51ce37ab584af723058ce69180e5c52a1"}],"pci-sim/fake_pci_sriov_cfg.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":"4ad183281b3c4182d15970135bcd3297acb1d158","unresolved":false,"context_lines":[{"line_number":573,"context_line":"\t\treturn count;"},{"line_number":574,"context_line":"\t}"},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"\tmutex_unlock(\u0026host-\u003elock);"},{"line_number":577,"context_line":"#if PCI_SIM_HAS_MDEV"},{"line_number":578,"context_line":"\tif (old_pers \u003d\u003d PCI_SIM_VF_PERS_MDEV)"},{"line_number":579,"context_line":"\t\tpci_sim_mdev_unregister_parent(host);"}],"source_content_type":"text/x-csrc","patch_set":12,"id":"8df7319b_6a8fed4b","line":576,"updated":"2026-07-29 18:11:49.000000000","message":"The vf_personality_store callback releases host-\u003elock at line 576 and then calls mutex_unlock(\u0026host-\u003elock) again at line 590 without re-acquiring the lock. This is a double-unlock, which is undefined behavior in the Linux kernel and will trigger a BUG/warning or memory corruption.\n\n**Severity**: CRITICAL | **Confidence**: 1.0\n\n**Risk**: Every successful personality transition (e.g., \u0027echo mdev \u003e vf_personality\u0027 or \u0027echo uart \u003e vf_personality\u0027) will double-unlock host-\u003elock, causing a kernel BUG on kernels with CONFIG_DEBUG_MUTEXES or potential silent corruption on production kernels. This is a guaranteed crash on the normal code...\n\n**Priority**: Immediate\n**Why This Matters**: Every successful personality transition (e.g., \u0027echo mdev \u003e vf_personality\u0027 or \u0027echo uart \u003e vf_personality\u0027) will double-unlock host-\u003elock, causing a kernel BUG on kernels with CONFIG_DEBUG_MUTEXES or potential silent corruption on production kernels. This is a guaranteed crash on the normal code...\n\n**Recommendation**:\nRemove the mutex_unlock at line 576 so the lock is held across the mdev register/unregister and personality update, matching the commit message\u0027s stated intent. Add mutex_unlock(\u0026host-\u003elock) before \u0027return err\u0027 on line 584 so the error path releases the lock correctly. The lock can safely be held during mdev_register_parent/mdev_unregister_parent since those functions use their own internal locks that do not overlap with host-\u003elock.","commit_id":"d5bb2f29796c95b9cda190da7adad4e4398e99ff"},{"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":"9bac269fcb88168274be444244234fb938b3d7cf","unresolved":false,"context_lines":[{"line_number":573,"context_line":"\t\treturn count;"},{"line_number":574,"context_line":"\t}"},{"line_number":575,"context_line":""},{"line_number":576,"context_line":"\tmutex_unlock(\u0026host-\u003elock);"},{"line_number":577,"context_line":"#if PCI_SIM_HAS_MDEV"},{"line_number":578,"context_line":"\tif (old_pers \u003d\u003d PCI_SIM_VF_PERS_MDEV)"},{"line_number":579,"context_line":"\t\tpci_sim_mdev_unregister_parent(host);"}],"source_content_type":"text/x-csrc","patch_set":13,"id":"264626a7_0f3a7479","line":576,"updated":"2026-07-30 12:32:39.000000000","message":"The commit message states the store holds host-\u003elock across the transition, but the code releases it at line 576 before mdev parent operations and personality write at line 589. A concurrent sriov_configure (different sysfs attribute) can enable VFs while mdev parent registration is in progress.\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: A concurrent sriov_numvfs write can enable VFs on a PF simultaneously being transitioned to mdev. Both SR-IOV VFs and an mdev parent become active on the same PF, violating mutual exclusivity and potentially confusing Cyborg device discovery or causing kernel warnings.\n\n**Priority**: Before merge\n**Why This Matters**: A concurrent sriov_numvfs write can enable VFs on a PF simultaneously being transitioned to mdev. Both SR-IOV VFs and an mdev parent become active on the same PF, violating mutual exclusivity and potentially confusing Cyborg device discovery or causing kernel warnings.\n\n**Recommendation**:\nHold host-\u003elock across the entire transition. Remove mutex_unlock at line 576 and release only after host-\u003epersonality \u003d new_pers at line 589. The commit message confirms this is deadlock-safe and host-\u003elock is a mutex so GFP_KERNEL allocations in pci_sim_mdev_register_parent are fine.","commit_id":"bc5e8c39e5f2a53c4d1ecef0b78ce20f708c8430"},{"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":"b419d2eaba352fb791f09a4d5d721aa2d351c3b8","unresolved":false,"context_lines":[{"line_number":574,"context_line":"\t\treturn count;"},{"line_number":575,"context_line":"\t}"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"\tmutex_unlock(\u0026host-\u003elock);"},{"line_number":578,"context_line":"#if PCI_SIM_HAS_MDEV"},{"line_number":579,"context_line":"\tif (old_pers \u003d\u003d PCI_SIM_VF_PERS_MDEV)"},{"line_number":580,"context_line":"\t\tpci_sim_mdev_unregister_parent(host);"}],"source_content_type":"text/x-csrc","patch_set":14,"id":"23e343c9_550b8054","line":577,"updated":"2026-07-31 13:06:36.000000000","message":"The vf_personality_store callback releases host-\u003elock at line 577 before performing mdev parent register/unregister operations (lines 578-587) and before updating host-\u003epersonality (line 589). The commit message explicitly states the lock is held across the transition, but the code contradicts th...\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: Concurrent sriov_configure and vf_personality_store on the same PF can result in both VFs and mdev parents active simultaneously, violating mutual exclusion. host-\u003epersonality is written without host-\u003elock while sriov_configure reads it under host-\u003elock, creating a data race with no ordering guar...\n\n**Priority**: Before merge\n**Why This Matters**: Concurrent sriov_configure and vf_personality_store on the same PF can result in both VFs and mdev parents active simultaneously, violating mutual exclusion. host-\u003epersonality is written without host-\u003elock while sriov_configure reads it under host-\u003elock, creating a data race with no ordering guar...\n\n**Recommendation**:\nKeep host-\u003elock held across the entire mdev transition and personality update. Move mutex_unlock to after host-\u003epersonality \u003d new_pers. host-\u003elock is a mutex that allows sleeping, and mdev callbacks do not acquire host-\u003elock or fake_hosts_lock, so there is no lock-ordering deadlock risk.","commit_id":"8e696f5e80e78c370dfe471d2e88764ea8729e51"},{"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":"6c04af61a7dd0b432c465f816ede595344637092","unresolved":false,"context_lines":[{"line_number":574,"context_line":"\t\treturn count;"},{"line_number":575,"context_line":"\t}"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"\tmutex_unlock(\u0026host-\u003elock);"},{"line_number":578,"context_line":"#if PCI_SIM_HAS_MDEV"},{"line_number":579,"context_line":"\tif (old_pers \u003d\u003d PCI_SIM_VF_PERS_MDEV)"},{"line_number":580,"context_line":"\t\tpci_sim_mdev_unregister_parent(host);"}],"source_content_type":"text/x-csrc","patch_set":15,"id":"18d30e5e_d527ea40","line":577,"updated":"2026-08-03 09:32:49.000000000","message":"The commit message states \u0027The store holds host-\u003elock across the transition, which is safe because mdev registration locks do not overlap with pci-sim internal locks.\u0027 However, the code releases host-\u003elock at line 577 BEFORE performing mdev parent register/unregister operations (lines 578-587) an...\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: Concurrent sysfs operations could create VFs on a PF that is simultaneously registering as an mdev parent, or cause double mdev parent registration with a memory/resource leak. In CI environments running tests in parallel, this could produce confusing failures and leave orphaned mdev parents in t...\n\n**Priority**: Before merge\n**Why This Matters**: Concurrent sysfs operations could create VFs on a PF that is simultaneously registering as an mdev parent, or cause double mdev parent registration with a memory/resource leak. In CI environments running tests in parallel, this could produce confusing failures and leave orphaned mdev parents in t...\n\n**Recommendation**:\nMove mutex_unlock(\u0026host-\u003elock) to after host-\u003epersonality \u003d new_pers (line 589), so the lock protects the entire personality transition including mdev register/unregister and the personality write. This matches the commit message\u0027s stated design and prevents the race.","commit_id":"9f910c0bfc49d36c89cde5beb837b6edb8ea8c95"},{"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":"bfbead72cc183def28dbb7c27a31a54da303fadc","unresolved":false,"context_lines":[{"line_number":574,"context_line":"\t\treturn count;"},{"line_number":575,"context_line":"\t}"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"\tmutex_unlock(\u0026host-\u003elock);"},{"line_number":578,"context_line":"#if PCI_SIM_HAS_MDEV"},{"line_number":579,"context_line":"\tif (old_pers \u003d\u003d PCI_SIM_VF_PERS_MDEV)"},{"line_number":580,"context_line":"\t\tpci_sim_mdev_unregister_parent(host);"}],"source_content_type":"text/x-csrc","patch_set":16,"id":"e7cd1089_50e41a09","line":577,"updated":"2026-08-04 17:50:49.000000000","message":"The commit message states \u0027The store holds host-\u003elock across the transition,\u0027 but the code releases host-\u003elock at line 577 before performing mdev register/unregister operations and before setting host-\u003epersonality at line 589. This creates a data race on host-\u003epersonality and a window where sriov...\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: A concurrent sriov_numvfs write and vf_personality write can leave a PF with VFs enabled while personality transitions to mdev, or corrupt the personality read by sriov_configure. For a test fixture this is low-frequency but it undermines the mutual exclusion the code is explicitly designed to en...\n\n**Priority**: Before merge\n**Why This Matters**: A concurrent sriov_numvfs write and vf_personality write can leave a PF with VFs enabled while personality transitions to mdev, or corrupt the personality read by sriov_configure. For a test fixture this is low-frequency but it undermines the mutual exclusion the code is explicitly designed to en...\n\n**Recommendation**:\nHold host-\u003elock across the mdev register/unregister and personality update. Since host-\u003elock is a mutex it is safe to hold across the sleeping mdev operations (as the commit message itself argues). Re-acquire the lock for the personality write, or restructure so the lock is not released until after host-\u003epersonality \u003d new_pers. Alternatively, if mdev registration must not be done under host-\u003elock due to lock ordering concerns, document that decision explicitly and correct the commit message.","commit_id":"c8cc02186bb248cdcfbd13e712c0369a1d5c8f99"},{"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":"91ad9cbf12a54e23b2965ecf58c3060e80ec70d6","unresolved":false,"context_lines":[{"line_number":574,"context_line":"\t\treturn count;"},{"line_number":575,"context_line":"\t}"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"\tmutex_unlock(\u0026host-\u003elock);"},{"line_number":578,"context_line":"#if PCI_SIM_HAS_MDEV"},{"line_number":579,"context_line":"\tif (old_pers \u003d\u003d PCI_SIM_VF_PERS_MDEV)"},{"line_number":580,"context_line":"\t\tpci_sim_mdev_unregister_parent(host);"}],"source_content_type":"text/x-csrc","patch_set":17,"id":"221980c4_702a59c8","line":577,"updated":"2026-08-31 13:49:48.000000000","message":"The rewritten store callback releases host-\u003elock at line 577 and then performs pci_sim_mdev_unregister_parent/register_parent and assigns host-\u003epersonality (lines 579-589) without any lock. sriov_configure holds host-\u003elock precisely so a concurrent vf_personality_store cannot change the personality between its check and VF creation (comment at lines 490-493). With the lock dropped early, a concurrent sriov_numvfs write that still sees personality\u003d\u003duart can enable VFs while the personality store proceeds to register the mdev parent, producing a PF with both SR-IOV VFs enabled and an active mdev parent - the exact state both write paths guard against with -EBUSY/-ENODEV. Two concurrent \u0027mdev\u0027 writes can also both pass the old_pers check and both call pci_sim_mdev_register_parent; the second registration on the same PF fails (or an interleaved unregister clears a parent set by the other writer), leaving inconsistent state.\n\n**Severity**: WARNING | **Confidence**: 0.8\n\n**Impact**: Concurrent sysfs writes to sriov_numvfs and vf_personality can leave a PF with VFs enabled while registered as an mdev parent, defeating the module\u0027s mode-isolation guards and producing confusing results for the Cyborg discovery testing this fixture exists to support; concurrent personality writes can yield a failed/duplicate parent registration or personality state inconsistent with the registered parent.\n\n**Suggestion**:\nKeep host-\u003elock held across the unregister/register transition and the personality assignment. mdev registration only takes mdev-core locks and no mdev callback path takes host-\u003elock, so holding it introduces no deadlock; this also restores the serialization sriov_configure\u0027s comment documents. Alternatively, guard the transition with a compare-and-set on personality so racing writers cannot interleave.","commit_id":"bdeed0f32da589fc26529eaa4188667a6ad3b4d1"},{"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":"1b412d1c0901533b8e46770ae0f9bbfa82cb00e6","unresolved":false,"context_lines":[{"line_number":568,"context_line":"\t\treturn -EINVAL;"},{"line_number":569,"context_line":"\t}"},{"line_number":570,"context_line":""},{"line_number":571,"context_line":"\told_pers \u003d host-\u003epersonality;"},{"line_number":572,"context_line":"\tif (new_pers \u003d\u003d old_pers) {"},{"line_number":573,"context_line":"\t\tmutex_unlock(\u0026host-\u003elock);"},{"line_number":574,"context_line":"\t\treturn count;"}],"source_content_type":"text/x-csrc","patch_set":18,"id":"e7c18504_cee1379f","line":571,"updated":"2026-08-31 16:20:38.000000000","message":"The store callback validates the new personality and snapshots host-\u003epersonality under host-\u003elock, then drops the lock at line 577 before unregistering/registering the mdev parent and before writing host-\u003epersonality \u003d new_pers at line 589. The whole check-then-act sequence runs unsynchronized, and host-\u003epersonality is now written without the mutex every other user of the field holds (vf_personality_show, the sriov_numvfs store, and fake_pci_sriov_exit). Concurrent writes to the same vf_personality attribute via separate file descriptors are not serialized by the kernel.\n\n**Severity**: HIGH | **Confidence**: 0.75\n\n**Impact**: The mdev personality lifecycle, the central behavior added by this patch, can end in a state where host-\u003epersonality disagrees with the actual mdev parent registration: sysfs writes return success while the resulting mode is the opposite of what was requested, /sys/class/mdev_bus entries appear or disappear contrary to the visible personality, and a stale registered parent is left behind. Because module exit tears down parents only for personality\u003d\u003dmdev, a stale parent survives the exit path, so rmmod and cleanup_fake_pci_sriov.sh can fail with \u0027module in use\u0027 and leave fake PFs behind, requiring manual recovery.\n\n**Priority**: Before merge\n**Recommendation**:\nKeep host-\u003elock held across the transition: drop the mutex_unlock at fake_pci_sriov_cfg.c:577, perform pci_sim_mdev_unregister_parent()/pci_sim_mdev_register_parent() and host-\u003epersonality \u003d new_pers under the lock (as the commit message already describes), and restore the unlock on every return path. If holding host-\u003elock across mdev core calls is undesirable, add a dedicated mutex that serializes personality transitions and guards the personality field plus host-\u003emdev_parent, and re-check host-\u003epersonality after acquiring it so a concurrent writer cannot turn a transition into a silent no-op.","commit_id":"d3a5cc160c4ec417ee901fba3ef8be0e45c12407"},{"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":"a885534bd793f2fbc8aee58ddf1cb4f852139f1c","unresolved":false,"context_lines":[{"line_number":574,"context_line":"\t\treturn count;"},{"line_number":575,"context_line":"\t}"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"\tmutex_unlock(\u0026host-\u003elock);"},{"line_number":578,"context_line":"#if PCI_SIM_HAS_MDEV"},{"line_number":579,"context_line":"\tif (old_pers \u003d\u003d PCI_SIM_VF_PERS_MDEV)"},{"line_number":580,"context_line":"\t\tpci_sim_mdev_unregister_parent(host);"}],"source_content_type":"text/x-csrc","patch_set":19,"id":"eb2925c4_d63b6a3b","line":577,"updated":"2026-09-01 11:03:56.000000000","message":"The rewritten vf_personality_store() drops host-\u003elock at fake_pci_sriov_cfg.c:577 and then unregisters/registers the mdev parent (lines 579-586) and writes host-\u003epersonality \u003d new_pers at line 589 completely unlocked. sriov_configure() in the same file reads host-\u003epersonality under host-\u003elock and carries an explicit comment (lines 489-492) that the lock is held \u0027so that a concurrent vf_personality_store cannot change the personality between the check and VF creation\u0027. This change violates that documented invariant: the personality value and mdev registration state are now mutated with no synchronization against sriov_configure() or a second concurrent vf_personality_store on the same PF.\n\n**Severity**: HIGH | **Confidence**: 0.85\n\n**Impact**: Concurrent sysfs operations can enable SR-IOV VFs on a PF that is simultaneously becoming (or already is) an mdev parent, producing the exact mixed state the -EBUSY/-ENODEV guards exist to prevent, and can leak the mdev parent allocation, leaving inconsistent kernel state and sysfs visibility for the test fixture.\n\n**Priority**: Before merge\n**Recommendation**:\nKeep host-\u003elock held across the mdev unregister/register calls and the host-\u003epersonality assignment (the commit message already asserts this is safe because mdev registration locks do not overlap pci-sim internal locks), or introduce a dedicated transition mutex and re-validate personality and num_vfs_enabled state under it before committing the new value.","commit_id":"d27b90ab45d8cdf1159514702ff002225091526f"},{"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":"a22e3f2019eb183a5d062eda6ef2055d5ed3057b","unresolved":false,"context_lines":[{"line_number":574,"context_line":"\t\treturn count;"},{"line_number":575,"context_line":"\t}"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"\tmutex_unlock(\u0026host-\u003elock);"},{"line_number":578,"context_line":"#if PCI_SIM_HAS_MDEV"},{"line_number":579,"context_line":"\tif (old_pers \u003d\u003d PCI_SIM_VF_PERS_MDEV)"},{"line_number":580,"context_line":"\t\tpci_sim_mdev_unregister_parent(host);"}],"source_content_type":"text/x-csrc","patch_set":20,"id":"cdf5f143_aaa40f07","line":577,"updated":"2026-09-18 15:35:33.000000000","message":"The reworked vf_personality_store releases host-\u003elock (fake_pci_sriov_cfg.c:577) before unregistering/registering the mdev parent and writes host-\u003epersonality (line 589) after the unlock. The check-then-commit sequence is no longer atomic, so a concurrent sriov_numvfs write can pass fake_pci_sriov_configure\u0027s locked personality check while the transition is in flight and enable VFs, ending with VFs active under the mdev personality. Two concurrent vf_personality writes can also both execute the uart-\u003emdev transition and call mdev_register_parent twice for the same PF.\n\n**Severity**: WARNING | **Confidence**: 0.85\n\n**Impact**: The PF can end in a state the module explicitly forbids: VFs enabled while personality is \u0027mdev\u0027 (and an mdev parent registered while VFs are active), which confuses smoke tests and mdev/SR-IOV discovery. The state is recoverable by writing sriov_numvfs\u003d0 and re-setting the personality, so there is no data loss or security impact.\n\n**Suggestion**:\nHold host-\u003elock across the transition as the commit message describes: after the EBUSY/name checks, keep the mutex held while calling pci_sim_mdev_unregister_parent()/pci_sim_mdev_register_parent() and while assigning host-\u003epersonality, unlocking on every exit path. The commit message already asserts mdev registration locks do not overlap pci-sim internal locks, so no new deadlock is expected. Alternatively, re-validate num_vfs_enabled under the lock immediately before committing the new personality.","commit_id":"1ac7a00d538a92d20e6819fc6de848df8c7075d1"}],"pci-sim/fake_pci_sriov_compat.h":[{"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":"a22e3f2019eb183a5d062eda6ef2055d5ed3057b","unresolved":false,"context_lines":[{"line_number":46,"context_line":" * VFIO core in modern kernels.  mdev_register_parent() has been"},{"line_number":47,"context_line":" * stable since Linux 5.16, so no per-version shim is needed."},{"line_number":48,"context_line":" */"},{"line_number":49,"context_line":"#if IS_ENABLED(CONFIG_VFIO)"},{"line_number":50,"context_line":"#define PCI_SIM_HAS_MDEV 1"},{"line_number":51,"context_line":"#else"},{"line_number":52,"context_line":"#define PCI_SIM_HAS_MDEV 0"}],"source_content_type":"text/x-csrc","patch_set":20,"id":"dacb22ef_c9cb025a","line":49,"updated":"2026-09-18 15:35:33.000000000","message":"fake_pci_sriov_compat.h enables mdev support when IS_ENABLED(CONFIG_VFIO), but mdev_register_driver()/mdev_register_parent() and \u003clinux/mdev.h\u003e come from the separate CONFIG_MDEV tristate (named CONFIG_VFIO_MDEV before kernel 6.2), which merely depends on VFIO. On kernels with VFIO enabled and the mdev framework disabled, PCI_SIM_HAS_MDEV is 1 and the module fails at build/modpost with undefined mdev symbols. Conversely, because the sample Kconfig already depends on VFIO_PCI_CORE (which implies VFIO), the #else no-mdev fallback can never be reached in any configuration where the module builds at all.\n\n**Severity**: WARNING | **Confidence**: 0.82\n\n**Impact**: Building the test module on a kernel with VFIO present but CONFIG_MDEV unset (lean CI or custom kernels that only want vfio-pci) fails with confusing modpost errors even though the module\u0027s SR-IOV/uart features need no mdev; the graceful no-mdev build path the guard was written for never activates.\n\n**Suggestion**:\nGate on the mdev framework itself, e.g. \u0027#if IS_REACHABLE(CONFIG_MDEV)\u0027, so the module builds without mdev support when the framework is absent. Also handle the now-reachable PCI_SIM_HAS_MDEV\u003d0 build: pci_sim_personality_names unconditionally advertises \u0027mdev\u0027, so vf_personality would silently accept it and set PCI_SIM_VF_PERS_MDEV without registering anything; reject or hide that name when mdev support is not compiled in.","commit_id":"1ac7a00d538a92d20e6819fc6de848df8c7075d1"}],"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"},{"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":"d39825163864e362f3650696be3928fc325ba61a","unresolved":false,"context_lines":[{"line_number":402,"context_line":"\treturn 0;"},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"#if PCI_SIM_HAS_MDEV"},{"line_number":405,"context_line":"err_mdev:"},{"line_number":406,"context_line":"\tpci_sim_mdev_unregister_driver();"},{"line_number":407,"context_line":"#endif"},{"line_number":408,"context_line":"err_hosts:"}],"source_content_type":"text/x-csrc","patch_set":10,"id":"608b87c7_28bdf580","line":405,"updated":"2026-07-29 12:09:48.000000000","message":"The err_mdev: label is defined in the module init error-unwind chain but is never the target of any goto statement. When pci_sim_mdev_register_driver() fails the code jumps directly to err_hosts, which is correct (no need to unregister a driver that was never registered). However, the err_mdev la...\n\n**Severity**: WARNING | **Confidence**: 0.9\n\n**Impact**: Dead code in the error path that will trigger a -Wunused-label compiler warning under W\u003d1/-Wall, potentially failing the lint-build-warnings check. It also creates confusion for future maintainers who may assume the label is reachable.\n\n**Suggestion**:\nRemove the err_mdev label and its pci_sim_mdev_unregister_driver() call since no code path reaches it. The existing goto err_hosts on mdev registration failure already handles the case correctly.","commit_id":"f0324e550f4fd080585dac6453870853fbcdf449"}],"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"}],"pci-sim/run_fake_pci_mixed_mode_smoke.sh":[{"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":"6c04af61a7dd0b432c465f816ede595344637092","unresolved":false,"context_lines":[{"line_number":97,"context_line":"}"},{"line_number":98,"context_line":"echo \"OK: no mdev_bus entry for SR-IOV PF\""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"msg \"enable VFs on SR-IOV PF\""},{"line_number":101,"context_line":"echo 2 | sudo -n tee \\"},{"line_number":102,"context_line":"    \"/sys/bus/pci/devices/$SRIOV_PF/sriov_numvfs\" \u003e/dev/null"},{"line_number":103,"context_line":"sleep 1"}],"source_content_type":"text/x-sh","patch_set":15,"id":"61123c11_490f90a2","line":100,"updated":"2026-08-03 09:32:49.000000000","message":"The run_fake_pci_mixed_mode_smoke.sh script sets the second PF\u0027s personality to \u0027mdev\u0027 but never sets the first PF\u0027s personality to \u0027uart\u0027 before writing to sriov_numvfs. The fake_pci_sriov_configure callback rejects sriov_numvfs writes when personality is not PCI_SIM_VF_PERS_UART. Since PFs star...\n\n**Severity**: HIGH | **Confidence**: 0.9\n\n**Risk**: The mixed-mode smoke test will always fail at the \u0027enable VFs on SR-IOV PF\u0027 step because sriov_numvfs is rejected for a PF with \u0027unset\u0027 personality. The test cannot validate the intended mixed SR-IOV/mdev scenario.\n\n**Priority**: Before merge\n**Why This Matters**: The mixed-mode smoke test will always fail at the \u0027enable VFs on SR-IOV PF\u0027 step because sriov_numvfs is rejected for a PF with \u0027unset\u0027 personality. The test cannot validate the intended mixed SR-IOV/mdev scenario.\n\n**Recommendation**:\nAdd \u0027echo uart | sudo -n tee /sys/bus/pci/devices/$SRIOV_PF/vf_personality \u003e/dev/null\u0027 before the sriov_numvfs write (between lines 99 and 100), so the SR-IOV PF has the \u0027uart\u0027 personality required by fake_pci_sriov_configure.","commit_id":"9f910c0bfc49d36c89cde5beb837b6edb8ea8c95"}]}
