mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
ANDROID: arm64: Wrap MPAM setup with a config option
As it turns out, there are broken firmwares out there, and an apparent need to turn MPAM off until the firmware can be fixed. Introduce the ARM64_MPAM config option, wrap the MPAM setup with it, and set it as default for GKI. Non-GKI uses with broken firmwares can have their own config fragments to deal with it. The config option text is lifted from James Morse's git tree. Bug: 228613614 Signed-off-by: Marc Zyngier <mzyngier@google.com> Change-Id: Ib782aab89c826ea96dbf9ae26c16d1a4a61c41fb
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user