On Mon, Apr 17, 2023 at 8:47 PM Andrea Parri <and...@rivosinc.com> wrote:
>
> Hi Alistair,
>
> > > @@ -936,6 +936,11 @@ restart:
> > >              return TRANSLATE_FAIL;
> > >          }
> > >
> > > +        /* PTE reserved bits must be cleared otherwise an exception is 
> > > raised */
> > > +        if (riscv_cpu_mxl(env) == MXL_RV64 && (pte & PTE_RESERVED)) {
> > > +            return TRANSLATE_FAIL;
> > > +        }
> >
> > Isn't this caught by our existing check?
> >
> >             if ((pte & ~(target_ulong)PTE_PPN_MASK) >> PTE_PPN_SHIFT) {
> >                 return TRANSLATE_FAIL;
> >             }
>
> Thanks for checking this out.  AFAICS, the existing check/code doesn't
> work if either svnapot or svpbmt are active.

svpbmt uses some of the reserved fields right?

I'm not sure why svnapot excludes the check. The correct fix should be
to change this check as required (instead of adding a new check).

Alistair

>
> Please let me know if you need other information.
>
>   Andrea

Reply via email to