More Skylake Server CScripts Explorations

In Running Intel CScripts on Skylake servers, I gave a brief introduction to the Intel Customer Scripts (CScripts), and showed how to run them with SourcePoint. Today, I do a deeper dive.

Intel does an amazing job of productizing a suite of Python scripts whose main intent is silicon validation. Since there is so much overlap between what’s happening with a chip and the board it’s running on, these scripts are enormously useful to electronics systems OEMs and ODMs for hardware validation purposes. The CScripts have evolved over the years to encompass a vast number of useful applications, and on Skylake server are broken down into categories or modules. Here are some of them:

bkc Best Known Configuration checker
coreinfo Processor Core Information
edk2 UEFI Development Kit 2
ei Error Injection
error System Errors
mc Memory Controller
pch Platform Control Hub
pci Peripheral Component Interconnect
pcie Peripheral Component Interconnect (PCIe) base class
pm Power Management
ras Reliability, Availability, Serviceability
skx Model Specific Registers (MSR)
uncoreinfo SKX uncore implementation
upi UPI module implementation

Further, each module supports numerous functions. Use the “funcs” command to see what’s in each, for example an excerpt for edk2:

DumpAcpiDSDT …………Display Differentiated System Description Table.

DumpAcpiFACS …………Display Firmware ACPI Control Structure.

DumpAcpiFADT …………Display Fixed ACPI Description Table.

DumpAcpiHPET …………Display High Precision Event Timers Description Table.

DumpAcpiMADT …………Display Multiple APIC Description Table.

DumpAcpiMCFG …………Display PCI Express Memory Mapped Configuration Space Base Address.

DumpAcpiRSDT …………Display Root System Description Table.

DumpAcpiSLIT …………Display System Locality Distance Information Table.

DumpAcpiSRAT …………Display System Resource Affinity Table.

DumpAcpiSSDT …………Display Secondary System Description Table.

DumpAcpiWDDT …………Display Watchdog Description Table.

DumpAcpiXSDT …………Display Extended System Description/AS.

DumpAllEfiTables ……..This function dumps all the EFI tables.

decode_fit_table ……..Decode BIOS FIT table.

get_lbr_values ……….Get LBR record from all threads.

lbr_disable ………….Diabled LBR for all threads.

lbr_enabled ………….Enabled LBR for all threads.

lbr_status …………..Display current LBR enabled status for all threads.

msearch ……………..Search for specific pattern in specific memory region.

refresh ……………..Clear cached EFI system pointer in this module and scan signature from memory again.

stepbranch …………..Show cur reg val and asm code, then execute until branch.

stepinto …………….Show cur reg val and asm code, then step into current instruction.

stepout ……………..Show cur reg val and asm code, then execute until return.

stepover …………….Show cur reg val and asm code, then step over current instruction.

Further, there are a set of “shortcuts” that are defined for the most often-used functions:

crashdump_decode_analyze  Decode the given crashdump file to bit fields.

tordump …………….. Dump partial core/uncore/general purpose registers.

sysTopo …………….. Displays system topology to the user. This includes UPI, PCIE and DRAM.

sysDump …………….. Does as complete a system dump as possible.

unistart ……………. Start the Uniphy sub-system.

sysError ……………. Prints all CPU and PCH errors and advisory messages.

cha_mca …………….. Dump all MCA CHA Banks (bank9/10/11).

sysInfo …………….. Prints system info to the screen.

crashdump …………… Dump critical system debug information.

This is only a tiny sample of what’s available. Writing these applications yourself would be next to impossible. The functions range from simple labor-saving scripts such as edk2.lbr_status to significantly more complex applications such as sysDump or crashdump. The CScripts greatly assist with everything from board bring-up, to production testing, to failure analysis, and just about everything in between.

For more background on using SourcePoint with the Intel CScripts, have a look at the eBook written by Larry Traylor: Intel Debug using Python CScripts.

Alan Sguigna