NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/55958: pciback.hide parsing error



>Number:         55958
>Category:       kern
>Synopsis:       pciback.hide parsing error
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 26 09:25:00 +0000 2021
>Originator:     Aleksey Arens
>Release:        (current) 9.99.78
>Organization:
>Environment:
NetBSD HOSTNAME_REDACTED 9.99.78 NetBSD 9.99.78 (SYS0.STAGING.02) #2: Tue Jan 26 09:03:55 UTC 2021  root@HOSTNAME_REDACTED:/usr/obj/sys/arch/amd64/compile/SYS0 amd64
>Description:
Booting kernel with the following option produces an error message on the console, and does not attach the respective pci device (at 8:0.0) to pciback:

  pciback.hide=(8:0.0)(1:0.1)(1:0.0)

The issue does not present itself whence the option list is shorter:

  pciback.hide=(8:0.0)(1:0.1)


The relevant portion of dmesg output:

---8<---


[     1.000003] pciback_pci_init: hide claim device 8:0:0
[     1.000003] pciback_pci_init: hide claim device 1:0:1
[     1.000003] autoconfiguration error: pciback_pci_init: syntax error at 1:


---8<---

The issue manifests regardless of the order of parenthesized items.

>How-To-Repeat:
Boot kernel with option pciback.hide=(8:0.0)(1:0.1)(1:0.0) on a machine where thus-enumerated devices are present.  Only booting as Dom0 under Xen was tested.
>Fix:
I performed a very basic bit of debugging by changing the kernel source as follows:

---8<--

diff --git a/sys/arch/xen/xen/pciback.c b/sys/arch/xen/xen/pciback.c
index 57f70788d194..55dc646f927f 100644
--- a/sys/arch/xen/xen/pciback.c
+++ b/sys/arch/xen/xen/pciback.c
@@ -377,6 +377,7 @@ pciback_pci_init(void)
        if (strlen(xi.xcp_pcidevs) == 0)
                return;
        pcidevs = xi.xcp_pcidevs;
+        aprint_verbose("xi.xcp_pcidevs=%s\n", xi.xcp_pcidevs);
        for (pcidevs = xi.xcp_pcidevs; *pcidevs != '\0';) {
                if (*pcidevs != '(')
                        goto error;

---8<---

The resulting output in dmesg has been:

---8<---

[     1.000003] xi.xcp_pcidevs=(8:0.0)(1:0.1)(1:
[     1.000003] pciback_pci_init: hide claim device 8:0:0
[     1.000003] pciback_pci_init: hide claim device 1:0:1
[     1.000003] autoconfiguration error: pciback_pci_init: syntax error at 1:

---8<---

The source of the issue is thus very much clear.  I'll attempt to track it down further and post a fix thereby.



Home | Main Index | Thread Index | Old Index