Subject: Re: [PATCH v2] arm64: Restrict undef hook for cpufeature registers

From: Catalin Marinas <[email-masked]>
Date: Tue, 8 Jun 2021 16:20:43 +0100

On Mon, May 17, 2021 at 01:02:56PM -0500, Rob Herring wrote:
> From: Raphael Gault <[email-masked]>
> 
> 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 <[email-masked]>
> Signed-off-by: Rob Herring <[email-masked]>
> ---
> I don't *think* I'm going to need this for the perf userspace counter 
> access, but this patch stands on its own as the PMU registers are not 
> emulated. So please apply it.
> 
> v2:
>  - Fix warning for set but unused sys_reg
> ---
>  arch/arm64/kernel/cpufeature.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c
> index efed2830d141..c773f7c3c007 100644
> --- a/arch/arm64/kernel/cpufeature.c
> +++ b/arch/arm64/kernel/cpufeature.c
> @@ -2905,8 +2905,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,

Acked-by: Catalin Marinas <[email-masked]>

and changing Will's email address.

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel