qemu-trivial
[Top][All Lists]
Advanced

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

Re: [PATCH] target/tricore: Remove unused fields from CPUTriCoreState


From: Richard Henderson
Subject: Re: [PATCH] target/tricore: Remove unused fields from CPUTriCoreState
Date: Wed, 18 Jan 2023 08:37:01 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 1/17/23 23:03, Bastian Koppelmann wrote:
I'm not sure of the purpose of the hflags. I assume they are hidden flags that
hold some hidden state of the emulated CPU. However are privilege levels really
hidden state? At least in the TriCore any guest software can read PSW at any
privilege level and see its own privilige level. Is there a typical usecase when
I would use hflags?

I'm sure env->hflags was copied from i386 or mips. It would be used to cache cpu state that is not easy to recompute. There doesn't seem to be any of that in TriCore.


I do wonder why there is the extra step via the flags of a TranslationBlock. Why
can't we sync directly using CPUState?

We need the data in the TranslationBlock in order for the data to be hashed and compared, so that we do not attempt to run the same code with the wrong privilege.


I first thought to differentiated the
TranslationBlocks for the different privilege level. However isn't that done
using the softmmu_idx?

No, it's not. The only thing that's used to select TranslationBlocks is the data retrieved by cpu_get_tb_cpu_state.


Yes, everything runs in the highest privilege mode. I'll look into properly
implementing privilege levels, but for now we can remove this dead code.

Ok.


r~




reply via email to

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