diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index e821280972e1..617ab2c45526 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1688,6 +1688,21 @@ config ARM64_TLB_RANGE The feature introduces new assembly instructions, and they were support when binutils >= 2.30. +config ARM64_MPAM + bool "Enable support for MPAM" + help + Memory Partitioning and Monitoring is an optional extension + that allows the CPUs to mark load and store transactions with + labels for partition-id and performance-monitoring-group. + System components, such as the caches, can use the partition-id + to apply a performance policy. MPAM monitors can use the + partition-id and performance-monitoring-group to measure the + cache occupancy or data throughput. + + Use of this extension requires CPU support, support in the + memory system components (MSC), and a description from firmware + of where the MSC are in the address space. + endmenu menu "ARMv8.5 architectural features" diff --git a/arch/arm64/configs/gki_defconfig b/arch/arm64/configs/gki_defconfig index 4189c9e88235..363bda5001a3 100644 --- a/arch/arm64/configs/gki_defconfig +++ b/arch/arm64/configs/gki_defconfig @@ -60,6 +60,7 @@ CONFIG_ARMV8_DEPRECATED=y CONFIG_SWP_EMULATION=y CONFIG_CP15_BARRIER_EMULATION=y CONFIG_SETEND_EMULATION=y +CONFIG_ARM64_MPAM=y CONFIG_RANDOMIZE_BASE=y # CONFIG_RANDOMIZE_MODULE_REGION_FULL is not set CONFIG_CMDLINE="stack_depot_disable=on kasan.stacktrace=off kvm-arm.mode=protected cgroup_disable=pressure" diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h index 017d24711571..0c1a6fb93bf0 100644 --- a/arch/arm64/include/asm/el2_setup.h +++ b/arch/arm64/include/asm/el2_setup.h @@ -178,6 +178,7 @@ .endm .macro __init_el2_mpam +#ifdef CONFIG_ARM64_MPAM /* Memory Partioning And Monitoring: disable EL2 traps */ mrs x1, id_aa64pfr0_el1 ubfx x0, x1, #ID_AA64PFR0_MPAM_SHIFT, #4 @@ -189,6 +190,7 @@ tbz x0, #17, .Lskip_mpam_\@ // skip if no MPAMHCR reg msr_s SYS_MPAMHCR_EL2, xzr // clear TRAP_MPAMIDR_EL1 -> EL2 .Lskip_mpam_\@: +#endif /* CONFIG_ARM64_MPAM */ .endm /**