aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel/pmt/discovery.c
diff options
context:
space:
mode:
authorDavid E. Box <[email protected]>2025-07-03 02:28:28 +0000
committerIlpo Järvinen <[email protected]>2025-07-03 08:09:40 +0000
commit86fc85c75bcd9b0f28afadd60c9f890669b42ba4 (patch)
tree1927169ee3e8304b0db7c51575e3e5192e4f0859 /drivers/platform/x86/intel/pmt/discovery.c
parentplatform/x86/intel/tpmi: Get OOBMSM CPU mapping from TPMI (diff)
downloadkernel-86fc85c75bcd9b0f28afadd60c9f890669b42ba4.tar.gz
kernel-86fc85c75bcd9b0f28afadd60c9f890669b42ba4.zip
platform/x86/intel/pmt/discovery: Get telemetry attributes
Add intel_pmt_get_features() in PMT Discovery to enable the PMT Telemetry driver to obtain attributes of the aggregated telemetry spaces it enumerates. The function gathers feature flags and associated data (like the number of RMIDs) from each PMT entry, laying the groundwork for a future kernel interface that will allow direct access to telemetry regions based on their capabilities. Signed-off-by: David E. Box <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
Diffstat (limited to 'drivers/platform/x86/intel/pmt/discovery.c')
-rw-r--r--drivers/platform/x86/intel/pmt/discovery.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel/pmt/discovery.c b/drivers/platform/x86/intel/pmt/discovery.c
index 4b4fa3137ad2..e72d43b675b4 100644
--- a/drivers/platform/x86/intel/pmt/discovery.c
+++ b/drivers/platform/x86/intel/pmt/discovery.c
@@ -583,6 +583,39 @@ abort_probe:
return ret;
}
+static void pmt_get_features(struct intel_pmt_entry *entry, struct feature *f)
+{
+ int num_guids = f->table.header.num_guids;
+ int i;
+
+ for (i = 0; i < num_guids; i++) {
+ if (f->table.guids[i] != entry->guid)
+ continue;
+
+ entry->feature_flags |= BIT(f->id);
+
+ if (feature_layout[f->id] == LAYOUT_RMID)
+ entry->num_rmids = f->table.rmid.num_rmids;
+ else
+ entry->num_rmids = 0; /* entry is kzalloc but set anyway */
+ }
+}
+
+void intel_pmt_get_features(struct intel_pmt_entry *entry)
+{
+ struct feature *feature;
+
+ mutex_lock(&feature_list_lock);
+ list_for_each_entry(feature, &pmt_feature_list, list) {
+ if (feature->priv->parent != &entry->ep->pcidev->dev)
+ continue;
+
+ pmt_get_features(entry, feature);
+ }
+ mutex_unlock(&feature_list_lock);
+}
+EXPORT_SYMBOL_NS_GPL(intel_pmt_get_features, "INTEL_PMT");
+
static const struct auxiliary_device_id pmt_features_id_table[] = {
{ .name = "intel_vsec.discovery" },
{}