diff options
author | David Hildenbrand | 2018-06-27 15:44:08 +0200 |
---|---|---|
committer | Cornelia Huck | 2018-07-02 10:37:38 +0200 |
commit | 9dc6753718d4c0fe327729fea94e4d9f3f5a3d17 (patch) | |
tree | f3caad3bb24ed68a1f85ec2d49f6652df3e5e70d /target/s390x/misc_helper.c | |
parent | s390x/tcg: SET CLOCK COMPARATOR can clear CKC interrupts (diff) | |
download | qemu-9dc6753718d4c0fe327729fea94e4d9f3f5a3d17.tar.gz qemu-9dc6753718d4c0fe327729fea94e4d9f3f5a3d17.tar.xz qemu-9dc6753718d4c0fe327729fea94e4d9f3f5a3d17.zip |
s390x/tcg: implement SET CLOCK
This allows a guest to change its TOD. We already take care of updating
all CKC timers from within S390TODClass.
Use MO_ALIGN to load the operand manually - this will properly trigger a
SPECIFICATION exception.
Acked-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180627134410.4901-8-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target/s390x/misc_helper.c')
-rw-r--r-- | target/s390x/misc_helper.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index e4c1522140..7656a9b90a 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -184,6 +184,22 @@ void tcg_s390_tod_updated(CPUState *cs, run_on_cpu_data opaque) helper_sckc(env, env->ckc); } +/* Set Clock */ +uint32_t HELPER(sck)(CPUS390XState *env, uint64_t tod_low) +{ + S390TODState *td = s390_get_todstate(); + S390TODClass *tdc = S390_TOD_GET_CLASS(td); + S390TOD tod = { + .high = 0, + .low = tod_low, + }; + + qemu_mutex_lock_iothread(); + tdc->set(td, &tod, &error_abort); + qemu_mutex_unlock_iothread(); + return 0; +} + /* Set Tod Programmable Field */ void HELPER(sckpf)(CPUS390XState *env, uint64_t r0) { |