diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2015-06-13 00:46:01 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2015-06-17 12:40:52 +0200 |
commit | 2f54394997bfc808bbfbebb2d8294edd17d63808 (patch) | |
tree | 96afc8db13112b57425d0be22df77bf1b3a5a3cb /target-s390x/mem_helper.c | |
parent | 311918b979c5364c30392c1054ed77d047a83953 (diff) | |
download | qemu-2f54394997bfc808bbfbebb2d8294edd17d63808.zip qemu-2f54394997bfc808bbfbebb2d8294edd17d63808.tar.gz qemu-2f54394997bfc808bbfbebb2d8294edd17d63808.tar.bz2 |
target-s390x: PER store-using-real-address event support
This PER event happens each time the STURA or STURG instructions are
used. As they use helpers, we can just save the event in the PER code
there, if enabled.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-s390x/mem_helper.c')
-rw-r--r-- | target-s390x/mem_helper.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/target-s390x/mem_helper.c b/target-s390x/mem_helper.c index d03f9fd..3ccbeb9 100644 --- a/target-s390x/mem_helper.c +++ b/target-s390x/mem_helper.c @@ -1105,6 +1105,14 @@ void HELPER(stura)(CPUS390XState *env, uint64_t addr, uint64_t v1) CPUState *cs = CPU(s390_env_get_cpu(env)); stl_phys(cs->as, get_address(env, 0, 0, addr), (uint32_t)v1); + + if ((env->psw.mask & PSW_MASK_PER) && + (env->cregs[9] & PER_CR9_EVENT_STORE) && + (env->cregs[9] & PER_CR9_EVENT_STORE_REAL)) { + /* PSW is saved just before calling the helper. */ + env->per_address = env->psw.addr; + env->per_perc_atmid = PER_CODE_EVENT_STORE_REAL | get_per_atmid(env); + } } void HELPER(sturg)(CPUS390XState *env, uint64_t addr, uint64_t v1) @@ -1112,6 +1120,14 @@ void HELPER(sturg)(CPUS390XState *env, uint64_t addr, uint64_t v1) CPUState *cs = CPU(s390_env_get_cpu(env)); stq_phys(cs->as, get_address(env, 0, 0, addr), v1); + + if ((env->psw.mask & PSW_MASK_PER) && + (env->cregs[9] & PER_CR9_EVENT_STORE) && + (env->cregs[9] & PER_CR9_EVENT_STORE_REAL)) { + /* PSW is saved just before calling the helper. */ + env->per_address = env->psw.addr; + env->per_perc_atmid = PER_CODE_EVENT_STORE_REAL | get_per_atmid(env); + } } /* load real address */ |