On 04.12.2017 13:55, David Hildenbrand wrote: > Needed for machine check handling inside Linux (when restoring registers). > > Except for SIGP and machine checks, we don't make use of the register > yet. Suficient for now. > > Signed-off-by: David Hildenbrand <da...@redhat.com> > --- [...] > diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c > index 6d766ce1e7..2c6ab329fb 100644 > --- a/target/s390x/misc_helper.c > +++ b/target/s390x/misc_helper.c > @@ -146,6 +146,17 @@ void HELPER(sckc)(CPUS390XState *env, uint64_t time) > timer_mod(env->tod_timer, env->tod_basetime + time); > } > > +/* Set Tod Programmable Field */ > +void HELPER(sckpf)(CPUS390XState *env) > +{ > + uint32_t val = env->regs[0]; > + > + if (val & 0xffff0000UL) {
I think you could drop the "UL" suffix here. > + s390_program_interrupt(env, PGM_SPECIFICATION, 2, GETPC()); > + } > + env->todpr = val; > +} > + > /* Store Clock Comparator */ > uint64_t HELPER(stckc)(CPUS390XState *env) > { > diff --git a/target/s390x/translate.c b/target/s390x/translate.c > index 26cf993405..48b031894a 100644 > --- a/target/s390x/translate.c > +++ b/target/s390x/translate.c > @@ -3922,6 +3922,13 @@ static ExitStatus op_sckc(DisasContext *s, DisasOps *o) > return NO_EXIT; > } > > +static ExitStatus op_sckpf(DisasContext *s, DisasOps *o) > +{ > + check_privileged(s); > + gen_helper_sckpf(cpu_env); > + return NO_EXIT; > +} > + > static ExitStatus op_stckc(DisasContext *s, DisasOps *o) > { > check_privileged(s); > Reviewed-by: Thomas Huth <th...@redhat.com>