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).
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.
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.
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.
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.
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.
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).
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.
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>
PCIe r6.0, sec 7.9.26.4.2 "Link IDE Stream Status Register defines"
the link state as:
0000b Insecure
0010b Secure
The same definition applies to selective streams as well.
The existing code wrongly assumes "secure" is 0001b, fix that for both
link and selective streams.
While at this, add missing "Selective IDE for Configuration Requests Enable".
Also fix the base and limit parsing for the memory and RID ranges.
Fixes: 42fc4263ec0e ("ls-ecaps: Add decode support for IDE Extended Capability") Signed-off-by: Alexey Kardashevskiy <aik@amd.com>
Pali Rohár [Fri, 29 Mar 2024 20:19:27 +0000 (21:19 +0100)]
windows: Do not show unwanted file-not-found GUI message box
Sometimes SEM_FAILCRITICALERRORS flag (disable critical-error-handler GUI
messages) is not enough for LoadLibrary() and SEM_NOOPENFILEERRORBOX flag
(disable file-not-found GUI messages) is needed too to prevent showing GUI
messages on LoadLibrary() failures.
Pali Rohár [Tue, 27 Feb 2024 23:32:08 +0000 (00:32 +0100)]
libpci: ecam: Fix scanning of Extended BIOS Data Area for ACPI RSDP
At physical address 0x40E (part of BDA) is stored indirect 16-bit paragraph
offset to the EBDA, and not the EBDA itself. Fix it.
ACPI code in linux kernel checks if the EBDA offset in BDA is above
physical address 0x400. Do the same check here. It is for detection if EBDA
is present as it does not have to be on the old computers or in some
virtualised environments.
Pali Rohár [Sun, 25 Feb 2024 02:22:08 +0000 (03:22 +0100)]
Makefile: Pass CFLAGS also when linking executable
Optimization flags like -O2 from $(OPT) passed via $(CFLAGS) used during
compiling individual object files are ignored when gcc's LTO is enabled for
the linking final executable.
Optimization flags used for compiling individual object files should be
same as optimization flags for linking final executable.
Fix propagation of $(CFLAGS) and $(OPT) when LTO is enabled.
PCIe r6.1, sec 7.5.3.3 defines "TEE-IO Supported" in the PCI Express Device
Capabilities Register which indicates that the function implements
the TEE-IO functionality as described by the TEE Device Interface Security
Protocol (TDISP, PCIe r6.1, chapter 11).
ls-ecaps: Add decode support for IDE Extended Capability
IDE (Integrity & Data Encryption) Extended Capability defined in [1]
implements control of the PCI link encryption. The verbose level > 2 prints
offsets of the fields to make running setpci easier.
Pali Rohár [Sat, 24 Feb 2024 15:12:26 +0000 (16:12 +0100)]
libpci: Define STATIC_ALIAS for DLL Windows builds
Windows builds for versioned symbols use inline asm .set directive which in
some cases makes x86-64 LTO compiler to drop the referenced value. Define
STATIC_ALIAS macro with VERSIONED_ABI (used) attribute which forces LTO
compiler to not drop the symbol from the final DLL library.
Pali Rohár [Sat, 24 Feb 2024 15:09:35 +0000 (16:09 +0100)]
libpci: win32-cfgmgr32: Do not include resolver for cfgmgr32 function for MinGW-w64
MinGW-w64 toolchain (as opposite to MinGW32) provides all needed cfgmgr32
functions in import library. Use import library and do not resolve
functions at runtime.
Pali Rohár [Wed, 14 Jun 2023 15:43:21 +0000 (17:43 +0200)]
windows: Fix setting permissions in grant_process_token_dacl_permissions()
Rewrite function to always add a new allow granting permissions at first
position in DACL. Normally all deny permissions are before allow
permissions, so previously allow permission could have been overridden by
explicit deny permission. With this change, our newly added allow
permission override any possible deny permission and always grant access
for asked process user.
Also properly handle automatic inheritance model which is in use since
Windows 2000 and handle also special case when DACL is not present which
gives allow access to everyone.
Pali Rohár [Sun, 1 Jan 2023 18:52:16 +0000 (19:52 +0100)]
windows: Make msvc __readeflags more readable
Semicolon in msvc __asm block means start of the comment, and not end of
the __asm statement, like it is for all other C statements. Also function
which uses msvc inline assembly cannot be inlined to another function
(compiler reports a warning about it, not a fatal error). So add explicit
curly brackets for __asm block, remove misleading semicolons and do not
declare function as inline.