]> git.ipfire.org Git - thirdparty/pciutils.git/log
thirdparty/pciutils.git
4 days agoReleased as v3.15.0 master v3.15.0
Martin Mareš [Sun, 5 Apr 2026 19:24:24 +0000 (21:24 +0200)] 
Released as v3.15.0

4 days agoUpdate pci.ids to current snapshot
Martin Mareš [Sun, 5 Apr 2026 19:16:18 +0000 (21:16 +0200)] 
Update pci.ids to current snapshot

4 days agoABI: Forgot to assign versions to pci_filter_has_*
Martin Mareš [Sun, 5 Apr 2026 19:10:16 +0000 (21:10 +0200)] 
ABI: Forgot to assign versions to pci_filter_has_*

4 days agolspci: Show MSI routing
Martin Mareš [Sun, 5 Apr 2026 18:50:18 +0000 (20:50 +0200)] 
lspci: Show MSI routing

4 days agosysfs: Parse MSI routing if available
Martin Mareš [Sun, 5 Apr 2026 18:49:52 +0000 (20:49 +0200)] 
sysfs: Parse MSI routing if available

4 days agoBump ABI version of pci_fill_info to 3.15
Martin Mareš [Sun, 5 Apr 2026 18:49:16 +0000 (20:49 +0200)] 
Bump ABI version of pci_fill_info to 3.15

4 days agolspci: Do not show IRQ routing for disabled INTx
Martin Mareš [Sun, 5 Apr 2026 17:45:03 +0000 (19:45 +0200)] 
lspci: Do not show IRQ routing for disabled INTx

Closes #193

4 days agosysfs: Fix bug in parsing of classes
Martin Mareš [Sun, 5 Apr 2026 17:37:25 +0000 (19:37 +0200)] 
sysfs: Fix bug in parsing of classes

4 days agoMakefile: Fix building of man pages
Martin Mareš [Sun, 5 Apr 2026 17:31:19 +0000 (19:31 +0200)] 
Makefile: Fix building of man pages

The old pattern rule was subtly wrong and newer versions
of GNU Make started warning on it.

4 days agoMakefile: We no longer use ctags
Martin Mareš [Sun, 5 Apr 2026 17:23:19 +0000 (19:23 +0200)] 
Makefile: We no longer use ctags

4 days agoMan: Document what happens when multiple -s or -d options are given
Martin Mareš [Sun, 5 Apr 2026 17:19:07 +0000 (19:19 +0200)] 
Man: Document what happens when multiple -s or -d options are given

4 days agolspci, setpci: Warn when -s or -d is used multiple times
Martin Mareš [Sun, 5 Apr 2026 17:18:47 +0000 (19:18 +0200)] 
lspci, setpci: Warn when -s or -d is used multiple times

4 days agofilters: Added function for testing if a filter specifies slot/id
Martin Mareš [Sun, 5 Apr 2026 17:18:22 +0000 (19:18 +0200)] 
filters: Added function for testing if a filter specifies slot/id

4 days agosysfs: Hot-unplug of devices should not produce hard errors
Martin Mareš [Sun, 5 Apr 2026 17:04:04 +0000 (19:04 +0200)] 
sysfs: Hot-unplug of devices should not produce hard errors

Closes #187.

4 days agoAdd README.DJGPP
Martin Mareš [Sun, 5 Apr 2026 16:50:29 +0000 (18:50 +0200)] 
Add README.DJGPP

Contributed by Pali.

4 days agolspci: add test with capabilities 32, 34, and 36
Alex Martens [Sun, 25 Jan 2026 18:40:34 +0000 (10:40 -0800)] 
lspci: add test with capabilities 32, 34, and 36

- h0032: Flit logging
- h0034: Flit error injection
- h0036: MMIO register block locator

4 days agoFreeBSD supports 64b PCI addresses
Navdeep Parhar [Thu, 19 Mar 2026 00:24:41 +0000 (17:24 -0700)] 
FreeBSD supports 64b PCI addresses

4 days agosetpci: Fix discards const from pointer target
Rudi Heitbaum [Sun, 22 Feb 2026 00:47:15 +0000 (00:47 +0000)] 
setpci: Fix discards const from pointer target

Since glibc-2.43, and for ISO C23, the function strchr that return
pointer into their input arrays now have definitions as macros that
return a pointer to a const-qualified type when the input argument is
a pointer to a const-qualified type.

The char *e is only used as a pointer to const char **opts, and only
used for comparisons, so declare *e as const to address warning.

Fixes:
    setpci.c: In function 'parse_options':
    setpci.c:513:19: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      513 |             if (e = strchr(opts, *c))
          |                   ^

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
4 days agolibpci: ecam: Fix discards const from pointer target
Rudi Heitbaum [Sun, 22 Feb 2026 00:46:31 +0000 (00:46 +0000)] 
libpci: ecam: Fix discards const from pointer target

endptr is used as the return from strchr(addrs, ',') which is a const
char. endptr is subsequently used as a pointer to the token which is
char. Fix by not reusing endptr, but declare addrsptr as a const char *
pointer for use in the first case addressing the warning.

fixes:
    ecam.c: In function 'parse_next_addrs':
    ecam.c:620:10: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
      620 |   endptr = strchr(addrs, ',');
          |          ^

Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
4 days agodump: Support `lspci -F -` for stdin
Martin Mareš [Sun, 5 Apr 2026 16:38:32 +0000 (18:38 +0200)] 
dump: Support `lspci -F -` for stdin

It can be useful to pipe raw config registers (lspci -x) from one system
to another, so the latter system can do the parsing (lspci -vv -F ...).
For example, one might do this if the former has a more limited / older
version of lspci. Today, one has to write the contents to a file.

Support stdin via "-", so it's easier to run it through a pipeline, such
as:

  ssh ${remote_host} old_lspci -xxx | new_lspci -vv -F -

A dash (-) is a common convention used by many other tools. If one
really expected to access a file named "-", one can use "./-" or similar
to disambiguate.

Based on a patch by Brian Norris <briannorris@chromium.org>.

4 days agodump: Refactor file parsing
Martin Mareš [Sun, 5 Apr 2026 16:35:24 +0000 (18:35 +0200)] 
dump: Refactor file parsing

5 days agoREADME: Download by FTP is no longer supported
Martin Mareš [Sat, 4 Apr 2026 13:14:58 +0000 (15:14 +0200)] 
README: Download by FTP is no longer supported

3 months agolibpci: win32-cfgmgr32: Fix handling of "\\??\\C:\\..." driver paths
Pali Rohár [Sat, 20 Dec 2025 19:56:27 +0000 (20:56 +0100)] 
libpci: win32-cfgmgr32: Fix handling of "\\??\\C:\\..." driver paths

3 months agolibpci: physmem-windows: Fix check for length param of physmem_unmap()
Pali Rohár [Sun, 30 Nov 2025 16:21:57 +0000 (17:21 +0100)] 
libpci: physmem-windows: Fix check for length param of physmem_unmap()

VirtualQuery() does not have to return whole mapped range, but just region
subset. So call VirtualQuery() multiple times for each region and calculate
the total length of the mapping.

This change fixes unmapping of the BIOS 0xE0000-0x100000 memory for which
Windows creates region of one page and so VirtualQuery() for each region i
at virtual address ptr + i*4096 returns AllocationBase=ptr and RegionSize=4096.

3 months agowindows: Mark more local win32 helpers functions as static
Pali Rohár [Sun, 30 Nov 2025 15:27:21 +0000 (16:27 +0100)] 
windows: Mark more local win32 helpers functions as static

After movement of win32_call_func_with_tcb_privilege() function from
i386-io-windows.h to win32-helpers.c done in 3.11.0, lot of win32 helpers
functions are not used outside of win32-helpers.c anymore. Mark them as
static and remove from win32-helpers.h header file.

3 months agowindows: Simplify win32_find_and_open_process_for_query()
Pali Rohár [Sun, 30 Nov 2025 15:28:46 +0000 (16:28 +0100)] 
windows: Simplify win32_find_and_open_process_for_query()

Retrieve information about all processes in system via
NtQuerySystemInformation(SystemProcessInformation) call.
This method returns both process id and process name.
It is supported on all Windows NT based systems.

This replaces complicated code which uses different WinAPI functions
for specific Windows versions.

3 months agowindows: Improve win32_change_token()
Pali Rohár [Sun, 30 Nov 2025 13:19:52 +0000 (14:19 +0100)] 
windows: Improve win32_change_token()

Function ImpersonateLoggedOnUser() is not available on older Windows
versions.

Instead of ImpersonateLoggedOnUser(), use SetThreadToken() on the
duplicated token of SecurityImpersonation type, same what is
ImpersonateLoggedOnUser() expected to do.

3 months agowindows: Improve win32_change_error_mode()
Pali Rohár [Mon, 27 Oct 2025 10:55:34 +0000 (11:55 +0100)] 
windows: Improve win32_change_error_mode()

Do not clear existing error bits when setting SEM_FAILCRITICALERRORS bit.
Just append SEM_FAILCRITICALERRORS to existing error bit set.

Use GetThreadErrorMode(), GetThreadErrorMode() or GetErrorMode() function
to retrive existing set error bits.

3 months agowindows: Improve version detection
Pali Rohár [Sat, 16 Aug 2025 01:17:25 +0000 (03:17 +0200)] 
windows: Improve version detection

Move version detection code into helper functions, which can be reused.

For 32-bit x86 builds use GetVersion() which is available in all Windows
versions instead of GetVersionEx().

3 months agowindows: Fix wideness of 16-bit constant VWIN32_DEVICE_ID
Pali Rohár [Sat, 26 Jul 2025 17:34:38 +0000 (19:34 +0200)] 
windows: Fix wideness of 16-bit constant VWIN32_DEVICE_ID

3 months agoUpdate orthography of IDs
Jonathan Teh [Sat, 6 Dec 2025 00:06:52 +0000 (00:06 +0000)] 
Update orthography of IDs

Originally, we spelled "ID's" with an apostrophe. This is still correct,
but somewhat niche spelling.

3 months agoUpdate margin_hw.c
Amit Kumar [Thu, 27 Nov 2025 08:39:56 +0000 (14:09 +0530)] 
Update margin_hw.c

pcilmr: Fix incorrect device pair detection in margin_find_pair()

When finding the parent bridge of an endpoint device, margin_find_pair()
was reading PCI_SECONDARY_BUS (offset 0x19) from all devices in the
system without checking if they are actually bridge devices.

For non-bridge devices (header type 0), offset 0x19 contains arbitrary
data that could coincidentally match the target device's bus number,
causing the function to return an incorrect device as the downstream port.

This resulted in the misleading error:
  "Looks like you don't have enough privileges to access Device
   Configuration Space."

The error occurred because the incorrectly selected device (e.g., a SATA
controller) doesn't have a PCIe Express capability, causing pci_find_cap()
to correctly return NULL.

Fix by adding a margin_port_is_down(p) check before reading
PCI_SECONDARY_BUS. This ensures we only examine actual PCIe bridge
devices (Root Ports or Switch Downstream Ports) when searching for
the parent bridge.

Example failure case:
  - Target: 0000:60:00.0 (NVMe device, bus 0x60)
  - Actual parent: 0000:5d:02.0 (PCIe switch downstream port)
  - Incorrectly matched: 0000:00:18.0 (SATA controller with 0x60 at offset 0x19)

After fix, correctly identifies 0000:5d:02.0 as the downstream port.

3 months agosetpci: add reg name for flit logging
Alex Martens [Thu, 13 Nov 2025 23:11:41 +0000 (15:11 -0800)] 
setpci: add reg name for flit logging

Signed-off-by: Alex Martens <alex.martens@asteralabs.com>
3 months agoMerge remote-tracking branch 'am/lspci-flit-log'
Martin Mareš [Sun, 28 Dec 2025 20:20:03 +0000 (21:20 +0100)] 
Merge remote-tracking branch 'am/lspci-flit-log'

3 months agoMerge remote-tracking branch 'github/master'
Martin Mareš [Sun, 28 Dec 2025 20:09:56 +0000 (21:09 +0100)] 
Merge remote-tracking branch 'github/master'

3 months agoMerge remote-tracking branch 'am/lspci-flit-error'
Martin Mareš [Sun, 28 Dec 2025 20:08:57 +0000 (21:08 +0100)] 
Merge remote-tracking branch 'am/lspci-flit-error'

3 months agols-ecaps: Add XT and TEE-Limited support reporting
Alexey Kardashevskiy [Tue, 21 Oct 2025 07:49:47 +0000 (18:49 +1100)] 
ls-ecaps: Add XT and TEE-Limited support reporting

PCIe r6.1 added TDISP with TEE Limited bits.
PCIe r7.0 added XT mode for IDE TLPs.

Define new bits and update the test.

Signed-off-by: Alexey Kardashevskiy <aik@amd.com>
3 months agoFix indentation
Martin Mareš [Sun, 28 Dec 2025 19:57:06 +0000 (20:57 +0100)] 
Fix indentation

3 months agolspci: decode MMIO Register Block Locator
Alex Martens [Fri, 4 Jul 2025 16:48:56 +0000 (09:48 -0700)] 
lspci: decode MMIO Register Block Locator

MRBL is defined in the PCIe base specification 6.2.

Signed-off-by: Alex Martens <alex.martens@asteralabs.com>
4 months agolspci: decode flit logging
Alex Martens [Thu, 13 Nov 2025 22:50:21 +0000 (14:50 -0800)] 
lspci: decode flit logging

The flit logging extended capability is defined in the PCI express base
specification revision 6.4.

Signed-off-by: Alex Martens <alex.martens@asteralabs.com>
4 months agolspci: decode flit error injection
Alex Martens [Mon, 10 Nov 2025 18:29:12 +0000 (10:29 -0800)] 
lspci: decode flit error injection

The flit error injection extended capability is defined in the PCI
express base specification revision 6.4.

Signed-off-by: Alex Martens <alex.martens@asteralabs.com>
9 months agols-caps: Add support to decode Gen7 speed
Prabu Thangamuthu [Tue, 1 Jul 2025 00:05:09 +0000 (00:05 +0000)] 
ls-caps: Add support to decode Gen7 speed

Updated Link capabilities, Link status and Link capabilities 2 registers decode logic to support PCIe Gen7 speed.

Signed-off-by: Prabu Thangamuthu <prabut@synopsys.com>
9 months agoheader.h: Fix type 1 header comment
Rong Tao [Mon, 23 Jun 2025 08:30:43 +0000 (16:30 +0800)] 
header.h: Fix type 1 header comment

Should be 0x35-0x37 is reserved.

Signed-off-by: Rong Tao <rongtao@cestc.cn>
9 months agoMaint: Another typo in maint/release
Martin Mares [Sat, 21 Jun 2025 16:09:03 +0000 (18:09 +0200)] 
Maint: Another typo in maint/release

9 months agoMaint: Fix typo in maint/release v3.14.0
Martin Mares [Sat, 21 Jun 2025 16:06:20 +0000 (18:06 +0200)] 
Maint: Fix typo in maint/release

9 months agoReleased as v3.14.0
Martin Mares [Sat, 21 Jun 2025 16:05:08 +0000 (18:05 +0200)] 
Released as v3.14.0

9 months agoUpdate pci.ids to the current snapshot
Martin Mares [Sat, 21 Jun 2025 15:55:07 +0000 (17:55 +0200)] 
Update pci.ids to the current snapshot

9 months agolibpci: djgpp: Handle Windows NTVDM zero error codes
Pali [Sat, 21 Jun 2025 15:21:01 +0000 (17:21 +0200)] 
libpci: djgpp: Handle Windows NTVDM zero error codes

Windows NTVDM DPMI host clears the AX register for unsupported DPMI calls.
So handle zero error code as ENOSYS instead of default case EACCES.

9 months agoFix formatting of 64-bit integers
Martin Mares [Sat, 21 Jun 2025 15:19:12 +0000 (17:19 +0200)] 
Fix formatting of 64-bit integers

PCI_U64_FMT_X is needed.

9 months agoUse snprintf instead of sprintf to prevent buffer overruns
Mingjie Shen [Wed, 18 Jun 2025 21:47:28 +0000 (17:47 -0400)] 
Use snprintf instead of sprintf to prevent buffer overruns

In bitops.h, update the TABLE macro to call snprintf(buf, sizeof(buf),
...) rather than unbounded sprintf, ensuring that out-of-range indices
produce a bounded "??%d" string.

In setpci.c, change the device slot formatting from sprintf(slot, ...) to
snprintf(slot, sizeof(slot), ...), capping output to the 16-byte buffer
and avoiding overflow when printing PCI domain, bus, dev, and func
values.

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
9 months agoLMR: <string.h> is required for memset()
Martin Mares [Sat, 21 Jun 2025 15:08:50 +0000 (17:08 +0200)] 
LMR: <string.h> is required for memset()

9 months agoTables of strings should have both pointers and the actual strings const
Martin Mares [Sun, 15 Jun 2025 20:52:58 +0000 (22:52 +0200)] 
Tables of strings should have both pointers and the actual strings const

9 months agoRemove trailing whitespace
Martin Mares [Sun, 15 Jun 2025 20:50:53 +0000 (22:50 +0200)] 
Remove trailing whitespace

9 months agoFlit Mode and Device 3 Capability
Paul Cassidy [Fri, 28 Feb 2025 00:09:01 +0000 (00:09 +0000)] 
Flit Mode and Device 3 Capability

9 months agoheader.h: Classes and capabilities from PCI Code and ID Assignment rev 1.18
Martin Mares [Wed, 11 Jun 2025 21:04:09 +0000 (23:04 +0200)] 
header.h: Classes and capabilities from PCI Code and ID Assignment rev 1.18

9 months agoPort to RT-Thread Smart DM PCI
GuEe-GUI [Thu, 28 Nov 2024 06:37:12 +0000 (14:37 +0800)] 
Port to RT-Thread Smart DM PCI

Signed-off-by: GuEe-GUI <2991707448@qq.com>
10 months agolspci: Add test case for Physical Layer 16 GT/s and 32 GT/s extended capability registers
Tristan Watts-Willis [Mon, 9 Jun 2025 18:40:35 +0000 (11:40 -0700)] 
lspci: Add test case for Physical Layer 16 GT/s and 32 GT/s extended capability registers

10 months agoUpdate pci.ids to the current snapshot
Martin Mares [Sun, 8 Jun 2025 16:11:04 +0000 (18:11 +0200)] 
Update pci.ids to the current snapshot

10 months agopcilib.man: Update information about win32-kldbg
Pali Rohár [Sat, 18 Jan 2025 18:20:08 +0000 (19:20 +0100)] 
pcilib.man: Update information about win32-kldbg

10 months agolibpci: win32-kldbg: Implement registration driver from non-native process
Pali Rohár [Sat, 18 Jan 2025 18:05:50 +0000 (19:05 +0100)] 
libpci: win32-kldbg: Implement registration driver from non-native process

It is common that 32-bit application is running on 64-bit host system, or
nowadays also that 64-bit AMD64 application is running on ARM64 system.

For all these cases the win32-kldbg.c code horrible fails with just generic
error message when trying to register kldbgdrv.sys driver.

Add code which detects machine type of running process, machine type of
kldbgdrv.sys driver and machine type of the host system. If machine type of
driver and system machines then allow to register driver. Otherwise print
debug verbose message why it is not possible to use kldbgdrv.sys driver
from kd.exe/windbg.exe binary. This could allow to debug issues via command
lspci -G why win32-kldbg refused to load driver from windbg.exe binary.

At the same time relax checks in win32_check_driver() to not depend on the
constants related to process type as process architecture is not relevant
here. Important is always only driver and native system architecture,
process may be running under WoW64 (e.g. i386 process or AMD64 system).

10 months agolibpci: win32-kldbg: Fix calling IOCTL_KLDBG from 32-bit process on 64-bit system
Pali Rohár [Sat, 18 Jan 2025 17:57:05 +0000 (18:57 +0100)] 
libpci: win32-kldbg: Fix calling IOCTL_KLDBG from 32-bit process on 64-bit system

32-bit process on 64-bit system needs to pass all pointers in 64-bit format
for IOCTL_KLDBG call.

So for 32-bit builds (determined by not defined _WIN64 macro) define new
SYSDBG_BUS_DATA64 and KLDBG64 structures with u64 type for pointer members.
Compiler will automatically align all structure members and inserts padding
between members as needed, in the same way as for 64-bit builds. Due to
alignment restrictions, adding just one dummy 32-bit member after each
pointer member does not work.

32-bit code then needs to figure out if the host system is 32-bit or 64-bit
and choose which structure (process native or 64-bit) needs to be passed to
the IOCTL_KLDBG call for successful execution. This is determined by the
win32_is_32bit_on_64bit_system() helper function.

With this change 32-bit i386 lspci.exe binary is working fine on 64-bit
AMD64 system and via win32-kldbg can access PCIe config space if the
AMD64 kldbgdrv.sys driver is registered in the host system.

10 months agolibpci: win32-cfgmgr32: Improve parsing of driver path
Pali Rohár [Fri, 20 Sep 2024 21:10:42 +0000 (23:10 +0200)] 
libpci: win32-cfgmgr32: Improve parsing of driver path

Remove NT prefix "\\??\\" prefix only for drive letters when converting it
to Win32 path. And convert unhandled absolute NT path to Win32 path via
"GLOBALROOT" symlink (which points to NT root path) available in Win32
"\\\\?\\" path. With this change libpci's driver path on windows should be
always valid Win32 path.

10 months agolibpci: win32-cfgmgr32: Define error messages for all CR_* error constants
Pali Rohár [Fri, 5 Apr 2024 17:16:55 +0000 (19:16 +0200)] 
libpci: win32-cfgmgr32: Define error messages for all CR_* error constants

10 months agowindows: Fix declaration of GetSystemFirmwareTable function pointer
Pali Rohár [Sat, 18 Jan 2025 17:37:13 +0000 (18:37 +0100)] 
windows: Fix declaration of GetSystemFirmwareTable function pointer

Function pointer attributes have to be specified on the left side of the *.

10 months agowindows: Update comment about RtlNtStatusToDosError() side effect
Pali Rohár [Sat, 11 Jan 2025 13:10:37 +0000 (14:10 +0100)] 
windows: Update comment about RtlNtStatusToDosError() side effect

10 months agowindows: Check for SizeOfOptionalHeader before dereferencing OptionalHeader
Pali Rohár [Wed, 4 Dec 2024 17:20:18 +0000 (18:20 +0100)] 
windows: Check for SizeOfOptionalHeader before dereferencing OptionalHeader

offsetof(IMAGE_OPTIONAL_HEADER, DataDirectory) is the minimal size of
variable length OptionalHeader (IMAGE_OPTIONAL_HEADER) structure.

10 months agowindows: Improve win32_change_error_mode()
Pali Rohár [Thu, 21 Nov 2024 23:24:51 +0000 (00:24 +0100)] 
windows: Improve win32_change_error_mode()

Attempt to do two other thread safe methods before doing fallback to thread
unsafe SetErrorMode() method.

10 months agowindows: Do not manually load ntdll.dll library
Pali Rohár [Thu, 21 Nov 2024 23:36:29 +0000 (00:36 +0100)] 
windows: Do not manually load ntdll.dll library

Per Windows Internals, Part 1, Image Loader section, the ntdll.dll library
is always loaded into every process on all NT systems.

So remove code which dynamically loads ntdll.dll library via LoadLibrary()
function and remove also code which changes error reporting mode (used just
for LoadLibrary) as both are not needed.

Also Microsoft C/C++ compilers optimize EXE applications in a way which
expects that the ntdll.dll library is loaded as the first module into the
process before the main EXE module itself.

10 months agowindows: Do not cast FARPROC to LPVOID and then to some function pointer
Pali Rohár [Thu, 21 Nov 2024 22:51:26 +0000 (23:51 +0100)] 
windows: Do not cast FARPROC to LPVOID and then to some function pointer

FARPROC is function pointer type intptr_t(__stdcall*)() and LPVOID is data
pointer type void*. Casting from function pointer to data pointer and back
is undefined in C, and moreover in all cases it is not needed. In all cases
it is just needed to cast FARPROC function pointer type to some specific
function pointer type, and casting via intermediate LPVOID was there just
to mute compiler warnings about casting between two incompatible function
pointer types. To mute that compiler warning, do casting via intermediate
generic function pointer type void(*)(void) which is preferred according to
gcc documentation and does not throw any compiler warnings neither by gcc,
nor by msvc compilers.

10 months agolibpci: add some missing PCI_CLASS constants
Ronan Pigott [Fri, 9 May 2025 05:57:43 +0000 (22:57 -0700)] 
libpci: add some missing PCI_CLASS constants

The names and values are taken from the pci.ids file.

10 months agoAllow pci.h to be included from C++
Martin Mares [Sun, 8 Jun 2025 14:58:09 +0000 (16:58 +0200)] 
Allow pci.h to be included from C++

10 months agoAdd CXL DVSEC GPF time_scale 10s support
yeeli [Fri, 7 Feb 2025 06:37:12 +0000 (14:37 +0800)] 
Add CXL DVSEC GPF time_scale 10s support

Ref CXL Spec chapter 8.1.6 and 8.1.7, Add time_scale 10s support.

When time_scale is 7h

Old code shows:
GPF Phase 1 Timeout: 20<?>

New code shows
GPF Phase 1 Timeout: 20s

The changes do not affect Reserved time scale encoding shows <?>.

Signed-off-by: yeeli <seven.yi.lee@gmail.com>
10 months agolspci: Decode Physical Layer 64 GT/s extended capability register
Tristan Watts-Willis [Thu, 6 Feb 2025 01:38:51 +0000 (17:38 -0800)] 
lspci: Decode Physical Layer 64 GT/s extended capability register

10 months agolspci: Decode Physical Layer 16 GT/s and 32 GT/s extended capability registers
Tristan Watts-Willis [Thu, 6 Feb 2025 01:20:27 +0000 (17:20 -0800)] 
lspci: Decode Physical Layer 16 GT/s and 32 GT/s extended capability registers

16 months agoExtend the GNU/Hurd back-end to work on 64-bit systems
Samuel Thibault [Mon, 25 Nov 2024 12:54:11 +0000 (13:54 +0100)] 
Extend the GNU/Hurd back-end to work on 64-bit systems

20 months agolspci: add VirtIO SharedMemory capability support
Changyuan Lyu [Sat, 30 Dec 2023 01:37:28 +0000 (17:37 -0800)] 
lspci: add VirtIO SharedMemory capability support

This patch adds the support for VirtIO share memory capability [1].
A shared memory region is defined in a `struct virtio_pci_cap64`
where the highest 32 bits of `offset` and `size` are appened to the
original `struct virtio_pci_cap`.

With this patch, a VirtIO PMEM device (ID 27) shows like the
following:

```
00:02.0 Class ffff: Device 1af4:105b (rev 01)
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0
        Region 0: Memory at 100001000 (64-bit, non-prefetchable) [size=4K]
        Region 2: Memory at 101000000 (64-bit, non-prefetchable) [size=16M]
        Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
                BAR=0 offset=00000000 size=0000003c
        Capabilities: [50] Vendor Specific Information: VirtIO: ISR
                BAR=0 offset=0000003c size=00000001
        Capabilities: [60] Vendor Specific Information: VirtIO: Notify
                BAR=0 offset=00000040 size=00000002 multiplier=00000002
        Capabilities: [78] MSI-X: Enable+ Count=2 Masked-
                Vector table: BAR=0 offset=00000058
                PBA: BAR=0 offset=00000078
        Capabilities: [88] Vendor Specific Information: VirtIO: DeviceCfg
                BAR=0 offset=00000044 size=00000010
        Capabilities: [98] Vendor Specific Information: VirtIO: SharedMemory
                BAR=2 offset=0000000000000000 size=0000000001000000 id=0
        Kernel driver in use: virtio-pci
```

[1] Sec 4.1.4.7 https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-1240004

Signed-off-by: Changyuan Lyu <changyuan.lv@gmail.com>
21 months agoECAM: Fix memory leak
Martin Mares [Fri, 5 Jul 2024 18:06:25 +0000 (20:06 +0200)] 
ECAM: Fix memory leak

21 months agoECAM: Spell "ACPI" in capitals in debug messages
Martin Mares [Fri, 5 Jul 2024 18:03:35 +0000 (20:03 +0200)] 
ECAM: Spell "ACPI" in capitals in debug messages

21 months agolspci: Parse Intel Vendor specific capabilities
Pali Rohár [Fri, 5 Jul 2024 09:40:06 +0000 (11:40 +0200)] 
lspci: Parse Intel Vendor specific capabilities

Intel Vendor specific capabilities are present on following devices:
* Intel Host Bridge / DRAM Controller
* Intel Integrated Graphics Controller
* Intel LPC Controller

Intel Host Bridge / DRAM Controller is on BDF address 00:00.0, so following
command should should parse and show Intel Vendor specific capabilities:

  lspci -s 00:00.0 -vv

Currently only Intel Capabilities Version 1 is supported for now. This is
used since second generation of the Intel Core processors (Sandy Bridge).

21 months agolibpci: Update manpage documentation for devmem.path
Pali Rohár [Sun, 18 Feb 2024 14:26:00 +0000 (15:26 +0100)] 
libpci: Update manpage documentation for devmem.path

21 months agolibpci: Document physmem API
Pali Rohár [Sat, 17 Feb 2024 15:30:30 +0000 (16:30 +0100)] 
libpci: Document physmem API

21 months agolibpci: Add Windows physmem support for PCIe ECAM access
Pali Rohár [Mon, 8 May 2023 19:25:12 +0000 (21:25 +0200)] 
libpci: Add Windows physmem support for PCIe ECAM access

It requires either access to NT Section \Device\PhysicalMemory (or
compatible) or to have available kernel32.dll VxDCall2 function or
w32skrnl.dll DPMI function.

21 months agolibpci: Add DJGPP physmem support for PCIe ECAM access
Pali Rohár [Mon, 8 May 2023 19:22:59 +0000 (21:22 +0200)] 
libpci: Add DJGPP physmem support for PCIe ECAM access

It requires either Device Mapping support on DPMI host or Physical Address
Mapping support together with support for changing DS descriptor limit to
maximal size 4 GB which enables address wrapping and so access to addresses
below the process base address.

22 months agoMaintainer scripts: Create GitHub releases
Martin Mares [Sat, 8 Jun 2024 18:46:00 +0000 (20:46 +0200)] 
Maintainer scripts: Create GitHub releases

22 months agoReleased as v3.13.0 v3.13.0
Martin Mares [Thu, 30 May 2024 15:58:10 +0000 (17:58 +0200)] 
Released as v3.13.0

22 months agoUpdated pci.ids
Martin Mares [Thu, 30 May 2024 15:54:02 +0000 (17:54 +0200)] 
Updated pci.ids

22 months agoABI version bump for pci_fill_info()
Martin Mares [Thu, 30 May 2024 15:52:26 +0000 (17:52 +0200)] 
ABI version bump for pci_fill_info()

We have new flags and new fields in struct pci_dev.

22 months agoChangeLog was missing a 3.12 release
Martin Mares [Thu, 30 May 2024 15:46:57 +0000 (17:46 +0200)] 
ChangeLog was missing a 3.12 release

22 months agoRCD: Cleanup
Martin Mares [Thu, 30 May 2024 15:46:01 +0000 (17:46 +0200)] 
RCD: Cleanup

22 months agoAdd display function for cxl1.1 device link status information. (#183)
Kobayashi Daisuke [Thu, 30 May 2024 15:41:28 +0000 (00:41 +0900)] 
Add display function for cxl1.1 device link status information. (#183)

* Add display function for cxl1.1 device link status information.

* Modifications according to comments. Adding a description, Fix odd indent, and remove unnecessary statement.

22 months agopcilmr: Fix margining for ports with Lane reversal
Nikita Proshkin [Mon, 27 May 2024 15:22:55 +0000 (18:22 +0300)] 
pcilmr: Fix margining for ports with Lane reversal

Current implementation interacts only with first Negotiated Link Width
lanes even when Maximum Link Width for the port is bigger than that and
Lane reversal is used. Utility in such situation may try to margin lane
which is not used right now and erroneously fail with
'Error during caps reading' message. Fix that behaviour.

Signed-off-by: Nikita Proshkin <n.proshkin@yadro.com>
22 months agopcilmr.man: Fix whitespace errors
Martin Mares [Mon, 27 May 2024 12:36:34 +0000 (14:36 +0200)] 
pcilmr.man: Fix whitespace errors

22 months agopcilmr: Update usage and man: new arguments format and grading
Nikita Proshkin [Wed, 22 May 2024 16:06:34 +0000 (19:06 +0300)] 
pcilmr: Update usage and man: new arguments format and grading

Signed-off-by: Nikita Proshkin <n.proshkin@yadro.com>
22 months agopcilmr: Apply grading quirk for Ice Lake RC ports
Nikita Proshkin [Wed, 22 May 2024 16:06:33 +0000 (19:06 +0300)] 
pcilmr: Apply grading quirk for Ice Lake RC ports

Ice Lake RC ports don't support two side independent timing margining,
however the entire margin across the eye is what is reported by one side
margining. Utility already has quirks for Ice Lake RC, so expand them
based on this grading information.

Signed-off-by: Nikita Proshkin <n.proshkin@yadro.com>
22 months agopcilmr: Add option to configure margining dwell time
Nikita Proshkin [Wed, 22 May 2024 16:06:32 +0000 (19:06 +0300)] 
pcilmr: Add option to configure margining dwell time

Signed-off-by: Nikita Proshkin <n.proshkin@yadro.com>
22 months agopcilmr: Add new grading option
Nikita Proshkin [Wed, 22 May 2024 16:06:31 +0000 (19:06 +0300)] 
pcilmr: Add new grading option

Original version of the utility used values from the Table 8-11 of the
PCIe Base Spec Rev 5.0 to evaluate lanes. But it seems that these values
relate only to the margining equipment and are not relevant to evaluating
the quality of connections.

The PCIe Base Spec Rev 5.0 sets the minimum values for the eye in the
section 8.4.2. Change default grading values in the utility according to
this section.

The specification uses the values of the full width and height of the eye,
so add these values to the output of the utility.

In addition, manufacturers can provide criteria for their devices that
differ from the standard ones. Usually this information falls under the
NDA, so add an option to the utility that will allow the user to set
necessary criteria for evaluating the quality of lanes.

Implement the following syntax for the -g(rading) option:
-g 1t=15ps,f | -g 6v=20

Use passed per link receiver criteria for the eye width (timing - t) or
height (voltage - v) in the utility results.

Additional flag f is for situations when port doesn't support two side
independent margining. In such cases by default calculate EW or EH as a
double one side result. User can add f flag for -g option to tell the
utility that the result in one direction is actually the measurement of
the full eye (for example, Ice Lake RC ports work in this way) and it does
not need to be multiplied.

Signed-off-by: Nikita Proshkin <n.proshkin@yadro.com>
22 months agopcilmr: Move most of pcilmr arguments parsing logic to the separate file
Nikita Proshkin [Wed, 22 May 2024 16:06:30 +0000 (19:06 +0300)] 
pcilmr: Move most of pcilmr arguments parsing logic to the separate file

Also change arguments parsing logic: now link parameters (selected lane
numbers, timing or voltage steps, etc) need to be specified after link port
and will affect only this link margining (previously, one option was
applied to all links).

See updated man for syntax and example.

Signed-off-by: Nikita Proshkin <n.proshkin@yadro.com>
22 months agopcilmr: Ensure that utility can accept either Downstream or Upstream link port
Nikita Proshkin [Wed, 22 May 2024 16:06:29 +0000 (19:06 +0300)] 
pcilmr: Ensure that utility can accept either Downstream or Upstream link port

Previously, the utility expected only the Upstream Port to be input and,
in fact, passing the Downstream Port led to strange and buggy error
messages. Improve arguments parsing logic to accept any side of the link.

It seems that the only use case that will not be available now is margining
the internal links of the switch, but this scenario looks as strange as
possible.

Signed-off-by: Nikita Proshkin <n.proshkin@yadro.com>
22 months agosysfs: Include <libgen.h> for basename()
Martin Mares [Mon, 27 May 2024 12:21:29 +0000 (14:21 +0200)] 
sysfs: Include <libgen.h> for basename()

Otherwise, it fails to build with musl libc.

22 months agodump: allow 6-digit domains
Konrad Sztyber [Wed, 22 May 2024 10:16:44 +0000 (12:16 +0200)] 
dump: allow 6-digit domains

The SPDK VMD driver assigns domains for the devices behind a VMD by
concatenating bus/device/function of the VMD, each on a separate byte.
For instance, a device behind a VMD with an address of 5d:05.5 would be
assigned domain 5d0505.

Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com>