From: Will Deacon <will@kernel.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Rob Herring <robh@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Raphael Gault <raphael.gault@arm.com>
Subject: Re: [PATCH v2] arm64: Restrict undef hook for cpufeature registers
Date: Tue, 8 Jun 2021 17:34:59 +0100 [thread overview]
Message-ID: <20210608163459.GA10994@willie-the-truck> (raw)
In-Reply-To: <20210608152042.GG17957@arm.com>
On Tue, Jun 08, 2021 at 04:20:43PM +0100, Catalin Marinas wrote:
> On Mon, May 17, 2021 at 01:02:56PM -0500, Rob Herring wrote:
> > From: Raphael Gault <raphael.gault@arm.com>
> >
> > 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>
> > ---
> > 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 <catalin.marinas@arm.com>
>
> and changing Will's email address.
Should we update is_emulated() at the same time, or at least try to generate
the instr_val value here using the same constants?
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-06-08 16:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 18:02 [PATCH v2] arm64: Restrict undef hook for cpufeature registers Rob Herring
2021-06-08 15:20 ` Catalin Marinas
2021-06-08 16:34 ` Will Deacon [this message]
2021-06-11 16:04 ` Rob Herring
2021-06-23 14:00 ` Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210608163459.GA10994@willie-the-truck \
--to=will@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=raphael.gault@arm.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).