]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
perf/x86/intel/uncore: Support customized MMIO map size
authorKan Liang <kan.liang@linux.intel.com>
Mon, 7 Jul 2025 20:17:48 +0000 (13:17 -0700)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 9 Jul 2025 11:40:19 +0000 (13:40 +0200)
For a server platform, the MMIO map size is always 0x4000. However, a
client platform may have a smaller map size.

Make the map size customizable.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Link: https://lore.kernel.org/r/20250707201750.616527-3-kan.liang@linux.intel.com
arch/x86/events/intel/uncore_discovery.c
arch/x86/events/intel/uncore_snbep.c

index 9a78a31072df023b5d9291d8b177d5686657bac6..7d57ce706feb1ba5fbd64afae359d6f3e87c11d9 100644 (file)
@@ -651,7 +651,7 @@ void intel_generic_uncore_mmio_init_box(struct intel_uncore_box *box)
        }
 
        addr = unit->addr;
-       box->io_addr = ioremap(addr, UNCORE_GENERIC_MMIO_SIZE);
+       box->io_addr = ioremap(addr, type->mmio_map_size);
        if (!box->io_addr) {
                pr_warn("Uncore type %d box %d: ioremap error for 0x%llx.\n",
                        type->type_id, unit->id, (unsigned long long)addr);
index 2824dc9950be965cd1859f8af63c69c730cfecb3..3a6543159fabfc38680b2306feb7cb1f10ae7d83 100644 (file)
@@ -6409,6 +6409,8 @@ static void uncore_type_customized_copy(struct intel_uncore_type *to_type,
                to_type->get_topology = from_type->get_topology;
        if (from_type->cleanup_mapping)
                to_type->cleanup_mapping = from_type->cleanup_mapping;
+       if (from_type->mmio_map_size)
+               to_type->mmio_map_size = from_type->mmio_map_size;
 }
 
 static struct intel_uncore_type **