From: Bastian Koppelmann Date: Mon, 12 Jun 2023 11:32:43 +0000 (+0200) Subject: target/tricore: Correctly fix saving PSW.CDE to CSA on call X-Git-Tag: pull-xen-20230801~73^2~10 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5434557ffc5b46f178ccf325517db2b1f5e2c037;p=people%2Faperard%2Fqemu-dm.git target/tricore: Correctly fix saving PSW.CDE to CSA on call we don't want to save PSW.CDC to the CSA, but PSW.CDE must be saved. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1699 Signed-off-by: Bastian Koppelmann Message-Id: <20230612113245.56667-3-kbastian@mail.uni-paderborn.de> --- diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c index 026e15f3e0..9a7a26b171 100644 --- a/target/tricore/op_helper.c +++ b/target/tricore/op_helper.c @@ -2499,7 +2499,12 @@ void helper_call(CPUTriCoreState *env, uint32_t next_pc) } /* PSW.CDE = 1;*/ psw |= MASK_PSW_CDE; - psw_write(env, psw); + /* + * we need to save PSW.CDE and not PSW.CDC into the CSAs. psw already + * contains the CDC from cdc_increment(), so we cannot call psw_write() + * here. + */ + env->PSW |= MASK_PSW_CDE; /* tmp_FCX = FCX; */ tmp_FCX = env->FCX;