Skip to content

Commit cf292e9

Browse files
raphaelgaultwilldeacon
authored andcommitted
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>
1 parent 873c3e8 commit cf292e9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/arm64/kernel/cpufeature.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3018,8 +3018,8 @@ static int emulate_mrs(struct pt_regs *regs, u32 insn)
30183018
}
30193019

30203020
static struct undef_hook mrs_hook = {
3021-
.instr_mask = 0xfff00000,
3022-
.instr_val = 0xd5300000,
3021+
.instr_mask = 0xffff0000,
3022+
.instr_val = 0xd5380000,
30233023
.pstate_mask = PSR_AA32_MODE_MASK,
30243024
.pstate_val = PSR_MODE_EL0t,
30253025
.fn = emulate_mrs,

0 commit comments

Comments
 (0)