v9
2026-09-29
PCI核心支持Live Update · v9
PCI 核心 Live Update 系列跨 kexec 保留 VFIO 等设备,涵盖 FLB、设备跟踪、桥/总线号及 ACS/ARI。
原始补丁链接
子 Patch(13)
1/13
PCI: liveupdate: Set up FLB handler for the PCI core
注册 PCI Live Update 的 FLB handler,将核心需保留状态序列化进 pci_ser,使新内核避开仍在 DMA 的设备;保留由用户态经 LUO 文件 ioctl 决定并具备生命周期管理。
2/13
PCI: liveupdate: Track outgoing preserved PCI devices
新增 pci_liveupdate_preserve()/unpreserve(),驱动通知核心哪些设备为 outgoing 保留,更新 pci_ser 与列表,供 shutdown/kexec 和交接新内核;暂限根总线非 VF。
3/13
PCI: liveupdate: Track incoming preserved PCI devices
枚举时 pci_liveupdate_setup_device() 调用 pci_flb_retrieve() 取上一内核 pci_ser,转成 xarray 并挂到 dev->liveupdate_incoming,供 is_incoming() 识别 incoming 保留设备;取回失败必须致命。
4/13
PCI: liveupdate: Document driver binding responsibilities
在 pci_liveupdate.c 补充注释,说明 Live Update 下驱动绑定流程及 PCI 核心对驱动和用户的职责边界,仅记录当前分工,便于后续维护与演化。
5/13
PCI: liveupdate: Auto-preserve upstream bridges across Live Update
保留端点时自动保留其上游桥至根端口,并在 pci_dev_ser 用引用计数记录下游保留数,桥需等所有下游设备取消保留或结束 Live Update 后才释放。
6/13
PCI: liveupdate: Preserve bus numbers during Live Update
若上一内核有保留设备,则保留桥的 secondary/subordinate 总线号,即使 pci=assign-busses,避免 RequesterID 变化破坏在途 DMA;无总线号桥仍可新分配。
7/13
PCI: Refactor matching logic for pci_dev_acs_ops
将 pci_dev_specific_enable_acs() 和 disable_acs_redir() 中重复的设备匹配循环提取为 pci_dev_acs_ops_get(),供后续 Live Update 检查设备专属 enable_acs;纯重构。
8/13
PCI: Save and restore the ACS Control register
On Fri, 18 Sep 2026 20:06:34 +0000 David Matlack dmatlack@google.com wrote: > Save the ACS Control register in pci_save_state() and write it back > in pci_restore_state(), instead of recomputing the
9/13
PCI: liveupdate: Adopt ACS controls in incoming preserved devices
对 incoming 保留设备及上游桥继承 ACS 控制,避免在途 DMA 路由和 IOMMU group 变化;由 pci_save_state/restore_state 保存恢复,无法保存则重编程,并拒绝需 ACS quirk 的设备。
10/13
PCI: liveupdate: Adopt ARI Forwarding Enable on preserved bridges
在保留桥上继承 ARI Forwarding Enable 位并同步 pci_dev->ari_enabled,使桥下保留设备在 Live Update 后仍用相同 8 位功能号被识别。
11/13
PCI: liveupdate: Freeze preservation status during shutdown
在 shutdown 时由 PCI 核心调用 pci_liveupdate_freeze() 冻结所有设备的 outgoing 保留状态,阻止未保留设备被延迟保留,使 shutdown 路径可安全依据状态决策。
12/13
PCI: liveupdate: Do not disable bus mastering on preserved devices during kexec
kexec 关闭时对 outgoing 保留设备跳过 pci_device_shutdown() 中清除 Bus Master,保留端点和上游桥继续发起/转发内存事务,保障 Live Update 连续运行。
13/13
Documentation: PCI: Add documentation for Live Update
新增 Documentation/PCI/liveupdate.rst 等,基于内核注释描述 PCI Live Update 的 FLB API、设备跟踪和总线号/总线主控等保留策略,并更新索引与 MAINTAINERS。