e230dfaa3d538011bdd61f94de0385d18dfdd951
6 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
7e8d63ecc1 |
driver-manager: v3.0 — major assessment + plan realignment to Linux-driver reuse
Assessment (local/docs/evidence/driver-manager/ASSESSMENT-2026-07-22.md) from three parallel audits (pcid layer, linux-kpi binding model, Linux 7.1 PCI core) + full first-hand review: Blockers found: - B1: /scheme/pci/<addr>/bind never existed in pcid — the P3 bind/aer/uevent patches are orphaned (path-fork recipes don't apply patches). Every probe would ENOENT -> defer forever. Resolution: claim collapses into pcid's existing channel ENOLCK exclusivity (the pcid-spawner model) — driver-manager-only change, no fork surgery. - B2: linux-kpi pci_register_driver and driver-manager are two competing claim systems with zero mutual awareness; amdgpu (redox-drm FFI) and redbear-iwlwifi (manual scan CLI) bypass both. linux-kpi covers ~15% of the PCI API surface; MSI is synthetic. - B3: /scheme/pci/pciehp and /scheme/acpi/aer have no producers; both listeners were inert fail-soft loops. Plan v3.0: - Removes stale claims (bind endpoint 'done', pciehp/AER listeners 'done', exclusive_with as 'the CachyOS pattern' — CachyOS actually uses probe-time -ENODEV handoff (ahci->intel-nvme-remap in 6.17.9 patch) + userspace modprobe.d blacklists; modern_tech 'wired' was advisory theater). - New work program: P0 correctness blockers (claim-via-channel, orphan-patch resolution, modern_tech/exec.rs cleanup, QEMU runtime gate) -> LDR Linux-Driver-Reuse (unified claim model, spawned-mode pci_register_driver honoring PCID_CLIENT_CHANNEL, iwlwifi/amdgpu onboarding, linux_loader TOML pipeline, linux-kpi API completion: real MSI via pcid_interface, request_regions, pcie_capability, PM) -> P2 operator/event surface (pcid AER/pciehp producers, scheme bind/unbind/new_id/remove_id/driver_override/rescan endpoints, trigger-based deferred retry) -> P3 policy/hygiene (quirk pass phases, AER recovery actions, per-vendor firmware packaging). - D5 audit gains a Runtime column: no capability counts without a QEMU boot proving it. |
||
|
|
8822113df8 |
driver-manager: v2.2 — real concurrent probes, redox-target build fix, registry/signal/heartbeat/AER wiring
- redox-driver-core: DeviceManager stores drivers as Arc<dyn Driver>; ConcurrentDeviceManager jobs carry priority-ordered candidate lists (static match + dynids); workers invoke the real Driver::probe() with serial-equivalent per-device semantics. The previous synthetic-Bound dispatcher reported bindings with no driver spawned and bypassed exclusive_with/quirks/blacklist on buses with >= 4 devices. - scheme.rs: SchemeSync::write matches the redox-scheme trait (&[u8]); /modalias write stores the lookup result per-handle, read returns it; O_WRONLY/O_RDWR from syscall::flag (usize) not libc (i32). - config.rs: fix double-claim bug — probe() claimed the device before exclusive_with and again before spawn; the second pcid bind would always fail EALREADY on real hardware. One claim threaded to spawn. - main.rs: set_registered_drivers() at startup (exclusive_with and /modalias were no-ops against an empty registry); heartbeat handle threaded into enumerate + hotplug; end_to_end_test/linux_loader cfg(test)-gated. - reaper.rs/sighup.rs: really install SIGCHLD/SIGHUP handlers via libc::signal (previous install fns were empty placeholders; the reaper and blacklist reload never fired in production). - unified_events.rs: AER events routed through route_to_driver with a live bound-device snapshot (new bound_device_pairs scheme accessor). - Dead code removed or test-gated: standalone pciehp/AER listener threads, ProbeOutcome enum, SharedBlacklist::len/snapshot, placeholder install fns, heartbeat cv/stop, set_reload_flag. - 94 tests pass (56 driver-manager + 33 redox-driver-core lib + 5 dynid); zero crate-local warnings on host and x86_64-unknown-redox; audit-no-stubs: 0 violations. |
||
|
|
4383e4e097 |
docs: D5-AUDIT.md v2.0 status update
Updates D5-AUDIT.md with the v2.0 status: /modalias write path is wired, smart scheduler decides serial-vs-concurrent, exclusive_with mutual exclusion, pci=nomsi env var, pciehp hotplug listener, sighup/aer worker threads. |
||
|
|
1720af1431 |
driver-manager: v1.5 — pcid_interface env-vars + observability flags
Third-round integrations of the driver-manager migration's D-phase. The pcid_interface crate (in local/sources/base submodule, see upstream commit |
||
|
|
5fd2e16b8e |
driver-manager: v1.4 — second-round integrations
Round-two integrations of the driver-manager migration's D-phase.
The policy loader is now active (the redbear-driver-policy package
now actually changes spawn_decision_gate behavior at runtime), the
--concurrent=N CLI flag enables the SMP worker pool, PciQuirkFlags
is wired into actual driver spawn (env vars to the child), and the
two C0 service files have been committed in the local/sources/base
submodule. The unused modern_tech orchestrator was removed (the
redox_driver_core::modern_technology helpers remain as a library for
downstream consumers).
driver-manager (16 tests, was 13):
- config.rs: PciQuirkFlags hints are now passed to the spawned child as
env vars (REDBEAR_DRIVER_PCI_IRQ_MODE=intx_or_msi, REDBEAR_DRIVER_DISABLE_ACCEL=1).
Adds blacklist_match() consult at probe time before spawn_decision_gate.
- main.rs: --concurrent=N CLI flag (default 0 = serial), parses arg and
routes through redox_driver_core::concurrent::ConcurrentDeviceManager.
Loads /etc/driver-manager.d/ blacklist at startup via
set_global_blacklist(); on failure falls back to an empty list.
- policy.rs: new file. BlacklistFile / BlacklistEntry TOML schema,
load_dir() reads .toml/.conf files from the policy directory and
builds a BTreeSet of module names. Missing directory returns empty
(opt-in). Tests cover missing / valid / invalid-file paths.
local/sources/base submodule pointer (commit
|
||
|
|
4dc51bd61f |
driver-manager: v1.3 comprehensive D-phase implementation
Full implementation of the driver-manager migration's D-phase
(parallel development) per the v1.3 plan. The § 0.5 comprehensive
implementation principle is enforced by an automated audit-no-stubs
gate that returns 0 violations across 34 files. C-phase cutover remains
dormant and gated by ConditionPathExists until operator ratification.
redox-driver-core (28 unit + 5 integration tests):
- concurrent.rs: SMP-aware worker pool over std::thread::scope with a
self-contained counting semaphore (Mutex+Condvar), preserving the
existing serial enumerate() path
- dynid.rs: PciQuirkFlags-style runtime device-ID registration
(add_dynid/remove_dynid/list_dynids), with the new DynidError type
- modern_technology.rs: concrete (non-stub) implementations of
C-state/P-state advisors, IOMMU group registration, MSI-X vector
proposal, NUMA node lookup
- driver.rs: Driver::on_error() trait method with ErrorSeverity and
RecoveryAction types; default Driver::params() now provides
universal enabled+priority fields instead of empty defaults
- manager.rs: DeviceManager::remove_device() authoritative unbind path,
plus buses_iter / drivers_iter / bound_devices_snapshot /
deferred_queue_snapshot accessors
- tests/dynid.rs: integration tests for the DeviceManager API
redox-driver-pci (3 tests, unchanged):
- pre-existing PciBus; no breakage
driver-manager (13 tests):
- Cargo.toml: adds redox-driver-sys path dep
- quirks.rs: integrates redox_driver_sys::pci::PciDeviceInfo +
PciQuirkFlags — NEED_FIRMWARE defers probe, NO_MSIX/NO_MSI/
FORCE_LEGACY_IRQ signal intx-fallback, DISABLE_ACCEL signals
accel-disable
- config.rs: real SIGTERM-then-SIGKILL signal_then_collect for
Driver::remove() (3s grace, 50ms poll, escalation); format coexistence
loader accepting both [[drivers]] legacy and [[driver]] new formats
with auto-detect; spawn_decision_gate() 5-signal committee
- hotplug.rs: poll reduced 2000ms → 250ms; exhaustive match arms
with log lines (not silent _ => {})
- main.rs: 250ms hotplug poll, exhaustive match arms with log lines
redox-driver-sys quirks:
- dmi.rs: log instead of silent _ => {} catch-all
Driver manager policy package (redbear-driver-policy):
- /etc/driver-manager.d/00-blacklist.conf (4 driver blacklist entries)
- /etc/driver-manager.d/50-amdgpu.toml (AMD GPU driver policy)
- /etc/driver-manager.d/initfs.manifest (ordered initfs driver list)
- /etc/driver-manager.d/autoload.d/ntsync.conf (autoload ntsync module)
- /etc/driver-manager.d/README.md (explanation)
- recipe.toml: custom install script that stages into /etc/driver-manager.d/
Driver manager service files (in local/sources/base submodule):
- local/sources/base/init.d/00_driver-manager.service — dormant
(oneshot_async, ConditionPathExists=!/etc/driver-manager.d/disabled)
- local/sources/base/init.initfs.d/40_driver-manager-initfs.service —
dormant (oneshot, ConditionPathExists=!/etc/driver-manager.d/initfs-active)
Audit gate:
- local/scripts/driver-manager-audit-no-stubs.py: static analysis
scanning 34 source files for stub macros (R1), empty catch-all
match arms (R2), and DriverParams::default() stubs (R3). Returns
0 violations at v1.3.
- local/scripts/driver-manager-audit-no-stubs.sh: thin wrapper
- local/scripts/test-driver-manager-no-stubs-qemu.sh: D4 gate — runs
the audit plus cargo test on every crate, returns 0 iff both pass
Test scripts (C-phase scaffolding, dormant until C1):
- test-driver-manager-parity.sh (C1)
- test-driver-manager-active.sh (C3)
- test-driver-manager-initfs.sh (C2)
- test-driver-manager-hotplug.sh (D3)
- test-driver-manager-pm.sh (D2)
- test-driver-manager-cutover.sh (C4)
Docs:
- local/docs/DRIVER-MANAGER-MIGRATION-PLAN.md: v1.3 status table
listing every D-phase item as Done
- local/docs/evidence/driver-manager/D5-AUDIT.md: capability-by-
capability matrix + verbatim audit output
- local/docs/HARDWARE-VALIDATION-MATRIX.md: driver-manager rows
added with v1.3 status
- local/AGENTS.md: PLANNING NOTES pointer updated to v1.3
- docs/README.md: Related Red Bear-local plans row updated to v1.3
Test totals: 49 tests across the three crates, all passing.
Audit totals: 0 violations across 34 files, all clean.
Note: local/sources/base service files (00_driver-manager.service and
40_driver-manager-initfs.service) live in a submodule and need a
separate commit there. They are NOT included in this commit.
|