Repository navigation
kmorphd: Probe no driver behind an IOMMU that was not claimed - #7
Merged
Merged
Conversation
A successor that does not come to drive the dead host's IOMMUs went on to probe drivers for the devices it adopted. Their interrupts are still remapped by the host's tables, so they never arrive: virtio_blk waits for its first read forever inside its probe, and kmorphd with it. The takeover stays at FENCED. That is the case whenever a device could be neither taken nor quiesced, since kmorphd then leaves every unit to the dead host on purpose, and whenever the kernel refuses a claim. Unless every unit is claimed, leave the adopted devices without a driver and finish the takeover with the CPUs, the memory and the devices the successor already had. The bus is left probing no driver, so that a module loaded later does not bind one of them and block the same way. Signed-off-by: Cong Wang <cwang@multikernel.io>
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.
Problem
A successor that does not come to drive the dead host's IOMMUs went on to probe drivers for the devices it adopted. Their interrupts are still remapped by the host's tables, so they never arrive:
virtio_blkwaits for its first read forever inside its probe, and kmorphd with it. The takeover stays atFENCED.This happens whenever a device could be neither taken nor quiesced, since kmorphd then leaves every unit to the dead host on purpose, and whenever the kernel refuses a claim.
Change
Unless every unit is claimed,
ops_adopt_devices()leaves the adopted devices without a driver and the takeover finishes with the CPUs, the memory and the devices the successor already had.The bus is also left probing no driver, so that a module loaded later does not bind one of those devices and block the same way. This changes what the existing "host keeps the IOMMU" case leaves behind:
drivers_autoprobestays 0 there.The README's takeover description says the same.
Testing
make checkpasses, with a new unit test for the case and the existing one updated fordrivers_autoprobe.TAKEN_OVERwhere it hung atFENCEDbefore, with 13 adopted devices left without a driver.The arm64 and Intel runs cover only the path where the claim succeeds.