We may check following conditions to set the immutable flag whenYes, known at creation time, not retroactively enforced becauseAdd a flag to the group that positively indicates the group can neverOK, I see your point. It essentially refers to a singleton group which
have more than one member, even after hot plug. eg because it is
impossible due to ACS, or lack of bridges, and so on.
is immutable to hotplug.
someone used SVA
a new group is created for a device in pci_device_group():
1) ACS is enabled in the upstream path of the device;
2) the device is single function or ACS is enabled on a multi-function device;
3) the device type is PCI_EXP_TYPE_ENDPOINT (thus no hotplug);
4) no 'dma aliasing' on this device;
The last one is a bit conservative as it also precludes a device which aliasing
dma due to quirks from being treated as a singleton group. But doing so
saves the effort on trying to separate different aliasing scenarios as defined
in pci_for_each_dma_alias(). Probably we can go this way as the first step.
Once the flag is set on a group no other event can change it. If a new
identified device hits an existing singleton group in pci_device_group()
then it's a bug.