]> mj.ucw.cz Git - pciutils.git/log
pciutils.git
20 months agoParameters: Keep the list sorted and remove duplicates
Martin Mares [Sun, 5 Mar 2023 13:56:52 +0000 (14:56 +0100)]
Parameters: Keep the list sorted and remove duplicates

When multiple back-ends use the same option (e.g., "devmem.path"),
they tend to define it each. This is not nice, but before we generalize
these options properly, let us at least remove the duplicate definitions.

20 months agolibpci: Add PCIe ECAM access method
Pali Rohár [Sun, 29 Jan 2023 23:39:36 +0000 (00:39 +0100)]
libpci: Add PCIe ECAM access method

This is a new direct hardware access method via PCIe ECAM (Enhanced
Configuration Access Mechanism). It is available on all PCIe-compliant
hardware. Requires root privileges and access to physical memory.

ECAM mapping can be specified manually via a new ecam.addrs parameter or
can be read from ACPI MCFG table. ACPI MCFG table can be located in the
system or read from x86 BIOS memory.

20 months agoFix bug in previous commit
Martin Mares [Sat, 4 Mar 2023 22:53:00 +0000 (23:53 +0100)]
Fix bug in previous commit

20 months agowin32-cfgmgr32: Clean up initialization
Martin Mares [Sat, 4 Mar 2023 16:23:06 +0000 (17:23 +0100)]
win32-cfgmgr32: Clean up initialization

20 months agowin32-cfgmgr32: Improve wording in manual page
Martin Mares [Sat, 4 Mar 2023 16:02:46 +0000 (17:02 +0100)]
win32-cfgmgr32: Improve wording in manual page

20 months agoMerge remote-tracking branch 'pali/win32-cfgmgr32'
Martin Mares [Sat, 4 Mar 2023 15:58:35 +0000 (16:58 +0100)]
Merge remote-tracking branch 'pali/win32-cfgmgr32'

20 months agoUse "command -v" instead of "which"
Martin Mares [Sat, 4 Mar 2023 15:33:09 +0000 (16:33 +0100)]
Use "command -v" instead of "which"

Apparently, people started considering "which" obsolete. I still
consider "which" rather useful and definitely more comfortable to type
than "command -v".

Still, "command -v" should be more portable, so let us use it.
I wonder which of the ancient systems which we are still supporting
will be broken by this change...

20 months agoMerge remote-tracking branch 'pali/windows'
Martin Mares [Sat, 4 Mar 2023 15:28:08 +0000 (16:28 +0100)]
Merge remote-tracking branch 'pali/windows'

20 months agoMerge remote-tracking branch 'pali/mmio-ports'
Martin Mares [Sat, 4 Mar 2023 15:27:09 +0000 (16:27 +0100)]
Merge remote-tracking branch 'pali/mmio-ports'

20 months agoFilters: Allow leading "0x" for backward compatibility
Martin Mares [Sat, 4 Mar 2023 15:02:43 +0000 (16:02 +0100)]
Filters: Allow leading "0x" for backward compatibility

21 months agolibpci: mmio-ports: Fix support for 64-bit non-LLP64 systems
Pali Rohár [Sun, 29 Jan 2023 22:49:06 +0000 (23:49 +0100)]
libpci: mmio-ports: Fix support for 64-bit non-LLP64 systems

On 64-bit non-LLP64 systems is type long 64-bit. On 32-bit and 64-bit LLP64
systems is type long only 32-bit. But readl() and writel() functions works
with 32-bit PCI word. Fix it for non-LLP64 systems by using type u32.

22 months agolibpci: win32-cfgmgr32: Add support for accessing config space via other backend
Pali Rohár [Fri, 30 Dec 2022 20:21:10 +0000 (21:21 +0100)]
libpci: win32-cfgmgr32: Add support for accessing config space via other backend

Extend win32-cfgmgr32 backend and add a new option win32.cfgmethod for
specifying other backend for accessing PCI config space. There are more
config space access methods available on Windows and each is working only
sometimes (either requires special privileges or special setup).

So by default try to choose the first working one via order defined in pci
probe_sequence[] array. If none is available then emulate PCI config space
like before this change.

Function pci_init_v35() is extended and renamed to pci_init_internal() to
optionally do not throw errors and allow to specify one access method which
will be skipped in AUTO mode. This is used to prevent choosing win32-cfgmgr32
as config space access method for win32-cfgmgr32.

22 months agoFix versioned symbol aliases when used with link-time optimization
Martin Mares [Wed, 28 Dec 2022 12:48:47 +0000 (13:48 +0100)]
Fix versioned symbol aliases when used with link-time optimization

23 months agoREADME.Windows: Fix of $HOST
Martin Mares [Mon, 21 Nov 2022 19:21:59 +0000 (20:21 +0100)]
README.Windows: Fix of $HOST

Suggested by Pali.

23 months agolibpci: windows: Define ERROR_NOT_FOUND
Pali Rohár [Mon, 21 Nov 2022 00:20:30 +0000 (01:20 +0100)]
libpci: windows: Define ERROR_NOT_FOUND

Fix compile issues with older toolchain which does not define ERROR_NOT_FOUND macro.

23 months agoReleased as 3.9.0 v3.9.0
Martin Mares [Sun, 20 Nov 2022 12:06:14 +0000 (13:06 +0100)]
Released as 3.9.0

23 months agoUpdated pci.ids to today's snapshot
Martin Mares [Sun, 20 Nov 2022 12:05:15 +0000 (13:05 +0100)]
Updated pci.ids to today's snapshot

Worked around encoding issues in the database before we fix them
for real.

23 months agolibpci: windows: Handle long paths generated by GetModuleFileName()
Pali Rohár [Fri, 18 Nov 2022 22:40:39 +0000 (23:40 +0100)]
libpci: windows: Handle long paths generated by GetModuleFileName()

C function fopen() implemented by msvcrt.dll requires special prefix
"\\\\?\\" for paths longer than 260 bytes. Because GetModuleFileName()
returns absolute path, it may be longer than 260 bytes. Add fixup to handle
long paths.

23 months agolibpci: windows: Fix path returned by GetModuleFileName()
Pali Rohár [Fri, 18 Nov 2022 21:57:11 +0000 (22:57 +0100)]
libpci: windows: Fix path returned by GetModuleFileName()

GetModuleFileName() on Windows 10 has bugs and returns bogus path.
Implement fixups to make path usable for later fopen() call.

23 months agolibpci: djgpp: Allow to specify empty IDSDIR=
Pali Rohár [Fri, 18 Nov 2022 20:57:50 +0000 (21:57 +0100)]
libpci: djgpp: Allow to specify empty IDSDIR=

Like for windows builds this will cause to load pci.ids file from the same
directory where is stored application binary. Code is same as for Windows,
just djgpp uses global symbol __dos_argv0 instead of _pgmptr.

Tested with following compile command:
  make CROSS_COMPILE=i586-pc-msdosdjgpp- HOST=i586-djgpp ZLIB=no DNS=no IDSDIR=

23 months agolibpci: windows: Fix locating path to pci.ids file for DLL builds
Pali Rohár [Fri, 18 Nov 2022 20:54:53 +0000 (21:54 +0100)]
libpci: windows: Fix locating path to pci.ids file for DLL builds

When using shared libpci DLL library, it is expected that pci.ids file is
stored in directory where is also libpci DLL library and not in directory
where is application executable.

Based on the build mode and compile options, choose the appropriate
function for retrieving path to the libpci DLL library or application
executable. Also pass correct module argument to GetModuleFileName() call.

23 months agolibpci: windows: Fix usage of GetModuleFileName()
Pali Rohár [Fri, 18 Nov 2022 20:47:04 +0000 (21:47 +0100)]
libpci: windows: Fix usage of GetModuleFileName()

Module file name can have arbitrary length despite all MS examples say
about MAX_PATH upper limit. This limit does not apply for example when
executable is running from network disk with very long UNC paths or
when using "\\??\\" prefix for specifying executable binary path.

So handle buffer truncatenation by retrying GetModuleFileName() call with
larger buffer.

Fixes loading of pci.ids file when lspci.exe binary is running from network
drive with path longer than 260 bytes.

23 months agolibpci: mmio-ports: Add Extended PCIe Intel Type 1 access method
Pali Rohár [Sun, 2 Jan 2022 19:50:41 +0000 (20:50 +0100)]
libpci: mmio-ports: Add Extended PCIe Intel Type 1 access method

Extended method allows to access all PCIe registers, including extended
registers starting at 0x100 offset. This method uses 4 reserved buts above
bus bits for PCIe registers. On ARM platforms it is very common for PCIe
controllers. Like standard method, it needs to be properly configured.

23 months agoMerge remote-tracking branch 'pali/intel-conf1-memio'
Martin Mares [Fri, 18 Nov 2022 13:15:08 +0000 (14:15 +0100)]
Merge remote-tracking branch 'pali/intel-conf1-memio'

23 months agolibpci: mmio-ports: Check for write access to /dev/mem in detect method
Pali Rohár [Sat, 5 Nov 2022 16:51:25 +0000 (17:51 +0100)]
libpci: mmio-ports: Check for write access to /dev/mem in detect method

23 months agolibpci: mmio-ports: Add configure note messages
Pali Rohár [Sat, 5 Nov 2022 16:36:42 +0000 (17:36 +0100)]
libpci: mmio-ports: Add configure note messages

23 months agolibpci: mmio-ports: Bypass CPU cache and add barriers for read/write
Pali Rohár [Sat, 5 Nov 2022 16:32:38 +0000 (17:32 +0100)]
libpci: mmio-ports: Bypass CPU cache and add barriers for read/write

Between accessing address address and data I/O ports it is needed to issue
barriers. Use explicit readl() for barrier and O_DSYNC to bypass CPU cache.

23 months agoDraft ChangeLog for the next release
Martin Mares [Fri, 18 Nov 2022 11:17:02 +0000 (12:17 +0100)]
Draft ChangeLog for the next release

23 months agopcilib.man: Include information about win32-kldbg
Pali Rohár [Mon, 7 Mar 2022 20:22:40 +0000 (21:22 +0100)]
pcilib.man: Include information about win32-kldbg

23 months agolibpci: Add new windows kldbgdrv.sys implementation
Pali Rohár [Fri, 4 Mar 2022 00:07:53 +0000 (01:07 +0100)]
libpci: Add new windows kldbgdrv.sys implementation

Microsoft Kernel Local Debugging Driver (kldbgdrv.sys) allow access for
userspace processes to the PCI config space. It supports access up to
65536 domains and whole 4096 bytes long extended PCIe config space. Driver
is signed by Microsoft and is available for both 32-bit and 64-bit systems.

Driver is not part of Windows system and has to be installed via WinDbg
installation package. Standalone installers for WinDbg 6.12.2.633 version:
https://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/setup/WinSDKDebuggingTools_amd64/dbg_amd64.msi
https://download.microsoft.com/download/A/6/A/A6AC035D-DA3F-4F0C-ADA4-37C8E5D34E3D/setup/WinSDKDebuggingTools/dbg_x86.msi

This kldbgdrv.sys API is used by the !pci command of new WinDbg kernel
debugger for displaying PCI config space.

API of this driver is available only for processes with Debug privilege and
only if system was booted with Debugging option.

23 months agoDisable mmio-ports on platforms where it does not make much sense
Martin Mares [Fri, 18 Nov 2022 11:03:26 +0000 (12:03 +0100)]
Disable mmio-ports on platforms where it does not make much sense

Feel free to re-enable it if you find it useful.

23 months agoMerge remote-tracking branch 'pali/intel-conf1-memio'
Martin Mares [Fri, 18 Nov 2022 09:46:22 +0000 (10:46 +0100)]
Merge remote-tracking branch 'pali/intel-conf1-memio'

23 months agoMerge remote-tracking branch 'jphaws/cxl-dvsec-decoded'
Martin Mares [Fri, 18 Nov 2022 08:26:00 +0000 (09:26 +0100)]
Merge remote-tracking branch 'jphaws/cxl-dvsec-decoded'

23 months agolspci: Add test case for CXL device
Jaxon Haws [Mon, 7 Nov 2022 21:13:18 +0000 (15:13 -0600)]
lspci: Add test case for CXL device

Add requested config space dump of CXL device for testing

Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
23 months agolspci: Add support for Non-CXL Function Map DVSEC
Jaxon Haws [Mon, 24 Oct 2022 17:51:54 +0000 (12:51 -0500)]
lspci: Add support for Non-CXL Function Map DVSEC

Add Non-CXL Function Map DVSEC Registers 0-7 decoding according to
DVSEC Revision ID 0.

Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
23 months agolspci: Add support for CXL MLD DVSEC
Jaxon Haws [Wed, 19 Oct 2022 21:29:37 +0000 (16:29 -0500)]
lspci: Add support for CXL MLD DVSEC

Add MLD DVSEC decoding for CXL device accoring to DVSEC revision ID 0.
Decode Number of Logical Devices Supported.

Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
23 months agolspci: Add support for CXL GPF Port DVSEC
Jaxon Haws [Mon, 17 Oct 2022 21:09:55 +0000 (16:09 -0500)]
lspci: Add support for CXL GPF Port DVSEC

Add Global Persistent Flush DVSEC decoding for CXL port according to
DVSEC Revision ID 0.
Decode GPF Phase 1 Control and GPF Phase 2 Control.

Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
23 months agolspci: Add support for CXL Flex Bus DVSEC
Jaxon Haws [Mon, 17 Oct 2022 20:44:08 +0000 (15:44 -0500)]
lspci: Add support for CXL Flex Bus DVSEC

Add DVSEC Flex Bus Port for CXL devices according to DVSEC Revision ID 1,
capability decoding, control decoding, and status decoding.

Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
23 months agoMerge remote-tracking branch 'pali/i386-io-windows'
Martin Mares [Sun, 13 Nov 2022 16:05:46 +0000 (17:05 +0100)]
Merge remote-tracking branch 'pali/i386-io-windows'

23 months agoMerge remote-tracking branch 'pali/linux-ioperm'
Martin Mares [Sun, 13 Nov 2022 16:05:19 +0000 (17:05 +0100)]
Merge remote-tracking branch 'pali/linux-ioperm'

23 months agoMerge remote-tracking branch 'pali/win32-cfgmgr32'
Martin Mares [Sun, 13 Nov 2022 16:04:10 +0000 (17:04 +0100)]
Merge remote-tracking branch 'pali/win32-cfgmgr32'

23 months agoMerge remote-tracking branch 'pali/i386-ports'
Martin Mares [Sun, 13 Nov 2022 16:03:40 +0000 (17:03 +0100)]
Merge remote-tracking branch 'pali/i386-ports'

23 months agowindows: Codepage in resource file is 16-bit number
Pali Rohár [Wed, 9 Nov 2022 19:27:23 +0000 (20:27 +0100)]
windows: Codepage in resource file is 16-bit number

23 months agoi386-ports: Fix intel_io_lock usage
Pali Rohár [Sun, 6 Nov 2022 17:57:39 +0000 (18:57 +0100)]
i386-ports: Fix intel_io_lock usage

Do not call pci_generic_block_read() and pci_generic_block_write()
functions when io is locked. These functions call back same backend
read/write function which tries to lock and unlock io again.

23 months agolibpci: win32-cfgmgr32: Fix typo
Pali Rohár [Sat, 22 Oct 2022 14:58:21 +0000 (16:58 +0200)]
libpci: win32-cfgmgr32: Fix typo

23 months agolibpci: win32-cfgmgr32: Fix parsing paths in NT format
Pali Rohár [Mon, 18 Apr 2022 14:53:59 +0000 (16:53 +0200)]
libpci: win32-cfgmgr32: Fix parsing paths in NT format

NT namespace separator may be single or double backslash.

23 months agoi386-io-linux: Prefer usage of ioperm()
Pali Rohár [Sun, 6 Nov 2022 12:58:55 +0000 (13:58 +0100)]
i386-io-linux: Prefer usage of ioperm()

Since Linux 2.6.8, it is possible to use ioperm() syscall to gain access
for all I/O ports. Because iopl() syscall before Linux 5.5 allowed
userspace to disable interrupts, prefer usage of ioperm() syscall and ask
for access only for PCI ports.

23 months agowindows: Put name and version information into lspci/setpci executables
Pali Rohár [Sat, 5 Nov 2022 19:08:33 +0000 (20:08 +0100)]
windows: Put name and version information into lspci/setpci executables

Extend existing .in resource template file and generate resource objects
also for lspci.exe and setpci.exe executables.

23 months agolibpci: Add Intel Type 1 implementation for memory mapped systems
Pali Rohár [Sun, 2 Jan 2022 19:50:41 +0000 (20:50 +0100)]
libpci: Add Intel Type 1 implementation for memory mapped systems

Lot of non-x86 platforms also support Intel Type 1 mechanism. x86 IO ports
CF8 and CFC are on these platforms mapped into standard memory space.
Address mapping itself is platform or board specific and there is no
default value.

Lot of ARM boards with multiple PCIe controllers are multi-domain and each
PCI domain has its own CF8/CFC (address/data) registers mapped into memory
space.

Add new mmio-conf1 backend which access CF8/CFC ports via MMIO and define
new config option mmio-conf1.addrs which specify list of address/data
register pairs in memory space for each PCI domain. Format of this option
is: 0xaddr1/0xdata1,0xaddr2/0xdata2,...

23 months agolibpci: Add auxiliary data member to struct pci_access for use by the back-end
Pali Rohár [Sat, 5 Nov 2022 10:54:40 +0000 (11:54 +0100)]
libpci: Add auxiliary data member to struct pci_access for use by the back-end

23 months agolibpci: Add new internal function pci_generic_scan_domain()
Pali Rohár [Sun, 2 Jan 2022 19:49:30 +0000 (20:49 +0100)]
libpci: Add new internal function pci_generic_scan_domain()

Function pci_generic_scan() scans PCI domain 0. This new function
pci_generic_scan_domain() scans specified PCI domain number.

2 years agolspci: Add support for CXL GPF Device DVSEC
Jaxon Haws [Mon, 17 Oct 2022 20:29:41 +0000 (15:29 -0500)]
lspci: Add support for CXL GPF Device DVSEC

Add Global Persistent Flush DVSEC decoding for CXL device according to
DVSEC Revision ID 0.
Decode GPF Phase 2 Duration and GPF Phase 2 Power.

Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
2 years agocxl: Fix Register Locator DVSEC decoding
Jaxon Haws [Mon, 31 Oct 2022 21:57:43 +0000 (16:57 -0500)]
cxl: Fix Register Locator DVSEC decoding

Fix decoding of register blocks by introducing offset to position
calculation (8.1.9 of CXL 3.0 spec) and removed unused defines for
Register Locator DVSEC.

Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
2 years agolibpci: i386-io-windows.h: Improve ProcessUserModeIOPL error message
Pali Rohár [Sat, 5 Mar 2022 23:25:02 +0000 (00:25 +0100)]
libpci: i386-io-windows.h: Improve ProcessUserModeIOPL error message

Show error message from intel_setup_io() function into debug area instead
of error area. This is what other backends do as intel_setup_io() is called
during quite detect phase, which may fail.

Also show human readable failure instead of magic code number.

2 years agoMerge remote-tracking branch 'pali/win32-dll'
Martin Mares [Sun, 30 Oct 2022 15:26:43 +0000 (16:26 +0100)]
Merge remote-tracking branch 'pali/win32-dll'

2 years agolibpci: Put name and version information into DLL library
Pali Rohár [Sun, 8 May 2022 12:31:11 +0000 (14:31 +0200)]
libpci: Put name and version information into DLL library

Generate rc file from in template and fill DLL name and DLL version from
Makefile.

It looks like that the only possible way via GNU tools to specify version
information for DLL library is via text rc file compiled as COFF object
file via GNU windres and linked into the final DLL library via GNU ld.

2 years agolibpci: Do not call unversioned symbols from libpci itself
Pali Rohár [Sun, 8 May 2022 08:52:35 +0000 (10:52 +0200)]
libpci: Do not call unversioned symbols from libpci itself

Windows version of GNU LD has bugs which cause that linker would translate
this unknown unversioned symbols to some random version.

So change pci_fill_info() to pci_fill_info_v38() in lib/filter.c to ensure
that last version of this function would be used also by Windows version of
GNU LD linker.

Before this change GNU LD translated this function call to symbol
_pci_fill_info@LIBPCI_3.0. After this change GNU LD translate it to
_pci_fill_info@LIBPCI_3.8.

2 years agolibpci: Add support for building versioned shared Windows DLL library libpci3.dll
Pali Rohár [Sun, 8 May 2022 08:25:59 +0000 (10:25 +0200)]
libpci: Add support for building versioned shared Windows DLL library libpci3.dll

PE/COFF format, used by DLL libraries, does not support version symbols
like ELF format. Recommendation from Microsoft for DLL symbol versioning is
to use DLL API sets. But DLL API sets scheme requires for every API change
to generated a new slim forwarding DLL library, which is unsuitable for
distribution which wants just one DLL library with all version symbols.

So instead of Microsoft recommended scheme for DLL versioning, use new
different versioning scheme: Symbol is composed by function name, at (@)
character and version string (version is same as for ELF targets). Symbol
name without version information is added only into the DLL DEF file as
alias to symbol with higest version. So linker at application link time
resolves "unversioned" symbol to the versioned one via this alias and puts
"versioned" symbol into final executable. This works fine if GNU LD is
linking application via import library libpci3.dll.a generated from that
DLL DEF file libpci3.def. But does not work when linking directly to the
DLL library because library itself does not contain aliases. Note that GNU
LD does not support linking to DEF file (it is required to first generated
import library from DEF file).

Note that older GNU LD versions have bug which cause generation of
corrupted DLL files if some symbol contains dot (.) character. Hopefully
this bug was fixed in GNU LD 2.21.

At the end application lspci.exe requires library libpci3.dll with symbols
pci_alloc@LIBPCI_3.0, pci_init@LIBPCI_3.5, pci_fill_info@LIBPCI_3.8 and
therefore libpci3.dll stays backward compatible with future changes.

PE/COFF executables can reference symbols either via name or via its
ordinal number. Because DLL DEF files are generated from libpci version
script and generator ver2def.pl preserves order of symbols, it means that
ordinal numbers stay backward compatible unless order of lines in version
script is changed.

WARNINGS:

GCC an GNU LD for Windows target have some bugs which cause that
-fvisibility=hidden switch and __attribute__((visibility("default"))) does
not work. Seems that they are broken and ignored when building DLL library.
So instead use -Wl,--exclude-all-symbols switch with explicit DLL DEF file
for building DLL library, which seems to work. This switch is supported
since GNU LD 2.21.

GNU LD has also another bug which results in broken DLL library if input
DLL DEF file which describes symbols for exports, contains also symbol
aliases via == operator.

So do not specify symbol aliases in input DLL DEF file for building DLL
library. Instead construct separate DLL DEF file for building libpci3.dll
without symbol aliases and separate DLL DEF file libpci3.def with symbol
aliases for building import library libpci3.dll.a suitable for linking into
target applications. Note that operator == for symbol aliases is supported
since GNU dlltool 2.21.

Generate those two DLL DEF files via new script ver2def.pl from libpci.ver
version script. So exported functions and version symbols would be defined
only at one place in file libpci.ver.

Note that GNU LD for Windows targets has also broken support for version
scripts, it exports nonsense data and completely ignores version
information. So always use only DLL DEF files generated by ver2def.pl
script and never pass original version script to GNU LD.

Due to another bugs in GNU dlltool, ordinals for aliased symbols from DLL
DEF file are calculated incorrectly when building import library. So
calculate ordinals manually in ver2def.pl script and explicitly put then
into generated libpci3.def DLL DEF file for every symbol, including
aliases.

And because aliases are stored only in libpci3.def file (and in import
library libpci3.dll.a generated from that DEF file) and not in DLL library
libpci3.dll itself, it is required to link all libpci applications via
import library and not directly to libpci3.dll. This is limitation of
PE/COFF format used by DLL libraries.

So for building Windows DLL library libpci3.dll is needed to use GNU
binutils 2.21 or new.

2 years agoMerge remote-tracking branch 'pali/win32-readeflags'
Martin Mares [Sun, 30 Oct 2022 13:00:29 +0000 (14:00 +0100)]
Merge remote-tracking branch 'pali/win32-readeflags'

2 years agoMerge remote-tracking branch 'pali/setpci-register-checks'
Martin Mares [Sun, 30 Oct 2022 12:57:00 +0000 (13:57 +0100)]
Merge remote-tracking branch 'pali/setpci-register-checks'

2 years agosetpci: Check if standard register on device exist
Pali Rohár [Thu, 16 Jun 2022 14:14:56 +0000 (16:14 +0200)]
setpci: Check if standard register on device exist

Some standard registers are available only on device with header type 0,
some only on header type 1, some other only on header type 2 and some on
header type 0 and 1. Add definitions which registers are available on which
header type and add check to access only available registers.

2 years agoMerge remote-tracking branch 'thesamesam/which-hunt'
Martin Mares [Sun, 30 Oct 2022 12:42:12 +0000 (13:42 +0100)]
Merge remote-tracking branch 'thesamesam/which-hunt'

2 years agoMerge remote-tracking branch 'pali/win32-sysdbg'
Martin Mares [Sun, 30 Oct 2022 12:34:44 +0000 (13:34 +0100)]
Merge remote-tracking branch 'pali/win32-sysdbg'

2 years agolspci: Fix Virtual Channel VC# Caps: MaxTimeSlots
Mikhail Bratchikov [Thu, 2 Jun 2022 11:24:02 +0000 (14:24 +0300)]
lspci: Fix Virtual Channel VC# Caps: MaxTimeSlots

2 years agolib: Fix PCI_L1PM_SUBSTAT_CAP_L1PM_SUPP
Mikhail Bratchikov [Mon, 30 May 2022 15:21:57 +0000 (18:21 +0300)]
lib: Fix PCI_L1PM_SUBSTAT_CAP_L1PM_SUPP

2 years agolib: Fix PCI_HT_SEC_CMD_DN
Mikhail Bratchikov [Fri, 20 May 2022 14:33:01 +0000 (17:33 +0300)]
lib: Fix PCI_HT_SEC_CMD_DN

2 years agoMerge remote-tracking branch 'sthibaul/master'
Martin Mares [Sun, 30 Oct 2022 12:29:34 +0000 (13:29 +0100)]
Merge remote-tracking branch 'sthibaul/master'

2 years agoCXL: Code clean-up
Martin Mares [Sun, 30 Oct 2022 12:23:12 +0000 (13:23 +0100)]
CXL: Code clean-up

- We now pass capability length and revision to functions
  instead of reading them from config space again and again.

- Centralize fetching of the capability.

- Add checks for overrunning capability length.

- Avoid out-of-bounds reads from the array of register names.

- Sort capability list by ID.

2 years agoMerge remote-tracking branch 'jphaws/cxl'
Martin Mares [Sun, 30 Oct 2022 11:51:17 +0000 (12:51 +0100)]
Merge remote-tracking branch 'jphaws/cxl'

2 years agoMerge remote-tracking branch 'pali/lspci-tree-filter'
Martin Mares [Sun, 30 Oct 2022 11:47:06 +0000 (12:47 +0100)]
Merge remote-tracking branch 'pali/lspci-tree-filter'

2 years agolspci: Fix filter support (-s/-d) for subtrees in tree mode (-t)
Pali Rohár [Sat, 29 Oct 2022 12:09:51 +0000 (14:09 +0200)]
lspci: Fix filter support (-s/-d) for subtrees in tree mode (-t)

2 years agocxl: Add placeholder for undecoded DVSECs
Ben Widawsky [Mon, 3 Aug 2020 15:55:40 +0000 (08:55 -0700)]
cxl: Add placeholder for undecoded DVSECs

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
2 years agocxl: Add DVSEC Register Locator
Ben Widawsky [Sat, 1 Aug 2020 05:12:43 +0000 (22:12 -0700)]
cxl: Add DVSEC Register Locator

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Co-authored-by: Jaxon Haws <jaxon.haws@amd.com>
Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
2 years agocxl: Add support for DVSEC port cap
Ben Widawsky [Fri, 31 Jul 2020 21:31:17 +0000 (14:31 -0700)]
cxl: Add support for DVSEC port cap

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Co-authored-by: Jaxon Haws <jaxon.haws@amd.com>
Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
---
Add Viral Enable (Jonathan)
Add missing tab (Jonathan)
Add Alt Mem base/limit (Jonathan)

2 years agocxl: Implement more device DVSEC decoding
Ben Widawsky [Fri, 4 Jun 2021 03:09:12 +0000 (20:09 -0700)]
cxl: Implement more device DVSEC decoding

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Co-authored-by: Jaxon Haws <jaxon.haws@amd.com>
Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
---
Fix ranges (Pali): https://github.com/pciutils/pciutils/pull/59#discussion_r806335631

2 years agocxl: Rename caps to be device caps
Ben Widawsky [Fri, 31 Jul 2020 19:55:31 +0000 (12:55 -0700)]
cxl: Rename caps to be device caps

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Co-authored-by: Jaxon Haws <jaxon.haws@amd.com>
Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
2 years agocxl: Rework caps to new function
Ben Widawsky [Fri, 31 Jul 2020 19:37:15 +0000 (12:37 -0700)]
cxl: Rework caps to new function

This will help upcoming caps

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Co-authored-by: Jaxon Haws <jaxon.haws@amd.com>
Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
2 years agocxl: Collect all DVSEC Device fields
Ben Widawsky [Fri, 31 Jul 2020 19:24:17 +0000 (12:24 -0700)]
cxl: Collect all DVSEC Device fields

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Co-authored-by: Jaxon Haws <jaxon.haws@amd.com>
Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
2 years agocxl: Make id check more explicit
Ben Widawsky [Fri, 31 Jul 2020 19:12:42 +0000 (12:12 -0700)]
cxl: Make id check more explicit

Currently only type 0 DVSEC caps are handled. Moving this check will
allow more robust type handling in the future.

Should be no functional change.

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
2 years agocxl: Rename variable to match other code
Ben Widawsky [Thu, 3 Jun 2021 19:02:17 +0000 (12:02 -0700)]
cxl: Rename variable to match other code

The current variable is word sized, and so this makes the CXL code match
the rest of the code.

Signed-off-by: Ben Widawsky <ben.widawsky@intel.com>
Signed-off-by: Jaxon Haws <jaxon.haws@amd.com>
2 years agohurd: fix filling information
Samuel Thibault [Fri, 19 Aug 2022 21:35:10 +0000 (21:35 +0000)]
hurd: fix filling information

The hurdish methods only implement the region and base information, the
rest should be taken from the generic method.

2 years agoMaint: Tag releases with my new PGP key
Martin Mares [Wed, 10 Aug 2022 06:43:00 +0000 (08:43 +0200)]
Maint: Tag releases with my new PGP key

2 years agoAvoid adding multiple version tags to the same symbol
Martin Mares [Wed, 10 Aug 2022 06:34:28 +0000 (13:34 +0700)]
Avoid adding multiple version tags to the same symbol

This is apparently forbidden in most versions of binutils.

2 years agolibpci: i386-io-windows.h: Do not define __readeflags() for GCC 4.9+
Pali Rohár [Sat, 16 Apr 2022 15:23:45 +0000 (17:23 +0200)]
libpci: i386-io-windows.h: Do not define __readeflags() for GCC 4.9+

GCC header file <x86intrin.h> defines static inline function __readeflags()
which calls correct __builtin_ia32_readeflags_XX() builtin.

Header file <x86intrin.h> is included by MinGW-w64's <intrin.h> header file
in new versions of MinGW-w64 and <intrin.h> may be included transitionally
by some other header files automatically.

Defining __readeflags() as both macro and static inline function cause
compile errors.

Fix this compile error by not defining __readeflags() macro and instead
include GCC header file <x86intrin.h>.

2 years agolib/configure: respect $PKG_CONFIG completely
Sam James [Sun, 19 Jun 2022 22:53:42 +0000 (23:53 +0100)]
lib/configure: respect $PKG_CONFIG completely

Signed-off-by: Sam James <sam@gentoo.org>
2 years agolib/configure: drop usage of which
Sam James [Sun, 19 Jun 2022 22:52:22 +0000 (23:52 +0100)]
lib/configure: drop usage of which

'which' is not required by POSIX and is an external command which may not be
available, and 'command -v' does the job just fine.

Debian and Gentoo at least are both making efforts to drop which from
their base system package list.

Signed-off-by: Sam James <sam@gentoo.org>
2 years agosetpci: Define CAPABILITIES register
Pali Rohár [Tue, 14 Jun 2022 12:09:02 +0000 (14:09 +0200)]
setpci: Define CAPABILITIES register

2 years agoMakefile: Split variable for output shared library and import linking library
Pali Rohár [Mon, 18 Apr 2022 20:40:58 +0000 (22:40 +0200)]
Makefile: Split variable for output shared library and import linking library

Use new variable $(PCIIMPLIB) for storing name of the libpci import library
for linking with shared library $(PCILIB).

This would allow compilation of lspci and setpci applications on systems
where linking needs to be done with import library.

2 years agoMakefile: Define ABI_VERSION variable without leading dot
Pali Rohár [Mon, 18 Apr 2022 20:37:18 +0000 (22:37 +0200)]
Makefile: Define ABI_VERSION variable without leading dot

This would simplify usage of ABI_VERSION variable for platforms which do
not use leading dot in file names.

2 years agoMakefile: Unify building of shared libpci library
Pali Rohár [Mon, 18 Apr 2022 20:35:12 +0000 (22:35 +0200)]
Makefile: Unify building of shared libpci library

Move Darwin and Linux/ELF platform link switches to new PCILIB_LDFLAGS
variable.

2 years agoMakefile: Fix usage of empty IDSDIR
Pali Rohár [Sun, 29 May 2022 15:41:07 +0000 (17:41 +0200)]
Makefile: Fix usage of empty IDSDIR

When IDSDIR is empty then current lspci/setpci directory is assumed.
So install PCI_IDS into SBINDIR in this case.

2 years agoMakefile: Remove duplicate slash for $(DESTDIR) install target
Pali Rohár [Sun, 29 May 2022 15:22:33 +0000 (17:22 +0200)]
Makefile: Remove duplicate slash for $(DESTDIR) install target

2 years agopcilib.man: Include information about win32-sysdbg
Pali Rohár [Mon, 7 Mar 2022 20:21:44 +0000 (21:21 +0100)]
pcilib.man: Include information about win32-sysdbg

2 years agolibpci: Add new windows NT sysdbg implementation
Pali Rohár [Sun, 2 Jan 2022 19:51:02 +0000 (20:51 +0100)]
libpci: Add new windows NT sysdbg implementation

NT SysDbg interface allow access to the PCI config space. Only devices on
the first domain are available and only first 256 bytes of the PCI config
space can be accessed. Compared to intel-conf1 access, this API is race
free as NT kernel serialize access to PCI I/O ports. This NT SysDbg API is
used by the !pci command of 32-bit WinDbg kernel debugger for displaying
PCI config space. Debug privilege is required to use this NT interface.

2 years agoReleased as 3.8.0. v3.8.0
Martin Mares [Mon, 18 Apr 2022 16:48:26 +0000 (18:48 +0200)]
Released as 3.8.0.

2 years agoFilters: Fixed symbol versioning
Martin Mares [Mon, 18 Apr 2022 16:47:00 +0000 (18:47 +0200)]
Filters: Fixed symbol versioning

2 years agoREADME and ChangeLog for 3.8.0.
Martin Mares [Fri, 15 Apr 2022 23:55:33 +0000 (01:55 +0200)]
README and ChangeLog for 3.8.0.

2 years agoDocument new filter syntax in man pages
Martin Mares [Fri, 15 Apr 2022 23:26:19 +0000 (01:26 +0200)]
Document new filter syntax in man pages

2 years agoFilters now support partially specified classes and also prog-if's
Martin Mares [Fri, 15 Apr 2022 23:22:44 +0000 (01:22 +0200)]
Filters now support partially specified classes and also prog-if's

Rewritten the filter parser, the old code was too twisted to extend.

2 years agopciutils.lsm: metalab.unc.edu is gone
Martin Mares [Fri, 15 Apr 2022 22:21:39 +0000 (00:21 +0200)]
pciutils.lsm: metalab.unc.edu is gone