Talk Proposal: AMD Smart Trace Buffer (STB) Linux Driver

22 views
Skip to first unread message

Goswami, Sanket

unread,
Mar 27, 2026, 2:36:33 PM (5 days ago) Mar 27
to kernel-meet...@googlegroups.com

[AMD Official Use Only - AMD Internal Distribution Only]


Hi,

 

I would like to submit a talk proposal for the upcoming Kernel Meetup Bangalore 2026.

 

Talk Title: AMD Smart Trace Buffer (STB)

 

ABSTRACT

 

The AMD Smart Trace Buffer (STB) is a firmware debug mechanism that logs system execution data for characterization,

debugging, and telemetry. Operating as a multi-source, cross-IP postcode buffer, STB coalesces timestamped traces from

multiple firmware components into a unified data structure, providing inter-IP sequence visibility essential for root cause analysis.

 

STB runs non-intrusively in the background during normal operation, storing traces in SRAM. When failures occur, traces can be

collected immediately without reproducing the issue or running additional instrumentation. Since Linux kernel 5.16, the `amd-pmc`

driver provides routines for reading STB data to debug s2idle and suspend/resume problems.

 

The driver `amd-pmc` implements two mechanisms:

1) A basic FIFO-based STB read interface and the Spill-to-DRAM (S2D) feature for larger trace buffers.

2) S2D communicates with the System Management Unit (SMU) via message ports to configure DRAM regions for extended trace storage.

 

This talk summarizes the key challenges addressed include ring buffer management, platform-specific register configurations across AMD CPU

families and debugfs interfaces for userspace access and breifly touches upon the challenges faced for landing upstream.

 

This talk benefits kernel developers, AMD hardware engineers, and anyone interested in x86 firmware diagnostics.

 

================================================================================

KEY POINTS OUTLINE

================================================================================

1. Introduction to AMD PMC and STB Architecture

   - Overview of AMD Platform Management Controller (PMC)

   - Role of Smart Trace Buffer in system debugging

   - Integration with SMU (System Management Unit) firmware

 

2. STB Deep Dive

   - Module parameters: enable_stb and dump_custom_stb

   - SMN (System Management Network) register access

   - FIFO-based STB read mechanism (4096 entries)

 

3. Spill-to-DRAM: Implementation and Evolution

 

   S2D Driver Implementation:

   - DRAM region allocation via devm_memremap() for memory-mapped access

   - Message port communication with SMU for S2D configuration

   - Platform-specific register offsets (standard vs. special configurations)

   - SMU message IDs: SET_S2D_CONFIG and GET_STB_TO_DRAM

 

   STB Evolution: (From SRAM to Spill-to-DRAM)

   - Pre-Zen 3 era & evolution of sytem debug infrastructure from Zen 4 onwards.

   - BIOS-enabled S2D: BIOS reserves 16MB DRAM space and provides base address to PMFW

   - Watermark-based spilling: PMFW stores traces in 16KB SRAM; spills to DRAM when threshold reached

   - Crash recovery: upon system crash, driver fetches latest trace content from DRAM

   - AMD PMC driver implementation: Read debugfs entry to pull STB buffer from memory-mapped region

   - STB postcode decoder tool: Used to decrypt the STB buffer entries

   - Real-time access: All operations done "on-the-fly" via /sys/kernel/debug/amd_pmc/stb_read

 

   DebugFS Interface Implementation:

   - File operations: open, read, release patterns

   - S2D debug variants via the debugfs interfaces

   - Enhanced Firmware Reporting (EFR) mechanism

   - Ring buffer handling for wrap-around scenarios

 

4. Practical Applications

   - Debugging suspend/resume issues

   - Measuring FW resume time latencies

   - Firmware crash analysis

 

5. Future Directions & Conclusion

   - Upcoming platform support

   - Potential kernel infrastructure improvements

   - Community contribution opportunities

 

Q&A Session

   - Open discussion with audience

   - Technical deep-dive questions

   - Implementation clarifications

 

================================================================================

SPEAKER BIO

================================================================================

I am a senior Linux kernel developer at AMD, specializing in platform drivers for x86 systems.

As an author of the AMD Smart Trace Buffer (STB) driver, I helped enable critical debugging

infrastructure for AMD’s mobile and desktop processors in the upstream Linux kernel.

 

My work focuses on the platform-x86 subsystem, specifically the AMD PMC (Platform Management Controller) driver,

where I collaborate on implementing power-management features, debugging mechanisms, and firmware interfaces.

I have experience with SMU communication protocols, debugfs interfaces, and cross-platform driver development

across multiple AMD CPU families.

 

Beyond platform drivers, I have contributed to several core Linux kernel subsystems, including I2C, I3C, MCTP

(Management Component Transport Protocol), and UCSI (USB Type-C Connector System Interface), demonstrating

expertise across bus protocols and system management interfaces. I also contributed to the AMD PMF

(Platform Management Framework) driver, which provides intelligent power and thermal management for AMD mobile platforms.

 

I actively participate in upstream kernel development, working closely with the AMD open-source team to

ensure robust Linux support for AMD hardware.

 

================================================================================

CONTACT INFORMATION

================================================================================

Name: Sanket Goswami

Email: Sanket....@amd.com

 

================================================================================

ADDITIONAL NOTES

================================================================================

Code reference: drivers/platform/x86/amd/pmc/mp1_stb.c

Co-author: Shyam Sundar S K Shyam-su...@amd.com

 

 

Best regards,

  • Sanket Goswami

Priyajit Ghosh

unread,
Mar 28, 2026, 8:30:21 AM (4 days ago) Mar 28
to Kernel Meetup Bangalore
+1

Wyes Karny

unread,
Mar 29, 2026, 1:23:24 AM (3 days ago) Mar 29
to Priyajit Ghosh, Kernel Meetup Bangalore
+1
> --
> You received this message because you are subscribed to the Google Groups "Kernel Meetup Bangalore" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-meetup-ban...@googlegroups.com.
> To view this discussion, visit https://groups.google.com/d/msgid/kernel-meetup-bangalore/450c138d-3933-4272-b483-c7fc623b9c74n%40googlegroups.com.



--
Thanks & Regards
Wyes
Reply all
Reply to author
Forward
0 new messages