Re: [PATCH 3/4] target/tricore: Honour privilege changes on PSW write

2023-06-15 Thread Bastian Koppelmann
On Thu, Jun 15, 2023 at 05:15:28PM +0200, Bastian Koppelmann wrote: > On Thu, Jun 15, 2023 at 09:37:23AM +0200, Richard Henderson wrote: > > On 6/14/23 18:59, Bastian Koppelmann wrote: > > > void helper_psw_write(CPUTriCoreState *env, uint32_t arg) > > > { > > > +uint32_t old_priv, new_priv

Re: [PATCH 3/4] target/tricore: Honour privilege changes on PSW write

2023-06-15 Thread Bastian Koppelmann
On Thu, Jun 15, 2023 at 09:37:23AM +0200, Richard Henderson wrote: > On 6/14/23 18:59, Bastian Koppelmann wrote: > > void helper_psw_write(CPUTriCoreState *env, uint32_t arg) > > { > > +uint32_t old_priv, new_priv; > > +CPUState *cs; > > + > > +old_priv = extract32(env->PSW, 10, 2);

Re: [PATCH 3/4] target/tricore: Honour privilege changes on PSW write

2023-06-15 Thread Richard Henderson
On 6/14/23 18:59, Bastian Koppelmann wrote: void helper_psw_write(CPUTriCoreState *env, uint32_t arg) { +uint32_t old_priv, new_priv; +CPUState *cs; + +old_priv = extract32(env->PSW, 10, 2); psw_write(env, arg); +new_priv = extract32(env->PSW, 10, 2); + +if (old_priv

[PATCH 3/4] target/tricore: Honour privilege changes on PSW write

2023-06-14 Thread Bastian Koppelmann
the CPU can change the privilege level by writing the corresponding bits in PSW. If this happens all instructions after this 'mtcr' in the TB are translated with the wrong privilege level. So we have to exit to the cpu_loop() and start translating again with the new privilege level. Signed-off-by: