summaryrefslogtreecommitdiff
path: root/arch/arm64
diff options
context:
space:
mode:
authorRaphael Gault <raphael.gault@arm.com>2021-05-17 13:02:56 -0500
committerWill Deacon <will@kernel.org>2021-06-22 11:57:03 +0100
commitcf292e93f423fdebdf751a22ea01249196806328 (patch)
treeeabf1a5357f0be769180bebc31c0c5cf7ae7c1ff /arch/arm64
parent873c3e89777c8c56f936ae7aceca1a102aac6b9e (diff)
arm64: Restrict undef hook for cpufeature registers
This commit modifies the mask of the mrs_hook declared in arch/arm64/kernel/cpufeatures.c which emulates only feature register access. This is necessary because this hook's mask was too large and thus masking any mrs instruction, even if not related to the emulated registers which made the pmu emulation inefficient. Signed-off-by: Raphael Gault <raphael.gault@arm.com> Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Link: https://lore.kernel.org/r/20210517180256.2881891-1-robh@kernel.org Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64')
-rw-r--r--arch/arm64/kernel/cpufeature.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
index 52389018ff33..dbae006f625f 100644
--- a/arch/arm64/kernel/cpufeature.c
+++ b/arch/arm64/kernel/cpufeature.c
@@ -3018,8 +3018,8 @@ static int emulate_mrs(struct pt_regs *regs, u32 insn)
}
static struct undef_hook mrs_hook = {
- .instr_mask = 0xfff00000,
- .instr_val = 0xd5300000,
+ .instr_mask = 0xffff0000,
+ .instr_val = 0xd5380000,
.pstate_mask = PSR_AA32_MODE_MASK,
.pstate_val = PSR_MODE_EL0t,
.fn = emulate_mrs,