On 8/9/21 5:29 PM, David Gibson wrote:
      ctx->spr_cb = env->spr_cb;
+    ctx->spr = env->spr;

Eep... with that one line you're copying 8kiB of data into the context
structure.  That sounds undesirable.. especially since it look like
you only check 8 bytes of it.

Plus.. TBH, I'm a bit fuzzy on how the disascontext stuff works, but
I'm not sure copying the stuff here is correct.

It isn't.

I think instead you need to actually generate the instructions to read
from MMCR0 and conditionally generate an exception if the permission
bit isn't set.

Or copy exactly the bits you need from MMCR0 for the permission check into env->hflags, so that you can later read them from ctx->flags. Bearing in mind that hflags has only 32 bits, 19 of them are currently in use.


r~

Reply via email to