1*37002bc6SCosta Shulyupin.. SPDX-License-Identifier: GPL-2.0 2*37002bc6SCosta Shulyupin 3*37002bc6SCosta Shulyupin========= 4*37002bc6SCosta ShulyupinS/390 PCI 5*37002bc6SCosta Shulyupin========= 6*37002bc6SCosta Shulyupin 7*37002bc6SCosta ShulyupinAuthors: 8*37002bc6SCosta Shulyupin - Pierre Morel 9*37002bc6SCosta Shulyupin 10*37002bc6SCosta ShulyupinCopyright, IBM Corp. 2020 11*37002bc6SCosta Shulyupin 12*37002bc6SCosta Shulyupin 13*37002bc6SCosta ShulyupinCommand line parameters and debugfs entries 14*37002bc6SCosta Shulyupin=========================================== 15*37002bc6SCosta Shulyupin 16*37002bc6SCosta ShulyupinCommand line parameters 17*37002bc6SCosta Shulyupin----------------------- 18*37002bc6SCosta Shulyupin 19*37002bc6SCosta Shulyupin* nomio 20*37002bc6SCosta Shulyupin 21*37002bc6SCosta Shulyupin Do not use PCI Mapped I/O (MIO) instructions. 22*37002bc6SCosta Shulyupin 23*37002bc6SCosta Shulyupin* norid 24*37002bc6SCosta Shulyupin 25*37002bc6SCosta Shulyupin Ignore the RID field and force use of one PCI domain per PCI function. 26*37002bc6SCosta Shulyupin 27*37002bc6SCosta Shulyupindebugfs entries 28*37002bc6SCosta Shulyupin--------------- 29*37002bc6SCosta Shulyupin 30*37002bc6SCosta ShulyupinThe S/390 debug feature (s390dbf) generates views to hold various debug results in sysfs directories of the form: 31*37002bc6SCosta Shulyupin 32*37002bc6SCosta Shulyupin * /sys/kernel/debug/s390dbf/pci_*/ 33*37002bc6SCosta Shulyupin 34*37002bc6SCosta ShulyupinFor example: 35*37002bc6SCosta Shulyupin 36*37002bc6SCosta Shulyupin - /sys/kernel/debug/s390dbf/pci_msg/sprintf 37*37002bc6SCosta Shulyupin Holds messages from the processing of PCI events, like machine check handling 38*37002bc6SCosta Shulyupin and setting of global functionality, like UID checking. 39*37002bc6SCosta Shulyupin 40*37002bc6SCosta Shulyupin Change the level of logging to be more or less verbose by piping 41*37002bc6SCosta Shulyupin a number between 0 and 6 to /sys/kernel/debug/s390dbf/pci_*/level. For 42*37002bc6SCosta Shulyupin details, see the documentation on the S/390 debug feature at 43*37002bc6SCosta Shulyupin Documentation/arch/s390/s390dbf.rst. 44*37002bc6SCosta Shulyupin 45*37002bc6SCosta ShulyupinSysfs entries 46*37002bc6SCosta Shulyupin============= 47*37002bc6SCosta Shulyupin 48*37002bc6SCosta ShulyupinEntries specific to zPCI functions and entries that hold zPCI information. 49*37002bc6SCosta Shulyupin 50*37002bc6SCosta Shulyupin* /sys/bus/pci/slots/XXXXXXXX 51*37002bc6SCosta Shulyupin 52*37002bc6SCosta Shulyupin The slot entries are set up using the function identifier (FID) of the 53*37002bc6SCosta Shulyupin PCI function. The format depicted as XXXXXXXX above is 8 hexadecimal digits 54*37002bc6SCosta Shulyupin with 0 padding and lower case hexadecimal digits. 55*37002bc6SCosta Shulyupin 56*37002bc6SCosta Shulyupin - /sys/bus/pci/slots/XXXXXXXX/power 57*37002bc6SCosta Shulyupin 58*37002bc6SCosta Shulyupin A physical function that currently supports a virtual function cannot be 59*37002bc6SCosta Shulyupin powered off until all virtual functions are removed with: 60*37002bc6SCosta Shulyupin echo 0 > /sys/bus/pci/devices/XXXX:XX:XX.X/sriov_numvf 61*37002bc6SCosta Shulyupin 62*37002bc6SCosta Shulyupin* /sys/bus/pci/devices/XXXX:XX:XX.X/ 63*37002bc6SCosta Shulyupin 64*37002bc6SCosta Shulyupin - function_id 65*37002bc6SCosta Shulyupin A zPCI function identifier that uniquely identifies the function in the Z server. 66*37002bc6SCosta Shulyupin 67*37002bc6SCosta Shulyupin - function_handle 68*37002bc6SCosta Shulyupin Low-level identifier used for a configured PCI function. 69*37002bc6SCosta Shulyupin It might be useful for debugging. 70*37002bc6SCosta Shulyupin 71*37002bc6SCosta Shulyupin - pchid 72*37002bc6SCosta Shulyupin Model-dependent location of the I/O adapter. 73*37002bc6SCosta Shulyupin 74*37002bc6SCosta Shulyupin - pfgid 75*37002bc6SCosta Shulyupin PCI function group ID, functions that share identical functionality 76*37002bc6SCosta Shulyupin use a common identifier. 77*37002bc6SCosta Shulyupin A PCI group defines interrupts, IOMMU, IOTLB, and DMA specifics. 78*37002bc6SCosta Shulyupin 79*37002bc6SCosta Shulyupin - vfn 80*37002bc6SCosta Shulyupin The virtual function number, from 1 to N for virtual functions, 81*37002bc6SCosta Shulyupin 0 for physical functions. 82*37002bc6SCosta Shulyupin 83*37002bc6SCosta Shulyupin - pft 84*37002bc6SCosta Shulyupin The PCI function type 85*37002bc6SCosta Shulyupin 86*37002bc6SCosta Shulyupin - port 87*37002bc6SCosta Shulyupin The port corresponds to the physical port the function is attached to. 88*37002bc6SCosta Shulyupin It also gives an indication of the physical function a virtual function 89*37002bc6SCosta Shulyupin is attached to. 90*37002bc6SCosta Shulyupin 91*37002bc6SCosta Shulyupin - uid 92*37002bc6SCosta Shulyupin The user identifier (UID) may be defined as part of the machine 93*37002bc6SCosta Shulyupin configuration or the z/VM or KVM guest configuration. If the accompanying 94*37002bc6SCosta Shulyupin uid_is_unique attribute is 1 the platform guarantees that the UID is unique 95*37002bc6SCosta Shulyupin within that instance and no devices with the same UID can be attached 96*37002bc6SCosta Shulyupin during the lifetime of the system. 97*37002bc6SCosta Shulyupin 98*37002bc6SCosta Shulyupin - uid_is_unique 99*37002bc6SCosta Shulyupin Indicates whether the user identifier (UID) is guaranteed to be and remain 100*37002bc6SCosta Shulyupin unique within this Linux instance. 101*37002bc6SCosta Shulyupin 102*37002bc6SCosta Shulyupin - pfip/segmentX 103*37002bc6SCosta Shulyupin The segments determine the isolation of a function. 104*37002bc6SCosta Shulyupin They correspond to the physical path to the function. 105*37002bc6SCosta Shulyupin The more the segments are different, the more the functions are isolated. 106*37002bc6SCosta Shulyupin 107*37002bc6SCosta ShulyupinEnumeration and hotplug 108*37002bc6SCosta Shulyupin======================= 109*37002bc6SCosta Shulyupin 110*37002bc6SCosta ShulyupinThe PCI address consists of four parts: domain, bus, device and function, 111*37002bc6SCosta Shulyupinand is of this form: DDDD:BB:dd.f 112*37002bc6SCosta Shulyupin 113*37002bc6SCosta Shulyupin* When not using multi-functions (norid is set, or the firmware does not 114*37002bc6SCosta Shulyupin support multi-functions): 115*37002bc6SCosta Shulyupin 116*37002bc6SCosta Shulyupin - There is only one function per domain. 117*37002bc6SCosta Shulyupin 118*37002bc6SCosta Shulyupin - The domain is set from the zPCI function's UID as defined during the 119*37002bc6SCosta Shulyupin LPAR creation. 120*37002bc6SCosta Shulyupin 121*37002bc6SCosta Shulyupin* When using multi-functions (norid parameter is not set), 122*37002bc6SCosta Shulyupin zPCI functions are addressed differently: 123*37002bc6SCosta Shulyupin 124*37002bc6SCosta Shulyupin - There is still only one bus per domain. 125*37002bc6SCosta Shulyupin 126*37002bc6SCosta Shulyupin - There can be up to 256 functions per bus. 127*37002bc6SCosta Shulyupin 128*37002bc6SCosta Shulyupin - The domain part of the address of all functions for 129*37002bc6SCosta Shulyupin a multi-Function device is set from the zPCI function's UID as defined 130*37002bc6SCosta Shulyupin in the LPAR creation for the function zero. 131*37002bc6SCosta Shulyupin 132*37002bc6SCosta Shulyupin - New functions will only be ready for use after the function zero 133*37002bc6SCosta Shulyupin (the function with devfn 0) has been enumerated. 134