On 19 October 2018 at 17:31, Richard Henderson
<richard.hender...@linaro.org> wrote:
> On 10/19/18 9:12 AM, Peter Maydell wrote:
>> A conservative check is probably:
>>   if arm_current_el() < 3
>>      // TTBR definitely can only be affecting the EL0/1
>>      // translation regime for the current security state
>>      if arm_is_secure_below_el3()
>>         if EL3 is AArch32
>>             flush S1SE0, S1E3
>>         else
>>             flush S1SE0, S1SE1
>>      else
>>         flush S12NSE1, S12NSE0
>>   else
>>      // err on the side of flushing more than maybe we need to
>>      flush S1SE0, S12NSE1, S12NSE0
>>      if EL3 is AArch32
>>           flush S1E3
>>      else
>>           flush S1SE1
>>
>> (but you should check my logic ;-))
>
> Riiight.
>
> Clearly it would be simpler and safer to track unused tlbs within cputlb.c.

The advantage of the above logic is that it means that even
when we do have trustzone and are using the secure TLBs,
we only flush the side we need to, not the whole lot.
(But yeah, it's a bit hairy.)

> So drop this patch for now and I'll get back to it.  The other two in this
> series are at least incremental improvement in the meantime.

OK, I'll put those in target-arm.next.

thanks
-- PMM

Reply via email to