> > This is a case where you almost certainly want to check this 
> > condition inside QEMU and translate the opcode differently.
> > 
> > See cpu_get_tb_cpu_state, which sets bits in *flags.  These
> > flags can then be checked in tb->flags while translating.
> > At which point you'd avoid all the conditionalization on
> > the value in PS here in check_privilege and merely issue
> > the exception_cause.
> > 
> > The ARM port is a good example for testing these sorts of bits.
> 
> Actually, while the tb flags are useful, privileged instructions
> are usually checked by testing mmu_index, since we already have
> to generate different code for the TB based on which TLB entry we
> need to access.

Richard,
do I understand it right that if I use tb->flags or mem_index to make decisions 
during translation, then I must issue exit_tb on instructions that can change 
state they reflect?

Thanks.
-- Max

Reply via email to