diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2013-09-19 09:32:03 +0200 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2013-09-20 13:55:29 +0200 |
commit | d8b30c830243c5b7180befd9e1921383c9626bf0 (patch) | |
tree | 278be76b7e807b7f590472e4fb54d8487aab9ef2 /target-s390x | |
parent | 5d9bf1c07c1369ab3506fc82cc65a10f4415d867 (diff) | |
download | qemu-d8b30c830243c5b7180befd9e1921383c9626bf0.zip qemu-d8b30c830243c5b7180befd9e1921383c9626bf0.tar.gz qemu-d8b30c830243c5b7180befd9e1921383c9626bf0.tar.bz2 |
s390/kexec: Implement diag308 subcode 0
This patch implements subcode 0 of diag 308. This is necessary for kexec
(without kdump). The main difference to subcode 1 is that all CPUs get
a full reset, instead of the architectured CPU reset (which leaves all
registers untouched).
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'target-s390x')
-rw-r--r-- | target-s390x/misc_helper.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index 1690907..37ea60d 100644 --- a/target-s390x/misc_helper.c +++ b/target-s390x/misc_helper.c @@ -192,6 +192,29 @@ static void cpu_reset_all(void) } } +static void cpu_full_reset_all(void) +{ + CPUState *cpu; + + CPU_FOREACH(cpu) { + cpu_reset(cpu); + } +} + +static int modified_clear_reset(S390CPU *cpu) +{ + S390CPUClass *scc = S390_CPU_GET_CLASS(cpu); + + pause_all_vcpus(); + cpu_synchronize_all_states(); + cpu_full_reset_all(); + io_subsystem_reset(); + scc->load_normal(CPU(cpu)); + cpu_synchronize_all_post_reset(); + resume_all_vcpus(); + return 0; +} + static int load_normal_reset(S390CPU *cpu) { S390CPUClass *scc = S390_CPU_GET_CLASS(cpu); @@ -225,6 +248,9 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3) } switch (subcode) { + case 0: + modified_clear_reset(s390_env_get_cpu(env)); + break; case 1: load_normal_reset(s390_env_get_cpu(env)); break; |