All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Emmanuel Blot <emmanuel.blot@sifive.com>
Cc: Alistair Francis <Alistair.Francis@wdc.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [PATCH] target/riscv: fix exception index on instruction access fault
Date: Tue, 20 Apr 2021 13:06:03 +1000	[thread overview]
Message-ID: <CAKmqyKPVYqZdfvn22U+UwS5afJhH00DtTFb5YqESUNYKjK3Jzg@mail.gmail.com> (raw)
In-Reply-To: <CAKmqyKNxMWpfQDGxxXLk=reAwv8+ky72YrrX=m5-eF_p_848Hg@mail.gmail.com>

On Tue, Apr 20, 2021 at 10:56 AM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Sat, Apr 17, 2021 at 12:48 AM Emmanuel Blot <emmanuel.blot@sifive.com> wrote:
> >
> > When no MMU is used and the guest code attempts to fetch an instruction
> > from an invalid memory location, the exception index defaults to a data
> > load access fault, rather an instruction access fault.
> >
> > Signed-off-by: Emmanuel Blot <emmanuel.blot@sifive.com>
>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Thanks!

Applied to riscv-to-apply.next

Alistair

>
> Alistair
>
> >
> > ---
> >   target/riscv/cpu_helper.c | 4 +++-
> >   1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
> > index 21c54ef5613..4e107b1bd23 100644
> > --- a/target/riscv/cpu_helper.c
> > +++ b/target/riscv/cpu_helper.c
> > @@ -691,8 +691,10 @@ void riscv_cpu_do_transaction_failed(CPUState *cs,
> > hwaddr physaddr,
> >
> >       if (access_type == MMU_DATA_STORE) {
> >           cs->exception_index = RISCV_EXCP_STORE_AMO_ACCESS_FAULT;
> > -    } else {
> > +    } else if (access_type == MMU_DATA_LOAD) {
> >           cs->exception_index = RISCV_EXCP_LOAD_ACCESS_FAULT;
> > +    } else {
> > +        cs->exception_index = RISCV_EXCP_INST_ACCESS_FAULT;
> >       }
> >
> >       env->badaddr = addr;
> > --
> > 2.31.1
> >


  reply	other threads:[~2021-04-20  3:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-15 13:41 Emmanuel Blot
2021-04-15 16:07 ` Palmer Dabbelt
2021-04-15 22:27 ` Re: Alistair Francis
2021-04-16 14:17 ` [PATCH] target/riscv: fix exception index on instruction access fault Emmanuel Blot
2021-04-20  0:56   ` Alistair Francis
2021-04-20  3:06     ` Alistair Francis [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-04-13 16:30 Emmanuel Blot
2021-04-14  3:42 ` Palmer Dabbelt

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=CAKmqyKPVYqZdfvn22U+UwS5afJhH00DtTFb5YqESUNYKjK3Jzg@mail.gmail.com \
    --to=alistair23@gmail.com \
    --cc=Alistair.Francis@wdc.com \
    --cc=emmanuel.blot@sifive.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.