qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] target/arm: Set ptw->out_secure correctly for stage 2 tr


From: Peter Maydell
Subject: Re: [PATCH 2/3] target/arm: Set ptw->out_secure correctly for stage 2 translations
Date: Tue, 18 Apr 2023 12:30:22 +0100

On Tue, 18 Apr 2023 at 12:01, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 4/14/23 18:04, Peter Maydell wrote:
> > +        /* Check if page table walk is to secure or non-secure PA space. */
> > +        ptw->out_secure = (is_secure
> > +                           && !(pte_secure
> > +                                ? env->cp15.vstcr_el2 & VSTCR_SW
> > +                                : env->cp15.vtcr_el2 & VTCR_NSW));
> > +    } else {
> > +        /* Regime is physical */
> > +        ptw->out_secure = pte_secure;
>
> Is that last comment really correct?  I think it could still be stage1 of 2.

I borrowed the comment from earlier in the function, in the ptw->in_debug
branch of the code, which has the same

   if (regime_is_stage2(s2_mmu_idx)) {
      ...stuff...
   } else {
      /* Regime is physical */
   }

structure as this one does after this patch. If s2_mmu_idx isn't
a stage 2 index and it's not one of the Phys indexes, what is it ?

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]