Project

General

Profile

Actions

Bug #14957

closed

pcieadm overloads header1.iobasehi

Added by Andy Fiddaman 3 months ago. Updated 23 days ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

I was troubleshooting a system and dumping out the I/O base and limit for a PCIe bridge and noticed that pcieadm uses the same short code of iobasehi for both the I/O base and the limit

pcieadm_cfgspace.c
1101: { PCI_BCNF_IO_BASE_HI, 2, "iobasehi", "I/O Base Upper 16 bits",
1103: { PCI_BCNF_IO_LIMIT_HI, 2, "iobasehi", "I/O Limit Upper 16 bits",

Having found this I ran a script to dump the cfgspace of all devices and show which fields showed up more than once in the output, which suggests some overloading:

% /usr/lib/pci/pcieadm show-devs -H -o bdf | while read a; do
pfexec /usr/lib/pci/pcieadm show-cfgspace -d $a -HL | awk '{print $1}' | sort
 | uniq -c | awk '$1 > 1 { print $0 }'
pipe while> done | sort | uniq | awk '{print $2}'
header0.bar0.addr
header0.bar1.addr
header0.bar2.addr
header0.bar3.addr
header0.bar4.addr
header0.bar5.addr
header1.bar0.addr
header1.bar1.addr
header1.iobasehi
l1pm.ctl1
ltr.snoop
ltr.snoop.latscale
ltr.snoop.latval
pcie.slotsts.mrlsen
pcie.slotsts.presdet

Some of these might be false positives, but spot checks on a couple suggest a couple of copy/paste errors here.

Actions #1

Updated by Andy Fiddaman 3 months ago

  • Description updated (diff)
Actions #2

Updated by Andy Fiddaman 3 months ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk about 1 month ago

  • Gerrit CR set to 2478
Actions #4

Updated by Robert Mustacchi 24 days ago

I tested this by running through the pcieadm test suites. Both the privileged and unprivileged. I also tried to cons up the shell logic on a few other systems and didn't immediately see additional fields.

Actions #5

Updated by Electric Monk 23 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 66a9cc68640459b14e330f94bcab980ef58fd66d

commit  66a9cc68640459b14e330f94bcab980ef58fd66d
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2022-11-04T18:08:36.000Z

    14957 pcieadm overloads header1.iobasehi
    Reviewed by: Andy Fiddaman <illumos@fiddaman.net>
    Approved by: Dan McDonald <danmcd@mnx.io>

Actions

Also available in: Atom PDF