From: Ralf Baechle <ralf@linux-mips.org>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: "James Hogan" <james.hogan@imgtec.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Paul Burton" <paul.burton@imgtec.com>,
linux-mips@linux-mips.org, kvm@vger.kernel.org
Subject: Re: [PATCH 8/9] MIPS: KVM: Decode RDHWR more strictly
Date: Tue, 5 Jul 2016 14:51:12 +0200 [thread overview]
Message-ID: <20160705125112.GJ7075@linux-mips.org> (raw)
In-Reply-To: <24b4b1b6-2a58-63f8-f2c2-78ecc6eceb4e@cogentembedded.com>
On Tue, Jul 05, 2016 at 02:16:48PM +0300, Sergei Shtylyov wrote:
> > When KVM emulates the RDHWR instruction, decode the instruction more
> > strictly. The rs field (bits 25:21) should be zero, as should bits 10:9.
> > Bits 8:6 is the register select field in MIPSr6, so we aren't strict
> > about those bits (no other operations should use that encoding space).
> >
> > Signed-off-by: James Hogan <james.hogan@imgtec.com>
> > Cc: Paolo Bonzini <pbonzini@redhat.com>
> > Cc: Radim Krčmář <rkrcmar@redhat.com>
> > Cc: Ralf Baechle <ralf@linux-mips.org>
> > Cc: linux-mips@linux-mips.org
> > Cc: kvm@vger.kernel.org
> > ---
> > arch/mips/kvm/emulate.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/mips/kvm/emulate.c b/arch/mips/kvm/emulate.c
> > index 62e6a7b313ae..be18dfe9ecaa 100644
> > --- a/arch/mips/kvm/emulate.c
> > +++ b/arch/mips/kvm/emulate.c
> > @@ -2357,7 +2357,9 @@ enum emulation_result kvm_mips_handle_ri(u32 cause, u32 *opc,
> > }
> >
> > if (inst.r_format.opcode == spec3_op &&
> > - inst.r_format.func == rdhwr_op) {
> > + inst.r_format.func == rdhwr_op &&
> > + inst.r_format.rs == 0 &&
> > + (inst.r_format.re >> 3) == 0) {
>
> Inner parens not necessary here.
While I often strip unnecessary parens from patches I apply my guideline for
leaving them in is that nobody should need to know all C operator priorities
by heart.
Ralf
next prev parent reply other threads:[~2016-07-05 12:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 18:35 [PATCH 0/9] MIPS: KVM: MIPS r6 support James Hogan
2016-07-04 18:35 ` [PATCH 3/9] MIPS: KVM: Fix fpu.S misassembly with r6 James Hogan
2016-07-04 18:35 ` [PATCH 4/9] MIPS: KVM: Fix pre-r6 ll/sc instructions on r6 James Hogan
2016-07-04 18:35 ` [PATCH 5/9] MIPS: KVM: Don't save/restore lo/hi for r6 James Hogan
2016-07-04 18:35 ` [PATCH 6/9] MIPS: KVM: Support r6 compact branch emulation James Hogan
2016-07-04 18:35 ` [PATCH 7/9] MIPS: KVM: Recognise r6 CACHE encoding James Hogan
2016-07-04 18:35 ` [PATCH 8/9] MIPS: KVM: Decode RDHWR more strictly James Hogan
2016-07-05 11:16 ` Sergei Shtylyov
2016-07-05 12:39 ` Paolo Bonzini
2016-07-05 14:34 ` Sergei Shtylyov
2016-07-05 12:51 ` Ralf Baechle [this message]
2016-07-04 18:35 ` [PATCH 9/9] MIPS: KVM: Emulate generic QEMU machine on r6 T&E James Hogan
2016-07-05 13:58 ` [PATCH 0/9] MIPS: KVM: MIPS r6 support Ralf Baechle
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=20160705125112.GJ7075@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=james.hogan@imgtec.com \
--cc=kvm@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=paul.burton@imgtec.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=sergei.shtylyov@cogentembedded.com \
/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