DRAFT: kill giant - part 1 - #2399
Draft
opntr wants to merge 4 commits into
Draft
Conversation
Every Giant acquisition in this file is a bus topology lock: creating and destroying VF children mutates the device tree, and pci_iov_config(), pci_iov_delete() and the two ioctl paths all reach into it. Use the handle that says so. No functional change: bus_topo_lock() is still &Giant today. Converting the callers is a prerequisite for giving the topology lock its own sx, which is tracked in design/giant-removal-strategy.md. Note for that later change: pci_iov_config() calls pause() for the 100 ms the SR-IOV specification requires before VFs may be accessed, and does so with the lock held. Giant is silently dropped there today; an sx will not be, so the lock will need to be dropped and retaken around the pause. The region is already protected by IOV_BUSY, so that is safe. Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
The Giant acquisition here wraps device_probe_and_attach(), which is a bus topology operation. Use the handle that says so. No functional change: bus_topo_lock() is still &Giant today. This file is not referenced by any files* entry, sys/modules Makefile or kernel configuration, and it still includes headers that no longer exist (machine/xen-os.h, machine/hypervisor.h, machine/xenbus.h). It is converted here only so that no bus topology use of Giant is left in the tree; it is untested by construction and is a candidate for removal. Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
apei_pcie_handler() calls pci_find_dbsf(), which walks the device tree, so the lock it takes is the bus topology lock. Use the handle that says so, and record why the fatal path deliberately runs without it: the machine is going down and the handler may be running in a context that cannot block. No functional change: bus_topo_lock() is still &Giant today. Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
The code has called bus_topo_lock() around DEVICE_SUSPEND and DEVICE_RESUME for some time; only the comment still named Giant. Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
Contributor
Author
opntr
marked this pull request as draft
September 2, 2026 14:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.