Loose ends: repin illumos-ddi, ENOMEM for failed DMA binds, page-size constant in rdrmnull #4
Loading…
Reference in a new issue
No description provided.
Delete branch "loose-ends-20260928"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Loose ends after the R0, R1 and DMA-drill merges.
1. Pin
illumos-ddi moves from
b24c307toeb0150cadc, the head of illumos-ddiloose-ends-20260928(illumos/illumos-ddi#3). I chose the branch head so this PR's CI can build now. Once illumos-ddi#3 is merged, move the pin to the merge commit on illumos-ddimain. The branch commits stay reachable from that merge commit, so the pin keeps resolving either way.API adaptation: illumos-ddi now requires the
OwnNodefor minor nodes.Device::attachcreatescard<N>andrenderD<128+N>from the node before the GEM state takes it. Opens wait until attach returns, and a later failure (GEM setup, registry) drops the nodes again. No other illumos-ddi API change affects this repository: property updates andLdiIdent::from_dipare not used here.2. Errno for failed DMA binds
SysMem::bindmappedDDI_DMA_NOMAPPINGtoEFAULT. That is how every failed root-node bind on the patched kernel reached userland fromCREATE_DUMB;EFAULTin a create ioctl reads as a bad user pointer. The handle allocation went through illumos-ddi's genericFrom<DmaError> for Errno, which also answersEFAULTforNoMapping.The new
drm::dmaerrmodule maps DMA failures during object creation the way Linux's DRM reports a failed object allocation:NORESOURCES,TOOBIG,NOMAPPING,PARTIAL_MAP(never requested)ENOMEMBADATTR,BADLIMITS,TOOSMALL, zero length, out of rangeEINVALDmaError::NotOwnNode(illumos-ddi guard)ENXIOINUSE,LOCKED,STALE,DDI_FAILURE, unknown codes (not possible for a fresh handle)EIOThe handle allocation, the bind and the drill's raw allocation all use it. The match is exhaustive over
DmaError, so a new variant must be decided on. Five host tests cover the table, including NOMAPPING -> ENOMEM.The errno was also recorded on a kernel.
rdrmnull's self drill takes an optionaldma-max-transferproperty.tools/test/rdrmnull-dma-self-tiny.confsets it to one page, andtools/test/drm_dma_errno_test.cfound:ENOMEM), through rootnex'sDDI_DMA_TOOBIG, confirmed by rootnex's "coding error detected" warning.gemkstat is back at zero afterwards.DDI_DMA_NOMAPPINGitself cannot be produced on a stock kernel with these flags: rootnex returns it only on the IOMMU path, or when trimming withDDI_DMA_PARTIAL, which the core never requests. That mapping is therefore covered by the host test only.3. Advisory from the R1 review
rdrmnullnow usesdrm::offsets::PAGE_SIZEinstead of the literal4096for the drill's cookie limit and for the movable-object reservation.Verification
Local checks, targeting
x86_64-unknown-illumos:check,clippy -D warningswith and withoutrdrmnull/panic-drill,fmt --checkanddoc -D warningspass.cargo test -p drm -p drm-uapi: 47 + 1 passed. The 2 dead-code warnings in the test build are already onmain.uapi-check: 0 differences.Kernel runs used a fresh golden guest on Hephaistos (illumos
cda5b9a49f), withrdrmnullbuilt withoutpanic-drillagainst illumos-ddi9ebd16add0. The only difference fromeb0150cadcis illumos-ddi docs.run-r1-test.sh,dma-mode="none"run-r1-test.sh,dma-mode="self"under the root nexus/etc/path_to_instresiduedrm_dma_errno_test,dma-max-transfer=4096There was no panic in any run, and
rem_drvunloaded the module each time.CI note: the kmod-illumos job at
450b785never ran. Solstice runs 11 and 12 failed in "Set up job" withsolstice-ci: failed to enqueue job(s) to message broker(a broker outage; the hosted job passed on this head in run 11). Equivalent check done by hand:cargo +nightly-2026-04-16 build --locked -p rdrmnull --releasefor the kmod target, then on oibldofgate (illumos-cda5b9a49f)ld -ztype=kmod -z allextractsucceeded andelfdump -dshowsSUNW_KMOD; archive sha2560776c4b6…identical on both sides.