HomeFreeBSD

Support hot insertion and removal of PCI devices on EC2.

Description

Support hot insertion and removal of PCI devices on EC2.

Install ACPI notify handlers on PCI devices with an _EJ0 method. This
handler is invoked when devices are added or removed.

  • When an ACPI_NOTIFY_DEVICE_CHECK event posts, rescan the parent bus device. Note that strictly speaking we only need to rescan the specified device, but BUS_RESCAN is what is available, so we rescan the entire bus.
  • When an ACPI_NOTIFY_EJECT_REQUEST event posts, detach the device associated with the ACPI handle, invoke the _EJ0 method, and then delete the device.

Eventually this might be changed to vector notify events to devd in
userspace where devctl can be used instead to permit more complex
actions such as graceful unmounting of filesystems.

Tested by: cperciva
Reviewed by: cperciva, imp, scottl
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D21948

Details

Provenance
jhbAuthored on
Reviewer
cperciva
Differential Revision
D21948: Support hotplug of PCI devices on EC2.
Parents
rS353585: Export pci_attach() and pci_detach().
Branches
Unknown
Tags
Unknown