Thread (117 messages) 117 messages, 10 authors, 2025-08-15

Re: [RFC PATCH 10/36] ACPI / MPAM: Parse the MPAM table

From: James Morse <james.morse@arm.com>
Date: 2025-08-05 17:08:22
Also in: lkml

Hi Ben,

On 24/07/2025 11:50, Ben Horgan wrote:
On 11/07/2025 19:36, James Morse wrote:
quoted
Add code to parse the arm64 specific MPAM table, looking up the cache
level from the PPTT and feeding the end result into the MPAM driver.
quoted
diff --git a/drivers/acpi/arm64/mpam.c b/drivers/acpi/arm64/mpam.c
new file mode 100644
index 000000000000..f4791bac9a2a
--- /dev/null
+++ b/drivers/acpi/arm64/mpam.c
@@ -0,0 +1,365 @@
quoted
+static int acpi_mpam_parse_resource(struct mpam_msc *msc,
+                    struct acpi_mpam_resource_node *res)
+{
+    int level, nid;
+    u32 cache_id;
+
+    switch (res->locator_type) {
+    case ACPI_MPAM_LOCATION_TYPE_PROCESSOR_CACHE:
+        cache_id = res->locator.cache_locator.cache_reference;
+        level = find_acpi_cache_level_from_id(cache_id);
+        if (level < 0) {
+            pr_err_once("Bad level (%u) for cache with id %u\n", level, cache_id);
+            return -EINVAL;
Nit: More robust to check for level <= 0.
Sure, that can probably happen!


Thanks,

James
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help