Skip to content

platform/x86/amd/hsmp: Add support for variable-sized metrics tables#16

Open
muralimk-amd wants to merge 2 commits intoamd:masterfrom
muralimk-amd:u/muralimk/metrics_patch
Open

platform/x86/amd/hsmp: Add support for variable-sized metrics tables#16
muralimk-amd wants to merge 2 commits intoamd:masterfrom
muralimk-amd:u/muralimk/metrics_patch

Conversation

@muralimk-amd
Copy link

Add support for the new metrics table format introduced in AMD Family 1Ah Model 50h-5Fh processors with HSMP protocol version 7.

Use CPU family/model and protocol versions to map respective variable-sized metric table configurations.
The exported hsmp_metric_tbl_read() function provides offset support for variable-sized tables.

muthusAMD and others added 2 commits March 6, 2026 16:01
Add support for the new metrics table format introduced in AMD Family 1Ah
Model 50h-5Fh processors with HSMP protocol version 7.

Use CPU family/model and protocol versions to map respective variable-sized
metric table configurations.
The exported hsmp_metric_tbl_read() function provides offset support for
variable-sized tables.

Co-developed-by: Muralidhara M K <muralimk@amd.com>
Signed-off-by: Muralidhara M K <muralimk@amd.com>
Signed-off-by: Muthusamy Ramalingam <muthusamy.ramalingam@amd.com>
The below 2 upstream commits remove read_new() and bin_attrs_new.
Add linux version check in our driver appropriately.

commit 1d6249c1ce826fcf03c695973095eb4a50fb7fd2
Author: Thomas Weißschuh <linux@weissschuh.net>
Date:   Mon Aug 11 11:13:35 2025 +0200

    sysfs: remove bin_attribute::read_new/write_new()

commit 44d454fcffa8b08d6d66df132121c1d387fa85db
Author: Thomas Weißschuh <linux@weissschuh.net>
Date:   Mon Aug 11 11:13:36 2025 +0200

    sysfs: remove attribute_group::bin_attrs_new
.attr = { .name = HSMP_METRICS_TABLE_NAME, .mode = 0444}, \
.private = (void *)index, \
.read = hsmp_metric_tbl_plat_read, \
.size = sizeof(struct hsmp_metric_table), \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can have this check just around the one line 142. no need to duplicate the entire struct
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(6, 18, 0)

also, do not mix the tab, space indentation changes in this pathc. submit a separate patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants