Opposed to all other (single CPU) machines I have encountered so far,
the T4-2 has two instead of one PCIe root complexes.
ldomctl already accounts for this and iterates over them but lacks a
simple skip condition when iterating over subdevices to avoid linking
devices in one root complex to those in another.
This fixes `init-system' on my T4-2 where I have been using a lame
work-around so far, but the recent report on bugs@ reminded me to look
into it more closely this time.
Thanks to tracey for quickly providing details about his hardware for
quick comparison.
OK?
Index: config.c
===================================================================
RCS file: /cvs/src/usr.sbin/ldomctl/config.c,v
retrieving revision 1.40
diff -u -p -r1.40 config.c
--- config.c 24 May 2020 22:08:54 -0000 1.40
+++ config.c 19 Jun 2020 22:31:55 -0000
@@ -1142,6 +1142,8 @@ hvmd_finalize_pcie_device(struct md *md,
md_link_node(md, node, parent);
TAILQ_FOREACH(subdevice, &device->guest->subdevice_list, link) {
+ if (strncmp(path, subdevice->path, strlen(path)) != 0)
+ continue;
TAILQ_FOREACH(component, &components, link) {
if (strcmp(subdevice->path, component->path) == 0)
md_link_node(md, parent, component->hv_node);