Skip to content

Commit cbbfbfd

Browse files
aktondakxdavidzNishadSarafAdvaitNaik
authored
XRT, VTD submodule update and shim changes (#737)
* XRT, VTD submodule update and shim changes Signed-off-by: Akshay Tondak <[email protected]> * VTD update Signed-off-by: Akshay Tondak <[email protected]> * use last firmware for verbose in-memory log (#739) Signed-off-by: David Zhang <[email protected]> * Unify DPT (Debug/Profile/Trace) firmware debug across generations (#733) - Introduce a single DPT-based infrastructure for firmware debug/profile/trace across current and future devices. Remove legacy event-trace/DRAM logging to cut redundancy. - Improve ring handling by extending 32-bit FW pointers to 64-bit in-driver, making wrap and tail tracking robust and transparent - Enable firmware logging by default at ERROR level. Simplify usage via a boolean debugfs node (dump_fw_log) to toggle printing to dmesg. - Provide module params for advanced control (fw_log_level, fw_log_size, poll_fw_log). - Establish common management-DMA helpers for buffer allocation/handling. More consolidation to follow. Signed-off-by: Nishad Saraf <[email protected]> * Fix coverity use after free (#744) Fix coverity use after free. Signed-off-by: Nishad Saraf <[email protected]> * shim changes for dump log pr (#738) Signed-off-by: advanaik <[email protected]> Signed-off-by: David Zhang <[email protected]> Co-authored-by: advanaik <[email protected]> * VTD submodule removal (#745) * VTD submod removal Signed-off-by: Akshay Tondak <[email protected]> * subdir removal Signed-off-by: Akshay Tondak <[email protected]> --------- Signed-off-by: Akshay Tondak <[email protected]> * Report addition Signed-off-by: Akshay Tondak <[email protected]> --------- Signed-off-by: Akshay Tondak <[email protected]> Signed-off-by: David Zhang <[email protected]> Signed-off-by: Nishad Saraf <[email protected]> Signed-off-by: advanaik <[email protected]> Co-authored-by: David Zhang <[email protected]> Co-authored-by: Nishad Saraf <[email protected]> Co-authored-by: advanaik <[email protected]>
1 parent cdc3a11 commit cbbfbfd

File tree

4 files changed

+80
-18
lines changed

4 files changed

+80
-18
lines changed

src/shim/device.cpp

Lines changed: 76 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ struct partition_info
370370

371371
struct context_health_info {
372372

373-
static ert_ctx_health_data
373+
static xrt_core::query::context_health_info::smi_context_health
374374
fill_health_entry(const amdxdna_drm_hwctx_entry& entry)
375375
{
376376
ert_ctx_health_data new_entry{};
@@ -380,7 +380,12 @@ struct context_health_info {
380380
new_entry.fatal_error_exception_type = entry.fatal_error_exception_type;
381381
new_entry.fatal_error_exception_pc = entry.fatal_error_exception_pc;
382382
new_entry.fatal_error_app_module = entry.fatal_error_app_module;
383-
return new_entry;
383+
384+
xrt_core::query::context_health_info::smi_context_health val{};
385+
val.ctx_id = entry.context_id;
386+
val.pid = entry.pid;
387+
val.health_data = new_entry;
388+
return val;
384389
}
385390
using result_type = std::any;
386391

@@ -589,15 +594,25 @@ struct event_trace
589594
}
590595

591596
static result_type
592-
get(const xrt_core::device* device, key_type key)
597+
get(const xrt_core::device* device, key_type key, const std::any& any)
593598
{
594599
switch (key) {
595-
case key_type::event_trace_data:
596-
{
597-
// static query::firmware_debug_buffer log_buffer;
598-
// TODO : implement IOCTL to get event_trace data
599-
// return log_buffer;
600+
case key_type::event_trace_data:
601+
{
602+
// static query::firmware_debug_buffer log_buffer;
603+
// TODO : implement IOCTL to get event_trace data
604+
// return log_buffer;
605+
}
606+
default:
607+
throw xrt_core::error("Unsupported event_trace query key");
600608
}
609+
// TODO : Implement IOCTL to get event_trace configuration
610+
}
611+
612+
static result_type
613+
get(const xrt_core::device* device, key_type key)
614+
{
615+
switch (key) {
601616
case key_type::event_trace_version:
602617
{
603618
// query::event_trace_version::result_type version;
@@ -633,15 +648,26 @@ struct firmware_log
633648
}
634649

635650
static result_type
636-
get(const xrt_core::device* device, key_type key)
651+
get(const xrt_core::device* device, key_type key, const std::any& any)
637652
{
638653
switch (key) {
639-
case key_type::firmware_log_data:
640-
{
641-
// static query::firmware_debug_buffer log_buffer;
642-
// TODO : implement IOCTL to get firmware log data
643-
// return log_buffer;
654+
case key_type::firmware_log_data:
655+
{
656+
// static query::firmware_debug_buffer log_buffer;
657+
// TODO : implement IOCTL to get firmware_log data
658+
// return log_buffer;
659+
}
660+
default:
661+
throw xrt_core::error("Unsupported firmware_log query key");
644662
}
663+
// TODO : Implement IOCTL to get firmware_log configuration
664+
}
665+
666+
static result_type
667+
get(const xrt_core::device* device, key_type key)
668+
{
669+
switch (key) {
670+
645671
case key_type::firmware_log_version:
646672
{
647673
// query::firmware_log_version::result_type version;
@@ -664,6 +690,39 @@ struct firmware_log
664690
}
665691
};
666692

693+
struct archive_path
694+
{
695+
using result_type = query::archive_path::result_type;
696+
697+
static result_type
698+
get(const xrt_core::device* device, key_type key)
699+
{
700+
const auto& pcie_id = xrt_core::device_query<xrt_core::query::pcie_id>(device);
701+
xrt_core::smi::smi_hardware_config smi_hrdw;
702+
auto hardware_type = smi_hrdw.get_hardware_type(pcie_id);
703+
704+
switch (key) {
705+
case key_type::archive_path:
706+
{
707+
switch (hardware_type)
708+
{
709+
case xrt_core::smi::smi_hardware_config::hardware_type::stxA0:
710+
case xrt_core::smi::smi_hardware_config::hardware_type::stxB0:
711+
case xrt_core::smi::smi_hardware_config::hardware_type::stxH:
712+
case xrt_core::smi::smi_hardware_config::hardware_type::krk1:
713+
return std::string(get_shim_data_dir() + "bins/xrt_smi_strx.a");
714+
case xrt_core::smi::smi_hardware_config::hardware_type::phx:
715+
return std::string(get_shim_data_dir() + "bins/xrt_smi_phx.a");
716+
default:
717+
throw xrt_core::error("Unsupported hardware type");
718+
}
719+
}
720+
default:
721+
throw xrt_core::error("Unsupported archive_path query key");
722+
}
723+
}
724+
};
725+
667726
struct frame_boundary_preemption
668727
{
669728
using result_type = query::frame_boundary_preemption::result_type;
@@ -1596,14 +1655,15 @@ initialize_query_table()
15961655
emplace_func0_getput<query::preemption, preemption>();
15971656
emplace_func0_getput<query::frame_boundary_preemption, frame_boundary_preemption>();
15981657

1599-
emplace_func0_request<query::event_trace_data, event_trace>();
1658+
emplace_func1_request<query::event_trace_data, event_trace>();
16001659
emplace_func0_request<query::event_trace_version, event_trace>();
16011660
emplace_func0_request<query::event_trace_config, event_trace>();
16021661
emplace_func0_getput<query::event_trace_state, event_trace>();
1603-
emplace_func0_request<query::firmware_log_data, firmware_log>();
1662+
emplace_func1_request<query::firmware_log_data, firmware_log>();
16041663
emplace_func0_request<query::firmware_log_version, firmware_log>();
16051664
emplace_func0_request<query::firmware_log_config, firmware_log>();
16061665
emplace_func0_getput<query::firmware_log_state, firmware_log>();
1666+
emplace_func0_request<query::archive_path, archive_path>();
16071667
emplace_func0_request<query::aie_telemetry, telemetry>();
16081668
emplace_func0_request<query::misc_telemetry, telemetry>();
16091669
emplace_func0_request<query::opcode_telemetry, telemetry>();

src/shim/smi_xdna.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ config_gen_xdna::create_examine_subcommand()
7373
{"preemption", "Preemption telemetry data for the device", "hidden"},
7474
{"clocks", "Clock frequency information", "hidden"},
7575
{"context-health", "Log to console context health information", "hidden"},
76+
{"event-trace", "Event trace report", "hidden"},
77+
{"firmware-log", "Firmware Log report", "hidden"}
7678
};
7779

7880
std::map<std::string, std::shared_ptr<option>> examine_suboptions;

tools/info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"copyright": "Copyright (C) 2023-2025 Advanced Micro Devices, Inc. All rights reserved.",
33
"xrt" : {
4-
"version": "202520.2.20.132",
4+
"version": "202520.2.20.144",
55
"os_rel": ["22.04", "24.04"]
66
},
77
"firmwares": [

xrt

Submodule xrt updated 55 files

0 commit comments

Comments
 (0)